Problems with languages

22nd April, 2011

Over the years, I've had many conversations about programming languages. Looking back on them now, they were mostly pointless. However, I think there are a few areas ripe for improvement.

Isolation

To date, compilers, editors and code management have all been seen as separate. This places bounds on improvements because parts taken and improved in isolation either aren't effective or have a detrimental effect on the system as a whole.

Storage

Almost all programming languages and editors read and write plain text files. This means that what the engineer edits, what the compiler sees and what is stored on disk are forced to be the same at all times. This has the following effects:

  1. it prohibits real out of band information, eg comments and inline documentation.
  2. storage can't be optimised for anything other than editing, eg use of a tree structure to aid language agnostic comparison tools.
  3. style can't be separated from content - where do you like to put your curly brackets? The compiler doesn't care so it should be an editor thing.

Code blocks

Code blocks are currently special in popular languages. This can be evidenced by trying to replicate if within the language using code blocks. For example, in Java, one would have to use multiple classes adhering to an interface or reflection to get the same thing. This is a problem when you're passing code blocks to other parts of the system to be run.

Chopping it all up

The code you write is rarely an island. Your product is not your code; your product is the sum of your code and many other components you didn't write. The management of your code within the context of the multitude of components making up your product is critical. This includes taking account of dependancies across versions and multiple versions of the same component within a system.

Forced optmisation

Here are two examples of creating a mutable hash table:

Functionally, they're are almost identical. However they are slightly different in that in the the Java example the engineer chooses the performance, and in the Cocoa example, the engineer leaves that up to the underlying API.

Neither is strictly wrong, but neither is quite right either. Java should not force the engineer into premature optimisation, but it's difficult to see how Cocoa can always get it right at run time. There are many examples of this kind of thing in most major languages, especially in the type system.

Solutions?

I suspect that a full versioned bundle that exists both on disk and within the version control system as an atomic object would be a good start. This would contain both source code and compiler output, along with dependancies and version preferences.

As for what the language itself would be like, I think it should at least:

  1. natively support multi-threading and the throwing around of code blocks.
  2. not contain anything the compiler can work out for itself. Anything not critical to program flow should be in a side channel.
  3. not present false dilemmas with regards to optimisation. This could be by allowing the engineer to state a preference in a side channel, or performance metrics from test systems to update the preference for specific platforms.
  4. put anything the compiler doesn't need but the engineer would like in a side channel (eg comments) or in editor preferences (eg style information).

On the UI of links

19th February, 2011

Here are three sentences - identical text, but with different linking styles:

All quite different. The final line shows the current Wikipedia style: a compromise between the extremes of the first two. It's pretty much the same for every other web page out there: a compromise between readability of the textual content verses the findability of the hyperlinks.

I propose that this is a false dilemma; possibly coming from an implicit belief that the page is static when viewing lots of text.

I think there are three states a user (and thus the page) should be in:

  1. Reading content, not interested in links at all.
  2. Looking for links.
  3. Checking the link is the right one.

Each transition between the user's state should be accompanied by a change in visuals. For example, the text below decorates links with underlines when the mouse hovers over the link (states 2 ↔ 3).

In addition, all the other links on this website should also change visuals between states 1 ↔ 2. If the user moves, the links appear. If the user stays still for three seconds, the links fade away. Interestingly, even though the fade is fast, the visuals just look wrong if it's not there.

For reference, I've implemented the 1 ↔ 2 state change as a small javascipt files called links.js.

2010 Calendar

15th December, 2009

I created my first calendar for 2008, a better one for 2009 and once again it's that time of year.

However, I'm still not quite content with the results of the 2009 calendar. Specifically, I don't like the month names down the left side as one has to constantly reference the left side of the page even when looking at a date on the right. This is even worse than the similar problem of week day names as the calendar is wider than it is tall meaning the text is even farther from where it is needed.

After many iterations and suggestions from friends I've come up with what I think is a reasonable solution. Each Monday box has an additional value - a three letter month value:

Monday labels

This solution means that month names are never more than three squares away but do not interrupt the user too much by being on every square.

So, here's the first version of the 2010 calendar.

2009 Calendar

15th January, 2009

In the dying months of 2008 I wrote of my efforts to design a better calendar.

I'm grateful to all the comments I've received. In response, I've made a few improvements:

Without further ado, here's the first version of the 2009 calendar.

Oatmeal and Raisin Cookies

7th December, 2008

Here's a recipe for making oatmeal and raisin cookies. The ingredients are the same as I was given but the method has been simplified somewhat.

Ingredients

175g butter
1/4 tsp salt (if butter unsalted)
160g light brown sugar
130g caster sugar
1 large egg
1 tsp vanilla extract
3/4 tsp baking soda (known to work without)
3/4 tsp baking powder
160g plain flour

170g rolled oats
200g raisins

Method

  1. Using one bowl, add everything up to and including the plain flour.
  2. Mix the contents together.
  3. Add the oats and the raisins
  4. Mix the contents together.
  5. Drop dough on to an ungreased baking sheet with a 5cm gap between blobs.
  6. Bake at 190°C for 10 minutes (in a fan assisted oven)
  7. Leave to cool

Kardashev scale

16th November, 2008

According to Wikipedia, "The Kardashev scale is a method of measuring a civilization's level of technological advancement." For reference the formula is:

K=log10(Watts) &minus 6
10

There's no variable for population, so my yearly average of 5.2 thousand Watts in 2003 would give me a measly score of −.23. However, I think my score should be the same as my civilization, which is Type 0.71.

So, I've re-formed the formula to factor in population while giving me approximately the same answer:

KP=log10(Watts) &minus log10(Population) + 3.4
10

All very good. Now imagine that I'm part of Type I civilization, what would my yearly average be? The answer comes to a staggering 4 million Watts. Just for me. A question for a science fiction author might be "What does a civilization look like if everyone has access to a few MegaWatts?"

Exchange rates

9th November, 2008

According to Wikipedia, the United Kingdom has a per capita GDP of US$37,328 which (according to Google) is about £20,223. Again from Wikipedia, average annual working hours in the UK is 1652.

So, on average, the UK worker is paid £14.40 per hour (before tax). What's interesting about this is that the calculation can be done the other way:

£1 ≈ 0.069 hours (4.1 minutes)

To put this in more personal terms, approximately 4.1 minutes of your life is worth £1. You'll never see that four minutes again; you'll never get it back.

Curtains

30th October, 2008

I love the BBC's iPlayer. There's just one problem - every few minutes my screen goes to sleep and I have to wiggle the mouse.

This problem can be mitigated by using a tool called Caffeine from Lighthead Software. Except I forget to switch it off and the machine stay active all night.

So, I've written my own Mac OS X site-specific browser for iPlayer and named it Curtains. When this application opens it goes straight to the iPlayer. When you're on an episode page, the screen will not dim.

So, if this meets your use case too, feel free to download and give it a go:


Curtains

Additionally, there is a project page.

Designing a better calendar

21st August, 2008

For the past few years I've been trying to acquire a copy of Edward R. Tufte's Envisioning Information and last week I succeeded.

I'd hoped for a book that would tell me what to do. I did get a little instruction, but this was in-between a gorgeous tour of both good and bad practice. It seems clear that the learning is in the doing.

Conveniently, I've just such a project in mind: my calendar. On my cubicle wall is a year planner. It's an A3 photocopy of a an A4 original and a bad photocopy at that.

So, I've tried to improve it, and the result is my 2008 calendar. Here a list of what I've changed:

I appreciate 2008 is half gone, but this is just a practice. I may improve it for 2009.

Georgia

26th July, 2008

Last year I published a small programming language named Flores. At the time it seamed that no-one could be productive with a language that limited. Well, one can indeed get a long way; Flores existed a good 4 months before the post and makes it 19 months old.

Inevitably one does need new features, a programmer cannot live by Strings alone. So lets create a version 2 of Flores, one with more features. The problem with that is that there will be some inevitable questions:

These are valid questions, but they shouldn't even need to be asked. There's nothing wrong with Flores, it's complete in its own right. That's what fulfilling the requirements means. Really what we mean here is: build a new (and different) language on top of the Flores source code and add fundamentally new features.

So, without further ado, meet Georgia. It has the following features:

  1. Everything Flores had at release 6 (unless otherwise stated)
  2. Natively works with Objects instead of Strings
  3. Allowes integers to be parsed without quotes. Eg 1 instead of "1"
  4. Digits are not allowed as part of function names.

Georgia is available here and as with Flores I hope you find it useful.

Marriage

24th May, 2008

Here in the UK we have so many ways of pairing up that it can get a bit confusing. So to help me work out which one's which I've put this little table together:

UnmarriedChurch marriageCivil marriageCivil partnership
Allowed to use the title marriage
Allowed to use religious wording during ceremony
Valid within religion
Full partnership rights under law
Next of kin
Right to be at partner's hospital bedside
Annulled if not children produced
Allowed joint adoption
Allowable combinations


I hope that clears things up.

Dear Scotland

21st May, 2008

It seems such a long time ago that we were married. I know that our courtship was long and difficult, and that I wasn't your first choice of partner; if you were to wed at all. I guess now, as our 300th anniversary itself passes into history, is a good time to take stock and decide if we're right for each other now.

It is true we married, each of us, for very different reasons. I remember at the time you may have felt you had no other choice, and I was not a chivalrous suitor. I know you haven't let those early hurts go; I'm sorry that I've never been able to make it up to you.

There comes a time in a country's life, whether they're ready for it or not, when they can't force their partners to stay. I fear my time has come, when I realise that all those thoughtless little things I did will be held against me. I know that you've been drawing away from me a while now and you may think I just don't care any more. Nothing however could be further from the truth: you're more beautiful today than you ever were. And it has been with a heavy heart that I'm getting ready to let you go.

Please know that whatever you may hear, I do want you to stay. Not anymore to have dominion over you, I know that time has passed, but because I like your company, the way you laugh, and all those other little quirks only an old couple can know about each other.

Yours, always

England

In search of a crime

20th January, 2008

Following on from In search of no crime it seems reasonable to spend a little time peeling apart the crime itself.

After a little thought it was clear that a crime can be split into three sections:

  1. Intent
  2. Action
  3. Outcome

For example, because the driver is concentrating on something else (intent), a car might be wobbling down the road (action) and hits someone (outcome).

What's interesting here is that the criminal justice system, ostensibly in the UK, works the other way:

  1. Detect outcome
  2. Detect action
  3. Ascertain intent

This is necessary because until we see an outcome from the crime, even if that's just someone witnessing it, a crime cannot be judged to have occurred.

To understand the impact of of all of this it may be worth looking at taking the perspectives of the 3 groups in In search of no crime. Here's a table showing what part each group plays in the 6 events from above:

PerpetratorVictimOnlooker
Intent   
Action   
Outcome   
Detect outcome   
Detect action   
Ascertain intent   

How these different perspectives affect things is left to the reader.

The game is on

28th June, 2007 with responses from kyb and John

Think of a game. Now, it's likely that the game you've thought of has these three characteristics:

  1. a winner
  2. a loser
  3. an end

A critical point seems to be that until the end of the game there is neither a winner or loser. For example, it makes sense to say "who won the 1997 boat race?"; yet it makes no sense yet to ask "who won the 2097 boat race?".

Now, imagine a game with the following characteristics:

  1. it only ends when the last player leaves
  2. players can play individually and in any number of teams at the same time, and can change teams at any point
  3. players time in the game is finite
  4. players can be actively removed from the game
  5. most teams take the removal of a member very seriously
  6. a losing team always gets another move, even if a proxy carries it out.

It's very difficult to see how one could ever win such a game, or in fact what winning would even mean in such a context.

Now, lets take a specific example of a specific game that most people would characterise with the fist list: a World War I. It seams to fit, there was a winner, a loser, and an end (11 November 1918). Except it didn't, the loser's kept on living and got another move: World War II. All real life conflicts like war, terrorism, gang warfare, or a dispute with your neighbour, are actually of the second type of game, not the first.

Which is unfortunate really; just when the winner basks in glory the loser makes another move. Pity the winner.

Flores

12th April, 2007

Just over a year ago I wrote the post entitled Yet Another Programming Language. That particular project hasn't quite been finished yet. However, I have written a very small execution engine in Java named Flores.

Flores has the following features:

  1. One data type - String. Well, two if you count the singleton null.
  2. The while operator, complete with continue and break.
  3. The if operator, complete with else.
  4. The = operator.
  5. All functions are defined externally in Java as static methods. These have to be added to a Flores engine object at Java runtime.
  6. No functions by default. The developer needs to add them.

This may look like an odd features list, but there is method in the madness. I have often needed a small scripting lanaguage with one or more of the following features:

Flores is available here. If you have some of the same criteria that I do, hopefully you'll find it useful.

Tax Loopholes

4th March, 2007 with a response from kybernetikos

The dictionary on my computer defines a loophole as "an ambiguity or inadequacy in the law or a set of rules". However, in most countries, the law is defined to be correct; one cannot plead in a court that the law is wrong. If the law is defined to be correct, a loophole, tax or otherwise cannot exist.

However, let's consider the following situation: Alex normally pays £10,000 in tax per year. However, upon reading the Inland Revenue rules, notices that only £6,000 need be paid. What should Alex do? Remember, while a payment may be morally questionable, both are entirely legal.

Clearly, the difference can't be described as tax because Alex isn't compelled to pay it. Therefore, Alex would be making a £4,000 donation to the state.

Isn't Alex nice.

Choices

4th March, 2007 with a response from kybernetikos

The word choice is very popular in our country these days.

On the surface this is a great idea, but it's important to remember that a choice is only truly free if one's choice isn't affected by another's.

Say Alex and Chris are given the choice of 3 holidays: Norway, Kenya and New Zealand. But if there is only one vacancy per destination Alex and Chris can't both choose Kenya. Not really a free choice.

In order to have a free choice there needs to be at least as many of each option available as there are choosers.

So, imagine we have 450 children and 3 schools. In order to be completely free choice each school needs to make avaliable 450 places: 1350 places in total. However, there are only 450 children, so 900 places will be wasted. This may cost nothing if it takes a school less than 6 months to create a place. If however it takes longer, an actual place, with classes, buildings and the land to put them on need to be built in anticipation of a child coming; but with only a 1 in 3 chance of a child actually coming.

It is clear therefor that, while it is possible to attain this level of choice, it's quite expensive. Oh, and it was your money.

And the moral for this little story? When someone offers you a choice, find out who's paying for it before accepting.

In search of no crime

3rd January, 2007

This post starts with the premise of lowering the crime rate to zero, or as close to it as possible. This post will not discuss the merit or otherwise of such a premise.

It is clear, if a zero crime rate is to be achieved, that when a crime is committed each member of the society needs:

  1. to be persuaded not to commit the crime in future
  2. a mechanism by which they may put the event in the past and move on

However, each member cannot be treated in that same way. For instance, the perpetrator should probably be treated differently to the victim. With this in mind, I've split the society into 3 groups:

We thus have 6 factors that need to be accounted for in any proposed solution. A solution that takes account of all 6 satisfactorily has, for now, been left as an exercise for the reader.

Pilgrim's rest

28th October, 2006

Russian roulette at 30 miles per hour

13th September, 2006 with responses from kyb, MattLG, John, Roo and Ben Walsh

Russian roulette is viewed, almost mythically, by many people as the most dangerous game one can ever play. Really? Well, for a start, it should beat minor traffic accidents.

The current campaign in the UK tells us that in an incident at 30 mph 80% of pedestrians survive. That may sound pretty good until one calculates that the survival rate for Russian roulette is greater than 83% (5/6). I say greater because not all players die, even if shot in the head.

As with all dangerous activities, there is also a risk of serious injury. Being hit at 20 mph is no picnic, but pull the trigger with an empty chamber and you're not going to feel a thing.

In fact, on the whole, making every possible effort not to hit people, in any way, is probably the best policy. It is interesting, though, that the scenario seen as a reasonable compromise really isn't. At all.

The physical network stack

5th September, 2006 with a response from kyb

For a while I've been trying to work out what the difference is between the road and rail network. Specifically, I'd like to know why the rail network was fantastically successful in the 19th and early 20th centuries, but has been comprehensively beaten by the road network in the later 20th century.

In order to make comparisons easy I have decided to split physical networks (as opposed to data) into a stack:

  1. Pathway layer
  2. Link layer
  3. Vehicle layer
  4. Object layer

By way of example I have created this table of a few choice networks:

RoyalMail™ Rail Road
Pathway Any of the other physical networks Track Motorways (freeways), roads, tracks, fields (depending on vehicle), the rail network, ferries
Link Sorting office, postbox Stations, terminals Gates, road junctions, garages
Vehicle Envelope, parcel Rolling stock Cars (and taxis), lorries (trucks), buses (including coaches), tanks, tractors, combine harvesters, motorcycles, bicycles
Object Any inanimate object up to 20Kg Pretty much anything Pretty much anything

From this a few interesting questions arise. For each network:

  1. who controls each of the layers,
  2. by how much,
  3. and how does that control affect other users?

I'll admit that I haven't thought about those yet, but hopefully this exercise has brought me closer to answering my original question. I'm just not quite sure how.

Marking multiple arbitrary points on Google Maps

27th August, 2006

This post is a follow up to Markers at arbitrary points on Google Maps I wrote last year. At that time I noticed the following failings:

This has now changed with the addition to Google Maps of something called KML which was previously only available on Google Earth. It appears that KML allows one to mark multiple points by:

  1. Creating an XML file containing all the points one wishes to describe,
  2. Making that file accessible to Google Maps

In order to show this in action I have created the file oaklands.kml. The following things should be noted:

  1. The <Point> tag is set out in the following way: longitude,latitude,altitude. This is different to points entered into Google Maps query box which are in the format: latitude,longitude.

  2. tags should not be written with any slashes in.
  3. All the <description> tags I've seen have their data contained within <![CDATA[ ]]>. I suggest you do the same.

Now, all that remains is for me to present an updated Google Maps link for Oaklands Community School.

Rape on trial

24th July, 2006 with responses from an unknown person and John

This post was prompted by an episode of Panorama (shown on the BBC) entitled Rape on trial.

I've never quite been comfortable with the way the rape as a crime is set up. After a good discussion with Miss John, my perspective stems from imagining the following scenarios.

Imagine the situation given that all of the following are true:

  1. Alex wishes to have sex with Chris
  2. Alex and Chris have sex
  3. By some magical mechanism, we can clearly see what is going on inside Alex's and Chris' head

Given these, I can see 4 outcomes:

Alex believes Chris has not given consent Alex believes Chris has given consent
Chris has given consent A B
Chris has not given consent C D

A

This is a disturbing situation. However, even though we can detect Alex's thoughts Chris can't. Also, Chris is not materially hurt by this.

B

Two people having consentual sex (and hopefully a good time)

C

This is clearly rape. Alex believes that constent has not been given but continues to the detriment of Chris.

D

Alex essentially has a catastrophic misunderstanding of Chris's wishes. This is not a deliberate misunderstanding, we would be able to detect that. However, while this might be seriously negligent, I would be very uncomfortable convicting Alex of rape. I would suggest some extensive education for both Alex and Chris to make sure that in future, they both read and give out the correct signals.

My problem here is that the above analysis raises more questions than answers:

My Strengths

24th March, 2006 with responses from Kaman and Rachel

A few months ago a very good friend of mine bought me a book entitled Now, Discover Your Strengths by Marcus Buckingham and Donald O. Clifton. This book allows one to undertake an online test to find out what one's strengths are.

It turns out mine are:

Imagine

28th February, 2006

Imagine the perfect journey; what would it be like?

For me it's a journey in a car that just flows by. I don't have to stop at roundabouts; rather, as I approach junctions, a space appears just in the right place at the right time for me to fit in. As I come down the slip road, drivers courteously move into the next lane to let me in, just as others do the same for them. And at the end of my journey, there's a parking space; not too small, nor too large, but just right for my vehicle to fit squarely in the middle. In short, a set of almost perfect moments.

For me though, perfection requires more. It's a journey, where not only do all those things happen, but I make them happen for all the road users around me.

Yet Another Programming Language

7th February, 2006

For a while now, perhaps the last 15 years, I've had the urge to write my own programming language. I know that there are thousands of people qualified to build a good language, but deep down, I still reckon I could build something better.

But here's the rub: better than what? In what way, and why? Well, here is the set of criteria on which I am basing my language:

  1. it will be written by me
  2. it will be interpreted
  3. the scripts in the language will be readable
  4. the source that implements the language will be readable
  5. the implementation will be in C
  6. and none of that fancy C either
  7. the source will, if possible, total less than 1000 lines

To answer my questions, for me, the closer a language comes to meeting the needs laid out in one's set of criteria, the better it is. If your favorite language, or maybe the one you've just written, doesn't match the above set (ignoring #1), that's not a problem. You just need to make sure it matches your own criteria.

The point to note about the above list is that I came up with it before I started designing and writing the language. I've stuck to it too, otherwise by my argument, the language wouldn't do what I wanted and would therefore be pretty useless.

I'm still writing my language; I don't feel I want to show it to the world before at least the core is complete. What I will say is that at home I've been working on little else since a few days before Christmas. However, the experience has already been fruitful in that at least one lesson has become very clear: do not design and write a programming language.

Becoming An Early Riser: The Aftermath

16th November, 2005

Eight weeks ago I started getting up at 7am and I can say that there have been a few changes in this house.

I'll admit right now that I don't always get up at 7am. It usually happens for one of three reasons:

It's definitely been an education and I'm happy to say that I've learned a few things:

  1. Really, the worst thing that can happen when you wake up is to press the snooze button. Just don't do it.
  2. If you go to bed too late then you can safely set your alarm a little later than normal. As long it doesn't become a regular thing.
  3. Make sure you come to some kind of concensus with those who share your life. Otherwise, you may be asleep when they want you to be awake.

As a result of this exercise I now class myself as an earlier riser. That's nice, but I think the critical lesson for me has been self control. I now worry less about going to bed late because I know that I can get up when the time comes. That's very liberating.

So, for me it was well worth it. My biggest piece of advice to any potential early risers would be: Take a pair of pliers to your alarm clock and rip the snooze button off.

Death is Nothing at all

29th October, 2005
Death is nothing at all. I have only slipped away into the next room. I am I, and you are you. Whatever we were to each other, that we still are. Call me by my old familiar name, speak to me in the easy way you always used. Put no difference in your tone, wear no forced air of solemnity or sorrow. Laugh as we always laughed at the little jokes we enjoyed together. Play, smile, think of me, pray for me. Let my name be ever the household name that it always was, let it be spoken without effort, without the trace of a shadow on it. Life means all that it ever meant. It is the same as it ever was; there is unbroken continuity. Why should I be out of mind because I am out of sight? I am waiting for you, for an interval, somewhere very near, just around the corner. All is well.

Henry Scott Holland

Rules of the road

28th October, 2005 with responses from kybernetikos and John

There are some things I take very seriously, and driving is one of them. If you believe that the roads can be made a better place simply by lowering speed limits then I'd like you to put your money where your mouth is by performing a little test:

  1. Find a brick or concrete (your choice) wall
  2. Stand 30 metres away from the wall
  3. Sprint towards the wall as fast as you can
  4. Do not stop or slow down until you have hit the wall
  5. Tell me that speed limits are the only requirement for road safety

If my calculations are correct you just hit that wall at around 20 miles/hour (9 metres/second). Now if you managed all the points (including 5) then I'm frankly astonished. Just to see how true you are to your beliefs I'd like you to perform one more test:

  1. Stand still
  2. Be hit by a wall going 20 miles/hour. It's hard to find a moving wall so try using a family car in place of the wall.
  3. Again. Tell me that speed limits are the only requirement for road safety.

Still, I suppose it's better than being hit at 30 miles/hour. However, I think you'd agree that it would be stupid to hit or be hit by a wall in the first place; and that's exactly my point.

Most people would agree that speed limits should not be the only method of road safety, but when we look around the world at what goverments and pressure groups do to directly affect drivers' behaviour it basically boils down to "Drive slower".

I expect and demand better. So should you, of yourself and of others.

I suggest we start at the beginning and remind ourselves of what the axioms for driving should be:

  1. Do not hit other road users (pedestrians are road users too)
  2. Do not, through your actions, cause any road user to hit any other road user

Now all we have to do is follow them.

A JavaScript Calendar

16th October, 2005 with a response from MattLG

As I've said before, Google maps are great; this time the starting point is the dragging. After quite a while using the site I started to think about what other tools could benefit from the dragging treatment.

Google maps style dragging seems to work with any tool that has the following properties:

After some thought, I realised that it doesn't matter what the tool is, the mechanism is the same:

  1. Create a window on to the larger tiled space
  2. Move that window around the space in response to dragging
  3. If the space is too large to hold in memory then seamlessly add and remove tiles as needed

The first one to my mind was the calendar, which I decided to build. Before talking about the issues I had building a drag-able calendar, here is the demo.

Right, I trust you've had a good play. I'm not going to tell you exactly how I did it here because frankly you can look at the source code. What I will describe here are the few major problems I had to deal with:

This is my way of saying I'm sorry the code isn't perfect. I didn't create an event model for the calendaring system like Google maps has, mainly because I don't really understand fully how the built in ones work.

This was a major headache. When you create an entry the current row expands (try it if you haven't already) and overlaps with the one below. I couldn't work out which one had moved until I realised that only the bottom edge moves. So if two rows overlap, it was the top one that changed and we need to move the bottom one down. Easy.

As you may have noticed from the demo, the range of dates is huge. The built in Date object doesn't seem to be able to cope with this and still give accurate days of the week. Also, if one tries to add or remove an arbitrary number of days, weeks or months, the result is a complete mess.

Thus I wrote my own, called DateTime. The code in quite a few major places is directly copied from the SQLite date code. The interface has been written differently because I wanted an almost drop in object to replace my Date code. I'd just like to say that I think the ideas behind the date modification code (DataTime.modify()) are inspired: just being able to change the date so easily is brilliant.

I did start work on storing the entries (you've probably noticed they vanish on reload or zooming) but it was taking forever. It's fair to say that I'm not really one of the world's completer-finishers: I'm interested in fleshing out new ideas, but only to the point where I know they work. So, there you are: A JavaScript Calendar.

Markers at arbitrary points on Google Maps

8th October, 2005 with responses from roo

Google maps is great: being able to find anything in the UK with just a postcode is very nice. However, sometimes the marker that it places on the map for you is not quite right.

For instance, SO16 8BY is the postcode for Oaklands Community School. The marker it places on the map for you is at the wrong end of the street which is very annoying. It turns out that it's possible to take the latitude and longitude from a google url and pop it directly into the query box. Thus the actual location if Oaklands School, 50.942002, -1.453006, can be shown.

The best way to obtain the lat/long of a point is to take a blank map, center the map at the desired point (say by double clicking at that point) and click on "Link to this page". The lat/long value you want is the bit in the url after &ll= and before the next &.

As an extra bonus, Google Maps allows one to add more or less arbitrary plain text into the marker overlay, by placing it in brackets after the query in the search box. So the final map would be: Oaklands Community School.

Rich Dad, Poor Dad

25th September, 2005 with responses from kyb and Chris Lautischer

I recently read Rich Dad, Poor Dad by Robert Kiyosaki et al. I thought it was so good that I went on to read Rich Dad, Poor Dad 2: Cash Flow Quadrant.

Unfortunately, this has caused a few problems with my friends. When I get excited about things I talk about them, unceasingly. My friends are truly wonderful people, but there's only so much anyone can take. Not good.

So what follows is an explanation of what I thought Mr Kiyosaki was talking about. I bought a flat last year for approximately £100,000. I could afford this place because although the mortgage (plus a few other costs) was about £250 per month more than my previous rent, I had more than that left over every month. All very nice, but would you spend £100,000 based on just that logic?

Of course you wouldn't. You'd:

  1. take inflation into account to count against house value appreciation and payment depreciation over the full 25 years of the mortgage
  2. take into account the various costs and limitations you will incur by signing up to a 25 year contract
  3. work out the total cost of renting, taking into account savings and investments gained (say with the £250 left over every month)
  4. make sure you have a financial plan for the next 25 years before you sign those years away to the bank
  5. do lots of other things I can't even think of because I do not have sufficient financial education

I know you would, because failure to do those things and more before spending a total of £200,000 (with interest most people pay double the buying price to the bank) over 25 years would be insane.

The point that I took away from the book is that I do not have sufficient financial education to make competent decisions about my life. I cannot blame anyone else, it is my fault. Further more, now that I recognise this, it would be incompetent of me to continue to abdicate from my financial responsibility to both myself and loved ones.

Becoming An Early Riser

20th September, 2005 with a response from Roo

A few months ago (my delicious account says early July) I read an article entitled How to Become an Early Riser by Steve Pavlina. I haven't been able to get up early without being a danger to both myself and others since I was 10 years old but I've always lamented losing so much of my time.

So, starting last Tuesday morning I began following the Steve Pavlina path to early rising. My normal pattern is to sleep from 1am to 9am. My plan was to get up at 7am and go to sleep when I was tired. Eight days later and I've learned quite a lot:

  1. I still sleep about 8 hours a day, I now go to sleep at 11pm. This is annoying as the whole point of this exercise as to give me more time.
  2. The first week has been hard. Really hard.
  3. Breakfast usually gets me through the first 3 hours of my day until lunch time. My day now starts 2 hours earlier so I'm famished by 10. I now have a stash of apples to keep me going. Five-a-day here we come!
  4. My daily routine is now out of sync with Mrs John. She is understandably not happy with being woken up 2 hours early or losing 2 hours with me in the evening.
  5. I never knew that there was an actual Saturday morning.

Has it been worth it? Even though I've not gained any time by doing this, being able to get up earlier than 9am is a definite skill even if I don't use it often. Also, gaining half a day I never knew existed has been quite nice.

Will I carry on with the minimum of a month that Steve suggests?

One day at a time.

The lot of women and men

24th August, 2005 with responses from cocoabeans, kyb, MattLG and Clifford Brock

Put these in order of importance:

Now imagine 2 groups: one has a greater relationship with their co-workers and one with a greater relationship with their children. The first group has more access to political power, the second more access to their children. Which group would you rather be in?

I think neither group is totally happy with their lot. It does, however, do well to remember what each group is missing and how sad that is.