Plasticx Blog

Capable of being shaped or formed

RV2 Camping on Gentoo

Posted by Mike 07/05/2007 at 03:57PM

Evan Weaver wrote a SysV init.d setup for daemonizing Camping apps on a *Nix system and documents it in rv, a tool for luxurious camping

I used that blog entry as a reference to build one called RV2 that is a little bit more Gentoo specific. Here are my scripts and directory layout

Posted in , , , |

small urls with Camping

Posted by Mike 07/04/2007 at 09:42PM

I am happy to announce yet another very small URL generator called

hurl it => http://hurl.it/

In fact its first entry is this very blog post.

There are obvious predecessors and the recent (and very cool) Rails based urlTea which itself I think is inspired by rubyurl

But hurl it is not those things, hurl it is a Camping application. Camping is a Microframework written by why the lucky stiff, a MVC based framework that is a total size of 4K and written in Ruby. Camping applications are small, light weight, and are intended to do one thing really well. hurl it does one thing very well – RESTfully create and serve very small URLs.

hurl it has these attributes

  • is a Camping application
  • RESTful (index, show, and create verbs) and responds to application/xml
  • tunes its use of ActiveRecord for use with the performanced minded MyISAM engine
  • developed with Agile practices including full unit and functional tests using Mosquito
  • is open source under the MIT License
  • has a neat-o base 62 number algorithm using the alphabet of 0-9,A-Z,a-z that would be good to know on an interview

hurl it is meant to be the honey layer in your peanut butter sandwich on wheat bread. hurl it is not the sandwich nor tries to be anything more than really super awesome at representing long URLs as really short URLs.

Things I’ve found helpful during hurl it development

I wrote a SysV init.d setup for Gentoo based on Evan’s work call RV2

Source

http://github.com/monde/hurl hurl hurl

Posted in , , , |

Agile Skateboarding

Posted by Mike 07/01/2007 at 12:30PM

Update 09/2010: This is one of my favorite Rails and MVC pattern books, please consider purchasing your own copy: Agile Web Development with Rails, Third Edition



I've been helping out a little on Eachday.com and when I was debugging with some real pictures I placed in my account I noticed the agile resemblance. Eachday is an awesome social media site like Flickr but you collect, sort, and display your media along your real life time line. They are using MMS2R technology as well by the way. Maybe I can be on the next cover of Agile Web Development with Rails



Posted in , |

Sasquatch, Inc.

Posted by Mike 06/21/2007 at 01:09AM

I’m now a company!!!

Sasquatch, Inc.

Yet another programmer becomes a consultant.

Linux, Ruby, and a little Java to make some latte money.

Posted in , , , , |

handling a rcov non-dependency in your gem on firebrigade

Posted by Mike 06/11/2007 at 11:25AM

MMS2R was not showing any tests in its firebridge entry because I had a non-dependency for a rcov task that I had included in the MMS2R gem’s Rakefile

This is what Eric says on firebrigade:

Depend on what you need so that your tests will work. For example, if you have an rcov task, but you don’t want to mark it as a dependency, wrap it in a rescue block. Tinderbox is friendly enough to add Rake or RSpec as a dependency if you forgot it, but other than that, you’re on your own.

This is how to rescue the LoadError exception around the require statement for rcov in the Rakefile :

begin
  require 'rcov/rcovtask'
rescue LoadError
end

and this is how I rescue the NameError exception in the rcov task:

begin
  Rcov::RcovTask.new do |t|
    t.test_files = FileList['test/test*.rb']
    t.verbose = true
    t.rcov_opts << "--exclude rcov.rb,hpricot.rb,hpricot/.*\.rb"
  end
rescue NameError
end

update

07/04/2007

Actually MMS2R is not being tested on the firebrigade currently. The problem stems from a bug in Gems 0.9.4 where MMS2R being dependent on Hpricot and Tinderbox getting a Gem::RemoteInstallationCancelled exception (line 106 of lib/tinderbox/gem_runner.rb) that Eric transforms into a Tinderbox::ManualInstallError


/usr/local/lib/ruby/gems/1.8/gems/tinderbox-1.0.0/lib/tinderbox/gem_runner.rb:108:in `install’: Installation of mms2r-1.1.2 requires manual intervention (Tinderbox::ManualInstallError)
from /usr/local/lib/ruby/gems/1.8/gems/tinderbox-1.0.0/lib/tinderbox/gem_runner.rb:265:in `run’
from /usr/local/lib/ruby/gems/1.8/gems/tinderbox-1.0.0/bin/tinderbox_gem_build:9
from /usr/local/bin/tinderbox_gem_build:16:in `load’
from /usr/local/bin/tinderbox_gem_build:16

Eric says its an known bug in Gems 0.9.4 and should bug them about it!

update

08/01/2007

Eric says that “automatic platform selection to RubyGems” will be fixed on his vacation

Posted in , , , |

mms2r version 1.1.0 has been released!

Posted by Mike 06/08/2007 at 08:16PM

mms2r version 1.1.0 has been released!

  • http://mms2r.rubyforge.org/
  1. DESCRIPTION:

MMS2R is a library that decodes the parts of an MMS message to disk while
stripping out advertising injected by the cellphone carriers. MMS messages are
multipart email and the carriers often inject branding into these messages. Use
MMS2R if you want to get at the real user generated content from a MMS without
having to deal with the cruft from the carriers.

If MMS2R is not aware of a particular carrier no extra processing is done
to the MMS other than decoding and consolidating its media.

Contact the author to add additional carriers to be processed by the
library. Suggestions and patches appreciated and welcomed!

Corpus of carriers currently processed by MMS2R:

  • AT&T/Cingular => mmode.com
  • Cingular => mms.mycingular.com
  • Cingular => cingularme.com
  • Dobson/Cellular One => mms.dobson.net
  • Nextel => messaging.nextel.com
  • Sprint => pm.sprint.com
  • Sprint => messaging.sprintpcs.com
  • T-Mobile => tmomail.net
  • Verizon => vzwpix.com
  • Verizon => vtext.com

Changes:

  1. 1.1.0 / 2007-06-08 (Toki Wartooth)
  • get_body to return body text (Luke Francl)
  • get_subject returns "" for default subjects now
  • default subjects listed in yaml by carrier in conf directory
  • added granularity to Cingular, Sprint, and Verizon carrier services (Will Jessup)
  • refactored Sprint instance to process all media (Will Jessup + Mike)
  • optimized text transformations (Will Jessup)
  • properly handle ISO-8859-1 and UTF-8 text (Will Jessup)
  • autotest powers activate! (ZenTest autotest discovery enabled)
  • configuration file ignores, transforms, and subjects all store Regexp’s
  • Put vendor Text::Format & TMail::Mail as an external subversion dependency
    to the 1.2 stable branch of Rails ActionMailer
  • added get_number method to return the phone number associated with this MMS
  • get_media and get_text attachment_fu helper return the largest piece of media
    of that type if the more than one exits in the media (Luke Francl)
  • added block support to process() method (Shane Vitarana)
  • http://mms2r.rubyforge.org/

Posted in , |

FizzBuzz Pro, Hire Me

Posted by Mike 06/01/2007 at 09:56AM

I wrote this code in about one minute in response to Ruby QUIZ #126 :

(1..100).each do |i|
  case
  when i % 3 == 0 && i % 5 == 0
    p "FizzBuzz #{i}"
  when i % 3 == 0
    p "Fizz #{i}"
  when i % 5 == 0
    p "Buzz #{i}"
  else
    p i
  end
end

When I wrote it I couldn’t remember if the dot dot .. operator on a range was inclusive or exclusive, fortunately I guessed right.

So you can hire me

The quiz was inspired by this blog post
Why Can’t Programmers.. Program?

My experience has been if you can write white board code fairly well during an interview then you can code fairly well too.

Update
Morton Goldberg wrote many versions but this one with the value to puts chained together with the ternary operator (I think) is The Hot

# ... or even with the ternary operator.
(1..100).each do |n|
   puts(
      n % 15 == 0 ? 'FizzBuzz' :
      n % 5 == 0  ? 'Buzz' :
      n % 3 == 0  ? 'Fizz' : n
   )
end

Posted in |


Web Statistics