Archive for the ‘Computer Programming’ Category

My top 10 most significant web technologies

Monday, June 21st, 2010

Drupal
The mainstream web has yet to fully catch on to the significance of Drupal although it is rapidly gaining significant momentum. Kind of quietly whilst nobody noticed – at least, not me – the Drupal team have been developing a most intelligent, comprehensive framework for assembling tailored content management systems.

Having worked with content management systems for 10 years I had all sorts of ideas and aspirations for problems to solve and technology to develop. It came as a revelation to discover Drupal a year ago and realise that most of my wildest content management dreams have not only already been realised, but matured, tweaked, documented and improved. Discovering Drupal has pushed my information technology horizons at least 5 years into the future and not only that but I’ve discovered a large, well organised, friendly and extremely well informed community of fellow developers to work with.

A year later, I’m beginning to discover the new boundaries, but wow, what a ride ! Imagine all the “web things” you’d like to build have already been built, have had the quality and intelligence dials turned up to max (and then some) and it’s all for free.

If you work on the web or especially with content management and you haven’t yet discovered Drupal then you are essentially blind to the reality that is surrounding you.

JavaScript
I think most programmers tend to think of Javascript as a toy programming language, the sickly younger brother of Java; good for animating flashy web pages but not much else?

Nothing could be further from the truth. JavaScript is probably the most powerful, flexible, portable and accessible mainstream programming language available. True, it’s object orientation is a bit weak but this is a minor detail and will fully resolved with JavaScript 2.

Prediction: JavaScript will become *the* programming language of the 21st Century

jQuery
jQuery is a library that empowers JavaScript with vastly easier and more powerful control over html user interfaces. It makes it practical to create much more engaging and responsive html applications that easily work across different browsers.

cPanel / WHM
WHM (Web Host Manager) and cPanel are the unsung heros of anyone who enjoys cheap high quality Linux web hosting. cPanel is a “control panel” that  de-skills the management of web servers and allows computer literate people to host and manage their own websites for a minimal cost. The best value and quality hosting in the UK that I use for all my sites and clients is powered by cPanel and available from eukhost for as little as £30 per year !

WHM is a web system administrators dream come true for the large scale management of multiple servers hosting many sand boxed customer hosting accounts.

mySQL
A fast, simple and reliable SQL database for the web. More than a little behind on functionality compared to many other databases but it doesn’t matter because it’s fast, it works and it’s free.

mySQL is the backbone of the interactive web.

HTML / CSS
Flawed and quirky, html & css are the foundation of the web. Open, secure, flexible and can deliver information and applications to any device with a web browser. The next version, HTML 5 will enable a quantum leap in the quality and variety of browser based applications.

postgreSQL
Possibly the most advanced relational database available (certainly for the price). Not as popular as mySQL due it’s more demanding hardware requirements which is a shame because postgreSQL has game changing, next-generation RDBMS features. It supports table inheritance, multi-values, user defined data types and the ability to code stored procedures in your choice of programming language as well as high end features such as table spaces.

WebGL
WebGL is a relatively new project that gives JavaScript direct access to the 3d acceleration hardware of a device through a web browser – It’s so new, it only works if you download the “development” versions of browsers.

You may or may not appreciated the significance of this development but it’s going to be huge, from 3d modelling to product marketing and augmented reality WebGL will be the key to the next generation of web applications.

Linux
Linux seeded the crystallisation of free and open source software. It’s a mature and extensive business and personal computing environment and it’s totally free. Linux is the ninth wonder of the world. Amazingly, even when it’s right under their noses many people still fail to see the opportunties and possibilities of not paying licence fees for basic IT infrastructure. Not to worry, they’ll get it eventually because Linux *is* taking over the world.

The Gimp
The amusingly named GIMP (GNU Image Manipulation Program) isn’t a web technology as such but it’s an excellent tool for slicing and dicing images for building websites. If you’re a professional graphic designer then it’s probably going to be worth investing in a licence for Photoshop, but for the rest of us, The GIMP is a powerful tool for processing photos and images for the web – and it’s free!

Drupal Automated Title Update SQL

Sunday, January 3rd, 2010

update node_revisions as nr
JOIN node AS n ON n.nid = nr.nid
JOIN content_type_yoga_class AS yc ON yc.nid = nr.nid
JOIN content_type_location AS loc ON loc.nid = yc.field_class_location_nid
join node as locnode on locnode.nid = loc.nid
set nr.title = concat(‘Yoga class at ‘, locnode.title, ‘ ‘, loc.field_town_value)
where n.type = ‘yoga_class’

Inspirational Online Presentations

Monday, July 13th, 2009

I missed out on going to the 4 day TEDGlobal 2009 conference in Oxford recently largely because I didn’t have the $4500 entrance fee. That doesn’t matter though because TED videos the presentations and puts them online for free.

Here is a great video to get you started, but the rest of the TED site is *well worth* checking out.

This first video presents some very interesting (and positive) global socio-economic data with a fascinating graphing technique. For anyone that works with “data” the video is worth watching for the “information presentation” alone.

Linus Tourvalds on Distributed Source Code Management

Saturday, July 19th, 2008

This video is quite long (1hr) but it will (should) change how you think about source code management.

Linus developed a source code control package called Git because all other version control systems were doing it (badly) wrong. I was sceptical, but having watched the video, I’m convinced there is compelling power in distributed source code management.

If you replace the term source code management with content management and use a bit of imagination then distrbuted source code systems look very similar to what I believe the next generation of Enterprise Content Management systems should look like. (ie source code management and content management are very similar concepts)

Handy Unix / Linux Command Reference

Sunday, March 23rd, 2008

When I saw the link for this page on Digg.com, I though it would be really handy for my girlfriend who has recently switched from Microsoft Windows to Ubuntu Linux.

It turns out it’s an excellent reference for both unix beginners and (relative) experts.

Check out the Unix ToolBox. It’s useful, informative and easy-to-use.

6 Principles for Creating New Things

Thursday, March 20th, 2008

I agree with Paul Grahams 6 principles for making new things.

I like to find (a) simple solutions (b) to overlooked problems (c) that actually need to be solved, and (d) deliver them as informally as possible, (e) starting with a very crude version 1, then (f) iterating rapidly.

I particularly agree with (a) creating simple solutions but even more so with (c) solving problems that actually need to be solved.

It’s amazing how often complex solutions create more problems than they solve and / or completely miss the underlying problem.

How the Netflix algorithm works

Sunday, March 2nd, 2008

You use the Netflix website to rate films that you have seen on a scale from 1 = hated to 5 = loved.

The Netflix algorithm compares your film ratings against other Netflix customers in order to calculate a predicted rating for every film in their database.

This enables Netflix to suggest

The Netflix “algorithm” works by calculating a predicted rating for every film in their database based on how you and other Netflix customers have rated the films you have already seen.

Having a “predicted rating” makes it much easier for you to find films you would enjoy watching.

Sublime SQL for migration to YAF forum

Friday, February 29th, 2008

Not the most complicated bit of SQL I’ve ever written, but it took a bit of thinking about. It was used as part of a script to migrate a bespoke Immediacy forum application to the .NET YAF forum.

Note the join using the power function :cool:

INSERT INTO dbo.yaf_ForumAccess
(GroupId, ForumId, AccessMaskId)
select groupid, fid, 3 from Forum_old.dbo.forums
left join Forum_old.dbo.usergroups on (POWER(2,groupid-1) & fReadPermission) > 0 and gUsed = 1

Reverse DNS Lookup from MS SQL Server

Tuesday, November 6th, 2007

The following SQL script demonstrates how to perform multiple reverse DNS lookups from MS SQL Server.

The script uses the xp_cmdshell stored procedure to execute the nslookup DOS command. The output from this command is then imported into a database table.

You will need to enable xp_cmdshell in the “Surface Area Configuration Tool” on your SQL Server. This does have security implications when running in a high security production environment, so you may prefer to run this script in a non-production environment.

This particular script updates a table called ip_address_data for entries where the column arp_domain is currently null. The script also logs a date when the reverse DNS lookup was done so that you can periodically refresh the domains.

Minor caution: it takes a relatively long time in database query terms (about 1 or 2 seconds) to perform each reverse DNS lookup, you need to factor this is into any processing you do with this script.

declare @ip_address varchar(16)
declare @cmd varchar(100)

declare curs cursor LOCAL READ_ONLY
for select ip_address from ip_address_data where arp_domain is null
open curs

create table #output(line nvarchar(100))

while 1=1
begin
fetch next from curs into @ip_address
if @@fetch_status != 0 break

set @cmd = ‘nslookup ‘+@ip_address

insert into #output
execute xp_cmdshell @cmd

update ip_address_data set
arp_domain = (select substring(line,10,99) from #output where line like ‘Name%’),
last_cached = getdate()
where ip_address = @ip_address

delete #output

end

drop table #output
close curs
deallocate curs

Who wants to win a million dollars ?

Sunday, October 21st, 2007

This is old news for many, but Netflix.com has been running a competition for computer programmers. The prize is one million dollars!

The competition involves creating a better algorithm for recommending DVDs to Netflix customers.

When you rent a DVD from Netflix you can use their website to rate that DVD on a scale of one to five. The Netflix algorithm compares your film ratings to the ratings of other Netflix customers in order to suggest films you might like to see.

The first programmer (or team of programmers) to develop a recommendation algorithm that is 10% better at predicting film ratings will win the prize of one million dollars.

This is not easy (for reasons I will explain in a future blog post) and after over a year of work by many teams, the best algorithms are only 8.5% better than the Netflix one.

The true value of the Netflize prize is not the prize itself. The value of the predicting algorithm to both Netflix and the winning team far outweighs the value of the 1 million dollar prize.

For more info: www.netflixprize.com