Think Different

Above my desk, just so I can look at it, I have the full text from the Apple 1997 “Think Different” marketing campaign. I reckon it spurs me on for at least another hour or so of work a day. The team at TBWA\Chiat\Day that came up with this were really on to something.

Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo.

You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius.

Because the people who are crazy enough to think they can change the world are the ones who do.

And the other quote right next to it is a Walt Disney quote that means just as much to me right now.

It’s kind of fun to do the impossible.

Posted in Focus | Tagged , | Leave a comment

What’s In My…

I just saw a post on Lifehacker about “What’s in your backpack?” I always find other people’s responses quite interesting – that little insight into someone’s day-to-day life – and I’m going to make a list of what’s in my backpack and what’s on my desk (although, three days before a house move, the latter may be slightly skewed).

On My Desk

Electronics and Accessories:

  • 24″ iMac
  • 22″ HP widescreen monitor
  • BOSE Companion 3 speaker system
  • 500GB Maxtor external hard drive
  • An inkjet printer
  • An LCD screen cleaning kit
  • One iPhone cable and one iPhone AC charger with cable

Work:

  • My notebook
  • My business card holder
  • A stack of my own business cards
  • A few pens

Miscellaneous:

  • Deodorant
  • A book of stamps
  • My passport

In My Backpack

For a long time I’ve wanted a more business-like carrying case, which might well be an option now I’ll be doing a lot less walking around as part of my daily commute. Besides, my rucksack (which is a really nice Targus one that’s survived a few years) is getting a little battered now! But either way, it’s a rare day I leave the house without it.

  • 13″ MacBook Pro
  • MacBook Pro AC charger
  • One iPhone cable and one iPhone AC charger with cable
  • My notebook
  • Panasonic Lumix FX30 point-and-shoot camera (it’s a fantastic little thing, but I hardly ever use it these days)
  • Bank chequebook and paying in book
  • A few pens
  • A voice recorder (left over from university – I use it as little now as I did then, but it might come in useful one day!)
  • A mini umbrella
  • My lightweight raincoat
  • The book I’m reading at the moment
  • Deoderant
  • A stack of my business cards
Posted in Random | Tagged , , | Leave a comment

Facebook ‘@’ Tagging Using jQuery

In one of the projects I’m working on for Montrose River, I’ve needed to write a Facebook-like tagging system – when writing a note about a student, it allows you to choose another student to link to. The Facebook “What’s On Your Mind?” box allows you to press the @ key and then choose from a list of your friends. When you post the update to your news feed, it then links to that person’s profile.

I  couldn’t find any code to do this, so I wrote my own version.

I tried to approach this using a <textarea> to begin with, but quickly realised that you can’t put HTML code inside them! To make this work, it requires using a property on a <div>contentEditable.

The Form

<div contentEditable="true"></div>
<ul id="students_list"></ul>

CSS

Just a bit of styling to make the dropdown options look nice…

div.textarea {
  height: 50px;
  margin-bottom: 15px;
}
 
ul#students_list {
  background: #F9F9F9;
  padding: 10px;
  border: 1px solid #BFBFBF;
  border-top: none;
  display: none;
}
 
ul#students_list li {
  font-size: 12px;
  margin-bottom: 0;
}
 
ul#students_list li:hover {
  cursor: pointer;
}

The Backend

My backend code simply returns a JSON array of any students matching the search result when I visit /students/.json.

/students/search/Fr.json

[{"student":
	{"id":1,
	"name":"Fred Bloggs"}
}]

The Javascript

$('div.textarea').live('keypress', function(e) {
 
  // Hide the dropdown
  $('ul#students_list').hide();
 
  // If we press the @ key or have started tracking
  // e.keyCode works in everything but Firefox which needs e.which
  keyCode = (e.keyCode ? e.keyCode : e.which);
 
  if (keyCode == 64 || tracking == true) {
    tracking = true;
    // Replace HTML-encoded spaces with a standard space character
    str = $(this).html().replace( ' ', '%20' );
    // Get the string from the last @ character to end of the string
    searchCaret = str.lastIndexOf('@');
    searchString = str.substring( searchCaret ).replace( '@', '' );
 
    $.getJSON('/students/search/' + searchString + '.json', function(data) {
 
    if( data.length > 0 ) {
      for( i = 0; i < data.length; i++ ) {
        $('ul#students_list').html( '<li>' + data[i].student.name +  '</li>' );
      }
      $('ul#students_list').show();
    }
 
    });
  }
 
});
 
$('ul#students_list li').live( 'click', function(e) {
 
  // Get the contents of the string before the @
  newContent = str.substring( 0, searchCaret );
  // Add the name of the student
  // Intentionally blank, add your own link/formatting in here
  newContent += '<a>' + $(this).html() + '</a>'; 
 
  $('div.textarea').html( newContent.replace( '%20', ' ' ) );
  $('div.textarea').focus();
  $('ul#students_list').hide();
 
});

Essentially, the JavaScript code does the following:

  • If the @ key has been pressed, start “tracking” (send requests to the server from now on).
  • If tracking is enabled, find the last @ in the string and get the content between the @ and the end of the string (so “This is a post about @Fr” returns “Fr”).
  • If the JSON query returns results, populate the <ul> with list items and make it visible.
  • When a <li> is clicked, replace the @ to the end of the string with the content of the <li> (so “@Fr” is replaced with “Fred”).

The Result

Notes

I’ve tested this in Firefox (3.6+, I think contentEditable wasn’t introduced before then so there may have to be some looking into alternative solutions), IE6-8, Safari, and Chrome, and it seems to work fine. I’d have liked to have included being able to use the arrow keys to page up and down the list, and enter to select, and this might be something I’ll add in the future. I’m hoping if the jQuery UI Menu project makes it to stable, this will be very easy to integrate.

Calling .focus() on the <div> seems to have different results in different browsers – ideally this would go to the end of the content in the <div>. If anyone has a solution, please let me know in the comments!

Comments, as ever, are appreciated.

Posted in Code | Tagged , , , , | 1 Comment

In Development

My mind is Google: perpetually in beta.

Or at least, that’s what it feels like. It’s interesting, because I’m not really one for two-day projects – as much as they tend to be the “bread and butter” that brings the money in for client work, I always like something I can get my teeth into. When I started Montrose River, I made a somewhat conscious decision that I’d take no project lasting longer than a two week duration, instead focusing on developing the software products. And I’ve held true to this – I’m happy to say that the income from client work is being used to bootstrap the software development efforts of the company, and as every day goes on I’m closer to getting a product out there.

I think it’s important to look at how my focus has changed, though. I tend to divide the last five months up – the first three were really spent in ideas generation, writing pages of a business plan that now are trashed never to be seen again, but with reams of ideas that have stayed in my head and really shaped where the business is going. The last two have been spent being involved with my IDI Fellowship, and this has really helped get some of the larger issues explored, which has been incredibly useful.

In that time, I’ve also gone from an idea for one product, to two actively in development. The newer (and smaller) of the two is a bit of a labour of love – a system for managing and auditing child protection in schools. It will never be as revenue generating as the original idea, but I also know I’ve got a lot of personal reasons for trying to get this out there as quickly as possible. It’s also my hope that getting this out there will generate enough revenue to bootstrap the company through a period of organic growth.

It does mean, though, that I’ve got two products in active development and on many days my life feels like neither are going to launch. It’s not true, and in fact it draws closer and closer to only being some screens of code and test suites away from being out there. I’ve set myself a deadline (although I daren’t disclose it publicly quite yet!) by which time I’d like the first of the systems into beta testing in a few institutions. I’ve got a ‘Days To Launch’ counter ticking away…

Until then, it seems, my life will be in a Google-like state of perpetual development. Time to get coding.

Posted in Work | Tagged , , | 6 Comments

My “Best Of The Web”, July 2010

I just thought I’d post up a few things I’ve found, read or seen online over the last month that are worth a look:

Posted in Web Roundup | Tagged | Leave a comment

Another Focus

Paul Graham:

I’d noticed startups got way less done when they started raising money, but it was not till we ourselves raised money that I understood why. The problem is not the actual time it takes to meet with investors. The problem is that once you start raising money, raising money becomes the top idea in your mind. That becomes what you think about when you take a shower in the morning. And that means other questions aren’t.

I think this is why I find both client work and raising finance feel like they “detract” from the end game of writing a software product at the moment. As much as my experience, and indeed, running a company necessitates me to wear many different hats and juggle many different things – which is one of the things I love – I find that time increasingly runs away with me. There’s a danger of having spent too long thinking about any one thing – and increasingly I’m finding myself wondering where the time has gone.

I’ve found things to help – I track my time pretty religiously, am fairly fanatical about creating to-do lists when I get up in a morning and making sure they’re done by the end of the day; this, I find, gives me a better grasp on my time than I’ve ever had before. But in the downtime, it’s interesting to note that at the moment my thoughts return to the financial , as opposed to the visionary. I’m worrying more about client projects – which of course deserve attention, but only whilst I’m actively working on them – and raising finance more than completing the software products. Without them, everything else is really irrelevant – so perhaps I should do something about changing my focus there.

My commitments at the IDI are a little more regular than I’d originally expected, and I keep thinking the solution is just to say that for the next 10 or 14 days my sole focus will both be the things I have to do, and sitting down and really writing code on one of the ongoing projects – perhaps by pushing back any client commitments until the end of that period. It’d be really interesting to see if I feel like my time has been better spent after it.

Posted in Focus, Work | Tagged , | 1 Comment