Archive for the 'My Kit' Category

02/07 w00t!

root@fic-gta01:~$ python hangul.py
Python 2.5.1 (OpenEmbedded build) sitecustomize.py active.

가와세 나쓰나(川瀬夏菜,9월 8일생)는 일본의 만화가이다. 히로시마현 출신, O형. '미아의 행방(迷子の行方)' (「LaLa DX」2000년 11월호)으로 데뷔하였다. 다네무라 아리나의 어시스턴트로 일한 경력이 있다고 한다.

KA-WA-SEY- NA-SSU-NA-(川瀬夏菜,9WEL- 8IL-SAYNG-)NUN- IL-PON-YI- MAN-HWA-KA-I-TA-. HI-LO-SI-MA-HYEN- CHWUL-SIN-, OHYENG-. 'MI-A-YI- HAYNG-PANG-(迷子の行方)' (「LaLa DX」2000NYEN- 11WEL-HO-)U-LO- TEY-PWI-HA-YESS-TA-. TA-NEY-MWU-LA- A-LI-NA-YI- E-SI-SU-THEN-THU-LO- IL-HAN- KYENG-LYEK-I- ISS-TA-KO- HAN-TA-.

Doesn’t look like much, but this is some Python code I wrote for someone, running *on* my Neo1973. Sweet…

02/03 The force is with me little one…

I have written over the last two days RB bindings for libgd, in the continous search for a replacement to the Picture object, which is missing in console apps. As long as the promised-and-long-forgotten SwordFish project won’t be released, there’ll be little need, I think, or more accurately little clamoring for a Picture object – but once people start writing web apps in RB, you bet your ass they’ll want to produce images on the fly, like everybody else…

So. GD’s one option I had been thinking about – while still thinking I could build my own. And fPic works well enough, albeit with quirks. And it covers lots of ground – including PDFs, thanks to CoreGraphics. But it’s not very portable – my attempts to make it work on Linux, sans PDF and vImage.framework, failed so far. Since gd works on all platforms, I thought I could try it out. And sure enough it was easy to write bindings to the library, with very few quirks – I am having problems with saving to wbmp format, but who cares about that format anyway? :-)

One format that’s missing in GD is TIFF – which fPic handles very well, na na na – so I re-read fPics Tiff code [a wrapper to libtiff really] and converted that to RB. Which means I ended up writing bindings to libgd *and* libtiff, oh so much fun! It only reads TIFF files for the moment, as I haven’t worked out how to get access to the int **tpixels array from RB, in order to save as Tiff. Might have to write a small dylib to go with it – or use fPic’s very own manip.dylib! :-)

Like in fPic, when using freetype2 to draw text, one has to pass the path to a .ttf font file. It’s not exactly user-friendly, so I am trying to find a way to provide for a better interface into that. Maybe a Font class that’ll take care of the nitty gritty work. I found a good code sample to retrieve the name of a ttf font. Could be useful…

01/23 identicons

   

I am adding my entry to identicon third party implementations. I followed more or less Don’s algorithm, and, using the PIL, I have now a functioning identicon lib in Python. The results are not as good as the originals, but it should give you an idea. If you perfect it, I’ll welcome back changes.

Download the source code.

identicon Python

01/18 Shameless plug

Dot-Tunes credits

Dot-Tunes 3.0 is out and Jeff has done an oustanding job. The new UI looks great – and the new web site too. The Flash player works on devices as odd as the Wii… I am proud to have worked as a code monkey on the internals of this nice piece of kit. Go to the web site, download it and give it a try!

08/21 mb update

I have decided that the only way to make mb faster was to change the underlying structure from {Encoding::atom(), String::list()} to {Encoding::atom(), String::binary()}. Which implied a thorough overhaul of the code. I am almost done, although still fighting with some issues. Still, preliminary tests tend to show that the change was worthwile: mb:reset() – the creation of the encodings-related text files into dets tables – is easily faster by half. Only one test in the test suite passes so far, and it too executes quite faster than the original.

As a side note, I have discovered something puzzling. Say you have a variable Code1 which contains the integer value 0×2121. I was expecting that doing <<Code1>> would yield <<33,33>>. Nopesky. It yields <<”!”>>. You have to do <<Code1:16>> – and hope the integer is not greater than 65535: if your integer was, say, 0×012345, <<Code1:16>> would yield <<35,69>>. Ah well…

I am maintaining the source code with git. It is quite pleasant to use, although I have yet to manage to push the repository correctly to the public repository. So nothing is published yet, except partial docs. MNK, who gave me a FreeBSD jail to play with, and is hosting the whole thing, is playing with a git to mercurial bridge. We’ll probably have one day a <your_scm> to mb repository bridge. Maybe.

Erlang