I have a neglectful relationship with inject. That is, I neglect to remember that it exists, having worked for so long with other languages which are “unfamiliar with the concept”. Amos King’s blog entry on Inject & Me – BFFs got me to thinking that ucat (see cat on steroids (or cat on a hot …
Category Archive: Computers
Sep 10
cat on steroids (or cat on a hot ruby roof)
I got to thinking about SuperIO and how it could be used as a swiss army chainsaw to open files, whereever they might be on the net. From there, my fevered mind got to thinking about cat and how the two could be used together. That said, I present ucat — a universal cat, if …
Sep 08
Random Quotes
Quotes can provide inspiration or food for thought. In this entry, I’m examining the use of open-uri and feed-normalizer to get a random quote which could be used as either a thought for the day or a “fortune” replacement.
Sep 05
A “grue”some look at Statemachine and Treetop
In this blog entry, dear reader, we examine the statemachine and treetop gems via an old standby, a Zork imitation. And, despite the title, you won’t find a grue.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
$ ruby adventure.rb This is the beginning. Like all tales, there's a beginning, a middle and an end.... Paths lead n. What do you want to do? n This is a path in the forest, it looks fairly well travelled. You see a clearing to the east Paths lead w, n, e, s. What do you want to do? e This is a clearing. You can actually see the sky here. Compared to the deep dark forest, it seems a relief. A path can be seen to the west. Paths lead w, n, e, s. You see the following: letter. What do you want to do? get letter Ok, you pick up the letter. What do you want to do? w This is a path in the forest, it looks fairly well travelled. You see a clearing to the east Paths lead w, n, e, s. What do you want to do? w You're lost in the depths of the forest. You're not sure where you are, nor how to get out of there. Paths lead w, n, e, s. What do you want to do? quit |
Sep 05
Converting a rails app from 1.2.6 to 2.1
This is the first in a series(???) of posts detailing things that I’ve found in the process of updating rails (and other plugins/gems) for an application. Due to politics, it’s using JRuby, running inside a JBoss container, with a Derby backend. Things which are getting updated include: Rails ActiveRecord-JDBC ActiveScaffold ActiveScaffoldExport Goldspike is being replaced …
Sep 02
A language a year
The Pragmatic Programmers have proposed that developers learn a language a year. I agree that it’s very important to keep abreast of changes in IT and that by learning new languages we can keep our minds sharp and bring new ways of doing things into old languages. However, I have to wonder if this learning …
Aug 29
CSS tooltips using CSS Sprites
For a project I’m currently working on I wanted to make some “bubble” tooltips. In order to cut down on the size/number of images, I’m using css sprites. A quick google reveals that nobody else has (at least on the first page) put together tooltips using sprites. The technique will work with any sort of …
Aug 28
CSS “width” gotcha
I found out something interesting today. Per the W3C, the total “width” that a block element uses is: If ‘left’ or ‘right’ are given as ‘auto’, their computed value is 0. The following constraints must hold between the other properties: ‘margin-left’ + ‘border-left-width’ + ‘padding-left’ + ‘width’ + ‘padding-right’ + ‘border-right-width’ + ‘margin-right’ = width …
Aug 27
Programming philosophy in the oddest of places
Today’s thought for the day from A Word A Day is: Not being able to govern events, I govern myself. -Michel de Montaigne, essayist (1533-1592) This struck me as being very much the idea behind defensive programming. Because we don’t know what sort of events life will throw at a programme, we need for it …
Aug 26
Mini Sagas
One of the manifestos from ChangeThis this month is about Mini Sagas. The author, Rajesh Setty presents the idea that writing mini sagas, which contain exactly 50 words, expands your creativity — following on the idea that Creativity Loves Constraints. Typically the mini saga expresses some sort of message or value — I think in …