Podcasts - These days there are so many useful sources of information for software developers: websites, user groups, message boards, second life events, conferences, not to mention good old print mediums such as magazines and books. In the last few years another interesting means of content delivery has come into play with the proliferation of portable mp3 players... podcasts. I'd like to share a few that I've found useful not only for keeping me up to date on the latest and greatest software development news but to pass the time during my 60 miles of driving every day. Keep in mind to play these you only need podcatching software, not necessarily an iPod or other portable mp3 player. .Net Rocks! - This is a great podcast hosted by Richard Campbell and Carl Franklin...
ironruby - for the last year i've somehow been avoiding doing any ruby work. been writing plenty of python for prototyping as and duct tape for work as well as hobby, but nothing in the way of ruby. one of the reasons i've had the opportunity to write some python is because of ironpython. no matter how much diversity i would like in my professional development the truth is i work in a microsoft shop. it's just that simple. because ironpython lives in the .net runtime i only have to be slightly creative to get some professional use out of it. with the advent of .net 3.5 microsoft (thanks in part to john lam) has introduced ironruby. much like ironpython the idea is simple. marry the .net runtime with the ruby programming language...
Full-Text Indexing in Ruby Using Ferret - Few things are more useful that a good full-text search. It's clearly the easiest way for users to actively drill down into the content they want. It's also quite easy on the Ruby programmer to implement thanks to Ferret, an Apache Lucene-inspired search engine library. Building an Index The first step to implementing a search is to get an index built. The following code illustrates creating an index with two documents in it. require 'ferret' include Ferret # get or create an index on the filesystem index = Index::Index.new(:path => './test.idx') # store a document index 'A Cool Article', :content => 'Penguins are cool.' } # store another document index 'A Hot Article', :content => 'Volcanoes are hot' } Querying the Index Now that the index is built it's ready to...
Now in IronRuby on Rails - Just a quick note. I've again changed the architecture of this site. It's now in IronRuby on rails, running on Windows Server 2008 with SQL 2008 R2/Solr. Previously I was using django on linux with Oracle Express/Solr which was just one node in a long list of architectures I've used here. Why the change from django? Why the choice of IronRuby-microsoft-ish stack? Well, I'll surely be blogging about that shortly when I update my Tale of a Website post. In the meantime please keep an eye out for anything not working and let me know if you find something broken.
HTML Parsing with Ruby and Nokogiri - Parsing HTML is a frequent and somewhat annoying task programmers are commissioned with occasionally. Activities such as screen-scraping have become rare since the advent of RSS, but still... There's always content out there that you have to get at that leaves you no choice but to parse it out yourself. One of the more elegant bits that I've seen for this purpose is Nokogiri which is a Ruby library that supports querying HTML content by both an XPath and CSS selector syntax. XPath First I'll demonstrate how to parse some content out of a page via the XPath syntax. This code uses the ruby documentation for the Bignum class as a parsing medium and essentially extracts the method names. require 'nokogiri' require 'open-uri' doc = Nokogiri::HTML(open('http://www.ruby-doc.org/core/classes/Bignum.html')) doc.xpath('//span[@class="method-name"]').each do | method_span |...
Tale of a Website, from Rails to ASP.NET to Django - I hesitate to call it complete yet but for the most part www.chrisumbel.com has been ported from ASP.Net to Django. Sure, there really isn't a lot to this site so no port would have been incredibly painful but I'm quite pleased with the effort level (or lack thereof) required to get it done. Aside from just this port it's been a long and interesting ride for just a bunch of blog posts and comments. Ancient History: Rails in my basement In reality the story began with Ruby on Rails several years back. This site still bares the look, feel, basic data structure and even a few blog posts from kilnaar.com which was based on a Rails and MySQL stack and spent most of its time running on various OpenBSD, Solaris and...
Faceted Queries on acts_as_solr Associations - Recently in a rails app that employs Solr (via the acts_as_solr plugin) I've had the need to produce aggregate counts of entities on the far end of a many-to-many relationship. Essentially a tag cloud. My first attempt was to keep it entirely in ActiveRecord which resulted in a proliferation of SQL command executions. Obviously that wasn't performant. Sure it looked elegant, but was slow and unsustainable. While I could have hand-crafted the SQL it was more performant still to retrieve the aggregations from Solr via facets. Hell, I had the data handy! Such a faceted query directly from Solr is qutie simple but it required a little research to get it done with acts_as_solr due to my unfamiliarity with it. In order to make it simple for others attempting to do...
MapReduce with MongoMapper - A number of rails projects I've been working on lately have used MongoDB for a back-end via MongoMapper. In general it seems to do pretty much anything I'd want to do in a typical web app but finding documentation on how to do it can be difficult. One such task I came across recently was performing on-the-fly map-reduce. After implementing it myself I decided to share a simple example. Blog Post Example Consider the typical Article model which is essentially a blog post. A title, some content and a list of tags. What I'll do is produce aggregate counts that could be used to display a tag cloud. class Article include MongoMapper::Document key :title, String key :content, String key :tags, Array end Sample Data I'll throw in three sample articles from...











