Friday, 31 July 2009

Moving on to Wordpress.

I've finally found the time to move my blog over to my own space, you can find the blog here:
http://www.akademy.co.uk/blog-tips/

If you use RSS then you can signup for the new one with this:
http://www.akademy.co.uk/blog-tips/feed/

Thanks for reading!

Wednesday, 29 April 2009

Blackbird javascript debugging with PHP

If you're still using the javascript "alert()" function to output all of your debug information then take not: You need Blackbird!

Blackbird creates a little window to output all your javascript debugging information. When you need it, you can pop it up with a quick key press and all the output from your javascript programs is there.

You can put different types of information out to the window then filter the display to just show what you need. You have a choice of Information, Debug, Warning, Error or Profile. The first four just output text, but the last takes a label to start a timer, the next call with the same label outputs the time difference.

It's really simple to install. Just include a little javascript and CSS file like this:
  1. <link type="text/css" rel="stylesheet" href="/PATH/TO/blackbird.css" media="screen">
  2. <script type="text/javascript" src="/PATH/TO/blackbird.js"></script>


Make sure the script tag is above any other javascript you might want to debug.

Now all you have to do is call one of the functions:
  1. // Output text marked as debug:
  2. log.debug( "I'm trying to debug this thing" );

  3. // Output text marked as information:
  4. log.info("Hello World!" );

  5. // Start a timer with label testFunc1
  6. log.profile("testFunc1");

  7. // Stop the timer and output time (You'd usually do something between the two profile calls)
  8. log.profile("testFunc1");


That's all great and really useful. Most of the time however, you'll not want to include the Blackbird code, with a little bit of PHP magic you can choose on the fly when to include it. Place this code in your PHP file in the HEAD section of the resulting page:
  1. if( isset( $_GET["debugging"] ) )
  2. {
  3.   echo <<<END
  4. <link type="text/css" rel="stylesheet" href="/PATH/TO/blackbird.css" media="screen">
  5. <script type="text/javascript" src="/PATH/TO/blackbird.js"></script>
  6. END;
  7. }
  8. else
  9. {
  10.   echo <<<END
  11. <script type="text/javascript"><!-- <![CDATA[
  12. var log={toggle:function(){},move:function(){},resize:function(){},clear:function(){},debug:function(){},info:function(){},warn:function(){},error:function(){},profile:function(){}};// ]]>-->
  13. </script>
  14. END;
  15. }


So the simple idea here is that if you include "debugging" in your URL call then Blackbird code will be included, in all other calls, the log functions are set to empty so no code will be output. This means you can leave the actual debug calls in your code, without them causing errors or being display. Here's an example:
With debug (don't forget to press F2)
http://www.akademy.co.uk/index.php?debugging
And without:
http://www.akademy.co.uk/index.php

The javascript "alert()" function doesn't is not even come close!

Check out Blackbird here: http://www.gscottolson.com/blackbirdjs/

Tuesday, 31 March 2009

HP miniNote review (vs the Asus minibook)

General

The HP miniNote is a fine piece of kit, but I question whether it's much of a Netbook. In fact I'd place it in a position somewhere between a Netbook and a full laptop...

The specs are pretty impressive though - the one I'm using has a 10 Inch screen, 2Gb of RAM, 1.6 Ghz process and an impressive 150 Gb of Hard drive space. The battery length is also pretty impressive, I've easily had five hours out of it, with estimates of up to 8 hours claimed. The size is bigger than other netbooks but still much small than most laptops. You can get a feel for it's size from the following images:
HP miniNote depth

HP miniNite width

HP miniNote

It's keyboard feels like a full size one - your fingers fit the keys and make typing a breeze - but is still slightly smaller than standard. You can happily type away on it for a good deal of time, it would be ideal to take with you down the coffee house for a quick drink, although prolonged typing did make my fingers feel a little cramped after a time.

Comparison
Here's the the HP mini next to the Asus miniNote:
HP miniNote and Asus miniBook
The HP is clearly a lot wider which could make it a little harder to carry around. Another problem for its netbook credentials is its start up time. A good test of a netbook is the time it takes from when it's switched on until the time you can get a web page up, say a weather forecast. I believe this would be a typical use for a net book. Time comparison:

HP MiniNote Switch on to desktop : 72 seconds Switch on to Website: 235 seconds
Asus MiniBook Switch on to desktop : 25 seconds Switch on to Website: 85 seconds

I believe this is mostly due to the different operating systems they run (Linux on Asus, XP on HP). The Asus operating system was specifically created for speed, add even on a much slower machine the speed is impressive. The linux operating system could in theory be installed to the HP making a really impressive peice of kit.

Cost is somewhat prohibative too. The original Asus at the moment costs about £195 while the HP can cost around £450, this is well within the full laptop cost area.

Conclusion
The HP is a really great sub notebook, ideal for when you need to do a little work away from you office or home. Think of it as a really small laptop, placed somewhere between a netbook and a laptop, great for typing, not so great for a quick internet update.

Saturday, 31 January 2009

Teaching programming to the masses.

Most people believe it's easiest to learn new things when you are young, however, I believe if you are still able to think then you are still able to learn, but there is one good reason for learning earlier and that's the time to practice and gain experience.

Starting to learn programming early certainly has it's benefits, the best ones are almost always the ones who started when they were young, and this leads us to the main part of this blog: Teaching Programmers.

I grew up programming the Sinclair ZX Spectrum, not an experience I'd want anyone else to try, (though it was pretty clever for its time). This was always a rather loney pursuit, and in many cases, still is. However, programming has come a long way since then, object orientated programming was a massive improvement and Garbage Collectors have improved far enough to be pretty fast and reliable.

But has the way we program really changed that much? Well, no not really. All programming comes down to opening up a file and writing symbols in certain orders that only a select few can understand. How does the majority learn what's going on? Isn't it a little strange that the world over uses software but a tiny minority actually know how to create it?

Well, I think so, but the good news is that programming is slowly going mainstream, and there's several really useful and fun pieces of software available to teach it, here's my top picks.

Alice (http://www.alice.org/) (Personal Favourite!)
With this you first create a 3D world with characters and props through a simple drag and drop interface. You then control what happens through coding. The tutorial is excellent and gets you going immediatey. It won't be long before you are creating your own little world (See mine here)

Scratch (http://scratch.mit.edu/)
Two-dimensional images can be controlled to make all kinds of interesting games and tools. There's a large list of examples created by people across the world.

Kudo (http://research.microsoft.com/en-us/projects/kodu/)
This one is especially for creating games and just looks really nice. The programming is just drag and drop.

Karel (http://mormegil.wz.cz/prog/karel/prog_doc.htm)
This isn't actually a program but a fully fledge programming language. But it's designed especially for people new to programming.



Sunday, 16 November 2008

Phishing for phishers: An idea

Phishing
I just had another phishing email today and had an idea how to fight against it. (Phishing is an email which looks like it is from one company but was actually from someone else, they are designed to steal your login details - Hence, they were "fishing" for my details)

I was curious to know how close the dummy login page looked to the real one (I should point out at this point you should never normally even click on a link on email like this, it can be really unsafe!). So that you don't have to try this I show two images below for you to have a look at:



As you can see, they are pretty identical (the first one is the fake one).

Taking care
Don't worry, it isn't hard to avoid these phishing scams. Here's a few tips to help you catch these.

Is it likely?
Firstly, it's actually quite unlikely that your bank would suddenly need to contact you for any reason. If somethings important, they'll almost certainly send a letter.

Avoid links
If you do recieve an email and you think it is genuine, don't use any links embedded in the email, instean open your Internet browser and type the name in manually, or use one of your own bookmarks if you have one.

Fake URL's
If you do use a link inside an email (or even on the internet) it's a good idea to check what the URL is. This appears in the box, usually at the top of your browser (For instance, this website's URL is: "http://akademy-tips.blogspot.com/" you should see this in the box).

Phisihers usually attempt to trick you by including the real one with their own. For instance, this is a fake url: "http://akademy-tips.blogspot.com.fakingit.com/" - notice the additional text at the end "fakingit.com" - this is actually the real address of the website.

Always check the right most text of the top URL part. This is the part between the "http://" (or "https://") and the first "/", e.g. (in bold):
  • http://www.bbc.co.uk/merlin/episodes/
  • http://en.wikipedia.org/wiki/Main_Page
  • http://akademy-tips.blogspot.com.fakingit.com/
  • http://akademy-tips.blogspot.com/
Many modern browsers actually highlight this part for you now.

An idea
Once you've realised what's going on, any information can be added into these websites. In fact simply entering dummy account information will start to put of the phishers, however a much more ingenious thing to do would be for the real companies affected by these emails to set up dummy accounts, and then enter these details into the phishing websites.

Now, as soon as these dummy details are entered on the real website a company can take immediate actions to stop them, perhaps logging and banning their IP address, so that no real accounts can be used from that position. Alternatively, with the help of the police, perhaps money transfers could be tracked as they are made.

Of course, it's highly likely that this is already taking place. Perhaps it's only a matter of time before these people are caught.

Let me know what you think.


Monday, 20 October 2008

Human computing power

The idea
There are still quite a few tasks that computers struggle to do, image recognition is a good example. Currently there's only one way to complete these tasks and that's manually. This can obviously take a long time to do but there is a solution, you just need to find thousands of people to take part - this is exactly what we are seeing more and more of right now.

The internet is ideal way to get many thousands of people together, and with the right task really great things can be achieved. Of course, it's not as easy as uploading thousands of images and expecting people to look through them for you - if we don't find the images interesting then we are simply not going to take part. One way to keep a task interesting is to make the process into a game and compete with other like minded people.

The other problem is making sure the tasks are being performed correctly. The current preferred solution is to first train the participants and secondly to randomly test them against already checked responses. This also removes any unscrupulous individuals intent on causing problems and ultimately makes the completed task more reliable.

Some examples of human computing follow.

Clickworkers
The first test of the idea was back in 2000, and was called Click Workers. It was run by Nasa and the idea was simply to select craters on Mars. The interface is quite basic, and reflects some of the early internet's draw backs clearly lacking some of the enhancements in more recent projects, but the project proved that the concept could work.

The stardust project

One of the first projects to use some of the latest Web 2.0 ideas was the Stardust Project. Stardust was a sample return mission to collect interstellar particles passing through the Solar System. The particles were tiny and captured in a gel like substance (see image), it was as they put it
"...like looking for 45 ants on a football pitch."

more information about the project here.

For the website the "gel" was imaged at a high resolution and small pieces then farmed off to an individuals. First each individual was given a test to make sure they knew what they were looking for, then they were given a really image of the "gel" and had to decide if it contained a particle or not. The whole idea was to pretty much search for the stuff stars (and everything) are made of, as if you were some intergalatic explorer, as they put it:
"The best attitude for this project is this: Have fun!"

good advice for anyone wanted to set up their own human computing experiment.

The galaxy zoo project

The next project to give this a try was the galaxy zoo project. The idea here was to try to classify galaxies into spiral (as image) or elliptical. There exists thousands and thousands of photographs of the night sky unseen by human eyes and just waiting for the next great discovery to be made - step up the next group of intergalatic explorers.

This project was in a similar vain to the previous one but executed with a slightly slicker interface. This also had a massive following, with quite quickly millions of galaxy classifications taking place. Participants were again trained and tested during their continual classification. Friendly competition was enhanced with high score tables and records of right and wrong classifications.

The foldit game

One of the more advanced software programs in human computing tasks is the FoldIt Game, it's also one of the cleverest ideas and one of the most fun to do. The idea is you have to fold proteins so that they can have the right shape to combine with other proteins, these can then be used to cure real world diseases.

This one is attempting something slightly different from the other examples here. Rather than classification, this one actually wants you to solve some rather complex problems. Many of the puzzles have unknown solutions and there may even be some that have no solution.

It's fairly simple to get started, the puzzles have a nice learning curve and the interface has been well designed. Just use the mouse to grab or shake parts of the protein to see what happens. You'll have to download the program to try it yourself.

More detailed information can be found here.

GWAP.com
This is the final one we'll look at here, and the idea takes various human computing tasks into the mainstream. GWAP comes from "Games With A Purpose" and there are several games here to compete in. All are primarilly designed to be fun to play but are cleverly designed to help computers recognise things like images or words.

To check that it is being correctly played, couples co-operate anomonously and try to, for instance, tag a photo with the same word, or ring the same part of an image. Doing this means it effectively checks itself, and the more people that play the games the more reliable the information becomes.

Check out more info here. And for an in depth look into GWAP and similar ideas check this video out.

Summary
It seems like more and more projects are being started that utilise these unique human abilities, and with each new project becomes an ever more ingenious idea. But the question is how long will it be before computers have the abilities to do these tasks themselves? Well, with more of these projects actually aimed at improving computers in the first place, maybe it'll be sooner than we think.

One last thing I must mention though is the darker side of human computing. It's already been shown that criminals have used this technique to bypass the CAPTCHA login systems by employing enough humans to sort through the vast outputs.

Let me know of any other human computing projects you've come across.

Thursday, 2 October 2008

The future is big, bendy and transparent.

You might have seen bendable displays before, but unfortunately they've
always had something that stopped them going main stream. Until now.


All of the problems have been fixed: any size, any resolution, flexible and
bright.

Check out the new report here:


I think it's hard to imagine the many ways this will transform today's world, but just imagine what a roll up, light weight, flexible screen could do:
  • Wrap around your arm like a bracelet.
  • Sewn directly onto fabrics.
  • Floated into the sky by balloons.
  • Embedded into spectacles or any glass surface.
Do you have some good ideas?