UnSheffield

Events

I spent yesterday at UnSheffield, and I’ve got to admit, I had a great time. I kicked the sessions off by attending a talk on content for mobile phones, which was chaired by Mike Smith. We had some good ideas, mainly focused on data being provided as RSS and the phone handling presentation itself – aswell as some discussion on cool technology such as projecting the phone screen onto a surface, and interacting with the phone via voice.

After such a good first session, I got talking to @richardathome [A web developer in Sheffield] and Lisa Hall [Ex-Sheffield Uni researcher, currently in recruitment] about a variety of different things – we eventually settled on Computing in education, and how new graduates are technically skilled, but aren’t being taught to think about a problem and solve it.

Our chat lasted for almost another session, after which I signed up to do a talk in the afternoon. My first talk at Barcamp Leeds kind of crashed and burned, so I was hoping for it to go a bit more smoothly this time. However, I was determined not to just show pre-written code, as that doesn’t show how easy jQuery is. I eventually presented a live demo of jQuery, starting with an empty file. I spent the next hour or so testing code that I was going to write live in the session to make sure I could remember how to do it, and was pretty much done when Joel Gascoigne reminded me that I could also use Firebug to manipulate the DOM. Firebug made the session a lot more interactive, so cheers Joel.

Joel ran a session on filtering your social streams, and data overload online. He also provided a little disclaimer that his startup, OnePage, is intending to address this problem. After a brief sales pitch, the session turned into a discussion by the attendees. There was a definite split in people who want to share information with everyone, and people who want to selectively share (e.g. keep LinkedIn and Twitter seperate). They argued that making it that easy for people to mash all their data together is dangerous. For example, one guy caught his daughter out after she said she was going to one place, then tweeted from another. However, I believe that’s the responsibility of the user, and not the site – filtering what information you put online.
The session concluded with a discussion on showcasing content. Although OnePage is a stream of information, people would like to feature their best posts/tweets/photos as it shows them off best. Another angle was suggested, about aggregating multiples people’s data on one page, not just one person with multiple services. It would be useful for following a sales team, for example, in one place – via twitter or facebook statuses. Overall, a fairly interesting topic.

I presented my session after Joel, and quite a few people stuck around/turned up. I’d guess at about 15-20 people in the room watching. I was quite nervous after my last talk failed, but decided to give it my best shot anyway. It all worked [almost] perfectly first time, and I enjoyed the session. As I can’t review my own session, here’s one from Paul Brabban who blogged the session as it happened.

Michael starts by intoducing jQuery, a Javascript library designed to provide functionality based on CSS selectors and lift the burden of cross-browser incompatibility from the programmer.

Michael’s bravely doing live demonstration of the functionality of jQuery, using Firefox and the Firebug plugin. He builds an HTML table and demonstrates the capability to modify the CSS styling of the table rows based on selectors, switching on zebra-striping, selecting a specific row by index and selecting an element by pattern matching part of an ID.

This kind of manipulation is difficult to do and very error-prone in raw Javascript. Using jQuery takes the complexity away and can make these changes in a single line of code, that Michael’s editing on the fly.

Looking around the room, there’s a wall of laptop and netbook lids open with folks trying out what Michael’s demonstrating and twittering about it.

He then moves on to show how functions can be easily defined in jQuery and bound to events that may occur in the browser. He pops up an alert window when the user clicks on an element in the HTML document.

It’s a great demonstration of the ease of programming in jQuery. Michael was taking questions during the demonstration and adapting the demonstration quickly to provide an answer.

In the next part of his demo, Michael demonstrates how quickly and easily simple web services can be used within jQuery, when he requests a chunk of JSON data from a webpage and logs the output to the console. In three lines of code – if you include the line with the closing brace, bracket and semicolon.

To add context to the request based on the element that was clicked, we’re looking at a couple more lines of code. Now, we have a list of elements being created on the fly in the document. He’s not happy with the results jerkily snapping out, so he adds an extra line of code which smoothly slides out the new elements.

As he says, that functionality is moving towards a practically useful application.

He finishes with questions. Me: why jQuery over other Javascript frameworks? Michael responds that the frameworks tend to have specialities, but jQuery has a small footprint and is very easy to use. It can also be used in conjunction with other frameworks.

He also mentions that jQuery has a thriving community producing plugins and documentation.

Steve Frost mentions confused.com – they recently introduced jQuery to the website and ‘made it tens times more usable for 19k banwidth’.

Round the room, it’s pretty clear that we’ve been blown away. A great session.

I couldn’t have asked for better feedback, it’s a great confidence boost and I’m already trying to think of more sessions to present at my next barcamp.

The day ended with a talk on HumanHacking by Ian Forrester from the BBC. It was all about how to manipulate people to get what you want, from ignoring someone who disagrees with you in a meeting (very subtley) to the Nigerian 401 scammers. After we’d discussed some of the ways to hack people. the discussion moved onto why it’s so easy, including banks asking for details over the phone, and internet banking being so insecure. (World of Warcraft has 2 factor authentication, Online banking doesn’t) The general consensus was that people needed to be more educated about online scams, and that the scams wouldn’t stop any time soon, as the scammers only need 1 person in 10 million to fall for it, and they make a lot of cash.

So there we go, my writeup of UnSheffield. It’s a bit long, but I enjoyed it all and didn’t want to miss any of it out. I think come September, I may be venturing over to Geekup Sheffield once a month, and socialising with an entirely new set of people :)

No Comments

I Have A New Theme!

General, Personal

… it’s just not perfect yet.

As some of you know, I’m not very creative. This posed a pretty big problem when I decided I wanted a blog theme that no-one else would have. Sure, I could have paid someone to do it (I like Ryan Taylors design on the hodge’s blog) but I’m a student, and what money I do have is needed to buy gadgets!

Also, there’s something rewarding about designing it yourself and seeing it all come together.

As I said, I’m not too creative, so I designed it by working through the sections I need. There’s the occasional decent post every now and then, but I tend to bury them with quick posts. My focal point for the new design is featured articles, which will stay on the front page for a while.

Once I had that in place, everything else just slotted around it. The hardest part was designing the single post page. I needed to emphasize content while providing as much meta data as possible. Finding the balance between content and data was pretty difficult, but I eventually decided on twitter, lastfm (titles only) and a set of links.

I know this doesn’t really constitute a post, but I’ve not posted in weeks, and some of you were beginning to worry that I was dead (or worse, had lost internet access!) – hopefully this’ll explain why. I’m either working (full time), designing or sleeping – which doesn’t leave much time to read up on fancy gadgets or anything. However, it will be financing a new Macbook Pro for me next month, so I should be making a few posts about moving from a pc to a mac, and my experiences as a user, and as a developer.

No Comments

Capitalism and Cows

Humour

My final exam tomorrow, then I really am determined to get back to writing daily on here. That means that not every post will be a “how to do (X)” post, but hopefully there should be a lot more that people can agree/disagree with and discuss.

But as I still have one exam to go, I was busy procrastinating and checking out bookmarks from 24 months+ ago. Clicking through, I found this gem of a website. So here we go, Capitalism explained using cows.

TRADITIONAL CAPITALISM — You have two cows. You sell one and buy a bull. Your herd multiplies, and the economy grows. You sell them and retire on the income.

AN AMERICAN CORPORATION — You have two cows. You sell one, and force the other to produce the milk of four cows. You are surprised when the cow drops dead.

FRENCH CORPORATION — You have two cows. You go on strike because you want three cows.

A JAPANESE CORPORATION — You have two cows. You redesign them so they are one-tenth the size of an ordinary cow and produce twenty times the milk. You then create clever cow cartoon images called Cowkimon(tm) and market them world-wide.

A GERMAN CORPORATION — You have two cows. You re-engineer them so they live for 100 years, eat once a month, and milk themselves.

A BRITISH CORPORATION — You have two cows. Both are mad.

AN ITALIAN CORPORATION — You have two cows, but you don’t know where they are. You break for lunch.

A RUSSIAN CORPORATION — You have two cows. You count them and learn you have five cows. You count them again and learn you have 42 cows. You count them again and learn you have 12 cows. You stop counting cows and open another bottle of vodka.

A SWISS CORPORATION — You have 5000 cows, none of which belong to you. You charge others for storing them.

A HINDU CORPORATION — You have two cows. You worship them.

A CHINESE CORPORATION — You have two cows. You have 300 people milking them. You claim full employment, high bovine productivity, and arrest the newsman who reported the numbers.

AN ARKANSAS CORPORATION — You have two cows. That one on the left is kinda cute.

ENRON CORPORATION – You have two cows. You sell three of them to your publicly listed company, using letters of credit opened by your brother-in-law at the bank, then execute a debt/equity swap with an associated general offer so that you get all four cows back, with a tax exemption for five cows. The milk rights of the six cows are transferred via an intermediary to a Cayman Island company secretly owned by the majority shareholder who sells the rights to all seven cows back to your listed company. The annual report says the company owns eight cows, with an option on one more. Sell one cow to buy a new president of the United States, leaving you with nine cows. No balance sheet provided with the release. The public buys your bull.

ARTHUR ANDERSON, LLC — You have 2 cows. You shred all documents that Enron has any cows, take 2 cows from Enron for payment for consulting the cows, and attest that Enron has 9 cows.

via manbottle

No Comments

Chaining in PHP

Code, PHP

I was just flicking through Tweetdeck when I noticed a tweet by @F1LT3R that was a link to a pastebin snippet. I was curious, so I followed the link and was presented with the following code:


If (isset($resistance) && $resistance->leader == "John Connor") {
$resistanceDeath = $TemporalEngine->SetTimeCoords(strtotime('Birth of John Connor'))->AcquireSubject(new Terminator)->Transport();
}

if (!$resistanceDeath) {
$resistanceDeath = $TemporalEngine->SetTimeCoords(strtotime('Birth of John Connor + 12 years'))->AcquireSubject(new Terminator)->Transport();
}

Now that’s quite entertaining on it’s own, but it got me thinking. I love how you can chain items in jQuery, and I was wondered if it would work in PHP. A quick test showed me that it would! Not too sure how useful it’d be, but it’s quite interesting all the same. Here’s my quick mockup code:


class chain
{

function setStr($s){
$this->s = $s;
$this->response = $s;
return $this;
}

function length(){
$this->response = strlen($this->s);
return $this;
}

}

$c = new chain();
echo $c->setStr("HEH")->length()->response;

It’s a very trivial example, but I’m sure someone out there would be able to think of a use for it.

2 Comments
« Older Posts