Archive for July, 2008
Tracking TTime
I’ve added issue tracking for ttime using the fantastic ditz. I’ve also added ttime’s rdoc documentation. (Note: Version 0.8.5 is out)
Three things I didn’t know Ruby does
Edit: I was misled!
Illustrated here. Hints below.
>> def inspect_x_and_y(x,y); puts "x: %p, y: %p" % [x,y]; end
=> nil
>> inspect_x_and_y(y={"hello" => "world"},x=[1,2,3])
x: {"hello"=>"world"}, y: [1, 2, 3]
Security project
This site gets indexed by the almighty google. This link is part of a security project I’m doing for my CS degree.
Gettext oddities with Ruby
I was having a lot of trouble with gettext in Ruby, mostly due to lacking documentation. Here are some useful things I figured out while writing TTime. I ended up having a single gettext_settings.rb, included from every file which uses
gettext. Here it is (with some extra notes)
#!/usr/bin/ruby
begin
require 'gettext'
require 'pathname'
include GetText
# This fixes a swarm of problems on Windows
GetText.locale.charset = "UTF-8"
# Ruby's gettext acts in a sane
# method - add a path to the set of paths
# scanned.
locale_in_data_path = Pathname.new($0).dirname + \
"../data/locale/%{locale}/LC_MESSAGES/%{name}.mo"
add_default_locale_path(locale_in_data_path.to_s)
bound_text_domain = bindtextdomain("ttime")
# For Glade, however, it only seems to
# be possible to specify one path at a
# time. Fortunately, gettext already
# found it for us.
my_current_mo = bound_text_domain.entries[0].current_mo
if my_current_mo
ENV["GETTEXT_PATH"] = my_current_mo.filename.gsub(
/locale\/[^\/]+\/LC_MESSAGES.*/,
"locale/")
end
rescue LoadError
def _ s #:nodoc:
# No gettext? No problem.
s
end
end
One note for context: I use setup.rb (and ruby-pkg-tools) to package TTime. So my localizations go in data/locale.
That “Life” category there
I has it. Sorta.
A few weeks ago, the lovely NaNuchKa visited Israel for two and a half shows (the half-show was warming for Berry Sacharof). “Three shows in two weeks?”, people ask – well, yeah. They only come once a year. Their set is already too long to play all the songs I like, and that’s actually quite excellent – new EP and all. Great stuff
Deep Purple should be coming to Israel this summer (holy crap!), and I need to see what I can do about getting tickets for that.
This is my last semester at the Technion – then it’s off to the military for me. Courses for this semester are Electronic Switching Circuits (bleh…), Signals and Systems (which is actually turning out to be quite awesome!), and the neat Compilation Theory. After having thoroughly enjoyed Eli Biham’s excellent Modern Cryptology last semester, I’m visiting (but not taking) his advanced topics course this semester. I also have two projects: One in computer security, where we mess with Google, and another in EE, where we try using transactional memory in order to optimize Apache.
And finally – next week on Thursday, Shlomi Shaban is doing a piano show in Haifa, just like the good old days. He was supposed to join NaNuchKa for one of their shows, but had to cancel, so my lovely lady (who introduced me to his work in the first place) and I haven’t been to his shows in quite a while. It seems that will be able to use the new 200 line – part of a long overdue project to have cheap public transportation available all night long.
