Most Useful Windows Program Ever

Posted by Chris Mon, 12 Dec 2005 12:45:28 GMT

http://www.proffs.nu/brutus.htm

Posted in  | Tags ,  | no comments

Why Software Is Not There Yet

Posted by Chris Sat, 10 Dec 2005 09:06:24 GMT

So when I tried to post the previous entry, I got a 500 error. I don't really know ruby, but there was at least a nice backtrace in the typo log. The operative bit:

RuntimeError (wrong dateTime.iso8601 format):
    /lib/xmlrpc_fix.rb:9:in `dateTime'
    /usr/local/lib/ruby/1.8/xmlrpc/parser.rb:538:in `tag_end'

It was also nice enough to log the incoming XML-RPC data. The operative bit of that:

{"name"=>"dateCreated",
 "value"=>{"dateTime.iso8601"=>"20051210T08:28:40+0000"}}

Now, thanks to open source and all that jazz, I could pretty easily find this code, repeated here since it's short:

def self.dateTime(str)
  if str =~ /^(-?\d\d\d\d)(\d\d)(\d\d)T(\d\d):(\d\d):(\d\d)Z?$/ then
    a = [$1, $2, $3, $4, $5, $6].collect{|i| i.to_i}
    XMLRPC::DateTime.new(*a)
  else
    raise "wrong dateTime.iso8601 format"
  end
end

For what it's worth, this is overriding a method from ruby's own xmlrpc library, the version of which on my system being very similar but not accepting the final "Z" (for Zulu AKA GMT AKA UTC). That's not good enough, since MarsEdit has chosen to send the time zone, even though it's Zulu, as +0000.

But also on the web, I found this, and if you click on the "Source" bit of the dateTime method, you see a much longer and fancier function that attempts to actually handle ISO8601, including the format MarsEdit sends. There we see:

when /^(-?\d\d\d\d)-?(\d\d)-?(\d\d)T(\d\d):(\d\d):(\d\d)(?:Z|([+-])(\d\d):?(\d\d))?$/
  a = [$1, $2, $3, $4, $5, $6].collect{|i| i.to_i}
  if $7
    ofs = $8.to_i*3600 + $9.to_i*60
    ofs = -ofs if $7=='+'
    utc = Time.utc(a.reverse) + ofs
    a = [ utc.year, utc.month, utc.day, utc.hour, utc.min, utc.sec ]
  end
  XMLRPC::DateTime.new(*a)

Thinking that was what I needed, I updated the overridden method in Typo to use it. But alas:

TypeError (cannot convert Array into Integer):
    /lib/xmlrpc_fix.rb:11:in `utc'
    /lib/xmlrpc_fix.rb:11:in `dateTime'

What's the deal? A little research, and it turns out that in ruby you write *a to get the list of elements in a, rather than the Array itself. Don't ask me why it's written without the * in what appears to be official ruby library code -- my guess is that it's for a newer version of ruby where you can pass an Array to Time.utc. In any case, I tried:

utc = Time.utc(*a.reverse) + ofs

Behold, a new error!

ArgumentError (argument out of range):
    /lib/xmlrpc_fix.rb:11:in `utc'
    /lib/xmlrpc_fix.rb:11:in `dateTime'

Looking more closely, that a.reverse falls under suspicion. Time.utc seems to want (year, month, day, hour, min, sec), and that is in fact how it's coming out of the regex. So why reverse it? I haven't the foggiest clue! I took out the reverse:

utc = Time.utc(*a) + ofs

and voila! The post went through. I'm still totally stumped on how that could possibly ever work as written. Maybe some reader will help me out here. Of course, I only have the one reader (hi, Josh!), so maybe not.

Posted in ,  | Tags , ,  | no comments

Why MythTV Is Not There Yet

Posted by Chris Sat, 10 Dec 2005 08:28:40 GMT

http://jonobacon.org/viewcomments.php?id=597

Sweet Jesus, who wants to go through that much crap to watch TV? I've lost all interest in being a sysadmin for my computer; I'm not about to turn maintaining a TiVo into a full-time job.

This guy obviously has the motivation and perseverance to deal with every step being "well, this doesn't work yet" or "I tried a few dozen times until I discovered that you simply have to modify the kernel with a hex editor". Me, I'll be over there paying for a box that Just Works. And making the ten-years-younger me cry.

P.S. Posted with the MarsEdit 1.1 beta. Yay MarsEdit.

Posted in  | Tags , , ,  | no comments

Today In Religious Hypocrisy News

Posted by Chris Thu, 08 Dec 2005 15:26:00 GMT

Israelis to be allowed euthanasia by machine

Machines will perform euthanasia on terminally ill patients in Israel under legislation devised not to offend Jewish law, which forbids people taking human life.

[Update! Someone left a comment on jwz's blog pointing to this Feynman story.]

Posted in  | Tags , ,  | no comments

Mentally Ill Man Murdered By Homeland Security Agents

Posted by Chris Thu, 08 Dec 2005 04:14:00 GMT

http://www.cnn.com/2005/US/12/07/airplane.gunshot/index.html

Welcome to the USA. Go off your meds and we'll shoot.

Posted in  | no comments

Ze School Luncheez

Posted by Chris Thu, 08 Dec 2005 03:24:00 GMT

http://www.idlewords.com/2003/03/french_week_on_school_lunches.htm

Gets a little nutty near the end, but in general, yes, my country has ruined food forever.

Posted in  | no comments

MICROSOFT PREMIUM XBOX 360 PIC!

Posted by Chris Wed, 07 Dec 2005 17:32:00 GMT

http://www.newsfactor.com/story.xhtml?story_id=39880

Silentbarrel said in an e-mail that he had been "laughin histriocally" over the situation.

Posted in  | Tags , ,  | no comments

It wasn't me.

Posted by Chris Wed, 07 Dec 2005 16:02:00 GMT

https://www.alibinetwork.com/index.jsp

Posted in  | Tags  | 1 comment

The bizarre world of Patrick Byrne's Overstock

Posted by Chris Wed, 07 Dec 2005 04:34:00 GMT

http://www.theregister.co.uk/2005/12/03/overstock_issues/

I want to be an eccentric CEO when I grow up.

Posted in  | no comments

No Science In My Back Yard!

Posted by Chris Tue, 06 Dec 2005 18:51:00 GMT

The Cyclotron Comes to the 'Hood

Local lawmakers rushed to introduce emergency legislation banning the use of cyclotrons in home businesses. State health officials took similar steps, and have suspended Swank's permit to operate cyclotrons on his property.

I am so sick to death of these damned retards who can't be bothered to listen to logic and reason and just freak out 'cause that sucker's NUKULAR OMGOMG!!!!1

IT IS NOT A GODDAMN NUCLEAR REACTOR, SHUT THE HELL UP AND GO BACK TO WATCHING DESPERATE HOUSEWIVES AND LICKING THE RIBLETS GREASE OFF OF YOUR FILTHY SAUSAGE FINGERS.

Posted in , ,  | Tags , ,  | 3 comments

Older posts: 1 2