November 2009

bool regex_match( const char *pattern, const std::string str, std::vector *substrings ) { const char *err; int erroffset = 0; pcre *re = pcre_compile( pattern, 0, &err, &erroffset, NULL ); int ovector[90]; size_t rc; if ( !re ) { bug( “%s: regular expression compilation failed at: %d: %s”, __FUNCTION__, erroffset, err…

Read More

Ever get this error when installing a gem? /usr/bin/ruby1.9 extconf.rb install mysql extconf.rb:10:in `require’: no such file to load — mkmf (LoadError) from extconf.rb:10:in `’ It happens when you don’t have the development library installed. Easy enough to fix, just install ruby1.9-dev. For ubuntu: sudo apt-get install libruby1.9

Read More

Someone over at MUDBytes asked about sending emails from within their game. They were looking to do this from C++, which as we all know is a pain in the ass. I wrote up this quick utility script in ruby for sending emails easily, without the risk of passing stuff…

Read More