Archive for the ‘cod’ Category

subtracting one

Saturday, November 21st, 2009

this an educational game to teach the aspiring mathematician that essential skill of subtracting 1 (one)!
behold! the interactive program is included for those who wish to hone their talents.

http://blodgett.doof.me.uk/real/sayGOM

after save, to run type ‘ruby sayGOM’

(or if your computer do this you can type ‘chmod +x sayGOM’ to change file mode from text script into executable program, and then just ‘./sayGOM’ to run)

first foray

Wednesday, October 28th, 2009

at suggestion of friend nick, blodgett have generated a gif of its skyboat pictures that will probably not make sense unless comments are heeded
(http://blodgett.doof.me.uk/2009/10/20/sky-boat/#comments).

is here…
http://blodgett.doof.me.uk/real/skyboat.gif

blodgett used imagemagick. was very simple:
convert -delay 250 -size 1089×569 -page +0+0 skyboat.png -page +0+0 christmasskyboat.png -loop 0 skyboat.gif

which means:
convert images into gif, display each for 2.5 seconds, gif size will be 1089×569, images to use are first skyboat then christmasskyboat, each drawn at zero horizontal and vertical offset, loop forever, write output to a file ‘skyboat.gif’.

ta da! :)

PIGPIGPIGPIGPIG

Saturday, June 20th, 2009

blodgett have helped simulate pig! descriptive informations are here: http://www.doof.me.uk/2009/06/20/mechanical-pig/

cods available ici:

pig learns to read: literatepig

pig learns to grammar: piglang

(grammar of pig uses treetop gem http://treetop.rubyforge.org/)

pig learns to process: pig

first pig of happiness!: pig1

second pig not so happy: pig2

we pause here for a moment’s silence to remember all pigs who have sacrificed themselves that we might know the glorious wonder that is BACONFOOD

blodgett solves a problem!

Tuesday, June 16th, 2009

(with help of friend)

blodgett had a problem (but no longer): wanted wallpaper to change sometimes (blodgett likes variety), of its own accord (blodgett is lazy).

solution part 1: blodgett’s wallpapers are in a directory. blodgett runs fluxbox. blodgett will use fbsetbg! goes to manpage. friendly fbsetbg! it has already an option for random selection from a directory (-r). blodgett is pleased.

solution part 2: blodgett wants things to happen sometimes. blodgett acquires knowledge from friend of CRONTAB :O
running crontab -e opens a text file with mystifying markings. blodgett is mystified. acquires further knowledge from friend. fills out form. resembles now this:

# m h dom mon dow command
0,3,9,13,18,21,27,34,43,47,50,52,58 * * * * fbsetbg -r /home/blodgett/wallpaper/

the interpretation of which is to run command (fbsetbg …) at all listed minutes, of every hour, of every day of month, of every month, on every day of week. (hatching at start is for comment.)

so! crontab accept this input, blodgett wait in excitement for next listed minute! nothing happen. complain to friend. friend suggest maybe does not work when run without a display. friend further suggest solution of setting environment variable. this rather complicated for blodgett.

solution part 3: copy-paste friend knowledge into a file called bob. file bob resemble now:

#!/bin/sh

# I run this via a cron job where DISPLAY isn't set
if [ "$DISPLAY" = "" ]; then
DISPLAY=:0.0
fi

exec env DISPLAY=$DISPLAY fbsetbg -r /home/blodgett/wallpaper/

the interpretation of which is approximately to set a most likely display if it don’t know what to do, then run (exec) the fbsetbg thing with this informations (env, short for environment).

but! file is by default a file, not a program. cannot run a file. so must change mode (chmod) of bob to be executable.

solution part 4: run chmod +x bob

solution part 5: blodgett then updates the CRONTAB OF DOOM with new informations, which now resemble:

# m h dom mon dow command
0,3,9,13,18,21,27,34,43,47,50,52,58 * * * * /home/blodgett/bob

and wait for minute… and it work! blodgett have now randomly changing wallpapers! blodgett’s wallpapers have been upload here:
http://www.flickr.com/photos/blodgett-esq/sets/72157619470981253/

actually took blodgett longer to write this than to solve problem. blodgett bid you all good day, going for tea and cow biscuits now.

cods for story

Saturday, May 9th, 2009

nearly forgot! i made story with ruby. cods for these are here:

mkblob
bunny

free as usual for play, cannot be bothered to paste stuff into file. lazy blodgett.

i made some flowers!

Sunday, April 19th, 2009

they are in here cos have no garden:
windowbox

have only tried it on my shiny so far, tell me if it not work!
can probably make go by clicking on it. needs java though. is here if you do not have: http://java.sun.com/javase/downloads/index.jsp
(is “Java SE Runtime Environment (JRE)”)

also the cods are in there if want to play

alsoalso now i am hungry

string song

Wednesday, April 15th, 2009

i made a shortcut for song writing! is here: apieceofstring (needs ruby. ruby is here: http://www.ruby-lang.org)

if you ask it nicely it make song about string. like: GreatSong.new.sing

if you ask it extra nicely it sing about other things too. like: GreatSong.new(‘cheese’).sing

cheese is good