Where magic lives

Wednesday, January 31, 2007

Funny book

I was passing the time away in Waterstones the other day and started flicking through a copy of Code Complete.

The extract shown below actually made me laugh out loud... twice:

Funny extract from Code Complete

Labels:

Saturday, January 13, 2007

Fixing Windows

Ok, I used to do technical support a while back (for a local computer retailer). The trouble is a person can only take so much technical support work before they do all they can to avoid it (ask any geeky computer scientist type whether they'd prefer to troubleshoot a problems with some Windows drivers or write a Sudoku solver). It becomes far to easy to write off the majority of computer users as porn addicts on a kamikaze spyware installation mission and one even tries as hard as possible to avoid ones own problems.

Well, I'm not a spyware junkie, but my computer has had a problem for a while now. After it has been on a few days it will decide it doesn't want to draw any more windows. You'll try to, fire up a new browser window, maybe even right click on a button in the task bar, each action ends in the same "Exclamation" sound, a sudden beep, no new browser, no context menu. You have to close one window before you can open another (by double clicking the control box of course -- remember, no new popups allowed). Quite frustrating, and most unexpected for a computer with 2GB of physical RAM and large page files on two different physical hard drives to choose between.

It was time to act, be my own technical support expert, and there is no easy way out with blaming the user here...

At first I wanted to blame Directory Opus or GVIM, these were usually the programs I was dabbling in when the problem occurred. One or both may be at fault, or I may be jumping to conclusions as very often when I am in a frenzy of work new instances of both of these applications will be loaded at an alarming rate. I went looking for a more low level solution and came across this little gem: <hi84d.130$hIO1.7@news04.bloor.is.net.cable.rogers.com>

Adjust your desktop heap size: HKLM\System\CurrentControlSet\Control\Session Manager\SubSystems.

The "Windows" value has a long string, including "SharedSection=xxxx,yyyy,zzzz". The second number (yyyy) is the one that you want to increase. It is probably at 3MB (3072) which allegedly supports 15,000 elements (windows, menus, etc.). While arbitrarily high values are not recommended, other users found 8MB fixed the problem (8192).

I took the advice, and all seems good so far. Quite possibly I have some software somewhere to blame. Maybe I have just delayed the time it takes for this behaviour to occur. But initial tests are looking good.

What a 5* service, I wont even test my prediction that a call to technical support for my hardware vendor would result in the good old format/reload.

Labels:

Wednesday, January 10, 2007

One Laptop Per Child

The "One Laptop Per Child" inititive is a project to get 50% of the world's population connected to the Internet by distributing very low power, low spec laptops to children in 3rd world countries via their governments. I haven't kept up to date with its development at all but the hardware and software is getting close to being finialized and I found this summary very interesting to read.

Labels:

How to fix Media Center

The last Windows Update for Media Center managed to break my installation. I started getting a notice saying something along the lines of "Some files needed to play back radio or tv are missing or corrupt, try restarting your computer" whenever I paused a video and tried to play it again, and the entire application would crash when pressing the green button to return to the main screen.

I ran through the steps described on Aaron Stebner's WebLog and found that doing the following fixed my problem:

  1. regsvr32.exe atl.dll
  2. C:\WINDOWS\eHome\ehSched /unregServer
  3. C:\WINDOWS\eHome\ehSched /service
  4. C:\WINDOWS\eHome\ehRecvr /unregServer
  5. C:\WINDOWS\eHome\ehRecvr /service
  6. C:\WINDOWS\eHome\ehRec.exe /unregServer
  7. C:\WINDOWS\eHome\ehRec.exe /regserver
  8. C:\WINDOWS\eHome\ehmsas.exe /unregServer
  9. C:\WINDOWS\eHome\ehmsas.exe /regserver

Labels:

Tuesday, January 02, 2007

Converting between Latitude/Longitude & OS National Grid Reference points in PHP (another fun postcode map)

I decided to have a play around with the Google Maps Javascript API. Seeing as I recently acquired the UK postcode database I thought I'd plot postcodes onto Google Maps.

The tricky part turned out to be converting between the grid references used in the PAF and latitude and longitude. Fortunately I found a page explaining how to do the conversion in Javascript. I needed the conversion to be done server side so I have ported the code to PHP [source].

To play with my map go to this page. To stop people screen scraping my postcode database the script will stop working after you have moved the map more than 200 times.

Labels: ,