Saturday 11 September 2010

Bus Eireann Route Plan: unintended scenic diversion


This is quite funny if you know Limerick. The route planner adds in 5 bus trips to cover a short distance in the city center.

Dublin to University of Limerick, via Limerick city centre and a selected tour of the city centre and a suburb. Fionnuala was hoping that perhaps the Dublin Bus might still stop at the University on the way.

Beware tourists and computer users everywhere!

:)

Friday 10 September 2010

bash/sh/ksh syntax: function needs whitespace after initial {

# this is broken:
$ function cdt {cd $TTM_TESTS_DIR;pwd;}

# this is also broken:
$ function cdt { cd $TTM_TESTS_DIR;pwd }

# this is okay
$ function cdt { echo "tcl isn't the only language with whitespace-dependant syntax. though looking mostly like a tokenised parsed language.";cd $TTM_TESTS_DIR;pwd;}

So like tcl sh/bash not really parsed in a properly tokenised way.
Mmmm.
Specifically here:
1. needs whitespace after first { of function
2. needs ; after last command before closing }  (doesn't matter about whitespace here)

Aliases are bad. For many reasons.One reason being vars in aliases expanded at definition time.
So if the variable is redefined then the alias doesn't match. Alias must also be redefined when changing variable.

man bash explains it better and says: "For almost every purpose, aliases are superseded by shell functions."
 http://www.gnu.org/software/bash/manual/bashref.html#Aliases




Best answer ever to question on parsing html tags with regular expressions:
http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454
This is more fun as it has a lovely pic of Cthulhu for illustrative purposes.
http://www.codinghorror.com/blog/2009/11/parsing-html-the-cthulhu-way.html
Cthulhu  ach, Cthulhu isn’t in my spell-check dictionary!
What an oversight!
Tsk!




Checked functrion cdt on a few bash versions.
These are the errors seen:

GNU bash, version 3.2.49(23)-release (i686-pc-cygwin)
GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)
sh on qnx is ksh 6.4.1

sh: syntax error near unexpected token `{cd'    (sh on this cygwin IS bash)
bash: syntax error near unexpected token `{cd'
-bash: syntax error near unexpected token `{cd'


qnx$ strings $(which sh) |grep -C8 -i version
The ksh is a public-domain version of the Korn shell. It's a command
interpreter that's intended for both interactive and shell
script use.
For more information please refer to a ksh or unix shell reference.
NAME=ksh
DESCRIPTION=Public Domain Korn Shell
DATE=2009/05/20-17:46:32-EDT
STATE=stable
HOST=cctrunk
USER=builder
TAGID=166
VERSION=6.4.1

Friday 3 September 2010

Oopsie daisies! http 404 error.

Just had some fun customising http 404 error page:


http://gmds.ie/gehbroked

In the spirit of fun:
http://www.dzinesoup.com/44-amazing-and-creative-404-error-pages/

GMDS, Glencullen Musical and Dramatic Society new web pages: http://www.gmds.ie just got hosting and domain registered with Blacknight. Trying out the default content management: Plesk. Putting some initial content up on site.

logo, sad theatre mask for 404 error page:  :)



TITLE: http 404 error: This page is not found.


Oopsie Daisies!


http 404 error: This page is not found.





Something is broken on the internet.
Do not fear!
We are alerting the appropriate authorities.
The entity responsible for the error will be traced and chastised appropriately.


Please carry on Forwards or Backwards ... or perhaps Sideways or Up or Down ...






And image transparency for logos, banners. In GIMP. Layers - add alpha channel, select part of image, Edit - clear, unselect mask layer before saving, save as png (jpg doesn't handle transparency.


logo: