9 Simple Rules For Financial Security

Scott Adams, the guy who writes Dilbert is undeniably a smart and funny guy. If you don’t read his blog then you should add it to your daily reading list now. Apparently he was up for consideration for the Nobel Prize for Economics recently. He didn’t win it but his 9 rules for financial security seem incredibly sensible to me:

  1. Make a will
  2. Pay off your credit cards
  3. Get term life insurance if you have a family to support
  4. Fund your 401k to the maximum
  5. Fund your IRA to the maximum
  6. Buy a house if you want to live in a house and can afford it
  7. Put six months worth of expenses in a money-market account
  8. Take whatever money is left over and invest 70% in a stock index fund and 30% in a bond fund through any discount broker and never touch it until retirement
  9. If any of this confuses you, or you have something special going on (retirement, college planning, tax issues), hire a fee-based financial planner, not one who charges a percentage of your portfolio

Not all of the rules translate directly to the UK (401K and IRA are both pension related) but it’s pretty close so this list is going to become a bit of a target for me over the next couple of years.

As the article about this says, this is pretty obvious stuff, but the real skill comes in expressing the rules in such a simple manner. I think most of us in our technical fields are probably guilty of not communicating clearly, Scott is as good a person as any to model your style on I think.

Last.fm

I’m probably running a little behind the curve here, but I heard about Last.fm this weekend. It’s a piece of software which you can download (for free as is usual in these Web 2.0 days), enter your favourite band name, press play and you get similar music which people have tagged with the band name played live over the internet for you. If you’re getting bored with your iTunes collection or just want to find some new music it really is a superb mashup of social networking and music.

Mac Client for Notes on Macrumors

The new client for Notes on the Mac has got a mention on Macrumors, good news in itself. What’s even better is the tenor of the responses on the site. So far there is only one (out of 16 so far) that is of the “I hate Notes” variety, all the rest are either very positve or neutral. Is this the beginning of a turnaround?

Oh and I’ve just installed the new 7.0.2 server and clients on my Windows machines, not a single problem (of course) and the new templates for blogging and RSS look pretty good so far.

Working for Google

I was reading the latest posting on Stevey’s Blog Rants talking about Agile programming, frankly I was skimming it but then came across the section called "The Good Kind" where he describes the environment at Google where he works. It sounds like a developer’s dream…


– there are managers, sort of, but most of them code at least half-time, making them more like tech leads.

– developers can switch teams and/or projects any time they want, no questions asked; just say the word and the movers will show up the next day to put you in your new office with your new team.

– Google has a philosophy of not ever telling developers what to work on, and they take it pretty seriously.

– developers are strongly encouraged to spend 20% of their time (and I mean their M-F, 8-5 time, not weekends or personal time) working on whatever they want, as long as it’s not their main project.

And there’s a lot more, go have a read, it’s a long old boy of an article so you’ll need 10 or 15 minutes. I was wondering whether that sort of approach to development would work in a more traditional environment, like an insurance company or a bank. Now obviously there are certain things which just have to be done as they are regulated in the financial services industry but I think a lot of the more peripheral projects which are not business critical (normally the sort of things I work on being a Domino developer) could benefit a lot from this style.

It would take a manager with enourmous cojones because he would inevitably take a beating from his bosses but in the medium to long term the pay-off would be great. I’ll give you my reasons but guess other’s might disagree…

Generally the developers on a project will have better ideas for what an application actually needs than the owners of that application. Once the business process is understood (often the business don’t even know this part which is just scary) the developers by their natures will be organising the application around the best workflow, ideas and so on because, assuming the right incentives are in place, they’ll have a good reason to. Even the "boring" tasks would be made attractive if the project team is given autonomy over the what, how and when elements.

Of course there are problems, Google hires the best people who are well motivated before they even arrive, but whenever I struggle with motivation for a project it’s usually because there are crappy political struggles going on, or the whole approach is wrong and I have no control over redirecting the deliverables, it’s not because the underlying development doesn’t hold some attraction.

The biggest challenge in all of this is to find a manager and a company where it would be allowed. Now I wonder if Google are looking to hire a Domino developer?

Posting to a Form for AJAX validation

I am guessing that this has been done before elsewhere but it was a new idea for me anyway.

A couple of weeks ago Julian and Philippe were talking about using the Scriptaculous Autocomplete feature. Philippe had the cracking idea of using a page to do DBLookups on the fly to provide JSON data.

While on the train this morning I came up with the idea of performing complex form validation using a similar technique. The sort of thing I am thinking of is uniqueness checking, complex business rules and so on but without the overhead of firing up an agent to do the processing, submitting to a form will do that same task much faster.

It’s definitely worth having a read of Philippe’s article that I mentioned earlier. What I am proposing is that rather than running a "GET" request from a page which he suggested for the autocomplete tool, that we create a simple form which we "POST" to, to make sure that all of the fields are valid, before submitting the "real" form to be saved. Let me describe things in a little more detail. I have a form which is registering a new user for an application. I need to make sure that the company name of the user is valid and that his email address has not been used for any other users that are already registered. Now this is pretty simple stuff to handle with normal form validation or webquerysave agents but I am not a big fan of the user submitting, waiting for a screen refresh only then to be told they’ve got something wrong.

So instead, before submitting the form, we run some javascript which creates an AJAX request (as usual I am using Prototype but you can use your preferred framework). My submit function looks something like this:

function submitClient() {
//Now we do the server side validation
var a=$H(
{
clientnameandcode: $F("clientnameandcode"),
email: $F("email")
}
);
var myAjax = new Ajax.Request(
'/validateNewclient?createdocument&rand=' + Math.floor(Math.random()*1001),
{method: 'post', parameters: a.toQueryString(), onComplete: submitclientContinue}
);
}
function submitclientContinue(jsonDoc) {
if (jsonDoc.responseText == "\n") {
//All the validation has been passed so submit properly
document.forms[0].submit();
}else{
//There are error messages so display them in a div on the form
$("validation").innerHTML = "

" + jsonDoc.responseText +"

"; $("validation").style.display = ""; } }

The two fields I am interested in, clientnameandcode and email are posted to the form called "validateNewClient". The form then has the following design:

The things to note are…

  • The SaveOptions field which is set to "0" to prevent the document being saved
  • The two data fields which match the parameters sent in by the AJAX request
  • The $$Return formula which actually does all of the validation work, it just computes some response messages where there are errors, or empty string for successes.

    Now the only "hack’ I’ve had to do is with the return value from the $$Return, where because @SetHTTPHeader("Content-Type"; "text/text") doesn’t work I have to redirect the message I want to return to a page where I can format the message as simple text to be returned to the AJAX request.

    This isn’t an approach which I would recommend for every situation, but where you have relatively complex business rules which need to be validated and the network can handle the extra load etc then I think it’s quite neat.

    Of course the one caveat is that with client side validation you must always, always double check on the server side to prevent sneaky people circumventing all of the Javascript you have written to make their lives easier!

    Technorati Tags: Show-N-Tell Thursday

  • Hardware consolidation

    Now that it looks like I will be moving fairly soon I need to think about consolidating all of the “stuff” I own, not least all of my geeky hardware needs to be rationalised. Until recently I had 5 different computers in the house which is just ridiculous.

    So today I have been gathering everything I need down onto two machines, my laptop which is really now my main machine for work etc. and the iMac which is going to perform multiple tasks at once. Firstly I installed a Windows server onto it using Parallels, that will be running all the time in the background and will be running the Domino server which hosts this site.

    I’ve also gathered all of my media, music, photos and movies onto this machine as well, the plan being that it will sit in my lounge and act as a media server as well (thanks to Front Row). A rather cheap way of killing several birds with one stone. Now of course this is all a hell of a lot of strain to put on one computer so over the next couple of weeks I’ll need to monitor the performance and stability of the website. So if you see any problems that will be the source and I apologise in advance.

    House move progress

    Things have been very quiet here over the last couple of weeks simply because there aren’t enough hours in the day. I accepted an offer on my house over two weeks ago but after that had to start looking for somewhere to live.

    Being honest I thought finding a flat in London would be easier than it has proved to be. About ten days ago I found somewhere I wanted to put an offer in on and phoned the bank to confirm my mortgage agreement in principle. Unfortunately because of a couple of things earlier in the year (when I took a couple of months off work) the application took longer than anticipated and so I lost out on the flat I wanted to buy.

    No matter, I had a second choice of place which I then proceeded to put an offer in on. Unfortunately the people selling that one decided that they were going to take it off the market the same day I offered! Beginning to think that I was being conspired against I started looking again. This is where it gets interesting. I found a place I really liked on the River Thames looking across to Canary Wharf, the problem was that the flat was quite a bit above my (self imposed) budget. I decided to take a punt to see whether my luck had changed and as expected the offer was rejected out of hand. I returned with a slightly higher offer but still much lower than the asking price and just sat and waited. Well last night I got a call to say that, shock, horror, my offer has been accepted.

    This is great news as I think I’m getting a great deal, now I just have to try and get everything moving with the solicitor and bank as quickly as possible. But hopefully it means I’ll be moving some time towards the end of October, or beginning of November assuming that there are no more problems.

    My commute will be dropping from just under two hours each way to under 30 minutes. Not sure what I’m going to do with all the extra time! Woohoo!

    Using profile documents in a web application

    A very quick tip for the non-admins out there today.

    I am looking after an app which uses lots of profile documents on the web. It’s not the way I would choose to do things because whenever you change the configuration in a profile document it takes ages (up to half an hour) for the change to be consistently available over HTTP.

    To get around that I found a new server console command which makes any change take effect immediately…

    tell http clearcaches

    It was new for me anyway, hopefully it will help someone else out.

    Technorati Tags: Show-N-Tell Thursday

    Computed For Display removes fields

    It’s not Thursday I know, but what the hell.

    OK, this is one which I am guessing that I should have known but I am convinced that Domino used to work in a different way. What’s the situation?

    Well, we have a document which is edited on the web. The document has a field on it called “MyField”, the form which is used to display the document on the web has a computed for display field with the same name. We are finding that when the document is saved, that “MyField” is being removed from the document.

    This seems entirely correct if looked at in isolation, computed for display fields are not saved. But the reason I am posting this (and am entirely expecting to get abuse for being such a dumb-ass) is that I am convinced that in previous versions (I am thinking in the R5.x timeframe) that the field would not be removed from the document, instead whatever was stored in the field would be used by the computed for display field regardless of the formula in the field on the form.

    So am I just remembering incorrectly or has the way that Domino works changed at some point in the last few years?

    It’s not a big issue, we just changed how the form was working, just a little unexpected.

    Technorati Tags: Show-N-Tell Thursday

    Busy couple of months ahead

    Things are quiet on here at the moment as other things in life are taking over. Work is settling down to a constant state of mayhem but then that’s how I like it, nothing worse than having nothing to do. The main project which I was brought in for also seems to be getting towards the end of the spec-writing stage so lots of coding to look forward to.

    But the main news is that I’ve sold my house so I need to find somewhere new to live. The plan is one I’ve had for quite a while but events conspired against actually being able to move. In the last year the market has picked up quite a bit and because I’m in a fairly long contract at the moment it seems a good time to finally make the move down to London. The fact that the trains have been an absolute nightmare over the last couple of weeks only makes the prospect of a much shorter commute all the more appealing.

    The hard work begins now though, I have an offer on my house but I haven’t found anywhere to buy and when I do we’ll have quite a long housing chain which are notoriously difficult to manage and often break down. Hopefully my solicitor will be able to keep things on track. But in the meantime I have to find somewhere to live, I have a load of property viewing booked in various areas of London this week, hopefully something will be right for me. Obviously moving into the city I am going to be losing a lot of space, currently I’m in a three storey house with three large bedrooms (one of which is my office). The most likely place I’ll be going to is a two bedroom apartment, probably without car parking. Lots of "consolidation" to do over the next few weeks of all of my accumulated crap, but it’s good to have a serious clearout once in a while.