xmlrpc changes on python 2.5 and MetaWeblog

While working to add MetaWeblog support to my blog (not that I’m writing lots of stuff here and I need a ‘desktop blogging tool’ to increase my productivity) I found some very helpful links how to add this to a Django based blog. Greg Abbas wrote two tutorials on how to integrate XMLRPC into Django and Metaweblog and Django. Everything fine and dandy until I tried to integrate the XMLRPC part into my system. I’ve started with the ‘arithmetic’ example, but I got the following error message:


xmlrpclib.ProtocolError: <ProtocolError for localhost:8000/blog/metaweblog/: 500 INTERNAL SERVER ERROR>

It was strange for me to see that my previous play with XML RPC (used in another part of the system) didn’t work either. It worked on the production server, but not on my development machine. One of the major differences between these servers was that I was using python 2.5 on my dev server and python 2.4 on the live server. After I’ve google it around a bit, I found that there were some differences between the 2.4 and 2.5 implementation of xmlrpclib. If you check the release note for python 2.5 there is a small mention:


- Patches #893642, #1039083: add allow_none, encoding 
arguments to constructors of SimpleXMLRPCServer and 
CGIXMLRPCRequestHandler.

And incidentally, SimpleXMLRPCServer is used by both XMLRPC implementations.

The fix is pretty easy: add the missing parameters (allow_none – Bool and encoding – String) when you instantiate SimpleXMLRPCServer or any class based on that.

After fixing this, I still had to adapt my models to the Metaweblog API. Thanks to ecto‘s trial version, it wasn’t a very hard job. I prefer to write my posts in Textile so now I have to see how I can make ecto or other blogging tool to let me to that.

Posted 11 March 2008 in: tips

OSX vs Linux

OSX vs Linux

On December 2007, I bought my first laptop, a brand new MacBook Pro. A friend brought it to me from US. Since then, I replaced my home computer and my work computer almost entirely (I still have my work mail on the Linux workstation, and I don’t plan to move it on my laptop soon, and I didn’t transfer all the feeds I’m reading from aKregator to NetNewsWire).

After more then 2 months of daily usage, I wrote some notes on what I like/dislike on OS X vs Linux. Perhaps other Linux users that want a prettier user interface will make the switch to another Unix based OS.

Although, a couple of A-list programmers/bloggers/writers already made the switch back to Linux (Ubuntu, mainly), I will give this OS a try (at least the period needed to earn twice the money I spent on this laptop doing freelance jobs).

This photo shows the US layout, which I like compared to the European/Romanian layout. Read more of my notes in OSX vs Linux, two months report

Posted 23 February 2008 in: tips

uncluttered desk

uncluttered desk

Inspired by the pictures posted on decluttered I’ve reorganized the cables from my desk.

First, I’ve looked for an appropiate pegboard, which I found very cheap at a furniture wood deposit. Then, with help from Sergiu, I’ve made a grid of holes, rows and columns, 4cm apart.

The last part was to attach everything that was ductaped to the back of the desk to pegboard and find a way to mount the pegboard to the desk. For this I used two kinds of zip laces, longer ones for medium – big devices, and shorter ones for cables.

I will add two more devices, an external hard drive (Western Digital MyBook) and a wireless router (AirPort Extreme Base Station) next month.

Here you can see the before and after uncluttered desk pictures.

Posted 21 November 2007 in: tips

internet explorer png transparency bug

Caveats to Internet Explorer PNG transparency bug



.png_image {
  background: url('/img/some_image.png') no-repeat;
  z-index:10;
}

* html .png_image {
  background: url('');
  filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=image, src='/img/some_image.png');
}

If you’re using the above hack to handle Internet Explorer 6 PNG fix, and you’re still seeing some light blue parts, check the following things:

  • The name of the class is the same in all the places you’re using it (in the div or img tag where you need the image, the ”* html .png_image” class line and the ”.png_image” class line)
  • The above CSS must be included in the HTML body/head using <style> tags. Do NOT include from an external file.
  • The path of the image is correct in both CSS definitions.
  • If you are trying to apply this hack to an <img> element, try to use a transparent pixel for <img> and set the png image from css. The image from img source is rendered above the image from css source.

P.S. When you’re writing code in textile, escape each paragraph using ”==”.

Posted 14 November 2007 in: tips

Artist wannabe

Artist wannabe

I present you my dear colleague Sergiu Oprean eating his lunch sandwich during our team building rafting trip on Nera.

In spired by this Photoshop tutorial I’ve used Gimp to obtain the selective coloring effect. I was curious how to do this, but didn’t bother to look it up on Google. Until today didn’t know that this effect is called “selective coloring”, come to think.

I have to thank someone special for asking how to do Sepia Effect and leading me to this page.

Posted 14 June 2007 in: tips

Mplayer on Windows

Here is how you can setup mplayer to use Central European encoding for subtitles (instead of default UTF-8):

Go to mplayer directory and edit the config file, located in mplayer subdirectory of mplayer (that will be \mplayer\mplayer\config), After the “font” line add: “subfont-encoding=iso-8859–2”. While you are still there, you can add ‘fs=yes’ to always have full screen when dropping a movie over mplayer’s icon.

Here is my mplayer config file:

vo=directx
double=yes
font=c:/windows/fonts/arial.ttf
subfont-encoding=iso-8859-2
autosync=100
framedrop=yes
quiet=yes
fs=yes

P.S. In theory, you can achieve this by replacing arial.ttf with arial-ce.ttf, just that I couldn’t managed to find arial-ce.ttf free on Internet. And it looks like arial.ttf already has the CE fonts (aka iso-8859–2) packed into it.

Posted 13 January 2007 in: tips