Name: Jeroen Ruigrok van der Werven
Member since: 2000-03-30 18:18:23
Last Login: 2009-05-20 12:43:17
Homepage: http://www.in-nomine.org/
Notes: Former FreeBSD and DragonFly BSD committer. Nowadays working on Python, Trac, Babel, Genshi, and many other projects.
FireMath – MathML editing made easier
I discovered FireMath today, an addon for Firefox that makes editing MathML much, much easier. Give it a spin. I just wish more browsers than Firefox supported MathML out of the box.
Syndicated 2009-06-29 12:54:06 from In Nomine - The Lotus Land
Nintendo DS and dd-wrt, revisited
In an earlier post I detailed how to get your Nintendo DS connected to a router with dd-wrt. One problem I had back then was that I could only make it work in 802.11b-only mode. The solution is to go to your dd-wrt page, select ‘Wireless’, then select ‘Advanced Settings’ and set ‘Basic Rate’ from ‘Default’ to ‘1-2 Mbps’. Now you can set ‘Wireless Network Mode’ under ‘Basic Settings’ to ‘Mixed’ instead of just ‘B-only’.
Syndicated 2009-06-08 20:12:54 from In Nomine - The Lotus Land
Inner Universe
Ангелы и демоны кружили надо мной
Разбивали тернии и звёздные пути
Не знает счастья только тот,
Кто его зова понять не смог…Mana du vortis, Mana du vortis
Aeria gloris, Aeria gloris
Mana du vortis, Mana du vortis
Aeria gloris, aeria glorisI am Calling Calling now, Spirits rise and falling
Собой остаться дольше…
Calling Calling, in the depth of longing
Собой остаться дольше…Mana du vortis, Mana du vortis
Aeria gloris, Aeria glorisStand alone… Where was life when it had a meaning…
Stand alone… Nothing’s real anymore and……Бесконечный бег…
Пока жива я могу стараться на лету не упасть,
Не разучиться мечтать…любить…
…Бесконечный бег…Calling Calling, For the place of knowing
There’s more that what can be linked
Calling Calling, Never will I look away
For what life has left for meYearning Yearning, for what’s left of loving
Собой остаться дольше…
Calling Calling now, Spirits rise and falling…
Собой остаться дольше…
Calling Calling, in the depth of longing…
Собой остаться дольше…Mana du vortis, Mana du vortis
Aeria gloris, Aeria gloris
Mana du vortis, Mana du vortis
Aeria gloris, aeria glorisInner Universe by ORIGA
Syndicated 2009-04-13 11:40:28 from In Nomine - The Lotus Land
docutils: ImportError: No module named roman
For some reason setup.py can fail with docutils complaining it cannot find the roman module. One thing that works is just removing docutils from your site-packages and reinstall it.
Syndicated 2009-04-07 08:22:14 from In Nomine - The Lotus Land
JSONP with Werkzeug
So I had implemented a simple JSON data server with Werkzeug for a classroom experiment. Unfortunately in my haste to get everything up and running I totally forgot about the fact that, since we cannot allow uploads to this server of various custom made webpages, using jQuery’s $.ajax() everything just fails since it will then be a cross-site scripting request.
So, normally you would do something like the following in order to return JSON data:
return json.dumps(data)
Which would be used with the $.ajax() call in a way like the following:
$.ajax({ type: "POST", url: "http://example.com/json/something", data: "parameter=value", dataType: "json", error: function(XMLHttpRequest, textStatus, errorThrown){}, success: function(data, msg){} });
Which is perfectly fine for scripts getting and using the data on the same host/domain. But, as said before, this will fail with warnings similar to: "Access to restricted URI denied" code: "1012" nsresult: "0xdeadc0de (NS_ERROR_DOM_BAD_URI)".
One way out of this is using JSONP. jQuery has a $.getJSON() function, which loads JSON data using a HTTP GET request. Now, the simplistic way to convert your code would be to change it as such:
$.getJSON("http://example.com/json/something", function(data){} );
But this causes another issue. Since $.getJSON() GETs the JSON data, but doesn’t use eval() on it, but instead pulls the result into script tags, it somehow causes,on Firefox at least, an invalid label error. In order to fix this you need to set up the JSON data server to properly support a callback argument, to use $.getJSON() how it is meant to be used:
$.getJSON("http://example.com/json/something?jsoncallback=?", function(data){} );
In the code above the additional parameter jsoncallback will, thanks to jQuery, get the question mark replaced by an alphanumeric string (typically in the form of jsonp followed by a timestamp). This value should be used to wrap the resulting JSON data with. This means you would have to change the initial Python code to something like this:
return request.args.get('jsoncallback') + '(' + json.dumps(data) + ')'
Of course this causes problems when you want to reuse the code for both AJAX use on the same host/domain and use it from outside. So in order to make both work you can test on whether or not the callback parameter is available and return the appropriate data. I came up with this little snippet for that:
def jsonwrapper(self, request, data): callback = request.args.get('jsoncallback') if callback: return callback + '(' + json.dumps(data) + ')' else: return json.dumps(data)
Syndicated 2009-04-03 13:07:15 from In Nomine - The Lotus Land
asmodai certified others as follows:
Others have certified asmodai as follows:
[ Certification disabled because you're not logged in. ]
FOAF updates: Trust rankings are now exported, making the data available to other users and websites. An external FOAF URI has been added, allowing users to link to an additional FOAF file.
Keep up with the latest Advogato features by reading the Advogato status blog.
If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!