Archive for the ‘Projects’ Category

0install Firefox

Thursday, August 2nd, 2007

0install feeds for Firefox

Yay! Feeds for every language of the latest version of Firefox.

It took ages to get all the scripts doing what they should be. I have version 2.0.0.6 and 2.0.0.5, and it’s fairly straightforward to add new ones (see the scripts directory).

0install is a cool little system which I like a lot. I made a Firefox feed before, for 2.0b1, but that was just for en-GB. It’s very easy to make feeds, but obviously Firefox and its 44 localisations requires something a little different. There’s a Debian (and Ubuntu) package: zeroinstall-injector.

To run Firefox:

0launch http://holizz.com/software/0install/Firefox/ja.xml

To make the command “firefox” run Firefox:

0alias firefox http://holizz.com/software/0install/Firefox/ja.xml

You can also drag and drop the URL onto XFCE’s “Program Launcher”, and there appears to be a Zero2Desktop application for adding 0install applications to GNOME/KDE menus. But my favourite method is using ROX’s AddApp.

Ruby Unicode String Fun

Monday, January 8th, 2007

RUnicode is coming along nicely.

I just implemented a few methods for String. One was String#blocks, which returns the names of the blocks codepoints belong to.

  # "今日はトム君。Niall is a ☆.".blocks
  # => ["CJK Unified Ideographs", "CJK Unified Ideographs", "Hiragana",
  # "Katakana", "Katakana", "CJK Unified Ideographs",
  # "CJK Symbols and Punctuation", "Basic Latin", "Basic Latin",
  # "Basic Latin", "Basic Latin", "Basic Latin", "Basic Latin", "Basic Latin",
  # "Basic Latin", "Basic Latin", "Basic Latin", "Basic Latin",
  # "Miscellaneous Symbols", "Basic Latin"]

And then I decided Ruby needed a real String#upcase and String#downcase. The original String#upcase just transliterates ASCII.

The operation is locale insensitive—only characters “a’’ to “z’’ are affected.

My version performs simple uppercase mappings according to the data found in UnicodeData.txt. Although it takes about a year to do it.

  # "天空のエスカフローネ Tenkū no Esukafurōne, wörtlich".upcase
  # => "天空のエスカフローネ TENKŪ NO ESUKAFURŌNE, WÖRTLICH"

String#downcase just calls String#upcase to do its dirty work. And String#upcase! and String#downcase! just use String#replace.

This Ruby Unicoding is rather fun. It’s a good language to work with. It’s just so hackable. Maybe the next step should be to work out how to get String#upcase running in a timeframe similar to the original String#upcase, and then I might like to make some Ruby extensions in C. Although I’m not fond of C, I do think it’s a good choice for low-level things, and this is indeed low-level stuff.

RUnicode started out as one method I needed for my KLookup final year project. It’s growing a little, but I’m keeping it in the KLookup source tree for now. You can check it out with the following command:

svn checkout svn://rubyforge.org/var/svn/klookup

There’s a cute little demo in demo/ which makes use of the String#tr method (which is also available in jcode, I discovered) to convert Arabic numerals into (Japanese-style) kanji numerals. There’s a shell script to print the date from the Ruby script:

二千七年一月八日

It only goes up to (10**26)-1 at the moment. If you’re interested, (10**26)-1 (that’s a nine followed by 25 nines) looks like this:

九万九千九百九十九億九千九百九十九万九千九百九十九兆九万九千九百九十九億九千九百九十九万九千九百九十九

Enough babbling, goodnight.☆

Green Belt and a Tip

Saturday, November 25th, 2006

緑帯になったんです!ぼうもパッスしました!

I became a green belt. I also passed bou (quarter staff).

Tom’s untopical tip: put a “TODO” in your source tree at every point where you have an actionable (make a central file for those without a place). Then you can grep -R TODO * | wc -l to check the general status of the project.

ヤー、おひさしぶり

Saturday, October 14th, 2006

IMEs are the best invention in the world. This week I’ve typed Ï€ and done some box drawing without having to look at 文字マップ (Gucharmap in this case).

Today I learnt Ï€ to 9 digits thanks to the Japanese language and this post. It was HARAGUCHI Akira’s recent escapades into real numbers that made me want to find Ï€ in Japanese phrases. It’s a great language for memorising numbers.

Today I have also been looking at fun things like graphical toolkits. It’s hard to put into words why GTK+ 2 could beat Qt or Tk in a fight. Just say that GTK+ 2 has a wider deployment and hope for the best. And then try to think up a good reason to choose Ruby over Python (I don’t think “Ruby is more Japonz” will cut the mustard in final year project documentation).

I shall probably start some coding of that soon (maybe sooner than my Gantt chart tells me I should be doing - but I’m sure I’ll live).

Well. I should go to bed now so I can go swimming in the morning and then write lots and lots of documentation.

P.S. I subscribe to the Doctor Will documentation methodology: have everything in a wiki then just print it out and call it a report.

My repository

Thursday, July 20th, 2006

I’ve been packaging so many things in the past week that I thought I’d put it all in one place and in some logical order.

http://holizz.com/software/

Currently I have three dyne:bolic 2.x modules:

And one 0install interface: Firefox 2.0b1

If you’re not using dyne:bolic or 0install, these are probably not for you. But then dyne:bolic and 0install are pretty cool, so maybe you should be.

Firefox 2.0b1 dyne:bolic module

Tuesday, July 18th, 2006

I made a Firefox 2.0b1 module (signature) today (British English dictionary included).

I also updated the Flobopuyo module (signature) to put it in a sensible menu (GAMES/ARCADE rather than FLOBOPUYO).

あけましておめでとう

Friday, January 13th, 2006

今年もどぞよろしく。

Happy New Year.

Yeah I know I suck. I just haven’t had anything to write about.

Yesterday I tried to enable Japanese input methods in X (again). I failed, but I think I’m getting closer to my goal. See the pages I found here: del.icio.us/holizz/japanese+input (I have 40 items tagged japanese; it’s catching up to web).

Today I’ve been trying to write some CSS that displays Ruby in a relatively useful way (since I don’t think any current browsers support Ruby). So far I have the rb and rt floating at the left; what I really need is to keep them inside ruby. But my CSS is a little rusty. You can see how far I’ve gotten, if you’re interested..

I’ve decided to exercise every morning. No it’s not a new year’s resolution, I decided upon it last night. Nothing quite so time-consuming (or good) as swimming which I did almost every day over the Summer holidays and into the first term. It’s just a warm-up I plan to do. It shouldn’t take more than 15 minutes (whereas swimming took almost an hour in total). I’m telling you this so that if I start to think it would be a good idea to give it up, I’ll imagine my reaction to somebody saying oh, are you still exercising every morning? and reconsider.

I’ve also started eating raw food as a rule (as opposed to before when I ate it by coincidence).

Little Man Computer interpreter in Ruby

Wednesday, October 19th, 2005

Today I wrote a Little Man Computer interpreter. I’m quite pleased with it.

For those who don’t know (almost everybody?), Little Man Code is a simple assembly-like language for teaching students. For example:

00 901
01 310
02 901
03 110
04 902
05 000

Which can be written in shorthand as (assume -- is comment syntax—which it isn’t):

00 INPUT  -- Get input and put it in the accumulator
01 STO 10 -- Store it in address 10
02 INPUT  -- Get input and put it in the accumulator
03 ADD 10 -- Add the contents of 10 to what's in the accumulator
04 OUTPUT -- Output what's in the accumulator
05 STOP   -- Stops execution

Very simple. We’re using it in Computer Architecture and Systems Software 2 (the return of the compiler?). I wrote 20 lines of it for coursework. And I’ll write some more of it.

Anyway, here’s my interpreter complete with examples and such: lmci_0.1.zip.

Even though it won’t be very useful to very many people, at least I had fun with it. And I learnt from it.