SQLDSL, by Jay Fields, is, simply, "a library for creating SQL statements using Ruby code." Jay posted separately about the pros and cons of SQLDSL on his weblog, although he might be accused of bias with only one con to six pros (compelling as they may be).
Coda Hale has announced the release of his new 'bcrypt-ruby' gem. bcrypt-ruby brings simple OpenSSL powered password hashing to Ruby along with some useful features like hash versioning, automatic salt handling, and the ability to produce hashes that are computationally difficult to compute to reduce the risks of attacks.
Skype and Google Talk are pretty clever in the way that they still work even if all of its users are behind firewalls (or NAT systems) that block incoming connections. The way they enable two-way connections is by using a 'firewall busting' technique. Simply, a central server does nothing but share IP addresses (and port numbers) and clients can then 'punch' holes through their firewalls and trick their firewalls and routers to route incoming packets back to them if they have certain source host and port numbers.
A lot of people seem to want to reinvent the wheel where Ruby is concerned, and I wish them all luck, but Tomasz Węgrzanowski has taken the unique step of trying to make the existing C-based Ruby interpreter faster instead, with intriguing results.. He even goes as far as to hack Ruby's source code to remove inefficiencies in how Fixnum objects are compared. I totally dig this and would love to support further efforts to implement non-damaging optimizations to the existing interpreter.
In case the title of this post is giving you deja-vu, we've looked at "How To Create A Ruby Extension In C" before at Ruby Inside. We've also looked at using RubyInline to make the process even faster by not having to write a specialized C extension.
SyntaxHighlighter is a WordPress plugin that provides code presentation and syntax highlighting features for your blog (if it's WordPress powered, naturally!). It supports a plethora of languages such as C, C++, C#, HTML, and PHP, as well as Ruby. On my blogs so far I've tended to use a homebrew approach with the Syntax gem, but this WordPress plugin should make it a whole lot easier in the future. If you're a WordPress powered blogger who likes to post code snippets, check it out.
Vsevolod Balashov has taken a PHP PageRank decoder and rewritten it in Ruby. It works and it's fast. Simply, it retrieves the PageRank value for a supplied URL from Google and decodes it back to the PageRank value between 0 and 10. Each page indexed by Google has one of these numbers, and have historically represented how well linked a Web site is and how well it will rank in Google. The usefulness of PageRank has dropped a lot in the past year or two, but it can still be a useful indicator of how significant a Web site is.
Russ Olsen has been putting together a small series of blog posts about building a DSL in Ruby. The first part dates from October 2006, but the second part has just been released, making it a good double length read. In the mini-series, Russ looks at the motivation for developing a DSL and develops a basic DSL called Potemkin.
Tattle is a project from Chad Fowler, Jim Weirich, and Bruce Williams that allows you to submit information that would be useful to the RubyGem developers and, ultimately, developers of other Ruby gems. You can see charts showing the data submitted so far here.
If you haven't got tab-completion and syntax coloring in your irb, you owe it to yourself to follow these instructions right away (should work for Linux, OS X, and Cygwin users). First, install the Wirble gem:
Walter Korman has released the first version of a Yahoo! Video library for Ruby. All it takes is a gem install yahoo-video and some simple code like this:
A couple of days ago, Tim Lucas wrote a cool article called "instance_eval brings sexy back" where he demonstrated how to use instance_eval to improve the usability of the match method. The downside, however, was that Tim's technique required manually defining accessor methods each time match was used.
There's more about Amazon S3 and Marcel Molina's hot new library coming as the first day of the Ruby Advent Calendar (this Friday!), so I don't want to say too much about it yet. For anyone already enjoying this library, however, I put together a scrappy program that lets me copy files up to S3 from the command line easily:
Sometimes strange things happen. I've been developing a small, basic recursive descent parser for Ruby called RDParse. Just before writing this post I decided to Google that name, and lo and behold the first result is a Ruby recursive descent parser called RDParse, created by Dennis Ranke, that I posted to Code Snippets for posterity several months ago. Since both of these libraries are unlikely to be used at once and that Dennis doesn't seem to be maintaining his version, I've decided to stick with RDParse as the name of mine for now.
(Disclaimer: I'm no Java wiz, so if I get anything wrong about Java or its libraries, post comments!)
The SWT (Standard Widget Toolkit) is a GUI widget toolkit for the Java platform. Unlike AWT and Swing, it uses the local operating system's own controls. This means you can develop Java apps that 'look native' on multiple platforms. The popular Eclipse IDE uses SWT to work and looks graphically native on multiple platforms (as does Azureus). SWT is also, reputedly, faster than the other alternatives. Sounds great for developers, right? Java developers.. sure.
I'm creating a library that sorely needs a 'debug mode' where each step of what the library does is printed to the screen for developers to check out. I wanted the debug mode to be easy to set and for the debug messages to be as non-intrusive as possible. Initially I arranged it in such a fashion: