Where magic lives

Monday, July 31, 2006

Bath

The latest stop on my Oxford people tour was Bath to spend a weekend with my friend Laura. Involving a night out with some engineering people, the tour of Bath, a visit to the cinema (The Breakup - I quite liked it) and a day trip to Weston-Super-Mare (I optimistically wore my swimming shorts but the sea was miles out) this was a fun weekend.

Labels:

Friday, July 28, 2006

Programming C#

Programming C# was a reasonable introduction to the C# language.

At the beginning the book was very slow moving for someone coming from Java. Despite this the description of some important language features was very fluffy. For example in Chapter 4 the notion of properties were introduced; we are told that the set accessor is analogous to a void method but this contradicts the point made earlier in the book about the result of evaluating an assignment being the value that is assigned. I am assuming that this point still applies and the value as evaluated before executing the set accessor is used for the overall result (as in many cases it would be inefficient to call the get accessor directly afterwards to provide a value for the assignment expression). A another example from Chapter 4; readonly members are introduced but we are not given a clear description of the semantics. I suppose the containing class is the unit of protection here but we are not told.

The later chapters of the book whose content was more .NET specific were at a better pace. They allowed for a very easy going read to introduce yourself to the various features. Some of the code examples were unnecessary but these can be easily skipped over.

The coverage of ASP.NET was very brief and has left me intrigued enough to find a book that just covers that topic.

Labels:

Thursday, July 27, 2006

Germany Visit

I spent the last five days in Germany visiting my friend Moritz who lives in Baden-Baden.

We spent the first evening in the Casino and lost a small amount of money playing Roulette. The next day was the tour of Baden-Baden which involved a stop at a very nice restaurant where I ate a meal based on my German favorite: SpƤtzle. We also visited Frankfurt (where I went up the 200m Main Tower and got a few Starbucks fixes, drove over the border into France and then straight back again (where we played some crazy golf and I won by 1 point!), had some 125mph trips down the Autobahn listening to a now favorite band of mine: Silbermond and went to a theme park: Europa Park.

I had a great time.

Labels:

Saturday, July 22, 2006

Bug in Solitaire

I just found a bug in Solitaire! Arguably one of the most tried and tested components of Windows.

I was playing in Vegas mode and had gone through my stack, in an effort to do some last minute rearranging I was placing cards from the Ace piles back onto the table. I pulled the 9 of diamonds down and accidentally dropped it on the 9 of spades and it stuck, bringing the 8 of diamonds with it. There must have been something else special about what I did though because I have tried to engineer similar situations and am not seeing the same behavior.

Yes, I know, I play too much Solitaire!

Labels:

Wednesday, July 19, 2006

Eric Meyer on CSS

Eric Meyer on CSS provides a very easy going introduction to the capabilities and application of CSS. Each chapter walks you through a typical project and the creation of the appropriate CSS then ends with some extra features for you to add as exercises.

As a non-artistic web developer I found this approach very enjoyable to read, and I felt that it gave a sound description of how the various CSS properties relate to design principles. However the book is not sufficient as a CSS reference, it lacked a complete description of how cascading and precedence works and there is no consistent method for introducing new attributes to the reader. This book will make a good companion to a reference text for someone who is starting out with CSS.

Labels:

Tuesday, July 18, 2006

Automated Word Speller [Update]

My Automated Word Speller is now capable of displaying codes/e-mail addresses as images as well as converting them to MP3 dictations.

Codes produced using the script look like this:

Visually impaired users click here

Try it out for yourself; use the form below to create a one-time link, or read my article on Public-Key Cryptography in PHP to create your own links on the fly.

Try it out; enter a word: (supports a-z, 0-9, @ and .)

All source code and related services that I release are "dontation-ware". If you use the above please make a dontation (pay whatever you think the it is worth) or (where applicable) leave the link to my site attached.

Labels:

Sunday, July 16, 2006

My New Car

Today I brought myself a car: A 1991 Ford Escort Ghia (i.e. with electric windows, central locking and electric mirrors!)

At £200 I think that it was an absolute steal (not so much the insurance premium which came at a cost exceeding £1000).

I have taken it for a drive and we are getting on well, just need to fit a computer now... (I'll look into it!) Oh, and I need to get a driving license.

Labels:

Modaco Summer Event

The Modaco summer event last year was so good that I had to go back to this years event, even though it did mean a train ride from Evesham to London this time.

At the Orange UK offices in Paddington I mingled with about 50 other Windows Mobile enthusiasts. We listened to interesting talks from people in the know at Orange and Microsoft as well as some people from smaller companies such as Time Cole at TAO talking about his miniMIXA project which aims to bring multimedia blogging to portable devices.

Disappointment at not winning the raffle prize (an XBox 360 and a years subscription to Orange Broadband) was softened by one of the many freebies we received from the sponsors; a Modaco branded, white-on-white Orange SPV C600. Definitely worth the train ride and £10 donation to charity.

Labels:

Friday, July 14, 2006

My Book Shelf

Last updated: 21 June 2007

Programming

Agile Web Development with Rails Review Dave Thomas

Programming C# Review Jesse Liberty

Eric Meyer on CSS Review Eric A. Meyer

Learning the vi Editor Lamb & Robbins

Java Cryptography Jonathan Knudsen

Java Security Scott Oaks

Linux Server Hacks Flickenger

Swing Robinson & Vorbiev

Introduction to Functional Programming using Haskell Richard Bird

Teach Yourself C++ Programming in 21 Days Liberty

Teah Yourself Visual Basic in 21 Days Gurewich & Gurewich

Security

The Art of Deception Mitnick

Rootkits Hoglund & Butler

Modelling and Analysis of Security Protocols Ryan, Schneider, Goldsmith, Lowe and Roscoe

Business

Boo Hoo Malmsten

Direct From Dell Dell

Bloomberg by Bloomberg Bloomberg

Mathematics

Mathematical Techniques Jordan & Smith

Discrete Mathematics Chetwynd & Diggle

Popular Science

Fermat's Last Theorem Review Simon Singh

Freakonomics Review Steven D. Levitt & Stephen J. Dubner

The Computer and the Brain Review John von Neumann

The Infinite Book Review Barrow

The Code Book Singh

Fiction

The Spanish Game Review Charles Cumming

Casino Royale Review Ian Flemming

A Spy By Nature Review Charles Cumming

1984 Review George Orwell

Digital Fortress Dan Brown

Other

The Trojan Files Review Roger Gray

Lima 3 Review Harry Ferguson

Kilo 17 Review Harry Ferguson

Living in the U.S.A. Lanier & Davis

Spy Catcher Peter Wright

Labels:

Very Easy Blogger Categories [Internationalisation]

As can be seen in the comments to my previous posts, I have been under quite some pressure to support multiple character sets in my Very Easy Blogger Categories system.

I now try and automatically detect the character set that you are using when I crawl your page. This allows me to output correctly escaped characters in the category lists that I place on your page.

Aside: The PHP htmlentities function does not support many character sets at all. As a work around I use the following code to correctly escape text in (hopefully) any character set: htmlentities(mb_convert_encoding($text, 'UTF-8', $charset), $quotestyle, 'UTF-8').

This is an entirely server-side change and does not require any changes to your templates or blog posts. Please let me know how it works by adding comments to this post.

Labels:

Wednesday, July 12, 2006

The Infinite Book

I just enjoyed reading The Infinite Book by John D. Barrow.

It was overall an interesting read, I really enjoyed the beginning chapters that were more mathematically focused. The latter chapters related more to physical infinities and the Universe; In my opinion this stretched on a little too much but that may just be because it is not where my interest lies.

For anyone who wants an amusing introduction to the infinite I especially recommend Chapter 3: "Welcome to the Hotel Infinity". Unfortunately the book is not indexed by Google Print or Amazon Search Inside! though so this will involve a trip to your local book shop.

Labels:

Tuesday, July 11, 2006

Public-Key Cryptography in PHP

I have just been implementing a Public-Key cryptography system in PHP. This will allow users of my Automated Word Speller to link to sound files without them having their address/code in plain text and without me having to run a server-side database storing sensitive data.

I chose to make a system based on Diffie-Hellman key exchange. I share with you the parameters g and p that we will be using, along with my 'public key' g^y mod p; I keep my 'private key', y secret. You will generate your own private key, x and keep it secret (probably hidden in your code) but you will send me your public key, g^x mod p with every request. We can now both generate a key, k = g^xy mod p = (g^x mod p)^y mod p = (g^y mod p)^x mod p. This key will be used as a key to a function that does the base 10 equivalent of Vernam Encryption (addition/subtraction modulo 10). If the plaintext is longer than the generated key then the plaintext is split into blocks and ECB chaining is used.

Links to sound files look something like this:
Where:

  • enc is a base64 encoding of a gzipped comma-separated list of encrypted blocks, and
  • pk is a base64 encoding of your gzipped public key.
This URL cannot be converted to the original plain text without my private key (I invite you to try).

To create some encrypted links for yourself you can use the form below, or you may wish to see some sample code.

Try it out; enter a word: (supports a-z, 0-9, @ and .)

All source code and related services that I release are "dontation-ware". If you use the above please make a dontation (pay whatever you think the it is worth) or (where applicable) leave the link to my site attached.

Labels:

Very Easy Blogger Categories [Update]

As pointed out in the comments by Jenny my Very Easy Blogger Categories didn't seem to work.

The problem was an AJAX 'security' feature that prevents accessing URLs on a different server using an XMLHttpRequest object. In my opinion the restriction is not implemented very well; in this case the XMLHttpRequest object was forbidden from accessing URLs on a server that the creating script was actually retrieved from.

I have made a work around (the categories menu doesn't actually use AJAX any more but appears the same). Follow the instructions as before, but use this script tag instead: <script language="JavaScript" src="http://da.vidnicholson.com/blogtags.php?dom=1"></script>.

Labels:

Sunday, July 09, 2006

Automated Word Speller

I have been working on a program that will spell out words. My aim is to turn it into an obfuscation service for websites that usually display e-mail addresses or bot prevention codes as images -- this program would allow them to also provide a sound file version of the text for visually impaired users.

Try it out; enter a word: (supports a-z, 0-9, @ and .)

Todo:

  • Output MP3 instead of WAV [ Done ]
  • Integrate with an image producing script [ Done ]
  • Make a flash player so that sounds can be easily placed on websites
  • Make use of public-key cryptography or a server side database so the text is not visible to bots [ Done ]
  • Publish an API for webmasters [ Done ]

Labels:

Friday, July 07, 2006

Very Easy Blogger Categories

I am a bit surprised that Blogger do not have a system in place for categorising blog posts. A quick Google search on the matter reveals that it is something a lot of people want to do but there are not really any elegant solutions available. The methods that I saw before I decided to make my own system involved creating a new blog for each category, or used the del.icio.us bookmark site, which does not allow for a very attractive user interface.

I have made a system that can be used by any website to categorise pages. Here are the installation instructions:

  1. Add this code to any page that you want to assign a category: <img src="http://da.vidnicholson.com/blogtags.php?tag=Category Name" />, replacing Category Name with the name of the category the page belongs to. (If you are using Blogger insert this in the Edit Html tab whenever you create a new post.)
  2. On any page that you want a list of categories to appear add the code: <div id="tagbox"></div> where you would like the list to appear and put the code <script language="JavaScript" src="http://da.vidnicholson.com/blogtags.php?dom=1"> </script> just before the closing </body>. (If you are using Blogger enter these in the Template tab.)

Update The bold text above reflects changes made to fix a bug.

Update Support has been added for other character sets.

...And you're done. No need to setup an account or password with me, no need to install any scripts on your server; as people start to view your articles through your 'permanent links' a category list like the one to the right will be generated for you.

How it works Including the img tag in each of your posts causes a transparent pixel to be shown. Whenever that image is loaded the referrer data is captured by my PHP script and your page along with the tag specified is added to my database (root URLs and archive pages are ignored so only individual posts should appear in your category lists). There is a delay of a few minutes before the page will actually appear in your category lists while the page is added to a queue for the server to verify it actually should have the tag given (this stops people spamming your category lists). If you later decide to remove a page from a category, just remove the img tag; it may take up to 24 hours for the change to be reflected in your category lists though. If you want a post to belong to more than one category, just use more than one img tag. For this to all work correctly you must have all your posts appearing on the same domain (e.g. myname.blogger.com) and be the only person using that domain. Including the JavaScript file and div tag in your Blogger template causes a nice AJAX category menu to be drawn into each of your blog pages.

Update If you want the names of the assigned categories to be displayed on each post instead of a transparent pixel, then use the following img tag: <img src="http://da.vidnicholson.com/blogtags.php?tag=Category Name&r=127&g=34&b=255&font=3" /> where r, g and b are decimal numbers between 0 and 255 specifying the amount of red, green and blue to use in the text colour and font is a number between 1 and 8 to specify the typeface that should be used.

Update I have added some true type fonts; font numbers 1, 2 and 3 are Times New Roman, Verdana and Arial respectively, 4 through to 8 are the older fixed width fonts.

Showing the number of posts in a category Change the Javascript shown above to <script language="JavaScript" src="http://da.vidnicholson.com/blogtags.php?dom=1&showcounts=1"> </script> if you would like the number of posts in each category to be shown on your blog.

Making a Backup If you would like your own copy of your category database as a backup just go to http://da.vidnicholson.com/blogtags.php?backup=yourdomain.com as often as you like and save the XML file that you are given. So, for example, to see my backup file go to http://da.vidnicholson.com/blogtags.php?backup=da.vidnicholson.com

All source code and related services that I release are "dontation-ware". If you use the above please make a dontation (pay whatever you think the it is worth) or (where applicable) leave the link to my site attached.

Labels:

Wednesday, July 05, 2006

An easier exam

Today I passed my driving theory test. Over the past two weeks I have had six driving lessons with my instructor plus some additional practice with my dad in his Skoda. I am on course to take and pass a practical driving test before the end of September which will mean I can drive when I move to Washington.

Labels: ,

Sunday, July 02, 2006

UK 3G coverage

Recently I switched to using a 3G capable phone but have not yet been able to make full use of it as I have not found any 3G network coverage. I found out today that the same phone when using the Vodafone network does get 3G service. This prompted me to investigate how much 3G coverage does differ between the different networks; my results can be found below:

The coverage winner appears to be 3. With each of the other networks providing more sparse coverage there does appear to be quite a few differences in the areas covered so it is worth checking the post codes for the areas you will be using your phone at the links below if you plan to use one of these networks.

Sources:

Labels:

A Picture is Worth a Thousand Words

I have created a new blog that I will be posting photos to directly from my mobile phone. I simply have to take a photo using the digital camera built into my phone and send it by e-mail to a 'secret' address (hopefully at 3G speeds if I can find coverage!). I have a PHP script on my server that is periodically run by cron to check for new mails and post them to the blog using the Atom API.

Labels:

Saturday, July 01, 2006

Water Cooling Update

Water cooling kit on my computerI have received and fitted my water cooling kit. Everything went smoothly and it is working great; I have not seen the CPU temperature exceed 30°C, and this is with the radiator fan running at low speed. I chose to unplug some case fans to decrease the running noise of my computer further, the motherboard temperature is now 46°C though which may be a little too hot. What is your motherboard temperature?

Labels: