All entries for August 2005

August 24, 2005

Minty Goodness

Music front cover
Title:
See You In The Morning
Artist:
Mint Royale
ASIN:
B0007O258Y
Rating:
5 out of 5 stars

Mint Royale's third album is a much more chilled out, loving, caring affair than their first two albums, the music is far less electronic and more acustical, more real.

The stand-out track on See you in the Moring has to be Singin' in the Rain which is simply awesome. I had the pleasure of listening to this song when it was absolutely pouring it down with rain, but a huge smile was emblazened across my face the entire time, this song is a masterpiece, but not the best track on the album!

That acclaim goes to Something New which combines the angelic vocals of aimee duffy with the not too overpowering rap of class a, and mixes it all over an almost orchestral backing piece. The track has elements of Don't Falter and Show Me all mixed together into one awseome five-minute mellow moment.

Other tracks that are worthy of note are Harpy, a kind of up-beat yet still chilled romp of guitairs and I'm sure an acordian, and See you in the monring which doesn't really sound like anything Mint Royale was responsible for in the past but is still really good.

My review of this album really can't do it justice, and I'm sure someone else will, but unlike most albums there really isn't a track I don't like on See you in the Morning.


Chemical Warfare

I'm not talking about chemical agents used in warfare, but instead about the drugs I use to suppress the head splitting headaches that I get. I had a 'migraine' last night a few hours from the end of work, luckily I get warning of the impending pain, because my vision goes very blurry, which is not a nice feeling. I know now that as soon as this happens I have to take something to take the edge off the headache that I'm about to get, usually thats 1g of Paracetamol and 16mg of codeine (both ph eur).

In case you didn't know codeine is in the same family of drugs as heroin and cocaine, but obviously no way near as powerful, still, codeine makes you feel horrible, and is only midly preferable to the migraine itself. I hate taking it, I hate the fact that I have to, if I didn't I hate the fact I couldn't do anything, I hate the fact I have to carry it with me wherever I go, I hate migraines!

I accept them though, I think of them as pennance for being quite clever, very arrogant but true. That way I can live with them, when I think they have a purpose I can knida deal with that. The only slightly worrying thing is that are get more frequent, but less severe, the fact that I can now bear to be in a bright room, or outside is testament to this. I have been very lucky so far in that I haven't had a migraine during an exam, if I did I think I would very much fail. The last time I tried to do some work during a migraine was in a chemistry class, I couldn't work out some standard electrode potenetials, it was so frustrating, and painful, so I just quit, walked out and went home.

Anyway, by a happy coincidence I have changed my days off work so i get a few to recover.


August 22, 2005

Work work work

I've just spent the last 13.25 hours working, but there was this one woman who was soo stupid, I just had to share.

She asked if this ride would be safe for her son, I said: "If he's tall enough", gesturing to the height sign, she looked at it and the repeated "Will this ride be safe for my son?", I replied: "Yes…"
Then she asked how "much was it?"
"£2" i replied,
"each?" she enquired,
"yes"

"So how much is that for three then?" she asked.
I very sarcastically replied "£6" (with a confused look),
she then asked three more times if it was safe.

Why are some people soo stupid?

Anyway very tired, very random, very done.


August 20, 2005

Neat little function

I am doing a lot of changing of elements' text within a html document using javascript, I had this little function that would simply replace the text node of an element given, this was fine, until I wanted to add formatting, namely line breaks, our old friend,
.
So I whipped up this little babe, which works a treat:
function changeElementsTextNode(aElement,text) {
if (aElement) {
if (aElement.childNodes) {
for (var i = aElement.childNodes.length-1;i >= 0;i--) {
aElement.removeChild(aElement.childNodes[i]);
}
var textarr = text.split("\n");
for (var i = 0;i < textarr.length;i++) {
var aNode = document.createTextNode(textarr[i]);
aElement.appendChild(aNode);
if (i != textarr.length-1) {
var aNode = document.createElement("br");
aElement.appendChild(aNode);
}
}
}
}
}
just thought I'd share.

AJAX debugging

Writing about web page http://blog.monstuff.com/archives/000252.html

Just found this very cool piece of script, basically it uses the Greasemonkey extension to firefox to replace the XMLHttpRequest object with a debuging version. The script appears as a floating div which shows you exactly what XMLHttpRequest is doing on ANY webpage!

If only I'd known about this sooner I'd have less debugging code in my script for TLH2, oh well, can't hurt can it, my stuff works in ie/opera.


javascript > vbscript

Just thought I'd have a rant about vbscript, firstly let me spell it out:

vbscript sucks

Firstly, the language syntax is awful, let me explain:
1. No curly brackets, so you have to write code like:

if (someTest) then

someFunc()

end if

which not only takes longer but, I think is less clear.

2. There are no clear bitwise and logical operators, sure AND and OR exist, but vbscript decides when it wants to use these as bitwise, or logical operators, This in my view is a bad thing, every time you lose control of something as a programmer it should send a shiver up your spine. In javascript we have & and && or | and || respectively bitwise and logical and and or.

3. Subs and Functions, vbscript has this notion of a function that doesn't return anything, and calls it a sub, while javascript doesn't really care if you don't return a value from your function. While you may think subs are a good idea, you have to write silly code like this:

someSub firstParam,secondParam

or

call someSub(firstParam,secondParam)

thats right, if you use subs you can't use brackets when calling unless you use the special 'call' keyword, utterly stupid.

4. Compound operators, or lack thereof. In javscript I can write:

thisVal += 10;

but in vbscript I'm forced to do:

thisVal = thisVal + 10

I think the top one is much clearer, and this brings me neatly onto the next point,

5. Assignment and Equivalence, the operators for these two functions are the same in vbscript, =, but in javascript we have = and == respectively. How can i assign a value in a if staement in vb, I can't.

6. Too much english, IMHO, vbscript uses natural language too much, and while its a nice safety net, it looks plain ugly and makes it harder to read code.

Conclusion
If you must, learn to program using vbscript, but move quickly on to javascript or at least C syntax style languages. If you want learn a language thats has a slightly easier to pick up systax than C or java, try delphi, its way faster too.


AJAX web development

So I started a little web development project over the summer (will be released soon) and thought I'd write a little about it for fun.

It's the second incarnation of a small online game I wrote a few years back when I was first getting into server side web development. So firstly a little history lesson:

When I got my first taste of web development I quickly became interested in making more than just static web pages, at the time all I knew was javascript. I would follow the tutorials in my favourite PC mag, PC Plus, and try do clever little things like making a popup window and populating it with some pretty html. However I was constantly running up against a wall, I needed server side scripting!
I read about this thing called ASP, and started to try doing things with it, quickly I had a database connected and a simple user authentication system set up. These things were really cool, there's nothing quite like the feeling of creation.
Then, my favourite online game of the time, Planetarion, went to a pay-only business model. My friends and I were distraught! I thought I could do a better job though, with my knowledge of some ASP I was convinced that I could improve on Planetarion.
The Last Hope was born, a play on 'A New Hope' as it was originally to be a star trek vs star wars game, but it quickly evolved into something else, just two fictional races at war.
Development was slow as I only had limited spare time, and doing things in ASP quickly turned into a right bitch. My original pages were slow, difficult to follow and used bad coding techniques. My later pages were much faster, expandable and more secure. Crowning achievement of TLH was the 'ticker', which actually makes the game work, it adds resources, works out battles etc, it was originally written in vbASP, but that quickly became a nightmare, so it was written in jsASP which is so much better. My advice, never ever use vbASP, use jsASP all servers support it and it features more advanced language features, not to metion a proper syntax (see my other blog entry). Back to the ticker, it stood at over 1600 lines of code, all streamlined so it ran very quickly, it worked almost perfectly first time too.

That was really the end of TLH active development, I lost interest in the game and when someone offered to buy the code for their own game, I sold. So TLH lives on as 'Planetwars', which from time to time I have to update and fix bugs in the code, which kinda sucks, since the code is mostly horrible and reminds me of how badly I used to code. But I've always wanted to follow up TLH with a new game, with more features and more gameplay elements. So,

TLH2 was born, I decided that games like this are at there best when you have to play with others against others that are also playing together. In TLH this was enforced by alliances, galaxies of planets and the two races, in TLH2 I will take a different tack. Players will control one of several colonies on a planet, so you will share a planet with others, and you will need to work together to do well in the game. There are a lot of gameplay features that I plan, but I'll save those for another entry, but the biggest change in THL2 is the user interface.

I decided to implement TLH2's UI using AJAX (hate that term) basically instead of reloading the entire page when a user wants to do something, I use javascript to call a behind the scenes XMLHttpRequest object, this returns data from the server, which is then parsed by more javascript and the client side is updated accordingly. The system took a while to build but now it's there actual development is really quick, you don't have to create new pages everytime, with new request hadling code, you just add a few new functions and some new case statements, and you're done!

The benefits are that its much faster on the front end, the entire page doesn't have to be reloaded and so less rendering has to be carried out by the browser, also the bandwidth savings are immense.

Anyways I plan to blog more about this, maybe someone will be interested.


August 2005

Mo Tu We Th Fr Sa Su
|  Today  | Sep
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31            

Search this blog

Not signed in
Sign in

Powered by BlogBuilder
© MMXIV