April 29th, 2010
I have some remarks on Steve Jobs’s “Thoughts on Flash”.
- “Adobe claims that we are a closed system, and that Flash is open, but in fact the opposite is true.”. I agree with Steve: Flash is pretty closed. However, the iP(hone/od/ad) isn’t open either.
- H.264, which Jobs touts as a great modern replacement of flash, is patented. You have to pay whatever the MPEG LA fancies you to pay for use of the standard. This is not really different from the control of Adobe over Flash.
- iPhone OS is closed. You need to buy yourself into the iPhone Development Program. Again Apple can shut the program down whenever they like, which is not really different from the control of Adobe over Flash development.
- Safari is an intermediate layer and creates sub-standard apps. Jobs claims that third-party intermediate layers result in sub-standard apps. Jobs argues that an intermediate layer will keep developers from platform enhancements, won’t result in targeted great apps and won’t put apps directly on the shoulder of the platform. If he is thinking about Safari, he is right: web-apps for the iPhone just don’t feel great, can’t use all the platform enhancements and don’t result in great targeted apps.
Posted in General | No Comments »
February 28th, 2010
Dear readers,
I’m looking for an apartment in the neighborhood of Nijmegen. I’m not picky, but can’t afford more than €300,- in total per month.
Contact me per e-mail (bas@this domain) or call me: 0644239435.
Bas
Posted in General | No Comments »
January 31st, 2010
This week, various student organisations protest against major cuts in the funding of education and research.
A reader of dutch, can visit their site.
Posted in General | No Comments »
December 16th, 2009
As pointed out by Jorg Kennis, Twitter‘s new lists feature make it hard to determine the amount of unique followers. I’ve written a simple script, using a slightly modified TweePy, to determine the amount of unique followers.
Example usage:
bas@w-nz ~/twitter-unique-followers $ python twitter-unique-followers.py JorgK -ubwesterb
Password:
rate_limit_status: remaining_hits: 112
Jorg Kennis
followed directly by 182
in lists
RPtje/vriendenbekenden subscribed to by 0
JorgK/TechNL subscribed to by 0
sentfanwyaerda/nijmegen1 subscribed to by 9
JorgK/Friends subscribed to by 0
sjorsjes/Community subscribed to by 0
robinspeijer/iPhone subscribed to by 1
nielsschooneman/iPhone subscribed to by 0
JeanPaulH/iPhoneclub subscribed to by 5
number of unique followers: 198
You can download it here. I could write a simple webpage with the same functionality, if anyone would mind.
Posted in General | No Comments »
November 1st, 2009
Normul normalizes URLs. It expands shortened URLs:
>>> from normul import normul
>>> normul('http://bit.ly/1I4VQ')
{'type': 'other', 'normalized': 'http://www.shinguz.ch/MySQL/mysql_mv.html', 'original': 'http://bit.ly/1I4VQ'}
And shows useful links for hosted-images:
>>> normul('http://yfrog.com/6c5krj')
{'image': {'full': 'http://img228.imageshack.us/img228/1079/5kr.jpg', 'thumbnail': 'http://img228.imageshack.us/img228/1079/5kr.th.jpg'}, 'type': 'image', 'original': 'http://yfrog.com/6c5krj', 'normalized': 'http://yfrog.com/6c5krj'}
You can find the simple but convenient sourcecode here.
Tags: normul, web2.0
Posted in General | No Comments »
October 24th, 2009
Given a set of countable sets
, such that
is totally ordered by inclusion, videlicet for every
either
or
. Intuitively, for at every step in this chain one element at least must be added, one expects the set
to be countable as well.
Suppose
is countable. Then the union,
is a countable union of countable sets, hence countable. (Suppose
is an enumeration of
and
enumerations of the elements of the chain. Then
enumerates
.)
Thus
is an upper bound of
. In the poset of countable subsets of some set
, of which
is a subset, every non-empty chain has an upper bound. Hence, using Zorn’s lemma there is a maximal element, say
.
Suppose
is uncountable, then there exists a
.
is most definitely also countable and
which contradicts
‘s maximality. We are forced to conclude that there exists an uncountable chain of countable sets.
Cantor’s set theory keeps surprising.
Update: an example of such a chain is the set of the countable ordinals.
Another update: a “more concrete” example are the downsets in
without the empty set and
itself. These downsets correspond to real numbers, see Dedekind Cuts.
Tags: mathematics, set theory, zorn's lemma
Posted in General, Maths | No Comments »
September 10th, 2009
Although I don’t bear any animosity against most dutch loanwords (except those Anglo-Saxon), the dictionary of the dutch Bond tegen Leenwoorden is a true joy to read.
Tags: linguistics, loanwords
Posted in General | No Comments »
August 31st, 2009
Since yesterday I, for the first time, enjoy the anything-but-special age of 21 years.
Posted in General | 1 Comment »
August 27th, 2009
Windows 7 Sins. I strongly agree with points 1, 3, 4, 5 and 6. The arguments for points 2 and 7 are a bit weak, but I do agree with the conclusions.
For the non US audience, it would have been nice to note that if Microsoft (or the US) would recall all foreign licenses for Windows, our entire government is crippled.
Posted in General | No Comments »
July 1st, 2009
At the faculty for sciences there are canteens for students. In each of these, there’s sound equipment connected to linux boxes. On each of those linux boxes, we run a music-request-server called Marietje. I just finished writing a front-end in Javascript. It wasn’t a pain. As instead, the use of jQuery was a bliss.
The frontend for one of those boxes and the source code (see the ajax folder).
Posted in General | No Comments »
June 22nd, 2009
When I wanted to react to any changes to a input textbox immediately, my first instrinct was to use onChange. onChange, however, is called when the input loses focus. onKeyPress then? Isn’t called on backspaces. onKeyDown, maybe? It does get called, but the effect of the keystroke isn’t yet applied, for the return value determines whether it that is done in the first place. (Same story for onKeyPress by the way.) onKeyUp does work a bit, except if someone is holding down a single key, for a while.
The solution: hook onKeyUp and use setTimeout with a timeout of 0. Yugh. I hate DOM.
Big Fat Disclaimer: I actually tested this only on one browser.
Tags: dom, javascript, stupid
Posted in General | No Comments »
June 19th, 2009
When I want to generate usernames from real names, which can contain non-ascii characters, you can’t simply ignore the unicode characters. For instance, danielle@blaat.org is the right e-mail address for Daniëlle, danille@blaat.org isn’t.
There’s trick. Unicode has got a single code for ë itself, but it has also got a code which (simplified) adds ¨ on top of the previous character. The unicode standard defines a normal form in which (at least) all such characters, which can be, are represented using such modifiers. If you then simply ignore the non-ascii representable codes, you’ll get the desired result.
In python: unicodedata.normalize('NFKD', txt).encode('ASCII', 'ignore').
However, this isn’t the right solution. For instance, in german, one prefers ue as a replacement of ü over u.
Tags: hack, python, unicode
Posted in General | No Comments »
May 30th, 2009
Consider
for page in Page.objects.all():
print page.title
for comment in page.comments.all():
print comment.
There will be a single query to fetch all pages, but there will be for every page another query to fetch its comments. Luckily, Django has got a nice trick up its sleave: select_related. Would I use instead of Page.objects.all(), Page.objects.select_related('comments').all() then Django will use a single joined query to prefetch comments for each page.
However, Django’s select_related only supports forward one-to-many references. No many-to-many; certainly no reverce many-to-many; no reverse one-to-many and no, not even reverse one-to-one (yet). A developer claims it’s impossible (which is bullshit), another asks for patches, which means he doesn’t care doing it himself.
It’s quite easy to manually code around the missing reverse select_related, but it takes too many ugly lines compared to the single word it could’ve been.
Tags: django, select_related, stupid
Posted in General | 3 Comments »
April 29th, 2009
new Date(2009, 1, 1) represents the first of February 2009. Not the second of February nor the first of January. Why this stupidity?
Tags: stupid
Posted in General | 2 Comments »
April 19th, 2009
When decoding, for instance, a variable-bitrate MP3, gstreamer reported durations are, to say the least, estimates. I’ve tried to get a better result in a few ways. First off, some files yield a duration tag, but even if you’re lucky and it is there, there are no guaranties about precision. After that I tried seeking to the end (GST_SEEK_END) of the stream and querying the position, which gstreamer didn’t like. Finally, routing the audio into a fakesink, waiting for the end of stream and then querying for the position gives the right result. It’s not the prettiest method, but it works.
This is a Python script that prints the duration of a media to stdout.
Tags: duration, gstreamer, hack, python
Posted in Computer Science | 3 Comments »
March 24th, 2009
is ugly, but
is nice! The solution: prefix \uparrow with \mathopen.
Tags: hack, LaTeX
Posted in General | No Comments »
February 6th, 2009
In a few hours I’ll travel the short distance to Bruxelles to visit Fosdem. Once again I’m pretty excited
. Lets hope this time the pink elephants of the Delirium Cafe don’t crush me. If you’re also going, drop me a comment.
Tags: fosdem
Posted in General | 2 Comments »
January 29th, 2009
It’s soon. The 14th of februari, 00:31:30 (Europe/Amsterdam). Will the world end? Will ancient libc code giggle and break?
Tags: arbitrary
Posted in General | No Comments »
January 1st, 2009
Assign 1 to True and 0 to False. Now the minimum corresponds to “and” and maximum to “or”. If you give it a bit more though, less or equal to corresponds to implication. This is a lot more general than this specific case. Add .5 for a third value (eg. NULL) and it still yields natural results.
We can recognize the behaviour of minima and maxima in a lot of other things. Take for instance set inclusion as order with intersection as minimum and union as maximum. Actually, the link between general order and set inclusion is frequently made to then propose that “intersection of two set of cases” and “logical and” do look a lot alike.
This is just the tip of the huge iceberg. Order appears everywhere! Everywhere in Math. Everywhere in CS. And its just recognizing simple order I’ve demonstrated. Other useful concepts in order theory that I didn’t even touch are Galois Connections and formal concept analysis.
Oh, another example of an order are integers with bitwise or and bitwise and. It is left as an exercise to the reader when one integer is greater than another.
Interested? Buy an Introduction to Lattices and Order.
Tags: math, order
Posted in Maths | No Comments »