Posts

Pyramid does 22, but how do you do zero lines of python?

There is an article talking about how in a certain configuration the Pyramid python framework uses 22 lines of python for a hello world app. How would your python web app run zero lines of code for a hello world? By pre-generating the html at startup - or at deploy time, and serving the generated data. Beat that Pyramid! ;) 6 minute Abs . This is a silly blog post - but also slightly serious. Uploading static data to serve is a very valid approach for a web framework. It's performance, security, and complexity benefits are quite big.

Why HD looks weird.

Very often I'm sitting next to a HD teevee, and people say 'that looks weird'. Why? There's a number of reasons, but the two main ones are: when compared to SD digital teevee is: Poor colour depth compared to the number of pixels . For a person used to analog teevee (PAL, or NTSC) - and not digital teevee, a major weirdness is the digital compression used. Digital teevee is compressed Compared to SD digital teevee - No increase in colour richness. They increased the number of pixels shown per cm (or inch), but did not increase the richness of colour displayed. On PAL for example, you may have 422 colour depth - which is 8 bit colour. If you come from the computer world you may think that is 8 bits per channel colour (RGB 888). However in the broadcast world they use the YUV colour space, and this is usually only 8 or 10 bits per pixel. 4 bits Y, 2 bits U, 2 bits V == 8 bits per pixel. If the colour depth is the same, then why does it look weirder in HD? Imagine a...

iphone web app development, from the trenches.

Dear reader, I joined the iOS web developers for adventure and a chance to see the world but instead I am working in a mud hole, freezing my arse off, with a constant fear of death. I am writing this note in hope that it makes it out of the trenches. In case I do not. It's bloody here in the iOS trenches and I feel my days are numbered. With these thoughts on my mind, I hope to share this with you. Some of this stuff is not documented in the standard issue manual, or disseminated via the standard propaganda channels. I feel it ought be of use to you. Unfortunately it has been very hectic here, so the words will likely be rushed and detail will be lacking. I apologise for this, but I still think it will be useful (no brain rockets, just some Damn Useful Information). In case I don't make it, Your friend from the trenches, René Dudfield. ps. if you find this note, please consider commenting on the back with any other useful information your fellow iOS trench mates might fi...

Tweeting python packaging tips.

I've begun 'tweeting' python packaging tips . I'm hoping to go up to 100 useful python packaging tips. If you're a twit too, please feel free to join in on the conversations . update : I wrote a little script to download all the python packaging related tweets from twitter. For some reason twitter is only giving me 32 of them... but I've written about 40 so far. Going to run through these at the london python dojo tonight in a mini talk. setup.py build_ext --inplace to compile your extensions inside the source directory. Good for developing inplace distribute 'setup.py develop' Installed pkg points to dev copy, quicker changes during dev. develop -u to remove For pyrex/cython/swig packages, include the generated C code so people do not need to install cython/pyrex/swig. For debugging info set DISTUTILS_DEBUG. os.environ['DISTUTILS_DEBUG'] = "on" OR export DISTUTILS_DEBUG=on Don't put code in package/__init__.py file. Makes debu...

Pokket mixer. A sound mixer from Berlin.

Image
pokket mixer I went to the big market at the Berlin park today, and saw this little sound mixer there. This dude and his girlfriend who were at the stall make them! They are his design too. Really cool buying electronics from the people who make them. Did I mention I like buying small things that can fit in my pocket, and in my carry-on luggage? It's passive - so it does not need to be powered. It's also very small. Seems to work quite well. The eq seems to work ok. It has the normal Hi, Mid, Lo for each of the two channels. The sound quality seems pretty good (even when going out to high quality studio speakers). I've bought more expensive mixers with worse audio quality.

3g modems in finland? Any plans for a month or one week?

Dear Lazy web, Are there any 3G usb modem plans available in Finland that I can get for one week or a month? I'd need to buy the modem too. Hopefully it should work two hours drive from Oulu. Update: used a modem by Elisa. Worked well, even 3g. Closing comments because this post is getting spams every day - and blogger.com spam protection seems broken.

javascript (and jquery) templating

I just put up some code for doing templating with javascript(and jquery). Either on the server side or on the client side. If you open the html in your browser, it runs on the client side. If you first process it server side... then it runs server side(but not on the client side). http://github.com/illume/nodejs_jquery_templating This is a followup from you are using the wrong templating language - as a proof of concept. Why is this useful? No need for a server to process the templates. Either process them server side or client side. Data can be stored in a json file. No need for a database for testing. Just create json files in a text file. Can reuse knowledge of javascript libraries (like jquery), rather than learning one of 798394 different templating languages. Can keep one html file which front end web developers can edit without them needing a new template file. Can use jquery plugins on server side too(validation, etc). Seems to work ok so far... but it still needs a lot...