Thursday 30 August 2012

Linux Desktop DEAD? I think not!

Is desktop Linux really dead? For down and dirty grunt Linux desktop has a long way to go. I develop on both Linux and OS X and whilst OS X has a responsive and intuitive interface Linux wins out on customisation. No surprise really as Linux has always attracted the 'modders' and 'tweakers' but there is a lot to be said for being able to customise your desktop to the point that it fits your workflow perfectly improving user efficiency and accuracy.
What Linux lacks for web developers are tools such as those included in Adobe Cloud Suite. Essential tools such as Dreamweaver and Photoshop and nice to have tools such as Edge and Premiere just don't exist for Linux yet, Adobe toyed with the idea but have finally admitted that there wasn't the user base present to justify the cost.
Office users will see a lack of Microsoft Office as a major issue in their day to day activities when there are tools available that are just as productive as the famous MS bloatware such as Open Office and KDE Office, they may not be as pretty but they sure pack a punch and can cope with 98% of day to day office work.
Gamers shouldn't ignore Linux just yet. There are games a plenty if you know where to look and with Steam coming to Linux the games scene will only get better. It still remains to be seen if these games can maximise the low overheads of the OS (compared to Windows 7/8) but I can see a new batch of Linux tweakers forming to provide the leanest kernels available to add to their hardware over-clocking skills.
Linux Desktop dead? No just taking a nap!
More of this can be found on the original OMGUbuntu article.

Tuesday 14 August 2012

In my new role as webmaster for the clan project (www.72010-hengist.org) I will be making sure regular updates are posted on the projects progress.
The latest news has now been posted and we have a new Twitter account at www.twitter.com/72010hengist. Come by and have a look. 
We are currently searching for an electrical engineer. You must be qualified and able to complete an electrical system from design to installation. Why an electrical installation on a steam loco? Modern safety standards dictate a raft of electrical safety gear from AWS (Advanced Warning System), TPWS (Train Protection and Warning System), OTMR (On Track Monitoring and Recording) and radio equipment. There is also cab lighting, dial lighting, access lighting, front and rear marker lights and headlights, the list goes on.
Who knows there may even be some form of networking involved between the loco and support coach by the time the loco hits the mainline!
Come and take a look at the website and see how we're going on!

Monday 30 July 2012

OS X Mountain Lion growling at git and rails

OS X Mountain Lion is a great update to the OS X lineup, however it is not without its problems. After you run the update you will find that your rails apps will no longer play ball if you so much as go near Gems accessed via git.
The reason... Xcode...
The fix...

Open App Store and check for updates. You should see an update available for Xcode that is compatible with Mountain Lion. Run the update. Xcode will now reinstall, but will remove the command line utilities including git... nice! 

Once the update of Xcode is complete open Xcode and go to Preferences -> Downloads -> Components and reinstall the Command line utilities.

Hey presto, bundle and rails should now be working again.

Added Note:
The Mountain Lion update also flattens the standard Apache2 config without making a backup first so if you have custom httpd.conf back it up first!

Sunday 15 July 2012

Linux : how to delete files from a certain month or year
To delete from a certain month (Linux never shows the year for files from this year) :
ls -la | grep May | /usr/bin/tr -s ' ' | /usr/bin/cut -d ' ' -f9 | xargs rm

To delete files from a certain year :
ls -la | grep 2010 | /usr/bin/tr -s ' ' | /usr/bin/cut -d ' ' -f9 | xargs rm 

Tuesday 29 May 2012

A lot of people who use Javacsript come up against the same problem when it comes to dates. Stack Overflow is full of these questions. Well look no more...

A quick prototype over the Date object will allow you to add days to a date. By all means extend this or create your own functions such as addMonth, addHour etc using getMonth, getTime and so on.







Date.prototype.addDays = function(days)
{
var dat = new Date(this.valueOf())
dat.setDate(dat.getDate() + days);
return dat;
}

Thursday 17 May 2012

Learn to code?

In response to Gina Trapanis post on Google+ on learning to code or not learning to code... 
The problem associated with most education based learning of coding is the recipe based format of the courses. We have all seen the "Lets write an app to record our shopping list" course in books, online and in class. 

To really become a developer you need to go back to the fundamentals. Frameworks and API's are great, I use them daily, but they shield the developer from the underlying principles of logic, work-flows, storage and security. You can't teach a person to cook an omelette and then expect them to prepare a 5 course fine dining experience!
Think outside the box and strive to learn more!

Wednesday 7 March 2012

Updating a database table based on dates from a related table


Ever been caught out when you need to update a database table based on the date of a field in another (related) tables?

For example update sales table 5 days after a product shipped (maybe for a survey / follow up.

Example SQL would be :





UPDATE sales as s
LEFT JOIN shipped as e
ON s.shipping_id=e.sales_id
SET s.shipped=true
WHERE NOW() > DATE_ADD(e.shipped_at, INTERVAL 120 HOUR)
AND s.shipped=false

Easy huh!

Sunday 4 March 2012

Hengist Inaugural Engineering Committee meeting

A very productive inaugural Engineering Committee meeting updating on progress and setting out future works including the Main Frames, Build plan (with yours truly aiding with the MS Project side).
It was also a chance to put some names to faces. The group is a friendly group focused on the tasks ahead. I will bring more updates on the progress of the project. For now though if you're interested in steam locomotives, heritage, engineering or are just feeling nosey please visit our website at www.72010-hengist.org.uk. Not only does the site contain a wealth of information on the locomotive, the history of the BR Standard Class 6 'Clans' but also progress news and information on how you can help bring this locomotive to the mainline.


Thursday 1 March 2012

Another quick tip for those RoR developers using Sphinx / Thinking sphinx as a search backend.

Sanitising your search string with Riddle.escape

e.g. Riddle.escape( :params[query] )

Wednesday 22 February 2012

A quick Ruby on Rails Paperclip tip here.

If you have setup your model fields avatar_file_name etc but cannot get the model to save. Make sure you have the entry:

:html=>{:multipart => true}

in your form declaration!

Saturday 11 February 2012

Moved beyond belief

Copyright Natalie Pinkham
Flicking through Five demand I came across Natalie Pinkhams documentary The Lost Orphan : Mirelas Story. Now I'm a 36 year old guy but I admit it had the tears streaming.
It lead to a startling realisation (or maybe an early mid-life crisis)... what is life? Calm down, I'm not going to go all philosophical and try to answer the question of the meaning of life (which we all know is 42!). But seriously stop for a second, watch the documentary and think. I sit typing this blog on an expensive PC, using 50mbps broadband in my comfy 3 bed semi with pictures scrolling through on one of Cupertinos finest devices. I've just spoken to a friend on one of my two smartphones and know where my next meal is coming from. My family and I are healthy apart from the usual colds. So what has that self-indulgent look at my life got to do with anything? Normally nothing but just watch the documentary again. Think how far the price of the 'mini-PC in your pocket' would go. It would probably pay the rent on one of the flats that Mirela lives in for a good few months. Feed and clothe all the children for even longer.Winter colds pale into insignificance in light of the physical and mental health issues these children suffer with after so many years in institutions where they were neglected and abused.
So what has this got to do with me and why am I blogging about something that is happening a 3 hour flight away? This is just it, these children are only three hours away. Some may say 'we have kids here in the UK that need help' and I would agree but the situation in Romania is dire, nobody can deny that and the UK has excellent care facilities and support, a lot more so than kicking kids out on the street to live in sewers.
So what can I do? I'm not rich, I can't say here have £500k and build the centre. But I must be able to help in some way. The charity involved Close To You Association is working with Natalie Pinkham to realise the new centre and provide lasting care for Mirela and 11 other children and young adults before they are lost completely in Romanias Adult care institutions. I would happily use work holiday to help in Romania or help raise awareness in the UK. If and how Close To You choose to use my time / skills or fundraising remains to be seen and as soon as I find out this blog will be the first to know. Until then please please do watch the documentary and if you can help get in touch with the charity.
Peace out people.

Thursday 9 February 2012

A random example of setting a table field to value of several CONCATenated fields from a separate table.


update comments set created_by = (select CONCAT(users.surname, ', ', users.forename, ' - ', users.email) from users where users.id=comments.user_id) where exists (select users.email from users where users.id=comments.user_id);
Well it's out with the old (BT and in with the new (Virgin cable). Old speeds :

Much much better :


Ping test looking good too:


2012 is all set to be an amazing year in EDI and First B2B.

Enhancements and extensions to the popular iPortal and Reverse Logistics tools alongside the ever popular TMVII document portal. We are also developing new tools aimed at streamlining your document path with the ability to analyse, audit, link and collate your documents all in one tool and to allow collaboration with your partners and customers in straight forward, easy to use products.
Keep an eye over at www.firstb2b.net/blog for more news, features, tips and useful information


I am a professional, well-seasoned web developer specialising in Ruby on Rails and PHP / js web applications. I state web applications rather than websites as the majority of my projects are business logic controlled and bespoke e-commerce solutions rather than static websites.
These tend to be beyond the 'three page and contact form' type sites!

I have created or been heavily involved in solutions for:
  • EDI (Electronic Document Interchange) for companies such as Mars, Tesco, Morrisons and many more UK and international companies
  • Fleet management (used by companies such as the NHS, Norfolk Line, Cadburys, LaFarge and many more in the UK, US and Australia)
  • Curriculum Delivery Management System for UK schools
  • Many other bespoke e-commerce and dynamic website projects for small and medium sized businesses
When not sat in front of a screen I can usually be found at the other end of the technical spectrum working on Steam locomotives or trying a new real ale (plenty in Sheffield!).