Sad TV and OF is back!
Outrageous Fortune was on tonight. Two words: Totally Awesome.
Then Private Practice came on, and it was sad. Damn them.
More Geekiness (Auto Signature)
Some new geekiness going on. I have a journal/blog over at SweetnLeo.com, where I talk about things relating to GaiaOnline. I wanted a way of making this available inside Gaia, so I came up with this.
It’s an image that shows the last 4 blog titles. How it works if I have a script that uses MagpieRSS to pull the feed from the blog, and then using PHP + GD I generate a simple image. When I make a blog post, it pings the update image script, meaning when I add a new entry the image will update.
It gives me a way to show what’s going on. Now to make it more pretty (as it’s just plain text right now).
Super Mario Galaxy 2
A weird concept, but it works. Seriously, once you get the hang of running upside down, the game is astonishingly fun to play.
Now there’s a second game coming out in the series (I should say came out, as it came out a couple of days ago).
Actually, now that I think about it, my birthday is on Wednesday…
LOST
The final just aired here in New Zealand. I was good all week, I avoided all spoilers, I wasn’t tempted to peek at what happened in the final. I’m glad I didn’t spoil it, it was worth waiting for the end.
I loved the final up to the point. I’m still trying to wrap my head around the last few minutes, so I’ll leave that alone for now.
Something I love about this show is that we got an ending. That’s rare in television, when the fickle networks cancel anything that looks like a ratings hole (something longer series tend to be). LOST managed to get an end instead of being dropped suddenly (Traveller anyone?) and for that I am thankful.
We also got answers to many of the questions. What the hell was the smoke monster? Where did the polar bear come from? How were all the dead people showing up all over the place? What was the point of the island? Who was Jacob? Why did The Others want the names of everyone who crashed? What was up with the hatches? Why did the plane crash? Why did they have to come back? Why didn’t Richard age? What did Juliet mean by "going Dutch" when she died?
What the hell was the smoke monster?
The result of Jacob pushing his brother (the man in black) down the light at the centre of the island. While the man in black died (his body showed up later, clearly dead) the smoke monster was born in that instant.
Where did the polar bear come from?
In the 70s the island was home to the Dharma Initiative, a organization who were performing experiments on the island (trying to find out about its unique properties). They had multiple hatches doing different experiments, one was a zoo with different animals. So they where the ones who bought the bear to the island originally.
What was up with the dead people showing up again?
They weren’t. None of the dead came back to life (with the exception of those who talked to Hurley). The black smoke monster/man in black has the ability to take the form of anyone who is dead. This means he appeared as Jack’s father, he was the one manipulating things throughout the series. When Alex came back and told Ben to do what Locke said, it was actually the man in black doing it for his own agenda.
What was the point of the island?
Beneath the island is a source of light, something important that is part of everyone. Think what you want, the point of the island is to keep it there and protect it from those who would want to do harm to it. After Jacob and his brother fought, the focus changed to keeping the malevolence born (the smoke monster) trapped on the island as well as keeping the light safe.
Who was Jacob?
You heard Ben talk about Jacob throughout the series, but he really didn’t show up until the end. Before that it was the man in black who was manipulating thing (Jacob’s cabin was actually home to the man in black). Jacob is not god, he’s not an angel and he’s not a divine being. He’s a man, born like any other (as a twin) and is the current guarding of the island and the light. He is the one calling people to the island, for the purpose of finding his replacement.
Why did The Others want the names of everyone who crashed?
They needed to know because that’s what they were told to do, from Jacob. Although it is unclear who was calling the shots, since it turns out a lot of their instructions came from the man in black, and Jacob would already know the people who crashed since he was the one calling them.
What was up with the hatches?
They were the different experiments by the Dharma Initiative, built in the 70s.
Why did the plane crash?
You can blame Desmond for this, but also Jacob. Jacob wanted certain people on the island, so they would come. However what caused the crash was Desmond not pushing the button in the Swan hatch, causing the built up magnetic energy to release, crashing the plane that happened to be passing overhead.
Why did they have to come back?
They never should have left. The people who left were candidates to replace Jacob, and they were all needed on the island. So Jacob convinced them to come back, in different ways (like talking to Hurley on the mainland). Jacob seemed to have the ability to leave the island at certain points in time.
Why didn’t Richard age?
Richard believed he was in hell, due to his sins. When offered the job as Jacob’s adviser/liaison. he asked to have his dead wife brought back as payment. But Jacob couldn’t do that (neither could the man in black, although he could make it look like it). So Richard asked for absolution, but Jacob couldn’t offer that either. Finally Richard asked to never die, and Jacob said that was something he could do. So simply put, Richard didn’t age because that was his payment from Jacob. However in the final we see that Richard does begin to age, which makes him realize he wants to live.
What did Juliet mean by "going Dutch" when she died?
Look at her conversation with Sawyer in the final, when they met again. He asks her out to coffee, but mentions he only has a dollar left (since the machine ate his other one). When she was dying, her consciousness was drifting between the realities. That’s how she knew it worked, that they did succeed in their plan of stopping the plane from crashing.
There are so many more questions that did get answers, and that’s why I love this show. Most things can be explained, some can be guessed, and others are left open. It was a show that was definitely different. I’m sad it has gone.
Object Oriented Fun
Currently my attempt is to rewrite my progress so far in a more OO manner. What I’ve previously done is use classes and objects, but infrequently. Let’s see if I can do this better, third time around.
XP Hosts File
C:/PATH TO WINDOWS/system32/drivers/etc/hosts
I use my hosts file in conjunction with my local network (to give names to my different computers without use of a DNS Server) as well as my XAMP installation (to run different development websites locally).
The host file lets you bind an IP address to a specific name. Usually your browser will check the hosts file first before contacting your DNS Server for the IP address.
The format is simple, IP – tab – Space separated list of host names.
Eg: 192.168.1.4 bender.home
Each new IP should start on a separate line.
Just a note: I only run XP for now, so I’ve no idea where this file is located in Vista or Windows 7. If you know, give me a bell ![]()
April Fools
It’s the first of April here already, and I avoided the jokes. However one did arrive in my email inbox which caused me to do a double-take.
One Day is a New Zealand discount website, where each day they will throw up 3 discounted items for sale, for a limited time and in limited quantities.
These items can range from anything; from food to clothing to technology. However the example above was a complete surprise. It’s pretty obviously which one I refer to.
Clicking the link took you to the one day website, where the second item was not a Russian bride, (as advertised), but makeup and beauty products.
I like a company with a sense of humour. By the way, watch out for Google. They usually have a few pranks each year.
Apache AuthMySQL
I had the pleasure of trying to figure out how to use AuthMySQL the other day, as I wanted to password protect my folders (in a simple fashion, since the content wasn’t essential) but wanted to avoid the whole flat-file .htpasswd system.
Lots of searching on Google helped, but it was funny that I found I didn’t have the Mod_Auth_MySQL module in XAMPP. It turns out the later releases of XAMPP removed the module for some reason. (There was a reason for it, but I wasn’t really interested in it, since I just wanted it working on my local machine!).
Getting the XAMPP Module
Getting it was actually pretty simple. You just need to find and download the 1.6.2 version of XAMPP. Make sure you download the correct version based on your operating system (since grabbing the Windows file wouldn’t work on Linux etc…).
It sounds insane downloading the entire thing for just one file, but unfortunately that’s really all you can do (unless you manage to find it elsewhere).
Once you have the mod_auth_mysql.so file, put it in your xampp/apache/modules folder, and then edit the xampp/apache/httpd.conf file.
Down around the file (was line 132 for me) is a line that looks like:
;LoadModule mysql_auth_module modules/mod_auth_mysql.so
The semi-colon at the front is basically a “comment”, disabling the module. Remove it, and then save the file. Restart apache (in Windows you can use the XAMPP manager).
Creating the Database Table
This is MySQL authentication, so we need to create the table. The table is pretty simple, at the most it needs 3 fields, a username, a password and a group.
Here’s a quick create script, but you can obviously make (or use) your own. I would suggest you don’t use plain passwords, rather if you use the MySQL md5 function, apache can work with that.
CREATE TABLE IF NOT EXISTS `auth_user` (
`id` int(3) NOT NULL AUTO_INCREMENT,
`username` varchar(25) NOT NULL,
`password` varchar(32) NOT NULL,
`usergroup` varchar(20) DEFAULT NULL,
PRIMARY KEY (`id`)
);Then add a user to the database.
INSERT INTO `auth_user` (`username`, `password`, `usergroup`) VALUE ('username', 'password', 'groupname');The group field should just be a group name, a simple string. We’re being simple here, but things can get more complicated if you want (such as multiple groups).
Setting Up
You can set up the authentication in your .htaccess file, like anything else.
Edit your file and add the following:
# MySQL Auth
AuthMySQLHost {your database host}
AuthMySQLUser {database username}
AuthMySQLPassword {database password}
AuthMySQLDB {database name}
AuthMySQLUserTable {user table}
AuthMySQLNameField {username field name}
AuthMySQLPasswordField {password field name}
AuthMySQLGroupField {group field name}
AuthMySQLNoPasswd on
AuthMySQLPwEncryption md5
AuthMySQLEnable on
# Standard auth stuff
AuthType Basic
AuthName "{Public name}"Anything in {brackets} were added by me, and should be replaced (with no brackets).
Finally, on the folders you want to protect, just add the regular directives.
# If you want to allow any valid-user
Require valid-user
# If you want to allow only a specific group(s)
Require group groupname secondgroupnameThat’s really it.
(Greasemonkey) Gaia Avatar Undo
I had another case of “distracted Greasemonkey writer”, where I’m on a web page and wondering why this certain something really doesn’t work that well.
Anyway, it resulted in me writing a new script, which I call the Avatar Undo. Like my last one, this is for GaiaOnline.com, and basically it adds a simple “undo” button to the avatar page. It records what items you put on, and in what order. Then when you click undo, it will go back and reverse those changes.
It is obviously not perfect, since it cannot compensate for server-side changes (like other items being removed due to layering clashes), however it is pretty good for the simple stuff.
This is something we all should hope Gaia adds, sometime in the future.
It can be found on my Gaia-based website, as well as on Userscripts.org.
Remember, this is a greasemonkey script, so if you don’t have it, go get it!
IDs starting with Numbers
We all know the ID and NAME conventions on HTML tags. The ID must start with a letter, and then afterwards can be any number, letter, hyphen, underscore or colon. So creating an ID of 56green would not work, as it begins with the number 5. Where as S6green would be perfectly valid.
Recently I wrote a greasemonkey script, and I found (to my horror) the website had used alphanumeric strings as their IDs. That was fine, but the catch was they didn’t check to see if each string followed the standards, meaning half started with a number.
ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens (“-”), underscores (“_”), colons (“:”), and periods (“.”).
It didn’t bother them, as the elements were not directly referred to. However it was a pain for me and my script, and so I had to find a way to call the element.
In my example, the name of the element will be 25tuna.
$('#25tuna').hide();
// In this case, nothing would happen. The element would not hide,
// even if it was still on the page.
$('#25tuna').length
// Would = 0, even though we can see the element sitting on the page.Instead, I ended up having to use a workaround for the issue.
$('div[id="25tuna"]').length; // now will equal 1
$('div[id="25tuna"]').hide(); // should now workSo while you can’t refer to the element using the regular notation, you can use it through attribute notation (since ID is another attribute on an HTML element).
This is not ideal, and does introduce its own performance issues. If it’s a case where you are able to alter the HTML element on the page directly (being your own website), do that and make the ID/NAME attributes conform. It will save effort and frustration.
However if you are writing a greasemonkey script (in jQuery like I did) then you may find this is your only option.
Posted by Cody in