Monthly Archives: January 2009

SockMonkeys and um, …things that rhyme with sock monkeys

Some people are naturally talented when it comes to making things with their hands.

Sadly, I'm not one of them. I'm a terrible sketcher, and making actual real things that you can drop on your foot is something that is largely alien to me - I don't usually have the patience to persevere after about 90 seconds, and usually give up straight afterwards. As you'd imagine, is a bit of a barrier when it comes to making stuff.

But something amazing happened this weekend - I actually made something physical, and I now know the joy and pride a maker feels when they craft an entirely new object from simple mundane parts.

Of course, it didn't go totally smoothly to begin with:

My one is the rude looking stripey one

My one is the rude looking stripey one

This was my first attempt at making a sock monkey at the Crafternoon put by Jo Maiden of the Ethical Fashion Forum, a fundraising event where the proceeds went towards a project to set up an ethical fashion production facility in Soko, Kenya, that directly supplies the UK retail trade. 

We turned up at the Hub with a fiver and a pair of socks with us, and in return, we were taught how to make a monkeys from socks, and given more tea and cake than we could possibly eat. This is a good way to spend a Satruday afternoon.

I could say more, but the chances are the penile appendage coming out the sock monkey's chest has probably distracted you somewhat. And rightly so; it's an abomination.

Like I said before, there are people who are good with their hands, and I'm not one of them.

But mercifully, there's a sewing kit at home, and when I headed home at the end of the day on Saturday, I took the instruction set with me, and over the weekend, managed to remove the unintentionally hilarious phallus/arm hybrid growing out of the torso, and end up with something with a passing resemblance to what a sockmonkey is supposed to look like.

Sockmonkey, post-op

My sockmonkey, post-op

The stitching on this is terrible, it's badly stuffed, I made an embarrassing number of false starts, where I had to undo loads of stitching and redo work, and in all, it took me absolutely aaaaaaaages to make, but despite this, it's my misshapen, badly stitched soft toy, and I'm pretty damn proud of it.

And it's also helped me get past whatever block I had when it came to handling garments, needles and threads. I'm actually fixing and adjusting my own clothes now - this week, for the first time in years, trousers that were too long finally fit me, so I don't have to do a adopt a strange hop-step gait to avoid destroying them as I walk through the streets of London.

Interested?

If this kind of stuff interests you, you could do a lot worse than check out The Make Lounge just off Liverpool in Angel Islington - they run workshops like this regularly, and while they're more expensive, I'm told that the post-workshop glow is similarly euphoric. Alternatively, you there's always O'Reilly's Craft Magazine, and if you're free on Feb 4th and like the look of this event, there's another Fundraiser for the Soko project.

There are people who are good with their hands, and I'm not one of them yet, but it doesn't feel out of reach forever now.

Huzzah!

Tinkering at the windmill

I love my job.

But after a day of starring at a laptop screen in your own home, it's nice to get out and interact with real people, instead of mediated avatars or disembodied voices on skype.

So a couple of days ago, I spent an evening at the Tinker meetup at the the Windmill, a normally charming pub, meeting a load of new faces working in the embryonic hardware hacking/ physical computing scene.

Someday I'll get tired and jaded about technology, and all the stories of ingenuity and resourcefulness will just sound like people talking about themselves and how good they are at hacking, but for now, these nights are revelatory for me - I've come away with so many useful new perspectives on the work I'm doing, but it's also been good to get an idea of what's out there in London for someone relatively new to the world of physical computing.

Sadly, the Windmill had started putting on a pub quiz the same night that Tinker normally have their hardware show & tell sessions, so we ended up passing around examples of 3d printing, to the sound track of distorted pub trivia questions booming out of cheap speakers; quite a strange juxtaposition.

Whither London resistor?

After reading about NYC Resistor in New York, and my own experiences of meeting so many interesting people in The Hub, and finding lots of interesting and fulfilling work as a result, I'm convinced that there needs to be a similar venue in London that lets people meet up, and put simply, hack together and share what they're building on.

In Arduino, we as developers, designers, and tinkerers have a free, open platform that serves a similar purpose to what html, but for ubiquitous computing - a standardised platform that abstracts away enough of the hard stuff associated with electronics to make it accessible to a much, much wider audience. In my opinion this is a wonderful thing - it means being able to come from a domain like web development, and dip your toes into the world of physical computing is possible, and in our experience, deeply satisfiying.

So why don't we have a place like NYC Resistor in London? It's not like there isn't interest.

I asked Alex from Tinker this, and this developed into a fairly involved conversation - the main take away points seem to be that there are two factors stopping things in London;

1) Health and safety

2) Universities

Health and safety

The UK's health and safety standards are generally more stringent than equivalents in the US. This is usually a very good thing. But it also means that when it comes to amateur electronics, you have a lot more regulation to deal with, which is time consuming and expensive, especially when such a space would be at least semi-public.

Universities

If you are linked to a uni, then you're in a great position to make use of equipment they have access to, like laser cutters, 3D printing devices and suchlike, usually at very favourable rates. Again, this is normally a good thing, but this easy access for alumni means that setting up  an independent place to reach the same experienced people who might attracted other relative newcomers is even harder, as anyone setting up such a place is competing against comparatively well funded institutions, who aren't subject the brutal economic realities facing down businesses in London.

Will things change?

These barriers are high, but they don't seem totally insurmountable. You'd really need somewhere relatively central, that's accessible, is cheap and has space for people to meet and hack, in a relatively informal setting.

At times the Hub in Angel Islington feels like it would meet at least some of these criteria, especially after 6pm, and there's already something of a workshoppy vibe here already. It also looks pretty cool:


This still doesn't solve the problem of tools though, or maintenance.

Damn.

At least it's a start.

Update - turns out we do have a space in London after all, called L-space, according to hackerspaces.org. Sadly we've no photos. Come on guys!

My latest reason for wanting to scoop IE7′s eyes out with a sharpened spoon.

When we're developing for the web, adapting for Interet Explorer is an unavoidable pain that we have to deal with.

But it's rare to find a problem that rears its ugly head in Internet Explorer 7, but not its much maligned predecessor Internet Explorer 6. We're trained by experience to expect IE7 to know better, albeit only slightly.

However,  I recently learnt that this isn't always the case; IE 7 throws its toys out the pram if you dare set a width on the on the main html element on a page like so:

<html>

<style type="text/css" media="screen">
html{
width:700px;
margin: 0 auto;
background:#444;
}

body{
width:650px;
margin: 0 auto;
background:#eee;
padding:18px;
}

#wrapper{
width:550px;
margin: 0 auto;
background:#435434;
padding:18px;
}

</style>

<body>
 <div id="wrapper">
 Yammer yammer
 </div>
</body>
</html>

 

Do this, and you'll find your layout clings to the leftmost side of the browser window in IE7, for no good reason.

But look at it in IE6, Opera, Safari or Firefox, and you'll see a series of boxes in the centre of the screen, behaving properly.

It's really rather frustrating.

I've put also put this into a test page here, as a sanity check for myself, and also to see if IE8 displays the same asinine behaviour.

I can't get back the time it took to work out this bug, the best I can hope for that this post saves time for another developer.

Such is life.

Renaming stuff with Ruby

I've been mucking around on the command line with Ruby again of late, and one thing that tripped me up initially, but is now firmly on my list of things I Like About Programming is how Ruby handles loops.

With javascript, actionscript, php, it's pretty common to iterate through an array with a for loop something like this:

for (i =o; i = array.length; i ++ ) {
 // call function foo() on array iteration 'i', with argument 'bar'
 array[i].foo(bar)
}

This is doable in Ruby too, but the following is much more common:

array do |i|
 // call function 'foo' on array iteration 'i'  
  i.foo(bar)
end

You could argue that you lose some context inside the loop if it's a long enough method, but for quick loops like in this file renaming widget me and Chris Mear wrote for the Open Rights Group, the expressiveness is pretty impressive.

Here's the full code we used for renaming the 6000-odd files that Photoshop spat out for the ORG founding 1000 badges. Chris knocked this out in about 5 minutes, and I've now commented it to the point that it's parsable even when I'm hungover. 

 

# this script iterates through about 6000 files that have been generated by Photoshop, 
# then renames them to fit naming conventions for a web app, as specified in a CSV file 'codes.csv'
# The Ruby CSV module allows to iterate through csv file easily
require 'csv'
# declare array literal to put desired filenames into
codes = []
# take column two of each row in codes.csv, and put it into 
# the first column of each row of the recently declared codes array 
CSV.open("codes.csv", 'r') do |row|
  codes[row[1].to_i] = row[0]
end
# switch into the directory 'export'
Dir.chdir 'export'
# bookmark current directory to return to later  
wd = Dir.getwd 
# glob is a function that returns an array of items matching the pattern given.
# in this case it this returns pretty much every directory or file name everything
# we could also substitute with Dir.entries('.')
('') do |dirname|
  # Dir.chdir is the Ruby equivalent to 'cd dirname'
  Dir.chdir(dirname)
  # perform a search for all .png files, (all files ending with '.png'  )
  Dir.glob('.png') do |filename|
    # read each filename, find the part of the filename that isn't the number (the '/\D/' part of the regular expression), 
    # then strip it out, leaving just the number, making sure to convert this to an integer, not a string
    number = filename.gsub(/\D/, '').to_i
    # local variable 'code' exists inside this loop only
    code = codes[number]
    new_filename = "#{code}.png"
    puts "Renaming #{filename} to #{new_filename}."
    File.rename(filename, new_filename)
  end
  # switch back to the starting directory before looping through the    
  # next folder 
  Dir.chdir(wd)
end

Understanding the appeal of baking

 

Baking has always been something of a black art to me.

I've privately marvelled over how simple, cheap base ingredients combine to the kinds of make culinary delights that trigger happy childhood memories, but it's always something I assumed was beyond my limited skills in the kitchen.

So today has been something of a revelation: mum showed me how she makes the mince pies that I grew up loving, and I've spent a fair chunk of the day practicing until I'm happy with the results.

And now, it's safe to say, I'm pretty happy.

There is life after the cloud

This post is partly a reaction to getting slightly sick of the phrase 'cloud computing' over the last few months.

I don't think that 'the cloud' is the be all and end all of computing, and I think there's some fascinating stuff happening at the edges of IT right now that shows the beginning of  swing back away from the idea of centralised computing as the best way to do IT.

If you look at the history of computing from halfway through the twentieth century to where we are now, you'll see evidence of an interesting oscillation between centralisation and decentralisation as a way to solve problems with computers.

In the 60's and 70's and computing was carried out, on huge centralised mainframes, whose processing cycles were shared by groups of users, using relatively simple terminals.

Through the 80's and 90's, the increasing power of computing at the edges of the network gave rise to prominence of the desktop PC, and the network became less important, relatively speaking.

Where computers were networked outside of academia, the most popular commonly used collaboration and groupware tools were properietary, and usually sold with accompanying hardware; the easiest example here is Microsoft Office's success on the desktop parlaying into the ubiquity of Microsoft Exchange for email, calendar sharing, sharing files, which in turn drove further sales of Office's suite and Windows licenses. Here the desktop is king, and any concessions to the existence of the internet are occurring terms that don't disrupt the continued dominance of the selling hardware and shrinkwrapped software.  

With the end of the nineties and the turn of the century however, the pendulum has started to swung back to centralisation, and as more and more computers have came online, more and more tasks are being performed through the web on centralised servers. You could argue we're at the apogee of this stage with the rise of cloud computing, where virtualised servers, instantiated on demand, are replacing the clusters of servers bought that and maintained in-house.

These virtualised servers exist physically in huge, energy guzzling datacentres aroudn the globe, in an echo of the centralisation of the early days of computing, though it's arrived late to the party, even Microsoft has an offering in this space, in the form of Azure.

I think in 2009 though, we're going to see the pendulum start to slowly swing back towards decentralisation again, as the experience and utility we get from centralised services like Google Docs, Youtube, Twitter and Facebook, can be delivered by a system of federated websites and webservices, that don't assume a constant connection to the net, in order to function.

Evidence?

I'm saying this based on the trends that emerged in the tools that are being used to make the web now, compared to those a couple of years back. 

Subversion vs. Git

Subversion is a really powerful version control system that uses a centralised repository of changes that everyone working on a project subscribes to. There's all kinds of clever logic in place that helps merge changes from disparate users, and let people branch off their development to try out new approaches to solving computing problems with code. But as soon as you lose your connection to the internet, it's severely crippled; you lose the ability to make incremental changes, branch off new versions of code for experimentation. Git by comparison is another tool used to help manage source code, but has a few other advantages, like being designed with decentralisation in mind; this means that even if your umbilical to the central server managing the master copy of all changes  to the code is severed, you can still keep working and enjoy the safety net of version control, branching off code in new directions, and get back in sync once you do have a connection to the net again.

Twitter vs. Identica

Twitter is a centralised service that lets people update their friends and followers with a stream of microcontent through the course of the day. Managing this centrally is a huge technical challenge, and users have now become familiar with the failwhale, an arresting little illo often displayed on the twitter page when servers are overloaded. Identica is a federated approach to microcontent blogging, that doesn't try to manage everything centrally, but breaks down the problem into smaller chunks, with a particular identica server only managing a subset of the problem, and leaving the areas that don't immediately concern it to being someone else's problem. If part of the network goes down, your server will keep going, and until the health of the network is restored again.

Microsoft Passport vs. OpenID

Managing usernames and passwords is not something that humans naturally do well. Despite our best intentions, we normally either end up using the same password across many, many sites at once (which means if we lose one passwords, we're compromised everywhere), or simply forget our passwords all the time and end up having to jump through hoops all day long to do anything useful. One solution put forward by Microsoft to solve this was the Microsoft Passport; in short, your hotmail login would become your login to every supporting site under the sun. While this would have been convenient for end users, this was problematic on many, many levels as Microsoft's habit of abusing monopolies understandably made users and site owners uncomfortable with this idea.

OpenID is designed to offer many of the same advantages of using a single username and password to sign into lots of sites, without as many security problems inherent with a centralised service like passport, by placing you as a user, in greater control of how your identity is managed, right up to the point that much like running a blog on your server, you can run your own openid server, precluding you from relying on a third party to grant or deny access to a site.

Blogger vs WordPress

Blogger is a centralised service for blogging. It works fine mostly, but if you want to change how it works, or you're not happy with all of it, there's not much you can do. WordPress is a available as a hosted service on wordpress.com, but it also can be downloaded from wordpress.org, and setup on your own server, and modified as you see fit. If the central server stops, you can keep blogging on your own instance of WordPress regardless.

MySQL - CouchDB

MySQL might be a strange example here for centralisation versus deentralisation, as it's the database that drives many a open source app. Ultimately though, it's designed to be one big database, with one unique key per database than a network of databases loosely linked. Making it act like a federation of silos takes a lot of work to shard off databases and still keep performance reasonably high. CouchDB by comparison is designed to be replicated in many disparate places, and has a simiarly laid back approach to how data should be structured compared to an SQL styled database; rather than having one canonical app using one database, CouchDB looks like it's designed to allow multiple apps with multiple databases to share data very well without data conflicts. This is something that's much, much harder than it sounds.

Swinging back, or something totally different?

I'm painting with very broad strokes here in this description, but what I'm hoping to show here is that over the coming year, we're likely to see some of this trend towards decentralisation, and in particular federation, in the web.