Half Price Tuesdays helps you find the best deals near you!
(or something like that, but for now that’ll be good enough)
If you’d like to help test the site please sign up here:
http://www.halfpricetuesdays.co.za/
that is all.
Half Price Tuesdays helps you find the best deals near you!
(or something like that, but for now that’ll be good enough)
If you’d like to help test the site please sign up here:
http://www.halfpricetuesdays.co.za/
that is all.
3 People have asked me in the last few hours if I was dead… Nope, I’m just busy…. but in the mean time please help me pick a logo. I’m not giving credit to the designers yet because I don’t want to bias the results.
Feel free to design a better one if you feel you can… Yes, that’s a challenge.
Many years ago I worked for a company who was a Microsoft certified partner. This was a long long time ago and I must admit that back then I was quite impressed by the fact that they were Microsoft certified partners… until I started working there. Redmond hands out certifications like a crack whore hands out cheap tricks — indiscriminately and to anyone who’s willing to pay fifty bucks.
Needless to say, this morning I was reading my gmail when I saw an ad for a “Microsoft GOLD Certified Development Partner based in Cape Town” and being the sado-masochist I am I clicked on the link… it was one of those /showpage.aspx?page_id=36 sort of sites. Ugly, but not necessarily dodgy. I put an apostrophe in the page id to see if they were cleaning their inputs and behold:
Line 166: Octigon.Octane8.Containers.Page tempPage = this._page;
Line 167:
Line 168: while (tempPage.Id != 1)
Line 169: {
Line 170: if (tempPage.Parent.Id == 1)
This shows that the site is vulnerable to sql injection… which, while not necessarily implying that the site can be hacked, does imply that, given enough time, you probably could hack it or at least cause some damage. The page also pukes out all kinds of file paths and stuff that would be useful if you were trying to do them harm.
The point here is this. Why is a web development company who are obviously bad web developers Microsoft Gold Certified?
The answer can only be that Gold Certification means absolutely nothing.
I’ve been playing with the concept of creating a multilingual site and after polling the experts I started toying with php’s implementation of gettext. What a ball-ache.
Ok, so some things you need to know before we start.
Firstly, why gettext? Besides the fact that it’s a standard, gettext is good because:
Ok, so let me run through quickly how it’s meant to work, starting with some code
<?
setlocale(LC_ALL, 'af_ZA');
bindtextdomain('messages', '/var/www/myapp/locale');
textdomain('messages');
echo gettext("Hello World!");
?>
Line for line:
Next we have to create our locale directory structure. This is what it looks like:
/locale /af_ZA /LC_MESSAGES messages.po (You'll create these later) messages.mo (You'll create these later)
Obviously you would create one per language you are wanting to support. I therefore have one for en_ZA and one for af_ZA.
Next we need to create our .po file. The .po file is the unindexed, uncompiled “language” file. Basically it has human readable plaintext in it. If you had a hoard of translators working for you you would send them your .po file/s, which they would add their translations to and then send back.
The important stuff in a .po file is:
msgid "Hello World!"
msgstr ""
Now, the cool thing about using gettext is that there are tools to generate a messages.po file from .php files automatically. The following command will scan all php files looking for references to gettext and will generate messages.po file for you.
xgettext -n *.php
The next step is to copy your messages.po file into your LC_MESSAGES folders. Once you’ve copied them you can make the change to the af_ZA one.
msgid "Hello World!"
msgstr "Hello Wêreld!"
Next you need to compile both your messages.po files by running the following command in the respective directories. This command will output a binary, indexed messages.mo file.
msgfmt messages.po
Once you’ve done that you should be able to rerun your code and it should give you the afrikaans version… although it won’t because here’s what you don’t get told. gettext will only work for locales it recognises, and even though you selected South Africa when you installed your ubuntu, it still doesn’t know what Afrikaans is. Enter the myriad of confusion solved, as usual, by one simple command.
locale-gen af_ZA
This will, if you’re on a newish debian-ish box, enable the af_ZA locale and then, after restarting Apache (remember it caches), your app should be speaking Afrikaans fluently.
A while ago I was moaning about how CNA’s website didn’t want to let me on with my never-before-heard-of-crazy-combo of Ubuntu and Firefox… It seems they’ve fixed that problem which probably also fixed the “telling Google to go away” problem.
http://www.cna.co.za and http://www.google.co.za/search?q=cna.co.za
I wonder if that had anything to do with me? They never said anything. Probably because I’m such a big bully.
ath.
Oh CNA… Who is the person responsible for this? If I could see your site I would send you an email.
I wonder if they realise that their site is not going to be indexed at all?
No really, I should. I have a really good blog post chomping at the proverbial bit… Even Adrian would approve. (probably not, but a man can have hope)
Anyway, it’s GeekDinner time again, and this one, “Eccentric Eggplant” promises to be a good’un for two reasons… Firstly, I might finally be able to get Derek the marketing guru to do his now – way – too – over – hyped – and – yet – not – delivered – on speil – about – the – old – world – vs – new – world – advertising, and secondly, but most certainly not leastly, my friend Jennie will be talking about her experiences in the world of game development. Yes, she’s a real girl, and yes, she’s a real game developer currently working on something to do with Maya and the Wii. (I like how that rhymes with Maya The Bee).
Sign up here http://wiki.geekdinner.org.za/wiki/Cape_Town_November_2007
Later, Aligator!
j.
I just uploaded pictures from some of my recent escapades to flickr. Check my stream out here.
Of particular interest to general geeks are the pics of Lourens’ prototype arcade controller that we put together to test the hack-job we did on an old keyboard controller circuit. The wiring is messy as hell but it worked perfectly (once we’d got all the wires soldered in the right place). He’s planning on building a full cabinet soon, and soon we’ll be rocking teenage mutant ninja turtles… just like I did when I was 13! In case you’re wondering, he’s running this on MAME on Ubuntu and with a 1.8Ghz CPU. It runs flawlessly and he thinks he might even be able to get away with a 1Ghz cpu.
Next up is breakfast with Pascal Dornier, the designer of the WRAP board and now more recently the ALIX. For those of you reading this who have no idea what a WRAP board is, it’s one of the best embedded computers on the market and it’s tiny. The ALIX is slightly larger but has everything, including vga and usb. Pascal is based in Switzerland and offered to fly to South Africa and deliver my ALIX personally. He also brought me Swiss Chocolate which was almost as sweet as the ALIX.
I haven’t had a chance to get the Alix up and running yet, but this weekend will be fun!
(ok ok, he didn’t fly here just to deliver my ALIX, there was some synchronicity involved too)
You can find out more about ALIX and her friends here.
ath.
Never before have I been so floored by the absolute uselessness of an online process as I was 2 weeks ago when I tried to use Nu Metro’s online booking process powered by Computicket.
The Computicket site requires Java to run. I run Linux, so even though I’m able to install Java I chose not to for security reasons. So, I load up my virtual machine and browse the site using Internet Explorer 7 under windows. Off to a bad start.
Lets have a look at the site. First of all, the color scheme is terrible. It looks like something put together by a color blind person in 1994. I love the way they have taken advantage of the Internet Explorer’s customizable scroll bars, because, like, red and yellow are classy.
Next up we have the interface. At first it looks ok. Then you start using your brain. The blue box is the cinema. Check. The white dot is the cursor. You wonder, where are the seats? Are they all available? Am I losing my mind.
You assume simply that maybe the entire cinema is empty. On the right you click the up arrow twice to select that you want 2 tickets. Then you click somewhere. hoping to find an open seat.
(If you’re seeing this in an aggregated form, the rest of this story is on my site)
Because I said I would blog this.
“The smallest cock-up of them all is sometimes the solution”
– anonymous
Also, there was a small discussion about monkeys doing repetitive tasks, which led us of course, to clarifying the distinction between regular monkeys and trained monkeys.
ath.