Webkit fun, maths and an ebook reader
March 16, 2010
I have been toying with webkit lately, and even managed to do some pretty things with it. As a consequence, I haven’t worked that much on ekiga, but perhaps some of my experiments will turn into something interesting there. I have an experimental branch with a less than fifty lines patch… I’m still trying to find a way to do more with less code : I want to do as little GObject-inheritance as possible!
That little programming was done while studying class field theory, which is pretty nice on the high-level principles and somewhat awful on the more technical aspects. I also read again some old articles on modular forms, but I can’t say that was “studying” : since it was one of the main objects of my Ph.D, that came back pretty smoothly…
I found a few minutes to enter a brick-and-mortar shop and have a look at the ebook readers on display. There was only *one* of them : the sony PRS-600. I was pretty unimpressed : the display was too dark (because it was a touch screen?), but that wasn’t the worse deal breaker. I inserted an SD card where I had put a sample of the type of documents I read : they showed up as a flat list (pain #1), and not all of them (no djvu) (pain #2) and finally, one of them showed up too small… and ended up fully unreadable when I tried to zoom (pain #3). I guess that settles the question I had on whether my next techno-tool would be a netbook or an ebook reader… That probably means I’ll look more seriously into fixing the last bug I reported on evince (internal bookmarks in documents).
Attracted to FLT
November 5, 2009
I have been a little stuck for some weeks : a new year started (no, that post hasn’t been stuck since january — scholar year start in september) and I have students to tend to. As I have the habit to say : good students bring work because you have to push them high, and bad students bring work because you have to push them from low! Either way, it has been keeping me pretty busy.
Still, I found the time to read some more maths, but got lost on something quite unrelated to my main objective : I just read about number theory and the ideas behind the proof of Fermat’s Last Theorem (Taylor and Wiles’ theorem now). That was supposed to be my second target! Oh, well, I’ll just try to hit my first target now (Deligne’s proof of the Weil conjectures). And then go back to FLT for a new and deeper reading.
I only played a little with ekiga’s code — mostly removing dead code. Not much : low motivation.
Class field theory, game and freebox issues
August 25, 2009
Class field theory
I’m still diving in mathematics ; I’m not very happy with my level of understanding on class field theory yet, so I think I’ll take some more… I don’t feel like I’m making good progress, but that’s not a big problem : I know things generally work that way with the brain — pieces don’t take their place until there are enough of them.
Game
I didn’t touch the code for my kids since the first draft : not good. I think I’ll dump soya and find something else.
Freebox issues
I would like to show photos on my somewhat big TV — photos which happen to be on my computer with a somewhat small screen (life is full of those situations…). The special type of modem used by my ISP (called a freebox) has gained a wonderful feature lately, which I had never tried : uPnP. So I quickly installed mediatomb, then configured it (incredibly easy…), and tried to see it from the freebox.
It worked! I could see my media collection ; I was so thrilled! But :
- trying to look at photos gave awfully pixellized images — unbearable, unusable ;
- trying to play music failed because the files don’t even show up : I only have ogg, flac and a few mp3 — nothing appears in the list ;
- trying to play video failed because even if some files show up (the .avi files — without the extension), I only get a black screen.
So in short : there’s a wonderful feature, but it just looks cool : it won’t see most files, and the few it sees won’t get anything correct.
I’ll either have to find out how to make the “freeplayer” feature work… or find a way to tell gstreamer : “here is a list of image files I want you to turn into a video diaporama with pretty transitions at that speed” (that later solution would be great!).
Playing with python
August 16, 2009
The title has a double meaning : I’ve been diving into python lately, mostly motivated by trying to understand sage ; but also because I wanted to write a small game for my kids.
I’m using a simple client/server organization, with the twisted framework for the networking part (the server should be mostly ready), and the soya framework for a client. I’m not 100% satisfied with soya though, so I’ll have to dig further to see if I find a more convenient framework… perhaps I’ll write the client using C++ and ogre. It looks overkill but interesting anyway.
Of course, this little game doesn’t get enough love since I’m still reading as much maths as possible, but it gives a nice recreation — and the sage objective means it’s not 100% un-mathematical occupation 😉
I must have read hundreds of pages of commutative algebra now, but I’m still feeling too weak on number fields and Galois theory yet : perhaps I should dive in the proof of the Weil conjectures to know more precisely what I’m lacking…
Feeling a mathematician again
August 2, 2009
I recently (well, it’s been a month or two) decided I wanted to do maths at a serious level. That meant diving again in books, and tryint to get my mind in shape again. The basics were still there of course : it’s like biking, you never really forget. But basics aren’t enough.
I decided I would follow the tracks I followed already before my Ph.D, so I dived into algebra. Then I read algebraic geometry ; Hartshorne’s “Algebraic geometry”, which didn’t really stick : I was lacking in both commutative algebra and category theory.
So I read a few things about commutative algebra (my old course notes, a dusty book), then Mac Lane’s “Categories for the working mathematician”. Ouch. Brain. Hurt. Much. But that was welcome pain : it made the bigger picture appear more clearly. I should still try to find something about the Goedel-Bernays axioms for categories : I’d like to have clean bases.
Then I tried read the EGA (Grothendieck and Dieudonné’s “Éléments de géométrie algébrique”) — that was probably a mistake : that series of books was obviously never meant to be read! The examples are sparse and undetailed, there is little in the way of explaining what the bare results mean (sometimes I would take a few pages back and say : “Oh, they’re proving that this construction is local in such and such a way… couldn’t they just say that to make it smoother!?”). A good reference, but not a learning tool. The zero-numbered chapters are probably the most helpful. If only I could lay my hand on Grothendieck’s Tohoku!
I’ll probably try to read Hartshorne’s once again : I’m sure I’ll be able to get the best of it this time. The ultimate goal of this algebraic geometry reading is to read Deligne’s work on the Weil conjectures. Then I’ll probably try to read Wiles’s proof of the Shimura-Taniyama-Weil conjecture (which implies the famous FLT — Fermat’s Last Theorem). I’m probably still a bit short on Galois theory, number fields and representation theory for those though.
And of course, the ultimate goal of this maths reading is to be able to read my Ph.D report, get up to date with the results in the field, then go further.
PS: for those who don’t know about that site yet : NUMDAM has a great number of very interesting things — including the EGA and Deligne’s work on Weil conjectures, Néron’s work on minimal models ; oldies and goodies, but also more recent stuff.
Lines and points
July 22, 2009
I was musing about the following situation a few days ago : consider a finite number of points, then take all the lines through pairs of distinct points, then all the intersection points of pairs of distinct lines, to obtain a new set of points.
There are several questions which jump to mind in such a situation :
- do we get a finite number of points? Of course!
- are there figures where we get the same points back — and only them? After a few sketches : a triangle does that.
- are the new points always in the convex hull of the first points? Again after a few sketches, a trapezoid (an arbitrary one, not a rectangle) shows it’s false (how unfortunate).
- are there situations where iterating the trick leads to a stable figure? Well, obviously the stable figures do answer that, and the example of a square shows it’s possible to start from a figure and go to a stable figure.
- are there periodical situations, that is figures where iterating gives other figures, but we fall back to the initial figure after a while? That one is trickier — if we start with strictly less than three points or aligned points, the algorithm gives zero points which is a stable situation ; if we start with at least three non-aligned, then we’ll always find the initial points in the new list of points. That means the number of points is increasing during iterations : there are no other (ultimately) periodical situations than the one discussed at the previous point. That means there are only two alternatives in that case : either the number of points is ever-increasing to infinity, or it’s ultimately stationary and we get a stable figure.
- are there figures which lead to an ever-increasing number of points? Well, I think there are trapezoids which will lead to such situations, but I didn’t try to prove it.
- given a number of points, is there a stable figure with that number of points? With at least three points (less leads to no point), the answer is yes, since we only have to align all but one (this generalizes the triangle case) — but the example of the square with a point in the middle shows it isn’t the only possibility.
Of course, trying to draw the figure with a simple hexagon was already so painful I soon realized it was beyond my poor drawing abilities (using a ruler may have helped, but hey 😉 ) — so I decided I would try to make a computer do the work for me. I decided to use haskell and its cairo bindings, since cairo is pretty easy to use, and haskell (as most functional languages) is pretty efficient when it comes to playing with lists. I quickly wrote the main code, then the viewing code. In a hundred lines I have what I need (I’m writing big).
Perhaps I’ll try to rewrite it in C++ (for performance!) or to sage. Or I’ll wait for someone to post about it on her/his blog 😉
E-readers
July 21, 2009
Last week I was having a look at what is available on the market to read documents in a more efficient way than on a full laptop (heavy, weak battery, average readability).
I found nothing which was meeting my technical requirements and of reasonable price. The kindle wasn’t in a bad place in the list of readers, but it felt awkward and worrying to have so smart a reader, so tightly integrated to a web service.
Fast forward this week, and I learn that amazon used that tight integration to nuke books on people’s own shelves! I’ll just end that blog post before reaching Godwin’s point…
I’m not afraid of people who write code either…
July 11, 2009
… but the world does exist. And there are particularly aggressive entities in it.
I’ll use C#/Mono if there are interesting applications written with it ; but I won’t trust my time working with it.
The tailor
March 1, 2009
Ok, let’s imagine you’re fed up with the GObject boilerplate code, and decide to use a mature serious language which gives easier access to classes : C++.
C++ followers will tell you how wonderful that language is, where performance with respect to both speed and space is taken very seriously. Read any document about C++ : this language has all bells and whistles, with options everywhere (do I dare saying “A real KDE!”? No, that would be trollish). Let me review some features of this both high and low level language. Performance!
Let’s begin with the most frustating issue, that of inheritance. When you override a method, by default you have done almost nothing : if your object is accessed as being from the base class, then the old method will be called. You have to use the “virtual” keyword on a method you think you’ll need to override later on. If someone else want to override and can’t modify your class, (s)he’s a two-sided toast. On the other hand, the performance!
Sigh, so you add the “virtual” keyword everywhere you think, run your program, and things just go wrong : it’s perfectly normal, you didn’t think C++. Yes, you should declare your base destructor virtual, otherwise when you try to destroy an object through its base pointer, things break, without warning. But with performance!
One more thing about inheritance, and more specifically multiple inheritance : you have to be extra careful in the diamond configuration, because you may end up with copies of data members, which may not be what you had in mind. In such a case, you will again have to use the “virtual” keyword — not where you form the diamond, but on the two branches : again, in C++ you don’t deal with inheritance when it happens, but much sooner. For performance!
The language has also nice things like constructors which get called automatically. Say you wrote an array-like class, with a constructor from integers, and you work with two arrays of integer ; at some point you want to do a comparison tab1[i] == tab2[i], but your fingers type tab1==tab2[i] — ah, you’re comparing a full array with an integer : no problem, the compiler will use the right-hand side to build an array and do a stupid comparison… isn’t it wonderful? Nonsense, but with performance! (for completeness, you saw the previous paragraphs, so I hope you guessed: there’s a keyword to avoid that problem : “explicit”.)
Another case of automatic (and unsafe) promotion is with conversion operators, but I have seen quite a few advices of not using them. I think the “explicit” keyword doesn’t apply to them (yet…).
As closing words, let me explain the link between the title and this post : Fernand Raynaud was a french humorist, and one of its most famous sketches, “Le tailleur” (the tailor) was the story of a man coming back to his tailor to complain about a bad suit. Of course, the tailor finds the suit perfect and puts the blame on his customer, who ends up admitting the suit is indeed perfect, once he has put his left shoulder a little higher, his right shoulder a little back, turned his hips a little, and raised one arm slightly…
PS: if some C++ lover wants to tell me I just don’t have the right mindset, lack the skills or whatever explanation that puts the blame on me and not the language itself : put your comment in /dev/null and read the last paragraph again, tailor!
Upgrading ubuntu…
February 21, 2009
Today, I upgraded my parents’ computer. From ubuntu 8.04 to ubuntu 8.10. Summary : ouch.
No more keyboard in X. No more mouse in X. No more soundcard.
What happened to X? Eh, it commented the keyboard and mouse sections in xorg.conf — because now it’s magically hal-detected, so those are useless now. So useless uncommenting makes things work again.
It works, but a shiny button proposes to install nvidia drivers. Shiny, click! Let’s restart X. Uh… doesn’t start. But we get a nice dialog asking what to do. One of the choices is to reconfigure. Let’s do that. No keyboard nor mouse — again!!!???!!! Of course, it just made a configuration file without the needed sections. A dpkg-reconfigure xserver-xorg later, the situation is sane again.
Now, what about sound? lsmod | grep snd makes it clear there are no sound modules loaded. After a quick updatedb, I check where the .ko are… none for the running kernel. A google later, I learn that I need a driver package (linux-ubuntu-drivers or something like this, but with the kernel version in the name), and synaptic says it doesn’t have one for the running kernel version. Gasp!
Let’s install a newer kernel, with all we need. Reboot (I hate rebooting… that’s so… stupid). Sound is back.
The fear I have is that it will now overwrite xorg.conf regularly, and hence stop working regularly. I need to find out how to make that box just work!!!
Edit: it turns out the keyboard&mouse issues were caused by the start of X before hal… reversing their initialization order makes things work : it won’t stop working behind my back (and worse, while I’m not there to fix back).