Posts

Showing posts from February, 2010

uh0h, I made a logo. What do you think?

Image
Made a quick little logo for a website called... Tried a few different versions... showed my girl friend a few, and stuck with this one in the end. Made it with a simple DejaVu Sans Mono Bold font. Ya for the DejaVu font project. Modified the zero(0) a bit, then inverted the colors (ya! negative space). Played around with the letter spacing... applied an old school guassian blur filter to the right side, resized for web... and done! What do you think? The brief is 'something quick for yet-another-culture blog/zine called uh0h... as in uh oh I dropped a hammer on my foot.'. update: Added some results in this image below. Which is updated with a pygame/freetype script. The idea is that the results in the image can be updated without the rss feed getting updated. Hoping to clean the script up and add it to pywebsite. The same technique seems to be used by some wordpress blogs with their 'comments:3' image links - so I think it will be useful for all sorts of things

svn merging is easy...

Subversion(svn) merging is easy... iff you are using a modern svn version (1.6.x). Here it is in short: $ cd /dir/of/your-branch $ svn merge ^/trunk Where ^/trunk is the url of the branch you want to merge from. For more details, have a look in the svn book basic merging section. Also this article on svn merging explains it fairly well. The svn 1.6 release notes and 1.5 release notes also talk about various svn updates including merge enhancements amongst other goodies (like improved python bindings). Really, merging is not too bad in subversion now. I know this post won't stop everyone from using 2004 reasons arguing over version control systems... but what ever. Ok, bzr, hg, and git all have lots of nice features - but merging in svn is pretty easy now so please bash(zsh) it for other reasons if you must. Now, let's move back to the vi VS emacs argument ;)

The secret to my web development productivity...

Image
Can you see the secret to my web development productivity in this photo? No it's not the red cup of coffee. It's not the pieces of sticky tape on my laptop. Follow the cable from my laptop... and have a look under the desk. ... ... I'll wait whilst you have a look before telling you the answer. ... That's right!!! ... it's a joypad. Using python and pygame, I've made a little app which listens for joystick events, and then deploys the website I'm working on. With a mash, kick or prod of my foot, up goes my website. Deployed. Deploy is just a fancy word for 'upload my website, do database migrations, restart app servers, run tests, rollback if there are failures... etc'. For 5 british pounds, $7.8 USD, or 5.74 euros, you can get one of these joypads delivered to most places these days. It's giving me too much pleasure pressing it every time I want to upload a new version of the website. Most live updates EVER today - and I have the joypad to tha

Genshi templates - header/footer templates, and including templates.

Image
How to include a Genshi template inside of another genshi template? Use "py:match" inside the template you want to include into other pages (eg. a sitelayout.html). Then you can use "xi:include" in the pages you want the files included in. (eg. best_picture_of_my_cat_today.html) Now, it's not a "simple include this template here" kind of thing. The py:match can find various parts of the file, and then replace them how they like. For example, a page layout template will match the header and footer with "py:match". It is best explained with examples, and in the documentation: pylons genshi example Includes section of the genshi documentation where it explains "xi:include". Genshi documentation where it explains py:match . Hopefully this explains the genshi way of including a template into a template.

My fling with engine X.

Image
Projects that have X in the name are cool. Engines are cool (especially steam powered ones). Spelling engine 'ngin' gains 17.5 l33t points too. All combined, this makes the name nginx super schwet! I've been using nginx for a while now, and have found it quite good so far. Been moving a couple of websites to it, fooling around with it a lot. So far I've been able to use it for everything I've tried. Some of my apache configs are fairly long... so that is saying quite a bit. On my low memory (512MB) server it has saved quite a bit of memory - even though I've only moved over a couple of websites. Along with the cherrypy memory reduction work I did recently, my server has a bit more room to breathe... (and for me to waste memory on hosting other websites! ya!). Nginx has a good reputation as being rock solid - so I hope it holds true for me. Then perhaps I can get rid of apache completely (on this one server). I've tried to replace apache with other

python - unifying c types from different packages.

Image
Python already has a number of objects to represent c types. However, there is a need to improve interoperability between systems using these c types. Below I explain the need, and discuss existing efforts to address this need. Then ways to transparently translate between the various type systems without each system needing to know about each other are also discussed. In the ctypes library - you can represent an unsigned 32bit integer with ctypes.c_unit32. In the array, and struct modules there are different array type codes. For example, 'L' represents unsigned int with a minimum of 4 bytes on 32bit systems and 8 on 64bit systems. numpy, cython, pyopengl and other python extensions have their own types representing c types too. Most extensions which link up to languages which use static typing represent basic c types to python in some way. Not only libraries, but various compilers and translation tools also use c types. For example tinypyC++, cython, swig, etc. Also typ