Michael J.A. Clark
Michael Clark is a Computer Science student from England providing freelance programming and design when not studying at Cambridge. Skills: C#, Sitecore, PHP, XHTML, CSS, AS3, Java, ML, F#.

Sections

Contact details

Email
mjac@mjac.co.uk
Skype
mjacdotuk
Twitter
mjacuk

Articles tagged projects

Setting up Disqus Comments

For a while I disagreed with comment systems with the assumption that someone would email if they had something relevant to say. This is naive. Interaction is far more important: if it only takes 5 seconds to comment then plenty of individuals will contribute and there is no need for hard mental operations. Once there has been a premature commitment, from the initial interaction, users are more likely to return.

So which comment system to use? Drafting my own is not an option. It has been done thousands of times before and I do not want to support commercial global identifiers that change over time. Is it worth the effort?

A couple of comment systems

Disqus integrates with Facebook/Twitter and is used by Wired magazine. Known for keeping up with developments from other social networking sites.

Intense Debate targets blogging platforms like WordPress, Blogger, Tumblr. I previously used this system while helping the Cambridge Tab last year. It was easy to administer through Wordpress.

My choice

Disqus won through because of its clean interface. Installation required a single JavaScript snippet at the bottom of my article pages. Further integration is possible by providing Disqus permalinks and unique article IDs to enhance their interface.

Thanks for reading, please add your comments.

Social Backup – data redundancy on trusted machines

Social Backup is my third year project at the University of Cambridge. It provides peer-to-peer backup between trusted peers (you and your friends share storage).

Commercial data storage

Dropbox has revolutionised off-site storage by providing a simple interface to black box data storage. There are a number of inherent disadvantages to using commercial services:

  • Freemium business models may result in data loss and low reliability
  • Companies are at liberty to remove free accounts and increase fees
  • Business catastrophes like liquidation could cause data loss
  • Users have no control over the encryption keys (Amazon S3 servers)

The Internet is becoming distributed

As Internet connectivity improves, the popularity of distributed systems such as BitTorrent (file transfer), and more recently Diaspora (social networking) increase. There is a trend toward ownership of data rather than subscribing to proprietary services, and also peer-to-peer data transmission rather than routing all information through a single point of failure.

Such systems have increased privacy, reliability and failure tolerance, often at the expense of inconsistent state across the distributed system.

My project Social Backup

Social Backup provides each user with data redundancy to restore important information if local failures cause data loss. Redundant data is spread across a set of trusted peers but kept under encryption so that only the original owner can access it. The social aspect promotes fairness and discriminates against free riders: a user who provides 100MB to 10 users will expect a similar allocation from these peers. This user can then use these allocations for repeated storage of small files or for chunking larger articles across the entire space.

My project aims to show that Social Backup is a viable alternative to physical backup and and cloud services.

Thanks for reading, please add your comments.

PT OnDemand (fitness)

Screenshot of the PT OnDemand homepage

PT OnDemand offers bespoke personal training videos to a global audience. Users can pay for a series of workout videos using PayPal and track their progress over time using a workout tracker.

I was brought in after the previous developer failed to deliver the requirements. The project required a complete rewrite. I created unique features from scratch while using open source libraries to handle common elements like email validation with the EmailAddressValidator class and controller/view separation using Savant3 native-PHP templates.

PayPal integration was important to enable videos to be purchased. My system is a succinct object-orientated version of their name-value pair examples. Unfortunately PayPal provided verbose functions that were intrinsically linked with their examples. I halved their example code using inbuilt functions like http_build_query.

The videos had to be available and fast to download from all target countries. Amazon CloudFront provides world-wide performance with reduced start-up costs compared to excellent but expensive CDNs like Edgecast.

Thanks for reading, please add your comments.

Solar Empire (game)

Solar Empire took a large amount of my childhood. It was brilliant inadvertent training in software development and team projects. During the time when I was an active developer we had over 200 active players producing over 50000 hits per day; cumulatively, our distributions have been downloaded over 40000 times. At the time it was an active rewarding community but the central developers eventually left for bigger things. The project is on hold until I find a team of competent developers who want to continue development in their spare time.

System Wars game map
Star system map
System Wars overview screen
Ship/planet listing

I joined the Solar Empire SourceForge project after contributing to an independent server. At that point in time there were over three developers working on separate distributions and my job was to organise the file releases and respond to bug reports. Eventually I took over the project and became the lead developer. I was even interviewed by the Online Multiplayer Gaming Network, although that review/interview website does not compare to the likes of GameSpot.

Interesting aspects

Solar Empire used a lot of Computer Science theory but I didn't realise it at the time. The autowarp system is an implementation of Dijkstra's algorithm for finding the shortest distance between two vertices in a graph. There is a lot of potential here: I liked the idea of using weighted graphs to take star distances into account. I optimised the algorithm by performing a single database query to retrieve all the stars and processing the dataset. This was all done naively, without any academic training.

The map was a numbered graph, peppered with graphics to signify the properties of each star system (vertex). Graphs initially had a upper bound of six edges per vertex and this was reflected in the database structure; I adapted this to allow unlimited edges (unfortunately a tradeoff between the amount of functional dependencies and database performance).

Sticking points

Arbitrary maths equations were used in conjunction with a random number generator to power most of the game features. The most underdeveloped aspect was the battle system which was simply of n versus m fighters plus a hint of randomness.

In the end I spent most of my time ensuring that the SQL statements were safe from SQL injections, improving user account authentication (hashing, salts), and trying to ensure sequential consistency through conditional transactions. Most of my techniques were derived from internet blog articles.

The project was written procedurally with a lot of ideas implemented slightly differently over many files. My work became an exercise in refactoring and eventually I realised that my time was better spent elsewhere. It would take a complete rewrite to produce a reliable product.

Technologies used:

  • PHP
  • GD Image library
  • MySQL
  • XHTML/CSS for layout
  • SVN (CVS in the beginning)
  • Perl

Thanks for reading, please add your comments.

GoodScripts (script archive)

Screenshot of GoodScripts script search

GoodScripts was a major project that began as my GCSE ICT coursework. It developed into an excuse to spend countless hours learning PHP and web layout skills, creating a script storage system like HotScripts and Scripts.com. The project was successful — it worked — but I stopped developing it after I realised that it was not a viable competitor to these existing resources.

It was my first delve into creating user authentication systems for the web. I designed all the class libraries from scratch and read articles about password hashing to keep users secure. When the login system was hacked by a member of a PHP forum I started to learn about web security and SQL injections: it took a few hours to learn the techniques this hacker used and secure the website from similar attacks.

I found character-sets difficult to cope with. At the time PHP had no support for character sets and treated strings as byte arrays. This caused inconsistencies as different users would store varying byte sets in the database and the output script would try to display this to the browser with a UTF-8 template. Another problem was stripping all the "magic" quotes that PHP used to generate. It took some research to add conditional stripping to ensure the input data will be processed consistently across server configurations.

It was very educational and far beyond the scope of GCSE ICT. I have uploaded the coursework write up for nostalgic reasons.

Thanks for reading, please add your comments.

More articles on the next page