|
|
About
'Blogs
Read
Syndicate
Resumes
Academia
Powered by
|
February 27, 2010Pascal's ParadoxA few days ago, a funny Seventh Day Adventist showed up on my door. He was a friendly enough fellow, and asked about my faith. "Atheist," I said, "and anyone that tries to tell me otherwise is probably trying to sell something." Yeah, I like the Princess Bride. He scribbled this down in his notebook. Great, I'm probably on some kind of "prayer list" or something. "Really?", he asked. "How can all of this subjective experience be just nothing?" "Simple," I said, "I live my life, and then I die, and then there is nothing left to experience." "What do you think Jesus was: son of god, historical figure, or work of fiction?" "Probably a historical figure, but fiction seems more plausible at times." "Well what about the objective reality?" Obviously my time in government service left me entirely too...sober. I was growing impatient. "Look," I said, "I go through life and question every piece of information that gets thrown in front me. I don't win a lot of friends, but I do make a difference." "You're familiar with Pascal's Wager?" he asked Yeah, Pascal's Wager. I could use the official church jargon to explain why it is a retarded bet, akin to playing Russian Roulette (it's also a lot less exciting than Russian Roulette, I imagine). Instead, I argued with reason. "Religious people waste their entire lives praying and bowing and hoping things will happen. I make things happen, because I know that only people can make things happen. That is the fallacy of Pascal. Hope." So today, I put my money where my mouth is. One of Laura's co-workers, Pablo, is from Chilé. His brother lives in a small town outside of Concepcion, as close to the epicenter of today's quake as possible. Pablo can't reach anyone in his family (most of his family lives near Santiago). I decided to donate my last paycheck to the Red Cross. Yeah, I probably can't afford it right now. I'm no saint, either. But money, more than prayers (or even yoga mats), is what folks in Haiti and Chile need right now.
Posted by reid at 03:18 PM
| Comments (0)
Green Hills C Compiler bugI had a rather proud moment a few days ago. I had been looking at a curious piece of compiled code that had an integer promotion bug. Yeah, I have some pretty weird hobbies these days. This particular bug was for the Motorola Coldfire processor. The C code, it turns out, looked like this: unsigned char table[256] = {0xsomevals} // global array, located on process heapThe compiler compiled the code (the function part of the above) into something like this: link a6, #0 For the coldfire assembler unaware, the mvs operation is "move with sign extension". The effect is that the function can return memory logically *before* the array. If the unsigned char passed in is 0x80 or greater, the most significant bit of the byte is a '1'. The sign-extended move operation makes the index value negative. What is interesting here is that the compiler ignored the explicit unsigned integer cast when it dereferenced the element in the array. It turns out that this was a bug in an older version of the Green Hills compiler. Newer versions don't exhibit this erroneous behavior. I have no information on what versions of the Green Hills compiler are affected by the bug, but if you are a vendor programming Coldfire V4 cpus (mvs was introduced in the Coldfire V4 instruction set), you may want to compile my above code snippet and make sure that your compiler is not affected. I have to say that I was kind of impressed with myself for finding the bug. The people that produced the compiled code were kind of dumbfounded as to how I stumbled upon it. Since I have started exploring embedded systems security, I've decided that the C language is probably one of the most wretched things in the universe, and that embedded system vendors ought to use as much as peer-reviewed code (read: open source) as possible in their systems. Here I mean both compilers and process code. C compilers for these systems generally don't receive as much scrutiny as desktop application compilers, probably because the target processors are not x86.
Posted by reid at 02:35 PM
| Comments (0)
February 13, 2010Hacking Traffic SignalsI noticed something funny on my walk tonight. The traffic signals in Pullman are timed funny for pedestrians. I've always lamented how horrible "downtown" Pullman is for pedestrian traffic. Smash a crosswalk button and you often have to wait for 5 minutes for the lights to change. Most of our intersections have traffic flow sensors on the signals (cheesy little things, I honestly have no idea how they work). I sat at one intersection and tried a few experiments to see how the traffic flow affected crosswalk time. Experiment 1: Hit the button while traffic is flowing steadily through the intersection. Time to light change (and my 'walk' sign lighting up): 3:30. Experiment 2: Hit the button while one car is going through the intersection. Little to no traffic following this car (two more cars went through the entire time I waited for this change): 3:30. Experiment 3: Hit the button while no traffic was flowing through the intersection. There was a ten second gap in traffic. The light changed in 0:15. Conclusion: The traffic algorithm at this particular intersection is retarded. It must measure traffic flow at the moment the 'walk' button is hit, and decide how long to wait based on that single measurement. As a pedestrian, you should wait until there is a small break in traffic to hit the walk button. You'll probably save time by not hitting the crosswalk button right away...
Posted by reid at 09:04 PM
| Comments (2)
|
Paris
USA
Berlin
Prague
Dresden
Archives
August 2011
July 2011 June 2011 May 2011 April 2011 March 2011 February 2011 October 2010 September 2010 April 2010 March 2010 February 2010 December 2009 November 2009 October 2009 September 2009 August 2009 April 2009 March 2009 February 2009 January 2009 November 2008 October 2008 August 2008 July 2008 June 2008 May 2008 April 2008 March 2008 February 2008 December 2007 October 2007 September 2007 August 2007 July 2007 June 2007 May 2007 April 2007 March 2007 February 2007 January 2007 December 2006 November 2006 October 2006 September 2006 August 2006 July 2006 June 2006 May 2006 April 2006 March 2006 February 2006 January 2006 December 2005 November 2005 October 2005 September 2005 August 2005 July 2005 June 2005 May 2005 April 2005 March 2005 February 2005 January 2005 December 2004 November 2004 October 2004 September 2004 August 2004 July 2004 June 2004 May 2004 April 2004 March 2004 February 2004 January 2004 December 2003 November 2003 October 2003 September 2003 August 2003 July 2003 June 2003 May 2003 April 2003 March 2003 February 2003 January 2003 December 2002 November 2002 October 2002 September 2002 August 2002 July 2002 June 2002 May 2002
Search
About
|