Category: Computing

June 29th, 2010

Time to Learn Some More Tools

For a while now I have been put off programming by my daytime experiences, but a recent Ruby5 podcast has whetted my appetite for fun again.

The great thing I found was that the initial install didn’t quite go smoothly…

[Tue, 29 Jun 2010 07:42:01 -0400] INFO: Starting Chef Solo Run
[Tue, 29 Jun 2010 07:42:11 -0400] INFO: Replacing the run_list with ["homebrew", "homebrew::dbs", "homebrew::misc", "ruby", "ruby::irbrc", "ruby::rails", "ruby::sinatra", "node"] from JSON
[Tue, 29 Jun 2010 07:42:12 -0400] INFO: Setting group to 20 for template[/Users/mike/.cider.profile]
[Tue, 29 Jun 2010 07:42:12 -0400] ERROR: template[/Users/mike/.cider.profile] (/Users/mike/.rvm/gems/ruby-1.8.7-p299/gems/chef-0.8.16/lib/chef/mixin/recipe_definition_dsl_core.rb line 59) had an error:
Operation not permitted - /Users/mike/.cider.profile
/Users/mike/.rvm/gems/ruby-1.8.7-p299/gems/chef-0.8.16/bin/../lib/chef/provider/file.rb:118:in `chown'

… so now I have a chance to use rdebug on a real issue, and maybe get to learn something about OS X and the Ruby setup. I’m looking forward to learning more about Cider, and maybe having some fun again.

After a little fooling around with rdebug I decided that the most expedient thing to do was add myself to group 20 and see if Cider would install OK. A quick Yahoo search for adding a user to a group in OS X Snow Leopard led me to this post, and with a quick

dseditgroup -o edit -u mike -p -a mike -t user staff

The install seems to be progressing…

1 July 2010:

My goal was to leave the Snow Leopard install of Ruby alone, and see if I could get the entire thing set up without using sudo. Unfortunately that meant I had to install rvm (from tarball as OS X doesn’t have a git by default) and an rvm ruby to get going. When it tried to install the ~/Developer/… rvm it fell over.

So… use sudo to get cider installed as part of the OS X install and see what it does!

2 July 2010:

It looks like it’s more than just my Ruby which will get dusted off soon, Cider uses RVM which allows multiple rubies and gemsets, and Homebrew to manage installed software on OS X. I ought to know at least what all the programs and gems installed by Cider are, and maybe learn a few of them:

ratdog:~ mike$ brew list
ack		libevent	node		redis		wget
ctags		markdown	npm		rlwrap
fortune		memcached	postgresql	rpg
git		mongodb		proctools	sqlite
kiwi		mysql		readline	tig
ratdog:~ mike$ rvm list

rvm rubies

=> ruby-1.8.7-p248 [ x86_64 ]
ratdog:~ mike$ gem list

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.0.0.beta3, 2.3.8)
actionpack (3.0.0.beta3, 2.3.8)
activemodel (3.0.0.beta3)
activerecord (3.0.0.beta3, 2.3.8)
activeresource (3.0.0.beta3, 2.3.8)
activesupport (3.0.0.beta3, 2.3.8)
arel (0.3.3)
awesome_print (0.2.1)
builder (2.1.2)
bundler (0.9.26)
configuration (1.1.0)
engineyard (0.3.2)
erubis (2.6.6)
escape (0.0.4)
heroku (1.9.9)
highline (1.5.2)
hirb (0.3.2)
i18n (0.3.7)
json (1.4.3)
json_pure (1.4.3)
launchy (0.3.5)
looksee (0.2.1)
mail (2.2.5)
map_by_method (0.8.3)
memcache-client (1.8.3)
mime-types (1.16)
net-http-spy (0.2.1)
polyglot (0.3.1)
rack (1.1.0)
rack-mount (0.6.6)
rack-test (0.5.4)
rails (3.0.0.beta3, 2.3.8)
railties (3.0.0.beta3)
rake (0.8.7)
rdoc (2.5.8)
rest-client (1.5.1, 1.4.2)
sinatra (1.0)
sketches (0.1.1)
termios (0.9.4)
text-format (1.0.0)
text-hyphen (1.0.0)
thor (0.13.7)
treetop (1.4.8)
tzinfo (0.3.22)
what_methods (1.0.1)
wirble (0.1.3)
April 15th, 2010

Perl Language Now Even Better!

Recently Perl 5.12.0 was announced. There are some great changes in this release, some incremental and some new goodness has been introduced. Looking at the commentary this announcement spawned I suspect there is a disconnect between the Perl developers, the Perl community, and the people who might be interested in Perl.

If you read on-line articles and blogs you could be forgiven for having discounted Perl when considering a language for a new project. The most telling review of the news of perl 5.12.0′s release announcement I have seen was in Ars Technica, and I’ll not link to it because I don’t want to drive any traffic their way. As a poorly researched article which managed to play to the false notion that Perl has in some way stagnated it succeeds, and the article is only redeemed by some of the comments.

A more general thing which I have noticed is that Perl seems to be frequently absent from the list of dynamic languages mentioned in on-line articles, as if it has vanished. In my personal experience Perl is still actively used in loads of places, the Perl community is still active socially, and CPAN is still growing, and the language is still developing – both perl 5.x and perl 6.

There may well be some rough old Perl code out there, the language is twenty years old and has attracted developers of all abilities. I wonder how many of the people who disparage Perl have looked at the tools and techniques which can let a serious developer craft readable, robust, scalable code with ease.

In my opinion modern Perl is a great language to develop in. The more languages you know the more informed your choice will be, but at least let your choice be based on having used the language – don’t take my word for it, don’t take my love of Ruby to mean you should love it too, don’t take some Google fan-boy’s word that some language is good because Google uses it, try some languages out!

November 15th, 2009

Testing Times

Sometimes I need to shake things up to get a better perspective on things. The experiment with having a day a week where I don’t expect to get anything done is working well, and by the end of the day “off” I have lots of ideas bubbling around in my head.

One of the things I have been worrying about at work is getting some old code tested properly, or at least having a plan for getting it all tested one day. Although I hate to admit it, I haven’t really written much test code in years, so I don’t have the mental “muscle memory” to help me figure out. There are books to help with dealing with Perl code (Perl Medic, and Perl Testing to mention but two), but for the time being I decided to abandon Perl and vim to have a go at learning emacs (again) and to see if I could use rspec to test a simple module, and then look at how to do testing using Perl’s tools. So far so good, there’s a lot of new stuff to learn, and it’s fun to have my mind in learning mode again. It’s good to get away from my old environment for a while – if or when I get back maybe I’ll have remembered how to forget a few of my inappropriate and outdated old Perl habits. By taking on new things I sometimes get a different perspective on the problem I’m trying to solve, and a clearer distinction between the techniques I’m learning and the tools I’m using.

Some new things I enocuntered were the emacs starter kit and gemcutter which have made it easier for me to get into using emacs and rspec to see whether I enjoy them.

Speaking of tests, we have found out why our cat was drinking so much water of late. She is diabetic. The thing I have to learn to do now is to give her her shots so my wife isn’t stuck doing it for ever.

June 7th, 2009

Back to the Future

Back in 1999 Perl was described as a postmodern language. As the husband of a philosophy professor, and as someone with an instinctive distrust of sophistry, my layman’s understanding of “postmodern” was essentially that it was a term used as shorthand for “vapid, overblown, vacuous intellectual performance masturbation”, especially by the French. Of course there are significant differences between Perl code and, say, Derrida’s writing – they can both be intolerably hard to read and make some sense of, but the Perl can at least be shown to do something useful in most cases.

Imagine my delight in discovering Modern::Perl. I have dealt with chromatic a couple of times, and I rate him as a “good guy” who has a balanced perspective on Perl, Perl boosterism, and things that seem odd coming to Perl from other languages. That gives me a sense of hope and enthusiasm about looking at the module, a sense I’d love to feel again when using Perl.

Now to play with Modern::Perl, or maybe relax and enjoy myself as iTunes has popped up Earthworks Underground Orchestra‘s rendition of Libreville to inject some joy into my day.

March 4th, 2009

Finding the Fun Again

Another few evenings playing with Rails (and paralleling the depot application from Agile Web Development with Rails (v3)) and I’m rediscovering the fun to be had with programming!

I have picked a project which is similar to something I’m doing at work to see what new perspectives using a different language and toolkit give me.

The biggest thing I noticed was that PostgreSQL and pgadmin3 is a delight to use.

February 7th, 2009

Getting Started with Rails

I have been following Ruby on Rails development for years, and I’ve never quite finished starting playing with it.

I have finally bitten the bullet and I have decided that I don’t want to do anything other than the rails development, so no compiling Ruby or database – just get to work.

So I have set up an Ubuntu machine under Sun’s VirtualBox on my Mac, and installed postgres and rails.

…now let’s see what happens!