July 22, 2006
Comments working again

Print | Home

When this blog switched servers, the Email::Valid module was missing. Now I’ve put it back and comments can be made. (Will I regret this?)

 
Posted by jservice at 10:51 PM
July 19, 2006
Mp3 player ain't

Print | Home

It doesn’t seem to turn on no mo'.

I didn’t use the mp3 part much; but, I miss listening to CBC Radio One while commuting to work already.

 
Posted by jservice at 10:06 PM
July 15, 2006
Multiple copies of rows in PostgreSQL

Print | Home

I had a rather complicated view where I needed to duplicate each row and change one column in every other row. I came up with this function:

-- Function: numbers(count int4)

-- DROP FUNCTION numbers(count int4);

CREATE OR REPLACE FUNCTION numbers(count int4)
  RETURNS SETOF int4 AS
$BODY$
BEGIN
  -- Usage: select * from numbers(10)
  -- returns a column of integers from 0 to 9
  --
  for i in 0 .. count - 1 loop
    return next i ;
  end loop ;
  return ;
END ;
$BODY$
  LANGUAGE 'plpgsql' IMMUTABLE;

To make 3 copies of each row of table I could use the following:

select * from mytable,numbers(3)
 
Posted by jservice at 10:31 PM
July 10, 2006
The graduand

Print | Home

Finnegan graduates

After several weeks, Finnegan’s owners know how to give treats and, in return, the dog does “sit”, “down”, “stay”, “come” and “heel” among other things. Finnegan learned by himself that when this owner gets the small bowls from the cupboard and the scoop from the drawer means that ice cream will be served and he’ll get in some licks. He also knows that if my son or I are peeing in the toilet then, very shortly, there will be fresh cold water after the flush.

 
Posted by jservice at 09:33 PM
July 03, 2006
It's not hard to meet expenses; they are everywhere.

Print | Home

or “I wish the buck stopped here! I could use a few.”

 
Posted by jservice at 12:01 PM