Category Archive: gotchas

Sep 05

A “grue”some look at Statemachine and Treetop

state_diagramme

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.

Continue reading »

Aug 29

CSS tooltips using CSS Sprites

Thought Bubbles!

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 …

Continue reading »

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 …

Continue reading »

Aug 26

Why my code is broken….. (break my code redux)

Yesterday, I posted an article entitled Break my code, please, wherein I posted a very fragile piece of code, with the challenge to find ways in which to break it. What follows is a discussion of the code and why it is bad/fragile/easily broken…..

Continue reading »

Aug 25

Break my code, please

There’s a number of things we can should take into account when writing code — boundary cases, etc., that can make or break a programme.  Yes, testing is important, but I think that developing good defensive programming practices is even more important.  That said; I present the following, fragile, code.  Just about every line has …

Continue reading »

Aug 19

autotest reminder (or why did it go boom?)

autotest / zentest are really useful tools.  However, it’s important to remember to run migrations for the test database — otherwise your tests will fail (miserably!) I’ve found the following to be helpful for using autotest: Getting started with Autotest – Continuous Testing Autotest RSpec Notifications for Ubuntu « My Pragmatig life

Aug 13

The trouble with injection

Ruby’s injection is very useful, but if you don’t remember one key fact, you’ll shoot yourself in the foot.

Continue reading »

» Newer posts