The End

March 1st, 2009

After 10 years with this domain, which I originally started to manage the  Information Architecture list I ran (which had a whole bunch of traffic at one stage) it’s time to move on.

So this is the end.

And a new beginning.

And funnily, there is not much difference between the two:

Top Secret Project now lives at:

http://topsecretproject.finitestatemachine.com/

PHP equivalent of Django Admin?

August 20th, 2008

So … where is the PHP equivalent of Django Admin? Or the multitude of Rails Admin plugins?

I don’t care what framework it sits on as long as the out-of-the-box functionality is awesome.

New Facebook App: Telstra HeroMessage®

July 21st, 2008

Been very quiet, but I have been working a lot, among other things.

I am happy to announce the launch of my latest Facebook Application: Telstra HeroMessage. You can read all about it at the  Telstra HeroMessage® Facebook Application About Page.

I am pretty excited about it, a massive national media campaign is already underway.

*this*

July 19th, 2008

Is all I think about

Rails Plugin - Acts As Scheduled

April 19th, 2008

I’ve just released the first pass of a Ruby on Rails Plugin called Acts As Scheduled.

acts_as_scheduled allows you to manage scheduled events for your models.

A good example of this is scheduling the update of RSS Feeds in a background process using Cron or BackgroundRB.

With acts_as_scheduled your schedule manager can simply call “Model.find_next_scheduled()” to grab the next item from the database.

At the moment it assumes you are working with MySQL.

All you need to get started is to add two extra columns to your table:

t.integer frequency
t.datetime last_scheduled

frequency is the number of seconds for your schedule.
last_scheduled is the date and time the record was last processed.

Ruby on Rails is real smart with times, so you don’t have to worry too much about calculating frequency values:

model.frequency = 1.day
model.frequency = 1.minute
model.frequency = 10.second

In your model class your simply declare “acts_as_scheduled” and you now have two extra methods find_next_scheduled and schedule_complete.

find_next_scheduled
Returns the next scheduled record from the table.
The next scheduled record is calculated as “the record who’s last_scheduled value is less than the current time minus the specified frequency in seconds”.

Which is the complex way of saying “if freqency is 1 minute, return the record if it was last_scheduled more than 1 minute ago”

If there is more than one record, records scheduled to occur more frequently will be handled first (so records with minute schedules are returned before records with daily schedules.

schedule_complete
Sets the record’s last_scheduled value to Time.now

Example

class ScheduledItem < ActiveRecord::Base
acts_as_scheduled
end

schedule_minute = ScheduledItem.new(:frequency => 1.minute, :last_scheduled => 2.seconds.ago)
schedule_minute.save

schedule_day = ScheduledItem.new(:name =>”day”, :frequency => 1.day, :last_scheduled => 25.hours.ago)
schedule_day.save

#returns thing_day because it was last_scheduled 25 hours ago
schedule_day = ScheduledItem.find_next_scheduled
schedule_day.do_some_stuff
schedule_day.schedule_complete
schedule_day.save

Persistent Storage on Amazon EC2 Announced

April 15th, 2008

The final piece in the EC2 web-hosting puzzle has been announced:

This new feature provides reliable, persistent storage volumes, for use with Amazon EC2 instances. These volumes exist independently from any Amazon EC2 instances, and will behave like raw, unformatted hard drives or block devices, which may then be formatted and configured based on the needs of your application. The volumes will be significantly more durable than the local disks within an Amazon EC2 instance. Additionally, our persistent storage feature will enable you to automatically create snapshots of your volumes and back them up to Amazon S3 for even greater reliability.

Until now the only way to get real MySQL storage has been to jump through some hoops with multiple EC2 instances or back the database onto S3 (with subsequent latency overhead). With 100GB of outbound data transfer the smallest ECV2 image will cost you about $90/month for 1.7GB of memory and a dedicated CPU core. The price just cannot be beat.

Bad things done well: accepting dangerous input with Rails

April 2nd, 2008

For various reasons I need to be able to be able to accept some script input from the client.

The basic requirement is to be able to accept some Ruby code from the client in order to allow customisation of the HTML output from an RSS feed.

This is obviously a rather dangerous thing. I essentially need to allow arbitrary Ruby to be executed with an eval

However, in Ruby, we can run code in SAFE mode.

At Level 4:

Ruby effectively partitions the running program in two. Nontainted objects may not be modified. Typically, this will be used to create a sandbox: the program sets up an environment using a lower $SAFE level, then resets $SAFE to 4 to prevent subsequent changes to that environment

The core of my approach is to create a new Thread, set the SAVE level to 4 and call a method.

feed = FeedNormalizer::FeedNormalizer.parse(open(self.url))
thread = Thread.start {
$SAFE = 4
html = safe_method(feed, script)}
}
thread.join #wait for the thread to finish

The safe_method itself does a sanity check on the safe level. The method takes a feed object and a script - the script is processed using eval and because the feed object is in the context, the script has access to it. However, the safe level prevents any malicious code from attempting to use Ruby magic and meta-programming to gain access to variables outside the thread or any globals

def safe_method(feed,script)
if ( $SAFE < 4 )
raise “SecurityException: attempting to execute UNSAFE script”
end

html = “”
eval(script)
return html
end

The user can then pass in code that looks like:

html << “<h2>#{feed.title}</h2>”
html << “<ul>”
feed.entries.each do |entry|
  html << “<li><a href=\”#{entry.urls.first}\”>#{entry.title}</a></li>”
end
html << “</ul>”

And the feed is processed without (too much) risk.

But will it scale?

March 12th, 2008

I am very pleased to announce the availibility of the Hypothetical Megastructure “but will it scale” t-shirt.

The t-shirt provdes the wearer with the following powers:

  1. Effortlessly win any technical discussion instantly!
  2. Impress your friends!
  3. Immediately dismiss any rival language or framework!

BUT WILL IT SCALE“?

Available in LARGE, EXTRA-LARGE, GRID, and the apparently defunct N-TIER.

but will it s c a l e

I like to wear mine in a cluster (simply buy two or more t-shirts and wear simultaneously).

Your credit report
Lil Wayne Ringtones
Pink Floyd Ringtones
Buy Zyban
Linux VPN
Atarax
Fix credit score
Calan
Internet VPN xp
Credit history report
Valium
Credit cards instant approval
Aldactone
Celexa
Annuel credit report
Diflucan
Cheap Avandia
Improving your credit score
Cheap Capoten
My credit report
Buy Synthroid
Buy Allegra
Credit reporting system
Nextel Ringtones
Buy Viagra
Best credit card rebates
Advair Diskus
Imdur
Buy Viagra
Tramadol
Netgear VPN
Diazepam 5mg
Buy Prednisone
Credit report score chart
Cheap Zoloft
Buy Xenical
Torn up credit card application
Nexium
Phentermine No Prescription
Yerba Diet
Totally free credit report
Zoloft
Avodart
Download Ringtones
Cipro
Buy Nexium
Cheap credit card processing
Nolvadex
Credit card reporting
Instant credit cards approval
Levitra
Cheap Acomplia
Paxil
Risperdal
Online Cialis Professional
Florida free credit report
Capoten
Buy Zyrtec
Buy Motrin
Phentermine
Hoodia
Buy Remeron
Cheap Flomax
Ativan Online
Cheap Colostrum 800
Providian credit card application
VPN setup xp
Set up a VPN
Online Viagra Soft Cialis Soft
Credit reports com
Atarax
Celexa
Buy Augmentin
Torn up credit card application
Cheap Paxil
Norco
Vicodin

The Emperor Has No Clothes: No RSS for Jakob Nielsen

March 11th, 2008

It’s been a while since I regularly read Jakob Nielsen’s Alertbox: Current Issues in Web Usability. Imagine my surprise when I find no RSS … the largest change to web use since the browser itself, and all we can get access to is email alerts.

Miscellany

March 10th, 2008

I used to have a lot more time for blogging. Now it’s all steam ahead with the actual paying work. I’ve actually had to turn down some projects recently.

My latest project is live and generating a lot of traffic. I built the promotional site for the latest Gillette product -  The Gillette Fusion Power Phantom. Very tight deadline, but I made it on time and under budget.

I’ve also been involved with some work on Hotel.com.au, which is actually old-school MS Access and Visual Basic. I am quite enjoying it. Sure beats the hell out of PHP.