logo

Rockall Design Enters 10th Year

Rockall Design was 9 years old yesterday. It's become customary on this day that I post a chart of growth (income vs years running).

So, here it is:

image

As you can see this last year has been something of a bumper year.

The secret to this past year's success? Long hours and "hard" work.

But mainly luck!

Well, I say luck, but again, as with 99.5% of my work, it's down to being the owner of this site and having put in endless hours in to its running. Without the site the luck wouldn't happen. But it's luck in the sense that I've done nothing to promote the business or try and build revenue other than running this site.

Lessons learnt this last year: doubling turnover doesn't necessarily make you twice as well off. Also, while I agree that money can't buy happiness, it can help prevent misery, brought on by the stress of not knowing where the next month's grocery money is going to come from.

Perhaps the reason I don't feel twice as "rich" is that the frugality that came about in Rockall's annus horribilis has stuck with us. We continue to watch what we spend, collect money off coupons, dig out bargains etc. As a bonus we're now debt free and I've even put aside all my tax this year and even saved some money that we hope to use to put towards a Buy To Let property. Times are good right now.

Doing well is a nice feeling. I can't imagine the growth pattern continuing, but even if it just stayed steady I'd be very happy less miserable for sure.

Please don't hate me for talking about being "well off" in the open. It's just what I've come to do each year and it happens this year was a good one. No numbers are mentioned. How well off I am is all relative to what I'm used to and what our outgoings / living costs are. I'm not bragging. Just being open.

Update: I forgot to mention - the vast majority of the work over the past year was Domino-based!

Comment Icon There are 25 comments in 16 threads Read - Add

Make Sure Your Stylesheets Have the Right Content Type

This week I got asked if I knew why a Domino-based website lost all its CSS styling when viewed over the internet, whereas it worked fine when viewed via the local intranet.

The browser in question was Internet Explorer and almost instinctively I knew what the cause may be. It's when stylesheets are sent to the browser with the wrong content-type, like with this Page:

image

Make sure you use "other" and enter "text/css", like so:

image

Some browsers let you off with this mistake. Some don't (Firefox). IE only allows the wrong content type until viewed with "Internet" settings.

Better safe than sorry and always make sure that the content-type is right!

Comment Icon There is 1 comment Read - Add

Site Mod: Let's Get Social

Top right on every page of this site* there's now the "Let's Get Social" section with a handful of links to sites that I'm a user of.

Some of the links were there before and some are new. They all have a new look though. Thanks to brilliantly simply icomoon.io web app, which lets you pick the icons you want, bundle them together and download as a font Base64 encoded in a CSS file. Use of the font is then dead simple.

Brilliant. Font-based icons are the way forward!

* this assumes your screen is wide enough to let the responsive design introduce the 3rd column. If not they'll be further down the second column (or down at the bottom of the 1st if you're using a mobile device).

Comment Icon There are 6 comments in 3 threads Read - Add

At the End of the Day (Java Tip)

Of all clichés people over-use, the worst has to be "At the end of the day...". It always makes me think of David Beckham's insightful post-match analysis.

These past few days I've been struggling to get my tiny mind round the simple notion of the "end of the day" and how to calculate it in code.

Here in the UK we're all in the same time zone. Midnight is at the same time wherever you happen to be. If you need a website to work out whether a date-based deadline has passed, it's easy.

That's not so in America where the east coast is hours ahead of the west. If you have a cutoff date in America then you have to decide where in America the cutoff time applies. If you have a bookings management system and you stop taking bookings at midnight East Coast time then you'll anger those on the West Coast who unwittingly missed the deadline by a few hours.

To get round this you can use midnight at the last location in America where the day ends - Hawaii. Then you don't upset anybody.

The problem with Hawaii is that it doesn't observe Daylight Saving Time (DST), so working out the time in Hawaii, relative to your web server gets a bit tricky as it varies by an hour for half the year.

Time calculations need to be independent of the location of the server on which the code runs. The simplest way to do this is always use the "universal" GMT time at the meridian as the starting point.

As Hawaii doesn't do DST it is always 10 hours behind GMT. So we can work out the time in Hawaii using this code:

private Calendar getTimeInHawaii(){ 
    //We always want to start with GMT so that DST isn't a factor 
    TimeZone reference = TimeZone.getTimeZone("GMT"); 
    Calendar hst = Calendar.getInstance(reference); 
    hst.add(Calendar.HOUR, -10); 
    
    return hst; 
}

We can then use the Hawaii time to work out if the day we're interested in has ended there by using a method like this one:

public boolean hasDateEndedInAmerica(Calendar date){
    Calendar cutoffTimeInHawaii = getTimeInHawaii();

    //Copy date (m, d, y) parts from closingDate!
    cutoffTimeInHawaii.set(Calendar.DATE, date.get(Calendar.DATE));
    cutoffTimeInHawaii.set(Calendar.MONTH, date.get(Calendar.MONTH));
    cutoffTimeInHawaii.set(Calendar.YEAR, date.get(Calendar.YEAR));
    
    //Make sure it's the end of the day!!
    cutoffTimeInHawaii.set(Calendar.HOUR_OF_DAY, 23);
    cutoffTimeInHawaii.set(Calendar.MINUTE, 59);
    cutoffTimeInHawaii.set(Calendar.SECOND, 59);

    Calendar nowTimeInHawaii = getTimeInHawaii();
    
    return nowTimeInHawaii.after(cutoffTimeInHawaii);
}

Where usage is like this:

if ( hasDateEndedInAmerica( getNotesFieldValueAsCalendar(doc, "ClosingDate") ) ){
    //don't allow code to proceed!
}

In turn this relies on the following utility method to return a date (stored as text in mm/dd format) in a Notes field as a Calendar object:

public static Calendar getNotesFieldValueAsCalendar(
    Document doc, String fieldName ) 
throws Exception { 
    DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy"); 

    Calendar cal = Calendar.getInstance(); 
    cal.setTime((Date)formatter.parse(doc.getItemValueString(fieldName)));

    return cal; 
}

Although if you do the right thing and store dates in DateTime fields then that last part is a bit easier.

Summary

This might all seem a bit obvious to some, but to me it was a bit of a mind-bender and took me a while to realise how simple it becomes once you start using GMT as the starting point, which you do initialising your Calendar object with a GMT TimeZone reference. Easy after that.

Comment Icon There are 5 comments in 5 threads Read - Add

Taking Backups To The Next Level

After this week's fiasco getting my laptop back after an SSD death I have starting taking backups way more seriously.

Somebody asked whether I had off-site backups. Last week I didn't. Now I do. Kind of. If you can call having one NAS in the office and one in the cellar "off site". They are in different buildings, so the risk of fire or theft to both is slim enough for my liking. I fear theft more than fire and the chance of a burglar robbing the office and the cellar has to be tiny.

Here's a side-on schematic of our house (click for larger version).

network

But what about flooding I hear you ask. Yes, that's a river 2 feet away from the office! Well, I say river, but it's a stream / brook really.

Here's a plan of the area. My office is the small building in the very centre of this map.

garage

On the diagram I've marked a line on the wall above the river which is where the water level occasionally comes up to. It's very rare that that happens, but when it does it's a raging torrent. If you fell in you'd be taken off with it and end up in the Trent.

The picture is kind of to scale and, although I've never actually worked it out exactly, I reckon the river bed is about at the same level as the cellar floor. When the river level rises sufficiently the cellar floor can reach ankle depth in water. To combat this there's a pump in the cellar floor. 

Despite all this, flooding, is not an issue for me. We've been here 8 years now and no matter what the weather does it's never come close to flooding. Try telling that to the insurance company though!

Backup

So, I've taken my old ReadyNAS Duo (1.5TB) that was sat doing nothing and set it up as a 2nd backup NAS in the cellar. The QNAP NAS (6TB) is still in the office and acts as both backup and file sharer.

Windows on my main laptop is now setup with Acronis True Image to perform the following:

  • Hourly incremental backup to the laptops D: drive (1TB spinning HDD).
  • Daily incremental backup to the main NAS.
  • Weekly full backup to the second NAS.

Also, now that I find myself using the Mac mini more and more (particularly for movie editing) I have turned on TimeMachine and it alternates it's backup between the two NAS boxes.

I feel safe(r). All the worst case scenarios that I can dream up are covered now. All except the scenario where I've left my laptop in the office to go for a run or something. While I'm out a robber gets in to the office, takes the laptop and the NAS, looks round the house, finds the cellar and takes the other NAS. All I have then is the Dropbox account (photos, invoice, passwords etc) but lose lots of work. That's just never going to happen though... is it?

Comment Icon There are 17 comments in 7 threads Read - Add

‹ Previous | « Firsticon Page 8 of 344Last » | Next ›