Monday, October 19, 2009

Some work on GNUstep theme support...

Quentin came to visit london this weekend, and he thus forced^H^H^H^H^H^Hconvainced me to work again on gnustep, on the theming support. GNUstep had the possibility to use themes using my theme bundle, Camaelon. But this had some technical issues (though we do use it in Étoilé), mostly that it's easy for Camaelon to be out of sync with the current GNUstep implementation. Richard Frith-Macdonald has thus started to implement some theme support directly into GNUstep, and even wrote a theming application to help creating themes. But the support is still limited -- you can change images, colors, and the drawing of some widgets but not all.

Anyway, what I did this weekend was quite a bit of refactoring in the theming code dealing with pixmaps -- things should be much clearer now. I also added an implementation for Nine Patch pixmaps, which basically makes creating custom themes a lot more simple. For example, the following content in a theme's Info-gnustep.plist will be enough -- no need to have multiple files as with Camaelon, no need to measure things...


GSThemeTiles = {
NSButton = {
NinePatch = YES;
FileName = NSButton.tiff
};
};


With a button made in five minutes of Gimp work (as can be seen!):




An example of the result:


Monday, July 06, 2009

New website

I finally took the time to redo my website properly :)

Obviously, I had to use Seaside, and as I did play with Pier some time ago, this looked like a good fit.

For those who do not know, Seaside is the best web application server I know of -- it really is something when you want to quickly write extremely complex sites or webapps. Pier is a CMS developped on top of Seaside, which provides a wiki system amongst other things.

The new theme is also frankly much better than my previous one -- it's actually nearly exactly the same as the default Pier theme, but hey, I really like it, and it _is_ cleaner :)

The site also automatically pull the last posts from this blog as well as my last commits and some recent twitter posts, and display all this as the main page.

Finally, one thing that wasn't great on the previous site was the pictures section; I resumed some earlier work I did on a Pier component (Pier Gallery) and cleaned it up to get what's shown now... more on that in a next post.

Monday, June 29, 2009

Automating DxO FilmPack (OSX)

DxO FilmPack is an awesome set of filters for your pictures, rendering them using classic films -- not just the colors, but the grain as well. It is available either as a standalone application or as a Photoshop plugin.

As an example of what FilmPack can do, here's one picture I took, first the original, then two filtered:

Original:






Fuji Superia 200:





Ilford Pan F Plus 50:





But even though it's really, really cool... it has a rather annoying limitation in its standalone version: you cannot apply a filter to a set of images, you have to apply it image by image. Of course, this might be all you need; but for my part, I would love selecting a type of filter I like and apply it on an entire set of pictures, as if I did shoot them using a film camera.

Hack it



Here is how you can do it, using a mixture of bash and AppleScript. Honestly, this is a hack -- it would be great for it to be integrated in FilmPack directly! but in the meantime, this can be useful...

As expected, the programmers did not bother to provide a scripting interface, so you seemingly cannot script it (it would have been useful for such a program with potential repetitive action, don't you think?).

Or can you ? It turns out that OSX has a rather nifty feature that allow near-global scripting: you can have access to all the GUI objects shown on screen, query their states, etc. It is not active by default -- you need to go (in the System Preferences) to "Universal Access" and click on "Enable access for assistive devices".

So, we starts with a bash script (we can call it "convert.sh"):


#!/bin/bash
for i in `ls *.JPG`;
do /Applications/DxO\ FilmPack\ 2.app/Contents/MacOS/DxO\ FilmPack\ 2 $i & osascript ./filmpack.script; done


This will, for each jpeg files in the current directory, open the binary executable of FilmPack and passing it the current jpeg as a parameter ($i). Doing this has for effect to start FilmPack and automatically load the image passed. Finally, as soon as FilmPack is started, we execute the filmpack.script.

This filmpack.script is a simple AppleScript:


tell application "System Events"
tell process "DxO FilmPack 2"
get enabled of menu item "Save As..." of menu 1 of menu bar item "File" of menu bar 1
set frontmost to true
click menu item "Save As..." of menu 1 of menu bar item "File" of menu bar 1
click button "Save" of sheet 1 of window "DxO FilmPack 2"
click menu item "Quit DxO FilmPack 2" of menu 1 of menu bar item "DxO FilmPack 2" of menu bar 1
end tell
end tell


This script asks the FilmPack application to save the current opened image, and to quit the application.

The only notable trick here is the "get enabled" line -- by asking AppleScript if the "Save As..." menu item is enabled, AppleScript will actually block until it can read the value, which makes the whole operation as fast as can be (no need for a sleep somewhere to wait until FilmPack is fully loaded and/or has applied the filter to the image).

Use it



Now, how to use it? well, let's say you have a directory Pictures containing your pictures. You can copy in that directory both convert.sh and filmpack.script (or alternatively put those files in some default path). Then the last thing you have to do is to "configure" FilmPack once -- it will then remember the settings for the next time it is used. The easiest way to do this is thus to start FilmPack, open one of your picture, choose what kind of filtering you want to do, then save where you want all the pictures to be saved. Then quit FilmPack, and run convert.sh!

Friday, February 06, 2009

Interview Étoilé



Me and Quentin were interviewed a few weeks ago by a french linux magazine (Linux Pratique Essentiel), about Étoilé. The magazine is out this month, and the magazine preview shows the article, starting page 24 to page 28...

(note: the title can be translated as "Étoilé, an innovative desktop environment")

Tuesday, February 03, 2009

Atari

Great stories about the creation of the Atari ST: part 1 and part 2. I still remember fondly the ST, TT030 and Falcons... (The TT030 my dad had still works, afaik). I also remember the huge Megafile 30 on top of the MegaST -- an incredible thirty megabytes of disk space ! Why is it that I am now always short on space :)

Sunday, February 01, 2009

...and snow in london

After the south of France, it's now London's turn...

It apparently did not snow as much in 18 years -- London is very quiet today!










update:










update2, going to work:























Wednesday, January 07, 2009

Snow in Provence

A friend just sent me this picture:







...taken from her window, near Marseilles, south of France. Impressive isn't it ? highway closed, etc.

Usually happens every ten years or so :)

edit: another friend took the following pics:













edit 2: check that video...



Monday, January 05, 2009

A Modern Objective-C Runtime

David just got his paper describing his new Objective-C runtime for etoile published in the Journal of Object Technology. Congrats :)

Thursday, December 11, 2008

Mona Lisa video

Here is a small video demonstrating the polygons evolution:



(better results should be doable with more time and/or more parameters tweakings)
For this example, I used 50 polygons of at most 16 points, starting with 10 polygons.

Wednesday, December 10, 2008

Genetic Algorithms and Mona Lisa

Genetic Algorithms try to apply evolution mechanisms to find solutions to hard problems (typically, where no "proper" solution is known and where the search area is large).

Roger Alsing posted a couple of days ago an extremely cool article showing the convergence of 50 polygons to represent the Mona Lisa, using a random approach.

That was too cool to not try to implement it :)







The screenshot shows a rendering of the Mona Lisa using 50 polygons (16 points each), after 40818 total iterations, with 4577 elected states; the middle image is the original (i.e. the target) and the right image the difference between the current polygon-based image and the target (i.e. a representation of the fitness function).
Underneath was an earlier attempt using ovals instead of polygons.

Now, to be more exact, Roger Alsing's algo is more a hill climber algorithm or possibly a simulated annealing algorithm than a good example of a genetic algorithm; it should be interesting to actually implement a proper genetic algorithm approach (i.e. a population > 1) and see how the convergence rate compares... combining polygons and ovals might also result into interesting things.

Tuesday, November 25, 2008

Gregynog 2008



Gregynog is an annual colloquium organized by Swansea University. I was invited to give a talk yesterday about web, webapps and the evolution of web programming. I uploaded the slides here (PDF) if you want to have a look.

Thursday, November 20, 2008

End of an era...



A pdf can be downloaded by clicking on the following image:

Thursday, October 30, 2008

Factor

I just watched this talk:



It's a very nice presentation of the Factor language, a mix of Forth / Lisp / Smalltalk -- a higher level Forth. Interestingly, they do have Cocoa bindings...

Wednesday, August 20, 2008

Done!

pending corrections on my thesis, I'm now a Doctor :)

Saturday, July 19, 2008

Charlie

On savait que Philippe Val etait un con (souvenez-vous de ses diatribes debiles sur l'internet), mais il persiste et signe. Minable.

Thursday, June 19, 2008

Gears presentation at the Google IO conference

The videos from Google IO are online, so if you wonder what I'm working on at Google, here is a nice presentation of Gears for Mobile, by Charles and Andrei:



Slides are also available

Friday, May 16, 2008

OpenSource Jam & Literate Programming






I gave a short talk yesterday about LP at the OpenSource Jam (bi-mensual open source meeting, at the Google London Office). So, here is the pdf of the presentation (just click on the above image to get it). People seemed to like the talk, and there was some interesting comments about the lack of good documentation tools (particularly, the need for multi-level documentations), the similarity with DSL, and some in-house LP tools used by some companies.

update: A blog post describing the event and pictures have been posted by the open source team...





Saturday, May 10, 2008

iLiad iRex pictures

As there's some interest in the iliad and other ebook readers, and as a follow-up to my previous post describing my general impressions of the iliad, I thought that posting some pictures would be interesting... Clicking on the images shows the original image size (note that the grain is in fact due to the iso setting rather than the iliad !)






This first picture shows an A4 PDF, not resized, and perfectly readable. As you can see, no problems either with the viewing angle.






The 16 gray levels work well enough for reading some comics :)






Another comic, close up.






One of the great thing with a reasonable resolution and antialiasing: you CAN put A4 scans of partitions, and IT IS readable :) -- here the Turkish March, from a freely available document scanned by the Bibliotheque Nationale de France (thanks!).






As you can see, the poor quality of the pictures (and the not-so-great white balance) are due to the actual lightning conditions :) -- and you can also see how well an e-ink device reacts to a direct spot lamp...


Finally, as it's one of the main use of my iliad and one of the main reasons I actually bought one, an A4 research paper:






As you can see, it's readable (albeit a bit small), with the PDF reader I use simply set in fullscreen mode.






Zooming on the same document with the camera (ie without touching the iliad) -- you can see how such A4 PDF documents are actually readable, without any kind of resizing (apart the fullscreen mode). The PDF reader application can also zoom the document if it's really necessary (using a simple gesture with the stylus), but I rarely use this feature (usually only for some diagrams if they are too small, not for the text itself).

Tuesday, May 06, 2008

Thesis







Feels good :)

Friday, April 11, 2008

Iliad iRex note taking and hand-writing recognition

I recently bought an Iliad iRex, a pretty awesome eBook reader. Among the cool features, it's running linux, an sdk is available, and it's really easy to hack stuff for it (for instance I wrote a simple script for downloading the 24h edition of The Guardian). Also, as shown with the previous link, the community is quite active :)

Just a couple of words about the iliad itself... the hardware is pretty awesome, with wifi, ethernet, wacom tablet, usb, mmc card and compactflash, audio jack...
the e-ink display is quite amazing too -- 768x1024 makes it precise enough to be able to read A4 PDF without too much problem (a great thing to review lots of research papers, believe me !).

The software side on the other hand... is a bit disappointing. Don't get me wrong: it's good enough, and some aspects are pretty cool. But you really unlock the possibilities of the devices by getting the root access and adding applications developed by the community (notably, the PDF viewer hacked by the community is fantastic, with gestures, etc.). Which means it's fine if you are a geek and not afraid to hack your device, but more annoying for your average consumer :-/
The other disappointing aspect is the (comparatively) low battery life: about 12-15 hours depending on the model (mine is a v1, the v2 do better), which is mostly caused by the fact that no sleep mode is available. Other eBook readers perform much better on that metric. To be fair they don't have wifi nor a wacom tablet :D ... so it's really a matter of choice.

All in all, it's a bit of a shame as really the platform is very nice, and with a bit more effort on the software side, Iliad would have a killer product on their hands. Oh, and yes the e-ink display refresh rate is slow, but curiously it's not that annoying, and having its full library in such small factor is absolutely fantastic.

Anyway... one of the really, really cool feature of the iliad is the presence of a stylus (i.e. the iliad display sports a wacom tablet), which allows you to annotate PDFs, take notes, etc.

I started to experiment a bit with the note taking feature of the iliad; the idea is that you can open a PNG image in the notes folder, and a copy will automatically be made where you can write on it (the image is being used as a background, so it's trivial to have customized backgrounds). But I then wanted to generate a PDF from those notes (i.e. combining the scribbles+PNG).

Iliad do provide a windows application to do all that, but it's a windows app, not really useful for me... there is a nice java application written by the community that allows merging scribbles with the PDF as well. Alas, the java scribble merging application only seems to work for PDF scribble; I guess it would be trivial to modify the java app, but I had a look at the xml scribbling format, and I saw that the format was really simple.

So I quickly wrote myself a MacOSX viewer for the notes, using the png image as a background, letting me print notes easily or convert them to PDF.

But then... I suddenly remembered the Ink handwriting recognition engine.

This thing comes straight from the ill-fated Apple Newton PDA (such a loss!), but what is nice is that it is available and installed by default on OSX.

Turns out it's not too difficult to feed Ink a set of custom datapoints, and after some tweaking it doesn't work too bad apparently, as can be seen on the screenshot...





So far, this is only highly experimental code, and it'll probably take a bit more time to have a really usable application. Still, pretty cool!