August 2004 Archives
Before I start I just need to say that I am an advocate of standards but I am not a religious bigot about them.
My problem has never been the technicalities of CSS or HTML, lets face it if you have figured out Perl to a reasonable degree and know your way around half a dozen programming languages then adding some markup etc to your toolbox is hardly going to kill you. Or at least you wouldn't think so?
Unlike programming languages and their platform specific problems, browsers display your work as they see fit. The user at the other end may see a work of art or a bloody debauchery and judge you and your ability accordingly.
The browser doesn't even have the common decency to open a window informing the user that it's made some complete horlicks in rendering our page, nor should it! It's our problem! if we want people to read the stuff the least we can do is make it as legible as possible for them, its not their fault the browser has a few quirks.
The internet, for all intents and purposes is a new method of communication and like all previous methods of communication it comes with its fair share of problems ie its new, its evolving, it hasn't reached any form of maturity yet. As an analogy:
Have you ever phoned someone and had a "BAD LINE". This prompts you into very articulated speech were all the words are formed "just so" and you might even talk a bit louder. Mean while, in the back of your mind you are cursing the weather or your blaming the old exchange down the road for the bad reception.
Without even realising it you will be compensating for the deficiencies of the system you are using with your loud speech and long drawn out words. You might not like it but its an accepted part of the system and out of your control so you just get on with it and do your best. Web Development (Development in general) is like this.
I am all up for standards but I am not one to take a pop at something because it has not been done "Just So". Implementing standards is a process and there is no need get all religious about it.
I have been meaning to learn some sort of image manipulation tool for quite some time. I have used the Gimp in the past when I want to scale something or convert images from one format to another but I have never had the time or inclination to sit down and learn enough of it to be reasonably confident.
I have just had a long weekend so I decided to learn it because like it or lump it, its a very handy tool in any web developers arsenal. I mainly do backend work but there are occasions when I envy the versatility of other web developers when putting together sites. If you want to have a look at the sort of stuff I mean have a look at the The Zen Garden. Some of the pages on that site are just divine.
For just over two years we have always bought McCain's oven chips. They are low in fat and as far as we were concerned very nice.
This all changed about 3 weeks ago when we cooked some chips and they came out smelling like pig manure, I kid you not, I have worked in a cattle market and I know what pigs smell like and this was exactly the whiff I was getting. The first thing we thought was that the freezer was playing up and that somehow the chips had defrosted and gone off or some such nonsense. We checked the rest of the stuff in the freezer and everything was fine, I know this because we always keep Vodka in the freezer and it was as syrupy as usual which indicated to me that the freezer was very cold.
Anyway, we bought another bag (previous bag from Tesco's) from Asda's several days later under the assumption that we had just got a dodgy bag, perhaps it had lay on the floor somewhere too long or defrosted and been refrozen once too often. Same bloody problem. You can imagine our consternation, we had been using this product religiously for two years. We then decided to clean the oven completely even thought it was fine.
Most people would just try and change brands at this point but we wanted to know exactly what was causing that pig shit smell so we went off to Iceland (the frozen food mecca of the UK) and got a bag out of their freezer. We came straight home and bunged a batch in the Oven. You'll never guess what. PIG SHIT all over again. So there we have it.
McCains Oven Chips stink of pig manure, or at least the ones we have used recently do. We wrote a letter to them detailing our discovery a few days ago. We are awaiting a reply................. to be continued..........................
I started reading
A Mathematician's Apology
Author: G. H. Hardy (Foreward by C. P. Snow)
ISBN: 052142706
this one as soon as it arrived through the post. It is quite a small book and even smaller when you open the cover, at least in this edition it is since they have left over an inch of margin around the text.
I really enjoyed it. I have to say that I enjoyed the forward by Mr Snow as much as the content by Hardy. I think this was because he was writing about the Author of whom I would like to know more whereas Hardy was writing about his subject rather than himself. You can get a feel for Hardy's character from the text, particularly near the end but I thought that it dealt mainly about his take on mathematics.
The book is definitely some sort of apology, I thinks its open for debate whether he needed to apologize for anything but he obviously felt the need to justify himself in some way.
Personally I don't think Hardy had any more need to justify himself than Da Vinci, Matisse or Michelangelo, Hardy was an artist its just that his art was mathematics which like some forms of art is not appreciated by the masses. However, this does not mean that what he created wasn't beautiful or worthwhile. In fact years later it was found that a lot of what Hardy had created was of immense use.
I am pretty damned sure that fonts are one of the most used yet least appreciated aspects of computing I have come across.
It would be fine to interject here and say NO, surely its "blah de blah". I say no...... People in general don't give a damn about how machines work / talk / do their stuff, however they are concerned with how stuff looks.
For instance, look at the fashion industry. Clothes are expensive but the workmanship is generally crap but who cares, its a "scurgly! made by whatsisname", and it looks good.
Its the same with computers, look at the Mac, previously thought the underdog, now its almost a fashion statement to own one.
Anyway, back to fonts. I am not really that bothered about what fonts are on my machine as long as I can read the text without squinting to much, but just the other day it was noted that I was using "Sans Serif" fonts and I was lacking in "Serif" fonts.
Well... I just shit my pants, what the hell was I missing. Apparently I wasn't missing anything. Sans Serif add an extra bit to your fonts and I was missing the option of not missing them on everything I read.
To cut a long story short I needed to get some Microsoft fonts installed on my Debian box and this is the process.
First thing I needed was the Microsoft truetype fonts. ON debian these are called
msttcorefonts
and can be installed via "aptitude" or apt whichever you prefer. I fetched these and this installed a whole pile of stuff in
/usr/share/fonts/truetype/
Next thing I needed to do is create a "fonts.scale" file as ROOT
]$ cd /usr/share/fonts/truetype ; ttmkfdir;
sorted. The directory should now have the correct file. The next thing to do is restart either, the font server, or X11. I just logged in and out and that was it. New fancy fonts that are almost identical to the ones I had previously or at least in first inspection they are.
I am never going to finish "From Here to Infinity". I was about half way through Mr Stewarts book when I got an urge to browse Amazon, big mistake.
I spotted the following books all of which I ordered
A concise History of Mathematics.
Author: Dirk J. Struik
A Mathematician's Apology
Author: G. H. Hardy (Forward by C. P. Snow)
The Man Who Loved Only Numbers
Author: Paul Hoffman
A History Of Mathematics (An Introduction)
Author: Victor J. Katz
I never really had to do this before but I have been using enlightenment for a few months now and use the ALT-(q,w,e,a,s,d,z,x,c) to switch between 9 separate desktops. I find this quite quick but I tried xemacs the other day and I needed ALT-x but I kept switching between desktops. So I decided to use a different key.
Since the Windows key ie the one to the left of the left ALT button is never used I decided to use it to switch desktops instead (I know I will need to use the ALT key in other applications so I might as well do it now before its ingrained into me).
Anyway the procedure goes as follows.
1. Detect the keycode of the key you want changed.
Open a terminal and type
]$ xev
Lots of text should whizz past on the terminal and then stop. Touch the key you want the keycode of and more text should whizz past.... something like
KeyRelease event, serial 25, synthetic NO, window 0xe00001,
root 0x38, subw 0x0, time 24436498, (-298,301), root:(458,320),
state 0x0, keycode 115 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes: ""
We can see that the keycode is 115.
2. Create a user modmap file to be loaded on starting X
]$ cd ~; touch .Xmodmap
and put the following text in it
keycode 115 = Hyper_L
add mod3 = Hyper_L
then edit your ~/.xsession file: Add
xmodmap .Xmodmap
before the "exec enlightenment" line and that should be you sorted. If for some reason you did not have a .xsession file then you will need to add the line to start whatever window manager you are using ie in my case my .xsession looks like
xmodmap .Xmodmap &
exec enlightenment
yours might well be
xmodmap .Xmodmap &
exec sawfish
You should now be able to use the MOD3 modifying key in e16keyedit as a modifier key after restarting xwindows.
I decided to get function folding working today and discovered that it is relatively simple to set up unless Vim isn't detecting your filetype correctly which it wasn't in my case.
To get basic Folding for Perl working add
let perl_fold=1
let perl_fold_blocks = 1
to your .vimrc file and then open a .pl file and you should see lots of blue lines running across the screen. These are where the folds have been made and you should see a line count similar to
+-- 24 lines: sub summit_sub {--------------------------------
Put the cursor on this line and press "za". This will magically unfold the line. Pressing "za" again refolds the line.
I don't like the perl folding defaults so I dedcided to run with the manual ones but my filetype was alway wrong when working on a modules. it was inserting c-style foldmarker ie "/*}}}*/" instead of the perl foldmarker #}}}
This was easlily remedied as follows
au BufRead,BufNewFile *.pm set filetype=perl || set commentstring=#%s
I now have folding working. Now all I need to do is decide what type of folding I prefer.
I was asked the other day if there was an easy way in Perl to join two pdf files together. The answer is that there is an easy way. It might not suit everyone but I managed to find a tool called the pdf toolkit (pdftk). Its another of those handy tools that gets filed in the magic toolbox for later retrieval.
I was wanting to start some comments in a large Perl module the other day and not really had to use Vim's regexp to any great degree because I know Perl I decided to see if it could be done.
I decided to add a little bit of pod above every funcion. The following was the result Remember In vim the ^M is a control character for carriage return and can be achieved by holding down the control key and pressing carriage return.
The following regex
:%s/^sub\(.*\) {\(.*$\)/=head \1\(\)^M^MDescrition:^M^M=cut^Msub \1{\2/
changes
sub summit_sub {
stuff;
}
to
=head summit_sub()
Descrition:
=cut
sub summit_sub{
stuff;
}
The following regex
:%s/^sub\(.*\)\n{\(.*$\)/=head \1\(\)^M^MDescrition:^M^M=cut^Msub \1{\2/
changes
sub summit_sub
{
stuff;
}
to
=head summit_sub ()
Descrition:
=cut
sub summit_sub {
stuff;
}
I just found another RSS Job feed and have incorporated it into my own RSS Job aggregator.
I have now got 15 separate feeds in the database.
I have decided to monitor where I come for the search term
harry
on google. Why? Why not. I am up against some very famous Harry's so I thought it might be a bit of a laugh to take them on and see how far up the ladder I can get. Current ranking. Why the hell could they not have called Harry Potter something like Derek Trotter ;)
319 on google for "harry" out of 23,900,000
I received a great little bit of spam that I thought I would chase up to see from whence it came. The following is the text of the email with the links edited a bit.
You have got a useful web site, but no one visits it?
Get each page of your www-site crawled by each major Search Engine including: MSN, AOL, Google, Yahoo, Overture, AltaVista, HotBot, Lycos, Excite, Inktomi, Webcrawler, Ask Jeeves, etc. Having each page of your site relisted every quarter will expose your site to extra traffic.
Site1: www[dot]hvat[dot]org/9767[dot]asp
Get more traffic from the search engines!
Jennifer Clark,
Marketing Executive
Hahahahahahahahahahaha.
On following the site there you get redirected to payinq-traffic.com which is a
site that reportedly submits your site to all the search engines once a month
if you pay a fee for this to be done.
For those of you that think this is great idea here are some facts.
1. Five search engines command over 80% of the market share
2. Its free to submit to these search engines.
3. Submitting to a search engine more than once is pointless.
4. Some search engines don't like the submission of individual pages only home pages.
Most important of all is:
Don't believe a bloody word you read on a website. That piece of advice goes
for my site to. Check everything I say and make sure I am not feeding you a crock
of shit otherwise you will just be another internet luser. When some stranger
approaches you on the street and offers you a magic bean you know straight away
the blokes full of it, a fraudster, a crook. Its just the same on the World Wide
Web except there's more of them and for the most part they are not going to prison if you have been dumb enough to give them your cash.
Believe nothing, confirm everything, take nothing for granted and always watch
your back.
I have just finished reading:
Fermats Last Theorem
ISBN: 1841157910
Author: Simon Singh
I actually bought this book and had started reading it when I found
"Surely You're Joking, Mr.Feynman!:"
but I am afraid that Mr Feynman took the lead and this book never got touched again until I had finished the Feynman book.
On the whole I enjoyed it but its a bit dry in places and meanders about the
place, or at least that was my impression. I had trouble seeing the
relevance of some of the writing to Fermats problem and this is where I got the
feeling of the book going off on tangents just to be brought back quite
sharply.
I was also a bit surprised to hear the Authors description of "divide by 0" in
one of the Appendix's. He says that you cannot divide by zero because zero will
go into something infinitely many times.
I know this is a religious issue for some people but I would have described it
as follows.
2 x 0 = 0 : True
this looks correct and is correct. Its basic algebra. Now when transposing formula we could take the left 0 over to the right side by dividing through by
0 as follows
2 = 0/0
We can see that 2 cannot = 0/0 so division by zero is undefined. Some people
might see it better as follows.
(2 x 0)/0 = 0/0
If the left zeros cancel which they would if 0 was a normal number then we are
left we are left with the absurdity.
2 = 0/0 : Absurd
So 0 cannot be a number or at least not in any normal sense. So to say that 0
divides something infinitely many times seemed wrong to me.
If we look at it another way it might be clearer. If we look at the following
infinite sequence
1/(1/2), 1/(1/3), 1/(1/4), 1/(1/5) .......... 1/(1/n)
the we can see that as
n |--> infinty that 1/n |--> zero
so we have 1/0 which if we could say gives us infinity because 0 divides 1
infinitely many time. That sounds plausible enough but, if we look at the following
infinite sequence
1/(1/-2), 1/(1/-3), 1/(1/-4), 1/(1/-5) .......... 1/(1/-n)
then we can see that as
-n |--> negative infinty then 1/-n |--> zero
but zero is the only number that is neither negative or positive so which
infinity do we pick. Do we say that because the sequence is approaching
negative infinity that it 1/0 is -ve infinity or +ve infinity. This is another
of those absurdities that we ran into earlier when dealing with divide by zero.
Dividing by zero is indeterminable which is why no one says that it divides
something infinitely many times when in fact we have no idea what its doing.
I am sure some clever cloggs will come along after a course in complex
analysis and blow the above out of the water but this is the way I have always
thought of this question.
I have just spent a week in Nottingham doing the Summer School for M203 ( Open University Pure Maths Course) which was quite a good laugh. I decided since I new the dates that I would book the tickets quite a bit in advance so that I could get them cheaper. I did consider using the car but I trust Midland Mainline so I might as well do a bit for the environment and traffic congestion and use the train, what a mistake that turned out to be.
The train was due to leave at 10:01 Saturday morning. On arrival at Luton station 20 mins early I am then told that there is no such train, it doesn't exist, there is no train at 10:01. I showed the bloke my ticket and lo and behold I am meant to be on the 10:01. This was not a mistake on my part, they had changed the timetable and my train would now be leaving at 10:50. BOLLOCKS, thats a lot of extra time I could have spent in bed.
Anyway, I got on the train and things were looking good until Kettering which is where the train decided to break down. So off we went to another platform where I could catch a train that would mean changing at Leicester. I don't like changing so I waited for a direct train that came 15 minutes later and caught it instead. Arriving more than two hours later than I thought I was a bit pissed off to say the least.
Return Journey.
Well, I finished earlier than I expected on the course so I decided to hell with it I am not waiting a further two hours at the station just to catch a train that said suggested service on the ticket. This was my mistake. I seen suggested service on the train that runs from Nottingham to Leicester but I had a reservation on the train from Leicester to Luton. I jumped on the train that was fast to Kings Cross and decided to change there and come back up to Luton since that would get me in a lot quicker than the other way. On ticket inspection I got whacked with a bill for £27 because I was being bumped up by £7.50 to get to Luton for some reason and I had to pay £19.20 to get a return from Luton to Kings Cross and back again. FSCK IT
The bastards make me late by two hours and charged me £27 quid for the pleasure of recovering one hour. Using the train is a sure fire way to get stressed out over a simple journey of just over 100 miles.
100 miles cost me £64. I can fly home to Ireland and back again for less than this. The government are constantly wittering on that we should all start using public transport, its quite obvious very few of them actually use it. I would also imagine that when they do they have everything arranged for them at both sides and its other peoples money they are spending. The whole things a bit of a farce.
Having read a little about R.P. Feynman I decided that I would read some more about him and I found the following book:
Surely You're Joking, Mr.Feynman!: Adventures of a Curious Character
ISBN: 009917331X
Authors: Richard P. Feynman and Ralph Leighton
This was in Unsworths just opposite the British Library on Euston Road. I got
it quite cheap so now I had somehthing to read on the way home on the train and
I was not dissapointed.
The book is a great read because it lets you have a good look at the man and
his quirks and entertains throughout. I was constantly amazed at the way he
just threw himself at various things and he very rarely did anything half
heartedly. Even as a kid he would immerse himself in things and the "Curious
Character" in the title means both that he had an insatiable curiosity and that
he was probably quite a character to know.
If you are after a look at the man without delving into the physics then this book is
brilliant and funny and I had a good giggle to myslef severral times throughout the book.
Sounds simple enough but considering the amount of stuff I used to read
the last few years has been a bit dry. This is partly due to being on the
computer a lot more than is healthy. I am also doing an Open University
Maths degree which has soaked up what was left of my time.
Studying Maths over the last couple of years has given me a bug to find out
more about the subject, not just the maths itself but the history of it and its applications ie physics. This culminated in a walk through Waterstones a few weeks ago and I came across the following book.
Some Time with Feynman
ISBN: 0141009535
Author: Leonard Mlodinow
I just seen it sat on the shelf in the physics section and I immediately
recognised the picture on the cover as Richard P. Feynman. I decided to buy it
and being a small book I had it finished in a couple of days. My only regret is
that there was not more about Feynman in it which was what the book implied but
it was still an interesting book from the point of view of someone who manages to
land a job in Caltech and spends most of his time doubting if he is capable or
suited for what they want even thought they have not given him anything solid
to work on. Its nce to know even people at the top struggle and wonder why they are there.





