blogitech from Chris Maddern

…technology editorial in a blog-saturated industry.

Browsing Posts in code

I’ve written a script to solve a problem that I’ve been having recently; when calculating expenses while working abroad, I never know what exactly to use as the exchange rate – on the day of submission, at the beginning? etc…

I’ve settled on calculating the average exchange rate between the date the claim began, and it ends. To make this easier I’ve created a PHP page that calculates this given a start and end date.

You can find it over at http://www.chrismaddern.com/currency

Currently it works only with USD -> GBP, however the API has data for about a dozen currencies so I’ll implement more in the next few days.

Bug reports etc… in the comments.

Chris

script_iconI often want to select all of the check boxes on a web page with Java Script; mainly for twitter related services, but can never find good code that doesn’t mess up the session and not allow it to be used again on the same page without refreshing. So.. this does exactly that.

You can also change the range of the checkboxes that are selected by changing the condition bounding ‘i’.

Select All Check Boxes on Page:

javascript:function check(){var c=new Array();c=window.document.getElementsByTagName(‘input’);for(var i=0;i<c.length;i++){if(c[i].type==’checkbox’){c[i].checked=true;}}}check();

Deselct All Check Boxes on Page:

javascript:function check(){var c=new Array();c=window.document.getElementsByTagName(‘input’);for(var i=0;i<c.length;i++){if(c[i].type==’checkbox’){c[i].checked=false;}}}check();

Select First 100 Check Boxes on Page

javascript:function check(){var c=new Array();c=window.document.getElementsByTagName(‘input’);for(var i=0;i<100;i++){if(c[i].type==’checkbox’){c[i].checked=true;}}}check();

Just copy and paste it in to your address bar and press return.

Chris

iPhone App Store

I’ve made a few attempts at this before (that have lasted less than a day each!), but for the past week I’ve begun teaching myself Objective-C and working on an App for submission to the App Store.

Objective C isn’t the easiest language to move to, despite what Apple seems to have droves of developers willing to testify – infact, it’s probably the most difficult language to ‘penetrate’ of all the high level languages. That said, the potential benefits and uses of being able to create applications to work on what will likely become one of the most ubiquitous platforms about are enormous.

So, I’ve now gotten to the stage of having a working Application on my iPhone (having payed for the Developer account) with it’s icon etc… It can run a sockets server, and connect to a sockets server. Hurrah.

Over the next 3 weeks (my aim for this app being to a stage where work will be polish and not interesting to write about), I will be posting most days about my progress  and letting you in on how the process of getting an App in to the App Store goes.

Wish me luck!
Chris

tweetgroups

Since I started using twitter, there’s been a constant up-hill battle of how

to collect the right followers, keeping all your friends as followers, work people, social networks and online communities etc… This should be easier.

Given a group of people all wanting to follow each other, a si

mple submission to a group should be able to keep all of those people’s follows up-to-date based on the other members of the group.

Now that’s possible. Or at least it will be.

TweetGroups allows you to do exactly that – at the moment only for the community of neowin.net at http://www.neotwit.co.uk

The aim is to create a more generalised version that will allow people to create custom groups, manage them etc… but for the moment it is functional.

Okay, this is a bit ‘niche’-ey. I have a US Macbook air with UK Keyboard layout and have spent a few months passively looking for the ‘hash’ key, whilst sort of admitting to myself that I’d probably bought a £1200 machine with no DVD drive, no changeable battery and NO HASH KEY.

But.. about that one, I was wrong… There is a hash key!

Anyone with a US Macbook Air on UK Layout : Ctrl-Alt-3

Finally!

Chris

I don’t often talk about my job on here, mainly because it’s not often relevant. But recently I’ve been in a lot of meetings / discussions about creating a system to keep the executives up to date on the progress of various projects.

It was an interesting meeting in which the system changed from a spreadsheet to a full implementation of Microsoft Project, but I left with lots of words in my head like ‘tags’ and ‘categories’. It took days for the association to hit me but it all sounds to me rather like the job for a blog.

Each entry could be an update tagged with a project title among other keywords. Wordpress could even be slightly modified to store progress of each category along with a few other key pieces of information, but essentially it seems like it could work; you could browse by category for a chronological update of the status of projects. It may even be more advantageous for the developers as they gain the scope of explaining any potential issues to a third party (albeit virtually).

I’m not sure if this has been done before / is implemented anywhere but would be very interested to hear any thoughts on the matter or any experiences.

Chris

While trying to see if a peculiarity in the rendering of this site was due to the IE6 install on a machine in my work (eurgh… companies) I stumbled accross a service that will produce a screenshot of your page rendered an any and all browsers available. And what’s best.. it’s free!

Browsershots will render your page on any of hundreds of OS, Browser and Settings configurations and produce you screenshots of the results. This is the easiest tool to test your page on any setup, ever.

Good Work!

BrowserShots