Blogroll: So close to an Australian word

[Dr Dave](http://homepages.cwi.nl/~dave/): “I have your blog in my blogroll. In Australia, bogroll means toiletpaper.”

The reason I write this is that I was chuffed to see that my blog is in Mr Lumpley’s [Anyway](http://www.lumpley.com/) blogroll.

I am part of the Conversation, it seems. (Perhaps I should add something to it. But hey, see above, a vulgar, Aussie slant on that horrible word – “blaahgroll”.)

Fasterfox: Get performance out of Firefox

My rambling thoughts when riding in the backseat of my uncle-in-law’s car yesterday: “Wouldn’t it be good to have the Google Accelerator in a small way, like local, user-controlled, and… integrated in something I already use? The pre-fetch of webpages I am going to look at, and so on… Those can be good features. But I want them only sometimes.”

Fasterfox, a Firefox extension that does exactly what I was dreaming about in the car yesterday.

I’m trying this out right now.

CakePHP news: Data Bindings v0.1 Example

You might know that I am involved in the [CakePHP framework](http://www.cakephp.org/) project, and I’m developing web sites with it now.

On the IRC channel today, I was alerted to the existence of the Bindings sister project. Now they have an example up, for all to see. Data Bindings v0.1 Example is a piece of very easy interaction between your PHP and the HTML the user manipulates.

Take a look at the “color box” example – yummy.

Delicious: Re-use of metadata

I have now added even more stuff to that bloated sidebar of mine.

Delicious sidebar screenshot with IDs

Perhaps you also have a delicious feed, and a WordPress blog? [Grab this plugin](http://www.w-a-s-a-b-i.com/archives/2004/10/15/delisious-cached/) to get started. The folks at Del.icio.us have made it really simple to use their data. Just look at [their documentation of their HTML feeds](http://del.icio.us/help/html).

> HTML feeds are available for users. This is an easy way to add your del.icio.us links to your blog.

(I opted for the “body” shape of the links, so you don’t need to hover the links to see the TITLE attribute in a tooltip.)

The picture shows how Mozilla Firefox’s Developer Toolbar displays the ID and class details of the HTML elements. Del.icio.us also gives me nice hooks for my stylesheet, thank you very much.

**Update:** For me to use the HTML feeds from delicious, I had to make them fit the presentation at my site, so I had to wiggle the charset a little, in the delicious.php plugin file. Line 42:

`  $response = utf8_decode(curl_exec($c));`

ActiveRecord outside of Rails: handy DB-tool

The popular web framework Ruby on Rails has a core part called ActiveRecord. That is the ORM, the object-relational mapper, which lets you use your database records “as objects” in your code.

With Rails, ActiveRecord is very powerful, but it’s not that bad on its own either.

Here is an example of using it as a microscopic SQL utility, for the two tables “seeds” and “products”.

Sean Treadway told me how to minimize the SQLing by just defining the Seed class. ActiveRecord detects all the column names on its own, so no need to type statements anymore.

And today I found out about the handy [clone](http://api.rubyonrails.com/classes/ActiveRecord/Base.html#M000739) method. It populates the to-be-created Product with the values of the parent.

Continue reading “ActiveRecord outside of Rails: handy DB-tool”

Testing: Ruby, Watir & more

Hi folks.

I’ve been busy pushing out a little micro-small shopping cart system, but multiple projects keep dragging on, and “project hang” locks me down. I am getting things done, but there’s just much of it all.

Today I needed a smarter way of walking through a series of screens to “buy a certain product” at my shop. Clickety-click.

Click manually is always a hassle. And you lose mental focus. Your mind starts to wander. You are grasping for that last thought, trying to concentrate, and wham, you lose it.

*Solution*: Using [Watir](http://wtr.rubyforge.org/), an automated functional test package, written in Ruby, you just type up the sequence… in Ruby, and then run that test script. Whenever you need to step through that process. Auto-magical testing. [Get going, using it, you too](http://wtr.rubyforge.org/watir_user_guide.html).

Watir’s gotten quite the following, in many circles, and it is seen by [some](http://helenius.dk/) as the next [“inroad to Ruby”](http://helenius.dk/archives/2005/09/27/vejen-til-ruby/), besides [Ruby on Rails](http://www.rubyonrails.com).

You can do as little or as much output and test logic as you please. I like the “dot means pass and F means fail” approach to output. Watir itself has very fine error messages, as when I tried to “click” a submit button that was hidden by CSS:

> OLE error code:800A083E in htmlfile
>
> Can’t move focus to the control because it is invisible, not enabled, or of
> a type that does not accept the focus.

Reading that, I found the culprit, changed it for testing’s sake, and then re-ran the test, successfully.

This was all in all a pleasant experience. Very Ruby-like: I got what I expected, and not so much else. Without pain or discomfort.

Tobin Harris: this is for you – Scott Hanselman on “Integrating Ruby and Watir with NUnit”.

Crazy operators: J, a different creature

Warning to non-geek readers: This might be the most in-bred geek-talk posting ever to be made on this blog. Bear with me. Skip this post if functional programming and “different” languages is not on your plate. The web is bigger than this blog: check *it* out instead of my ramblings. If you are interested, read on.
Continue reading “Crazy operators: J, a different creature”

Automation of searching: Practical use of Factbites

Do you use a lot of time searching for the right information? I know I do.

The meta-web-search site [FactBites](http://www.factbites.com/) can be a way of learning about stuff that you have an inkling of. Let’s take the word [monad](http://www.factbites.com/topics/Monad) and search for that: we get a rather extensive and eclectic list of stuff about different definitions of that word.

We get these domains, basically: Greece. Alchemy. Leibniz. Functional programming.

And as I am only interested in the latter of the four, I can skip those references to Greek gods and alchemy. Now I have some out-of-context statements to work with. Most of these, I can disregard, but I have something to go on. This gives a tiny bit more information than Google does, but it automates a big chunk of what I would have done myself, using Google.

All on one page.