Blog 2.0
Head on over to Blogger to see the new blog @ http://tancurrom.blogspot.com/
I’m dreaming of a white… June?
It may seem fairly random at this time of year (or for the northern hemisphere any who), but I wrote a snow script yesterday. I made it because I wanted it, but mainly because I wanted to sub class it. The original snowmaker script was written by Peter Gehrig (in 2003 I think), and most of the credit still has to go to him for this script. I am only rewriting it (better hopefully) in an object orientated fashion, and making it more flexible for users.
The script is wrapped up into one class. It uses the Prototype JavaScript library, as a prerequisite, so please include it before the script or it will not work. (The TMC.widget.Snow() class is shown at the button of the page). All that you have to do to initialise the script is create a new instance of it on the page, for example….
var snow = new TMC.widget.Snow();
This is all that is really needed if you just want to create a snow script, however you mgiht use it for something else you it can be easily customised. It takes in certain options that you can adjust on each instance if you wish, for example… (a full list of options is in the source with explanations and recommended value ranges).
var options = {
flakes: 39, // number of snowflakes (more than 30 - 40 not recommended)
speed: 0.8, // speed of sinking (recommended values range from 0.3 to 2)
font: ['Arial Black',Comic Sans MS'], // fonts that create the snowflakes. Add as many fonts as you like
};
var snow = new TMC.widget.Snow(options);
There are also some convenience methods provided for greater control over the script once it has been instantiated. The method names are self explanatory.
var snow = new TMC.widget.Snow();
snow.stop(); // stops the snow falling/moving
snow.start(); // starts the snow falling/moving
snow.hide(); // hides the snow from view (will continue to move, even though not visible)
snow.show(); // brings the snow into view
This is everything you should need to know about the script to really take advantage of all its goodness. Here is the class itself… Pastie Link. I posted it on Pastie as wordpress didn’t like me trying to post the code.
May, I
May is coming to a quick close, and I thought the blog was suffering some untrustworthy neglect. I didn’t want to pass another traffic less month without posting something here (this being my best attempt).
I am coming to the end of an exam period (ending June 13th) and have been quite busy trying to pass these. Between exams, coding for ZeroIdentity.org and playing Rock Band, I have been totally swamped this month. I hope to get a new job within the next two to three weeks, because I’m running low on funds after booking a holiday to Spain last week.
If I can I may buy a new hosting deal, and a domain, so expect that in the future weeks.
Controlling Your Laptop
Does anybody really enjoy controlling their laptop? It is a question I’m putting to myself, just now. In sight of my recent taking to computing mobility around the home I have had to use the laptops default method of input. Now, I didn’t think it was that bad for a while. I used it, got used to it, got comfortable with it – and then learnt to loath it.
Maybe it is a problem in a specific minority that I unfortunately fall victim to. My laptops trackpad is rather nifty. It just looks like a plain silver square that blends into the surface, but has some under lying benefits that I didn’t discover until a year after purchasing it. That is of course taking into consideration that my setup is assembled so that I never interact directly with the laptop (its a laptop + xbox + extra two screens mangle).
The Problem
The way it works could be found to be intuitive with practise and a desire to interact to use this method of input. Neither of which I hold. This is how the track pad works. As usual you move your finger across the surface and it will detect differing temperature or the breaking of light beams to control the movement of the mouse on screen. Subtly it has certain under lying abilities. The most obvious one being the quick tap on the surface that gives you a mouse click.
Then we have the extra controls that I only recently discovered. Tapping the top right hand corner of the pad will toggle the current window between maximised, tapping the bottom right hand corner of the pad will minimise the current window, tapping the bottom left hand corner of the pad will click the windows orb for you and scrolling your finger from top to bottom along the right side of the pad will scroll the current window.
I think they have just packed in to much, tried too hard and it has had a negative impact on the input device.
The Solution
Just keep it simple. We don’t need manufactures stuffing all this functionality into the trackpads. Its overloading them. I suggest try demoing a laptop before you buy it, its an investment that you don’t need screwed over on. Or just buy a mouse.
Zero Identity Remake
ZeroIdentity.org has reopened its doors. Its back and better than ever.
“The aim of this project is to provide knowledge about security to all members. We provide simulated scenarios and vulnerabilities, to know how it functions. Zero Identity is a safe, free, and legal environment for all to enjoy.”
If you have never been to ZeroIdentity.org then what are you waiting for? Go check it out. It’s a great source to unleash all your geeky knowledge. We have many people with different areas of expertise’s that can help with a problem, teach you new skills and generally make you laugh.
The community is a great part of Zi. Some of the members are really decent people, great for a laugh or a chat on the IRC and always willing to teach or be taught. The fact that you’re on the Internet reading this blog post pretty much makes you a person that could fit into the community. I urge you to try out the site; you will probably learn a lot.
Zi has missions that are simulating real life situations that you have to try and beat. They’re very educational, but fun educational. If you run a website that they are definitely worth a try, you might quickly find just how little (or whole lot) you know about achieving security for your site. A personal favourite is the encryption missions that teach encryption techniques and how to break them, and steganography missions that teach you how to conceal information. Zi have an E-Zine which always has some good reads in it. Check out Tech Head Magazine – Issue #1 that was just released with the site.
There’s much more content that can be seen over at Zero Identity , so go check it out all ready! I’ll be there for help, if you ever need it just shout at me.
April Foools 08
Isn’t this day just neglected?
Google seem to really have taken to the idea of april fools this yea, what with Virgle (?) and the Wake Up kit. And I was really amused by major nelson’s xbox daily update (not available on site, you have to view it on your xbox dashboard). I don’t think that people really take advantage of this day. But it is very amusing when a good spoof takes place.
Damn people, go all out!
Pre – Pro JavaScript Design Patterns
I just bought Pro JavaScript Design Patterns from Amazon for my birthday and it arrived today. Recently I have really got into JavaScript and decided on getting this book mostly because I enjoyed reading Dustin Diaz’s blog so much. The blog itself hasn’t had much recent content but it delivers a lot of very educational and enjoyable reads that are as validate as the day they were posted. I have never purchased a book about coding or even computing really, so this is a prototype to evaluate there benefits. I figured I would land some JavaScript design patterns that I like to use, very personally, so that after I finish the book I can compare how I code then. For the most part the techniques will be very basic but hopefully they benefit some web wonders.
Defining Functions
Usually you learn to define functions like so…
function doSomething() {
(...)
}
However, I like to define functions like so…
var doSomething = function() {
(...)
}
Semantically they are identical, but it’s just taken a preference recently. It keeps my code looking more consistent with the way I define objects (see literals below).
Literals
Sometimes it just seems ridiculous to define a new object (I don’t like using new to much (when you can use a literal)) …
var myString = new String('foo')
var myArray = new Array('foo','bar')
var myObject = new Object()
You probably already use some literals…
var myString = 'foo' //creates a string literal value
I like to additionally use these literals…
var myArray = ['foo','bar'] //creates an array literal, with values
var myObject = {} //creates an object literal
Object Initialisers
More commonly referred to as JavaScript Object Notation (JSON). Nearly all the JavaScript I write uses JSON. It’s a much better way of writing your code. It is a collection of name/value pairs usually stored in objects and arrays.
var ourObject = {
doSomething: function() {
(...)
},
'myString': 'foo',
myArray: ['foo','bar'],
myObject: {}
}
I have stored similar objects as before, however, even though I have stored them with the same names they will not over write the previous objects because they are stored with ourObject. They will render exactly the same results but will be called like so…
ourObject.doSomething()
ourObject.myArray(0)
// etc ...
Using this type of coding is much more efficient, and it’s considerably easier to read and understand because code is grouped into objects. It also allows you to use the same names for functions, for example ‘init’, which I use a lot.
XNA na na
Today I broadened my programming schema with a games development workshop. The workshop was very brief, only lasting one short day, or long day when there’s travelling involved. I had an extremely early start at 5.50 (sense when was there a 5.50 in the morning? It was news to me too.). After struggling out of the house I headed down to the train station where I met Aaron and eventually Ciaran and Mike. We started are adventure at 6.46.
We confusedly got some trains to Coleraine University stop and even more obtrusively wondered the campus in search of the “South Building”. After a short pit stop in the students union we ended up circumnavigating the South Building until managing to find the actual entrance and an unlocked door. By this stage we had been drenched in an over exuberant volume of Coleraine’s weather. However, with Aaron about it’s hard to put any dampers on group morale.
In spite of the self indulged perplexity that our group of dysfunctionate individuals had inadvertently induced, we arrived with roughly two hours to burn. We twiddling our fingers for a bit, but ended up helping Darryl set up for the rest of the people coming and chatting to David & James.
Everyone was situated in the labs for around 10.30 and the workshop kicked off. There was an introduction to XNA Game Studio and simplistic only-what-you-need-to-know guide to general programming aimed at C# with XNA. We moved swiftly into some exercises designed to get us used to general workings of the Visual Studio extension. They really helped but could get frustrating if you couldn’t find a solution to your problem.
After a lunch break we started into the real tender meat of the day. There was small shooter games (think asteroids and space invaders) that we needed to modify. I started making modifications to the way the ships guns would fire, limiting the amount of bullets that could be used at once. The amount would increase when you destroyed more ships. Aaron, beside me, started into the tasks of taking the single player game and making it co-op. Semantically, it was a very ugly process involving copying most of the existing code and running it again for difference instances, but the output was brilliant.
As there was going to be a prize (a copy of Halo 3) for the best modification, and I thought Aaron’s was more outstanding that mine, I took what code I had already done and added it into his project. We both worked on his and together made it fairly decent. It got top three so they had a match on one of the games a student had made. Aaron won – somehow. That’s a copy of Halo 3 for the dude without an Xbox 360 (Oh dear).
That pretty much wrapped up the day. It was really educational, but more importantly the people holding the workshop were great fun to be around. I have to greatly extend my gratitude to the persons involved in the day.
Birthday 2007
Woop! It’s my birthday. Got a coincidental half day which was nice. Didn’t really do anything eventful. Cake – num num num…
