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!