<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.1" -->
<rss version="0.92">
<channel>
	<title>chazmeyers.com/blog</title>
	<link>http://www.chazmeyers.com/blog</link>
	<description>BLOGTASTIC!</description>
	<lastBuildDate>Wed, 11 Jul 2007 20:07:24 +0000</lastBuildDate>
	<docs>http://backend.userland.com/rss092</docs>
	<language>en</language>
	
	<item>
		<title>Double escaping backslashes in ruby.</title>
		<description>If you have a string that looks like:
\

and you want it to look like:
\\

in ruby, you have to do the following:


irb(main):070:0> str = "\\"
=> "\\"
irb(main):071:0> puts str
\
=> nil
irb(main):073:0> puts str.gsub("\\", "\\\\\\\\")
\\
=> nil


In Ruby, you can use perl-style regular expression numbered group references in replacement strings (ie \\1 = the first ...</description>
		<link>http://www.chazmeyers.com/blog/2007/07/double-escaping-backslashes-in-ruby/</link>
			</item>
	<item>
		<title>Slightly better YAMLization of Ruby Exceptions.</title>
		<description>Consider the following irb session:


irb(main):001:0> e = Exception.new("Jerk!")
=> #
irb(main):002:0> e.message
=> "Jerk!"
irb(main):003:0> require 'yaml'
=> true
irb(main):004:0> YAML.load(e.to_yaml).message
=> "Exception"


That sucks. Where did the "Jerk!" go? YAML ate it. If you include this code, you can keep your "Jerk!":


cpm@juno:~/helpticket-dev/trunk$ cat lib/better_exception_yaml.rb
require 'yaml'

class Exception
  def Exception.yaml_new( klass, tag, val )
    o ...</description>
		<link>http://www.chazmeyers.com/blog/2007/07/slightly-better-yamlization-of-ruby-exceptions/</link>
			</item>
	<item>
		<title>Installing eventmachine on older FreeBSD&#8217;s.</title>
		<description>I'm replacing some backgroundrb workers that do long, slow TCP connections with async eventmachine code in one of my Rails webapps. I ran into some problems installing eventmachine 0.7.2 on FreeBSD 4.8-STABLE with no root access, so I'm documenting how I got around these problems. I'm certain this isn't the ...</description>
		<link>http://www.chazmeyers.com/blog/2007/07/installing-eventmachine-on-older-freebsds/</link>
			</item>
	<item>
		<title>My mind is gone.</title>
		<description>Today I decided to finally start teaching myself Python. Out of curiosity, I tried the following:


&#62;&#62;&#62; class NoneType:
...     def __str__(self):
...         return ""
...
&#62;&#62;&#62; None
&#62;&#62;&#62; str(None)
'None'


Is it sick that I find these results disappointing? Has Ruby corrupted my mind? 

A ...</description>
		<link>http://www.chazmeyers.com/blog/2007/04/my-mind-is-gone/</link>
			</item>
	<item>
		<title>Double-you-tee-eff, Gmail?</title>
		<description>I just noticed that if you rename or remove a label, filters don't get updated appropriately. 

For example, let's say that I don't like having MySpace or FaceBook notifications in my inbox, so I create a MySpace label and and 
FaceBook label and set up filters that archives mail and ...</description>
		<link>http://www.chazmeyers.com/blog/2007/03/double-you-tee-eff-gmail/</link>
			</item>
	<item>
		<title>Broken static methods in PHP make me sad.</title>
		<description>A few weeks ago, I tried implementing ActiveRecord in PHP. What a fool I was. Consider the following:





Sadly, User::findAll() returns "SELECT * FROM NOTABLE".  

I guess in order to implement ActiveRecord in PHP, you need to use some sort of combination of Singleton and Factory patterns? Gross. 

Add this ...</description>
		<link>http://www.chazmeyers.com/blog/2007/03/broken-static-methods-in-php-make-me-sad/</link>
			</item>
	<item>
		<title>6 &lt; 4.8?</title>
		<description>Like any good developer, I write code on a development server and then push the code to the production server. (Yay, SVN.) While testing out something, I noticed an odd inconsistency between the two.

Consider the following:
sock = TCPSocket.new( ip, port )

Fairly simple. When I run it on my test server, ...</description>
		<link>http://www.chazmeyers.com/blog/2007/02/6-48/</link>
			</item>
	<item>
		<title>Leaky Abstractions.</title>
		<description>You ever have a programming "Doh!" moment? I had one the other day. You could say I fell face first into a leaky abstraction. 

For those of you who are unfamiliar with the phrase "leaky abstraction", Joel Spolsky coined it in his classic essay titled "The Law Of Leaky Abstractions". ...</description>
		<link>http://www.chazmeyers.com/blog/2007/02/leaky-abstractions/</link>
			</item>
</channel>
</rss>
