Main
Latest
- Go Stii!
- Open Yale Courses
- Activity Streams in Atom
- New Twitter Phishing Scam
- RSS/Atom in Chisimba Courses
- Lucene Frustration
- Chisimba Module Loading
- Top Free Web Apps of 2008
- Firework Frustration
- Antfarm DNS and Linux
Archives
- June 2004
- July 2004
- August 2004
- September 2004
- October 2004
- November 2004
- December 2004
- January 2005
- February 2005
- March 2005
- April 2005
- May 2005
- June 2005
- July 2005
- August 2005
- September 2005
- October 2005
- November 2005
- December 2005
- January 2006
- February 2006
- March 2006
- April 2006
- May 2006
- June 2006
- July 2006
- August 2006
- September 2006
- November 2006
- December 2006
- January 2007
- February 2007
- March 2007
- April 2007
- May 2007
- June 2007
- July 2007
- August 2007
- September 2007
- October 2007
- November 2007
- December 2007
- January 2008
- February 2008
- March 2008
- April 2008
- May 2008
- June 2008
- July 2008
- August 2008
- September 2008
- October 2008
- November 2008
- December 2008
- January 2009
Blog closed (temporarily)
Actually this blog is not so much "closed" as "temporarily suspended". I wanted to move this blog onto my own custom platform for the past four years now since I started it. Despite what many people say about Blogger, I have to say that I was rather impressed; it's been pretty good over the years. However, it's now finally time to move on to greener pastures. I basically want to have the ability to manipulate my content by writing SQL statements on the command line instead of using some limiting interface like a noob.
Ok, there are a couple of things you'll have to take a note of.
- I will not post anything else on this blog until the migration is complete. This is because one of the first things I'll be doing is migrating the content. There is no point in making further modifications over here after the data has been migrated because then I have to manually reflect the changes over there as well.
- For the same reason as the above point, all comments will now remain closed until after the migration. Sorry, I know this sucks hard, but it's one of those things.
- The blog might go down temporarily. Please do not be alarmed and start unsubscribing from the feed if you get errors. We expect some growth pains so just relax and hold on.
If there's anything urgent please just mail me and I'll see what I can do.
Again, sorry for any and all inconvenience but like I said it's one of those things. Just hold on. :)
"I won't forget" by Jacques FT. Pebbles
I heard this song a couple of times on the radio the last while and quite liked it. Last time it was playing on KFM I was in front of my computer so thought I should quickly check on their site to see what the name of the song is. They had I WON'T FORGET - JACQUES FT. PEBBLES
listed (yes, in all-caps).
I quickly Googled and found out that this is actually a South African artist and there is even a music video on Boobtube.
I have to say, very nice, world class music in my opinion. Impressed!
Jaiku Revisited
I blogged a few times about Jaiku before. Unfortunately they stopped new registrations (well, maybe not stopped, but you need an invite code now) but I registered about a year and a half ago so I still got an account. Just enabled SMS messaging on it also so hoping to receive updates (none received thus far but my Jaiku stream is slow).
Anyway, it seems like Twitter is not the only microblogging service with capacity issues (see the screenshot).
Warcode
I was out most of the day but when I got back I saw Jonathan Endersby's post Codewar on the Clug Park I was almost outraged as I knew here goes a perfectly good 30 mins I'll never see again. However, it ended up being more than worth-while just in terms of fun. :)
However, awesome code there is not much of. However, what there is much of, especially in the PHP world, is absolutely horrible code. I didn't feel up to the challenge of writing nice code so I thought I would add to the scandal instead, which was definitely not very difficult (it's PHP after all):
<?php
$a = array();
for ($i = 0; $i < 6; $i++) {
while (in_array($x = mt_rand(1, 10), $a) || !($a[] = $x)) {}
echo "$a[$i] ";
}
Actually I can't even blame PHP here. This is just out-right disgusting.
Who on earth can read this now? It looks like it's been written by a retard. I should be ashamed! Especially after doing all that work in a conditional statement. What blatant abuse of a computer language! If this was a human language, they would have banned me off the internet due to pushing foul language to a new all-time low.
As Jonathan Hitchcock could rightly point out, this could loop forever. However I do believe that mt_rand is substantially better then the "usual" rand. After all, if you want to write freakish code, might as well do it properly.
Good challenge! Keep them coming! :)
myXchange July 2008
Finally after more than half a year we have another official myXchange meeting in George! :)
Many people apparently thought that the project is dead but they have something coming. ;)
Anyway, our myXchange July 2008 meeting is scheduled to start at 08:00 on 4 July 2008 until about 10:00 at the Hungry Camel.
For those of you that don't know where this is, if you're approaching from Knysna Road, this is just past the Woolworths (not the one at the mall, the "traditional" ("old" is such an ugly word) one in town). If you go a little further and turn around the corner you'll find the offices of JDL Printing and Design Signature.
If you need further instructions or have any enquiries please do not hesitate to comment or contact me directly.
Unfortunately I am not sure if I'll be able to attend this myself as it is quite early for me so no promises there, but irrespectively, please do blog and post your feedback about the meeting! :)
This event has also been posted on Google Calendar, iJol and Facebook. How's that for social networking? :)
The Netherlands at war with Zimbabwe?
I'm not one for taking part in the discussions regarding Zimbabwe because I try to stay out of politics. However, a Dutch friend of mine just sent me this link and I thought it was rather interesting. I am going to quote the original article titled Nederland in staat van oorlog met Zimbabwe? piece by piece and then attempt to translate it to English (I'm not saying my translation will be accurate but I'll try my best).
Landgenoten! Hebben wij weer. Oorlog! Mobilisatie! Onder de wapenen! De Zimbabwaanse oppositieleider Morgan Tsvangirai is de Nederlandse ambassade in Harare ingevlucht.
Countrymen! What do we have now again? War? Mobilisation? Under the weapons? The Zimbabwean opposition leader Morgan Tsvangirai fled into the Dutch embassy in Harare.
Op de vlucht voor de doodseskaders van de zittende potentaat Robert Mugabe. Een ambassade is een souverein stukje Nederlands grondgebied in den vreemde. Volgens BuZa-minister Maxime Verhagen is Tsvangirai. "Van harte welkom en mag hij overal aanzitten en alles opeten."
On the run from the dead-stabbers from the sitting potentate Robert Mugabe. An embassy is a sovereign piece of earth of the Netherlands in the unknown. According to the Minister of Outlandish Affairs, Maxime Verhagen, Tsvangirai is heartily welcome and may sit anywhere and eat everything.
Ons is natuurlijk weer eens niets gevraagd. Gewoon, hop laat die man een happie mee-eten, kom maar binnen met je knecht. Ondertussen maken Mugabes Moordenaars al jacht op leden van de oppositiepartij MDC. Daarbij vielen al 90 doden.
We are naturally again asked nothing. Simply let the guy grab a few bites, and come in with your servant. In the meantime, Mugabe's murderers are hunting down all the members of the opposition party MDC. There are already 90 dead there.
Vooralsnog zit de Zimbabwaanse Professor Pim veilig in onze ambassade, maar wij voorspellen u, hier gaat stront van komen. Negatieve reisadviezen, Zimbabwanen die Nederlandse producten boycotten, brandende ambassades. MinDef Eimert van Middelkoop, aub ingrijpen. Stuur Onze Jongens!
But before everything, the Zimbabwean professor Pim sits safely in our embassy, but we predict for you, here comes big shit.
Negative travel advisories, Zimbabweans boycotting Dutch products, burning embassies.
MinDef (minister of defense) Eimert van Middelkoop, you must please make a plan here. Send our men in quick, yes!
Herewith ends the translation. No I did not put this through an automatic translator, in that case the quality of translation would have been much better, but you do that for yourself, I'm out of here.
Plazes
I was just reading Joi Ito's blog and saw this in his sidebar. Plazes is a new social site that allows you to post your current location on the web. I guess this is similar to TwitterWhere in some ways, but not microblogging based. I wonder how I could integrate the two. Anyway, I posted my location and got this "widget":
Any thoughts?
work@cafe
I am a great advocate of the mobile office. To a large extent, I have been living this dream for longer than a year now. My primary office is actually my house. Over here, I have coffee, tea, food, ADSL and some nice workstations. What else do you need? :)
However, at times I do travel a lot. While I travel in South Africa, I work using a cell phone, laptop and 3G or wifi. In Botswana they don't have 3G (although apparently Orange now has Edge) but I use wifi a lot.
Today I found a great site called work@cafe. The site is in English although it seems to have been started by people from Denmark.
I completely agree - all that you need to work is good coffee, maybe the occasional snack and of course a hotspot. In South Africa, hotspots can sometimes be extortionist expensive, so I take my 3G USB modem along!
However, I think that we should start such a site for South Africa. We can have a map with the best cafe's, and possibly even a list of reviews. How's the wifi? How's the coffee? (Of course, reviews get posted to your own blog, but it must be in hreview format so that we can syndicate it in properly.)
How does that sound? Anybody interested?
Critter.co.za
Back in December, teh_oubie Jayx of Design Signature and me started a project called critter.co.za. The whole focus behind the site is mobile applications.
We wrote a little mobile twitter application in a few days (more or less the same time twaction was being built) because we were frustrated with certain features of twitter's own mobile site, mainly the contact management and sending direct messages (that was before I discovered that you can just type something like d charlvn hello there for example).
We both got pretty busy and the project hanged for a couple of months, but recently we managed to breathe some new life into it again.
The main site has now been converted to a blog with (obviously) a strong focus on mobile. In addition, all the source code for our first twitter application has now been released under the GPLv3 license on Google Code under the crittercoza project.
This is actually the first code I ever release under the GPLv3 license; I used to think it's evil as initially it was rather controversial but in the meantime it seems like it has gained some serious ground. I'm not a legal expert so other than my limited research I'm satisfied that it's fair enough for this particular project. If anybody has any objections to me supporting GPLv3 please let me know and I'll look into it again.
We definitely still have big dreams for this project but there are one or two other things that are taking priority at the moment so it will unfortunately have to wait for a few months before we start rolling out more apps.
Please note: unfortunately Twitter itself is a "little" unstable at the moment and this does at times reflect our app as well. However please if you see a problem by all means don't be afraid to report it to us! :)
We got the gear, now kick butt!
I just read South Africa spent R6 billion on submarines. I've been frustrated about this issue for quite some time so really glad somebody else decided to blog about it and get me going again. :)
Every single time I hear about the South African government spending billions on high-tech defense equipment I feel like going out of my mind. Yes there has been various accusations of corruption in arms deals the last few years; to me, corruption would sound like the only logical reason to buy more weapons right now.
South Africa is known as one of the most liberal countries on earth. We have little to fear from pretty-much anybody right now. We've got lots of international economic interest due to our mines. We're a developing country; we don't particularly have issues with the capitalists, with the communists, or with any other political regime. If there is one country that does not need a strong military, it would probably be us.
On the other side, we have millions of people that are shit-poor. They are living well below the bread line. Our economy is starting to wobble (not like we're the only country with this problem at the moment), inflation and petrol prices are going through the roof. The next couple of years the country might be in for a tough time. We need to use our resources wisely.
However, since we have all this stuff already, why don't we just send a few fighter jets over Mugabe's residence and blow the shit out of his rich propagandandic ass? No, I don't really think we should do this, but the thought is fun!
If you ask me, they should rather close down the entire military, take all that money and resources and push it straight into the police service. After all, it's like we have a civil war going on in this country right now! On the one side, you have the (generally) law-abiding citizens, and on the other side you have punk-ass criminals that just suck the life out of our country.
The only defense we need is against our criminal elements and corruption, if you ask me. And no high-tech solution will just solve that overnight, unless we maybe employ Robocop.
Firefox 3
If you have not yet heard that Firefox 3 has been released you were probably visiting Mrs. Ples' original resting ground somewhere deep in a cave in flipping Sterkfontein.
What else is there to say? I just took some screenshots.
And as always local is lekker.
And now I go to bed.
Twitter SMS Restored
After a looooong time of not receiving any SMSes from Twitter in South Africa, the feature finally got restored. I didn't realise this until the other day when I got an SMS after a direct message was sent to my charlvncell account. Hopefully they will be able to restore the Jabber bot again soon as well and all will be back to normal. We hope, because downtime is sad...
Although, note that this was on Vodacom, I assume Twitter doesn't really care about which provider so it should work across all networks but please let me know your experiences! :)
Unique IDs in the Google App Engine Datastore
The Google App Engine Datastore is an object oriented database management system.
I have to admit that it was quite a shift as I've been working almost exclusively with relational databases so far. This is my first hands-on experience with such a system so I had to do quite a bit of thinking and researching in order to make the shift.
One of the things though that keep irritating me is the amount of shit out there as far as entity ids are concerned.
Many people that are used to auto_increment in MySQL or AutoField in Django seem to think that there should be a similar field in GAE. It's an object database, so no, there is not. :)
To save you the trouble of finding this out yourself (it took me a bit of researching), here is the summary. There is a unique key for each entity. This does not work the same as properties. Here is the important part you need to know, from the Keys and Entity Groups: Paths and Key Uniqueness:
The complete key of an entity, including the path, the kind and the name or numeric ID, is unique and specific to that entity. The complete key is assigned when the entity is created in the datastore, and none of its parts can change.
The keys of two different entities can have similar parts as long as at least one part is different. For instance, two entities can have the same kind and name if they have different parents. Similarly, two entities can have the same parent (or no parent) and name if they are of different kinds.
An application should not rely on numeric IDs being assigned in increasing order with the order of entity creation. This is generally the case, but not guaranteed.
Even though a lot of people have all kinds of elaborate solutions, I still think it's the most efficient and the simplest just to use this built in system (although I have no proof or anything else really to back up this claim, it's just my opinion).
Here is an example. Let's suppose you have the following model:
class Post(db.Model):
content = db.StringProperty()
date = db.DateTimeProperty(auto_now_add=True)
Now let's say you want to get the id of a particular post entity:
mypost.key().id()
If you got the id as an integer and you want to get the post back:
mypost = Post.get_by_id(5)
If you want to order, remember these do not have to be sequential, so just use the date!
This example should work for you if you keep all the posts with root as the parent. Otherwise your solution might become "slightly" more complicated as you'll have to start working with a path down from the root to your node to ensure uniqueness (read the extract above for the reason, please note that I have not done any testing or experimenting on this).
Please comment if you have any questions. I have been sweating over GAE until four in the morning very often the last while so I'll be glad to help the open source community out in any way I can.
Unix Timestamp Bomb
This has been something that has been bothering me for years now.
I use unix timestamps on a regular basis in programming and databases. However, it almost feels like contributing to the next dot-com-bomb.
Here is a quote from unixtimestamp.com:
What happens on January 19, 2038?
On this date the Unix Time Stamp will cease to work due to a 32-bit overflow. Before this moment millions of applications will need to either adopt a new convention for time stamps or be migrated to 64-bit systems which will buy the time stamp a "bit" more time.
Well with the rapid adoption of 64-bit systems that might not be that much of a crisis then. However, the majority of them seem to run 32-bit operating systems. Anyway, since when is this a "universal" cure? There are so many interpreters out there that I'm sure quite a few things will fall over.
For example, what about MySQL? From the Overview of Date and Time Types:
A timestamp. The range is '1970-01-01 00:00:01' UTC to '2038-01-09 03:14:07' UTC.
I think I'll start avoiding timestamps so long and write future-proof applications. 2038 sounds like a long way off but that's what the guys thought about 2000 back in the '70s (while probably smoking some fine crack) and ended up costing the world billions.
Getting lines n to k
Why n to k? No idea why some computer science okes come up with such poor undescriptive variable names.
The funny thing is that I was almost certain I already blogged about this and somebody actually even gave me an answer but I can't find the post.
Anyway, sometimes I need to work with large mysqldump files. The files are too large to open in a normal text editor so I try to make minimal use of command line tools to extract certain parts of them.
I normally start off using less to find the right place in a file, then type = to display the line numbers. I get the start line number and the end line number of the piece I want to extract. Now I start off using head to give me everything until the end line number, and then I pipe the output of that into tail that then goes up to the first line number. Of course, it's a simple calculation; I just subtract the line number of the first line off the line number of the last line and give that number to tail. Then I write the output of tail to a file. For example:
head -n 4430 mysql.sql | tail -n 379 > ~/temp/cucumbers.sql
This works, but it just feels so stupid - surely it must be more efficient to have one tool to go from line number n to line number k, all in one command? Have been reading through various man pages but didn't manage to find anything yet. Now I'm wondering why I waste my time like this and not just write a simple little Python script to do the job.
But, just for the record, does anybody know of a better method?
PHP mysqli character sets
Most people that are accustomed to modern PHP development (therefore not sitting stuck in an almost-deprecated PHP 4 setup that some hosting companies like to keep us in) will probably know about the mysqli extension. It offers a bit better integration with the newer versions of MySQL than the old mysql extension.
Using the old extension, to make sure I get my data in UTF-8 format (which is then right for when I serve my pages as that's all typically in UTF-8 too), I used to do the following (or similar):
mysql_query('SET NAMES "UTF-8"');
I tried to pull off something similar with mysqli but no luck so had to go back to the docs. After a bit of searching, the answer is simple:
$db = new mysqli('localhost', 'myuser', 'mypass', 'mydb');
$db->set_charset('utf8');
(Just posting this as a lot of people have been asking me this over the last while.)
Ubuntu on ftp.is.co.za
I just tried to run some updates on my ubuntu machine and noticed that they took the HTTP service on ubuntu.mirror.ac.za down again. I needed to install a new package so started looking for alternatives. There is also an FTP service on ubuntu.mirror.ac.za which you can try and seems to work best for me.
There is a list of South African mirrors on the ubuntu wiki so I decided to check that out. The universities of Cape Town and Stellenbosch are kindly running mirrors as well but as we all know they are not too fast. The only other option is ftp.is.co.za. Years back I had some problems with this server and asked that they move the main South African ubuntu mirror to ubuntu.mirror.ac.za (which they did) and good thing too because the IS server still does not seem to be up to scratch.
For comparison, look at the last modification dates here, here and here. ubuntu.mirror.ac.za was updated on 2008-06-13 yet ftp.is.co.za is running two separate copies, one updated on 2008-05-14 and the other updated on 2007-10-18.
I would strongly advise anyone that is still updating from the IS server to move off ASAP!
Does anybody know who I can contact regarding this?
For easy reference, here is my new /etc/apt/sources.list file:
deb ftp://ubuntu.mirror.ac.za/ubuntu-archive/ hardy main restricted universe multiverse
deb-src ftp://ubuntu.mirror.ac.za/ubuntu-archive/ hardy main restricted universe multiverse
deb ftp://ubuntu.mirror.ac.za/ubuntu-archive/ hardy-updates main restricted universe multiverse
deb-src ftp://ubuntu.mirror.ac.za/ubuntu-archive/ hardy-updates main restricted universe multiverse
deb ftp://ubuntu.mirror.ac.za/ubuntu-archive/ hardy-security main restricted universe multiverse
deb-src ftp://ubuntu.mirror.ac.za/ubuntu-archive/ hardy-security main restricted universe multiverse
Intertubes getting pwned again
This is really irritating. I have been putting up with a ridiculously slow and unreliable internet connection the whole day. It's not international traffic that's the major problem, it's local! It seems like there is a major break between Verizon and Internet Solutions (at least):
charlvn@charlvn-desktop:~$ tcptraceroute robotics.za.net ftp -f 3
Selected device eth0, address 10.0.0.3, port 46002 for outgoing packets
Tracing the path to robotics.za.net (196.40.104.130) on TCP port 21 (ftp), 30 hops max
3 cdsl1-rba-vl2257.ip.isnet.net (196.38.73.237) 61.787 ms 63.352 ms 61.493 ms
4 curp1-rba-gi6.isdsl.net (196.38.72.238) 118.231 ms 64.852 ms 62.633 ms
5 cdsl1-rba-gi4-0-4-43.ip.isnet.net (196.38.72.229) 62.077 ms 83.515 ms 93.450 ms
6 cdsl2-rba-gi0-1.ip.isnet.net (196.36.80.162) 179.468 ms 63.345 ms 67.324 ms
7 196.36.80.165 64.956 ms 61.686 ms 63.918 ms
8 core2a-ny-gi1-0-3-256.ip.isnet.net (168.209.0.242) 672.432 ms 675.307 ms 674.586 ms
9 core1b-ny-gi1-2-8.ip.isnet.net (168.209.245.1) 675.684 ms 678.702 ms 677.787 ms
10 12.86.139.193 685.724 ms 676.768 ms 683.498 ms
11 tbr2.n54ny.ip.att.net (12.122.105.86) 816.649 ms 785.549 ms 794.041 ms
12 12.122.105.89 678.047 ms 1288.597 ms 883.257 ms
13 192.205.34.50 842.505 ms 1123.149 ms *
14 152.63.3.109 (152.63.3.109) 1577.325 ms 678.541 ms 672.606 ms
15 0.so-1-1-2.XT1.DCA6.ALTER.NET (152.63.1.41) 685.771 ms 771.382 ms 723.170 ms
16 POS6-0.IH1.DCA6.ALTER.NET (152.63.35.113) 723.510 ms 728.330 ms 727.427 ms
17 so1-0-0.IR1.LND19.ALTER.NET (152.63.32.26) 1147.374 ms 1151.400 ms 1125.061 ms
18 so1-0-1.cr1.lnd19.alter.net (196.30.229.189) 1168.443 ms 1077.058 ms 1078.832 ms
19 s6-1-1.cr2.cpt1.alter.net (196.30.229.222) 1324.160 ms 1289.453 ms 1268.691 ms
20 srp1-0-0.gw2.cpt1.alter.net (196.31.249.67) 1476.504 ms * 1440.781 ms
21 vlan10.hr1.cpt1.alter.net (196.30.176.36) 1304.027 ms 1314.579 ms 1303.213 ms
22 196.30.77.76 1458.671 ms 1494.255 ms *
23 firewall1a.your-server.co.za (196.40.102.244) 1448.002 ms 1416.350 ms 1420.459 ms
24 * win5.wadns.net (196.40.104.130) [open] 1899.911 ms *
Sucks! I hope they sort it out soon so that I can fetch mail again at a decent speed... :)
Google Apps + App Engine
Having a Gmail account automatically gives you a Google Account that you can use to log into Google, Blogger, Orkut, etc. However, having a Google Apps account does not. I had to separately register charlvn@charlvn.za.net as a Google Account afterwards, for example.
The funny thing is that, if I try to log into Google App Engine using charlvn@charlvn.za.net, I get sent into an endless redirect. This does not happen with my Gmail account nor does it happen with any other Google Account. I asked one of my friends to test it on his Google Apps domain and he got exactly the same problem.
However, when I try to log into my special login page then things work fine.
Strange!
Privacy Hole in Firefox 3
Firefox has excellent privacy options; you can let it cover (almost) all your tracks when closing the browser:
However, it does not clear your popup blocker exceptions! So if you allow a popup window on a site, if you don't specifically go and clear these, other people might be able to see some of the sites you visited:
health24.com against hyperlinking?
This is really strange to me. Go to health24.com and open the terms page (look for the link right below the logo). Go to sections 32 and 33. They actually forbid you to link to their website, even the homepage! What kind of sense is there in that?
Sorry for not including any hyperlinks or quotes in this post. These guys seem "slightly" paranoid to me. But I'm not the legal expert. :)
I got fragged, I mean tagged, again!
So so... I got tagged once again! An excellent reason to procrastinate indeed, I could not have thought of anything better... :P
So, which albums would I take with me?
- Rammstein: Mutter
- Rammstein: Reise Reise
- Rammstein: Herzeleid
- Rammstein: Sehnsucht
- Rammstein: Rosenrot
Hey, stopped laughing, noob! Rammstein is teh_shit! :P
So, what would I take with me?
- Cellphone (duh)
- Laptop (with my usual range of accessories, including 3G modem)
- Google Summer of Code 2007 T-Shirt!!
Mmm, I smell a conspiracy here... I think teh_oubie is starting to wake up my appetite to go to another 27/Geek Dinner! :)
However, now who to victimise, ahem, I mean tag?
In alphabetical order, girls first! :)
And now the boys...
Live Mesh Tech Preview
Just a little more than a week ago, I got an invite to join Microsoft's new hype technology Mesh.com.
I can't personally get massive advantage out of this platform as it doesn't support Linux as the operating system yet. However, the web interface seems to work perfect in Firefox. It seems like the Mac and Mobile support is also still hanging in the air.
I have to be honest that after all the hype I kind-of expected more. Then again, this is Microsoft we're talking about here, hype is their main strategy it seems (not like they're winning with Vista - even hype won't save them there).
But other than linking together your different devices, a pipe dream, and being able to share files between them, I'm not so sure what the point behind this site is.
5GB of storage space for anything you like isn't that bad though. Apparently you can have personal storage space and also share certain files / directories with certain other people. I don't know others that also got an invite though.
So essentially I'm unsure. It seems like they are just trying to build a windows environment on the web. In that respect they did a pretty good job, but who cares? It's bloated, slow... Not suitable for Africa although I'm sure they don't care about that either.
I don't know, maybe I just need to be patient; hopefully they will come up with some better ideas soon. Oh yes and the Windows-only Silverlight integration doesn't help me either.
Aspartame Dangerous?
I know many people personally that use artificial sweeteners for various reasons. Some people try to avoid getting hyperglycemic and develop diabetes, Some people are trying to lose weight. Personally I love both tea and coffee but drink both bitter (I hate sweet stuff anyway). There is quite a controversy about Aspartame however. Today I found this site; although I'm not sure if I can trust it 100% it does seem pretty credit-worthy to me. An extract from the article titled Dangers of Aspartame, Nutrasweet and Artificial Sweetner: Review 1:
Aspartame tastes sweet because, attached to it, is a molecule of methanol (wood alcohol). The methanol is very loosely bound and will fly off with the slightest heating or when consumed(20,51). Because methanol’s toxicity is well known, millions of dollars were invested by Aspartame’s inventors in an attempt to attach some other “safer” substance, but this attempt was not successful. With the approval of Aspartame, a new source of methanol was added to what is a very short list of methanol containing foods.
Methanol - Trojan Horse: Why is methanol dangerous? Inside cells, methanol is converted to formaldehyde(30), an undetectable toxin and recognized cancer causing agent of the highest order (Group I)(11). Even when formaldehyde is injected directly into a living human, it turns into formal hydrate(4,27), a very aggressive molecule that instantly attaches to any protein molecule which it makes contact. The formaldehyde molecule then completely disappears within the cover of the much larger protein(31,32). No diagnostic procedures, can detect a protein molecule so changed, yet the damaged molecule, loses function.
Damaged protein molecules are not tolerated by the immune system. Specific detection sites for “formaldehyde modified protein” are found on white blood cells called macrophages(23,24). Macrophages seek out and destroy these proteins at a rate 100 times faster than proteins not treated with formaldehyde(25). Upon autopsy, macrophages are found in the damaged areas of the brains of those who have died with MS(42,44).
Mmm, if this is true it's definitely reason for worry. There are a lot of sites out there where people claim they have been developing all kinds of diseases (particularly cancer) due to the intake of aspartame. Worth a quick Google or two.
Fasting for Good Health
Before you start reading this article, please take note that I'm not a medical doctor and hold no medical qualifications. I'm just a casual researcher. I do not accept any responsibility for what might happen or what might not happen if you are crazy enough to follow my advice.
I have been suffering from chronic sinusitis and asthma in the George area for as long as I can remember. Lots of people do around these parts; it's the main reason I want to GTFO of this place but, you know, moving is inconvenient at the best of times... My main concern is obviously connectivity as without that I've got problems and at my current house I have an excellent 3G signal as well as ADSL coverage.
I find anti-histamine to be pretty handy every now and then and have been using it for probably more than 15 years now but the only natural cure I've found so far for my shit is short-term fasting, and I have to say it works brilliantly.
If you know me in person you would know that I'm fairly thin so I can't do longer-term fasting. The maximum I stop eating for is about 2-3 days at a time. And also, when I do, I only refrain from eating food, not liquids. The body can get depleted from water very quickly and I don't see the benefits so I think people that get thirsty need to drink immediately.
Without trying to sound metro-sexual, everybody that stays here will know that the water quality in George is really horrible. I would recommend drinking bottled water, water that has been boiled, or water that passed through a good filter. Tea is also fine but I tend to prefer green or rooibos tea without milk or sugar as those defeat the object.
Short-term fasting has been brilliant for my chronic issues. Also, in my opinion it's the best thing for the casual stomach bug or when you pick up indigestion problems (such as the excessive production of hydrogen sulphide in the digestive tract which tends to be rather unpleasant).
I've recommended fasting to lots of people now but the first thing you hear is "no you can't do that it will kill you" etc. Listen, over the years a lot of people have been going hungry at times and they survived. My grandma survived in the Netherlands right next to Germany during the second world war (right in between Germany and the UK); currently, the Zimbabweans are probably the leading authority in Africa when it comes to first-hand experience with food shortages. Probably the only time it's dangerous is if you are half-dead already or have some strange glucose-related disease. Oh yes and of course if you've got existing eating disorders.
If you're anorexic and reading this, go to your flipping doctor for crying out loud! Thin is overrated, just ask me! :P
But yeah most people will just laugh at you if you start going on about fasting. Now today I found some very interesting information which made me smile. Please read the following extract from the Wikipedia article about fasting:
Research conducted by University of California, Berkeley suggests there are major health benefits to fasting. Benefits include a reduced risk of cancer, the slowing of the aging process and the potential to increase maximum life span[17]. Currently, the reduction of caloric intake is the only proven method of increasing the lifespan of an organism[2]. According to Dr. Mark P. Mattson, chief of the laboratory of neurosciences at the National Institute on Aging, fasting every other day (intermittent fasting) shows as strong if not stronger beneficial effects as caloric-restriction diets[3]. According to The National Academy of Sciences other health benefits include stress resistance, increased insulin sensitivity, reduced morbidity, and again increased life span [4][5]. Long term studies in humans have not been conducted. However, short term human trials showed benefits in weight loss. The side effect was the participants felt cranky during the three week trial. According to the study conducted by Dr. Dr. Eric Ravussin "Alternate-day fasting may be an alternative to prolonged diet restriction for increasing the life span[18]."
Adherence to Greek Orthodox fasting periods contributes to a reduction in the blood lipid profile including a non-significant reduction in HDL cholesterol and possible impact on obesity [19].
This sounds very positive but hold on a second before you start to fast. When you do it you will probably notice that your body starts to detox quite rapidly and aggressively. This is a completely natural process but if you are used to eating several times a day you keep stopping the process and toxins might build up. If you then suddenly stop eating totally then your body might not be able to handle it. You might "phase" yourself into the process by eating less, eating less frequently, eating healthier, etc, especially before going onto a fast that lasts multiple days.
Also, read this:
Also, just yesterday, more good information was added to the Wikipedia which you should read:
As a protective biomechanism, many toxins are stored within fat. During catabolism, these toxins are liberated and then released into the blood stream. Increases the likelihood of acetaminophen poisoning, possibly because of depletion of hepatic glutathione reserves.[16]. The body will continue to use fat for as long as there is fat to consume. The body will generally indicate to the faster when fat levels are running extremely low (less than 2%) with an increased urge for food.[citation needed] Fasts are usually broken long before this point. If the fast is not broken, starvation will begin to occur, as the body begins to use protein for fuel. It will begin with the least important proteins, then muscles, and eventually organs. Death may occur before the body turns to organs as a fuel source however.[citation needed]
Note the [citation needed]s so watch the wikipedia article but to me personally this makes sense and connects to what I said earlier.
And, as always, be careful, keep safe and consult a qualified medical professional when in doubt!!
Please let me know your thoughts / experiences!
Navigate Away JavaScript for Gecko
I have been seeing this dialog box Are you sure you want to navigate away from this page?
on lots of sites (particularly Google) recently. I suspected it might be something standard because in the Afrikaans version of Firefox it's translated.
I searched around like a dog to get the right code for Firefox/Gecko though. I got to some IE resources that didn't help me much and a lot of forum posts where people were talking more shit but eventually I just figured it out myself. This is the code that worked for me.
var body = document.getElementsByTagName("body")[0];
body.setAttribute("onbeforeunload", "return 'Please remember to click the \"save\" button.'");
I hope this helps somebody; these these things should mos not be a mission like this. I tested this only in Firefox 2.0.0.14 so I'm not sure about the compatibility of this. If somebody knows of a nice cross-browser script like this please let me know!
While searching, I found some interesting things though. Apparently Firefox 3 now supports window.returnValue for window.showModalDialog according to the DOM window reference. Why is window.onbeforeunload not documented though?
Plurk Python Post Script
Neville Newey of muti wrote the following Python script similar in function to the PHP script I wrote a bit earlier today. Essentially it lets you post a new message to your plurk account.
import urllib
import urllib2
import cookielib
# Based on Charl VN's PHP Code
PLURK_LOGIN_URL = 'http://www.plurk.com/Users/login'
PLURK_ADD_URL = 'http://www.plurk.com/TimeLine/addPlurk'
NICKNAME = 'yourname'
PASSWORD = 'secret'
if __name__ == '__main__':
# Set up
jar = cookielib.CookieJar()
handler = urllib2.HTTPCookieProcessor(jar)
opener = urllib2.build_opener(handler)
# Login phase ...
url = PLURK_LOGIN_URL
values = { 'nick_name': NICKNAME, 'password': PASSWORD }
data = urllib.urlencode(values)
req = urllib2.Request(url, data)
response = opener.open(req)
# Now plurk something!
values = {'content': 'Plurking from Python!', 'lang':'en', 'no_comments':'0'}
data = urllib.urlencode(values)
data+='&qualifier=%3A' # Dont know if this is needed
url = PLURK_ADD_URL
req = urllib2.Request(url, data)
response = opener.open(req)
print response.read()
This is the base for a new hook script so that you can now follow muti on plurk!
Muti API Updates
Firstly, all the dates are now in RFC 3339 profile instead of "MySQL profile". For example, instead of 2008-06-04 19:12:21 you now have 2008-06-04T19:12:21Z.
Secondly, all dates are now in UTC+00:00 timezone instead of some American timezone where the server is hosted in a data centre (the place with explosions, spitzensparken, fireworks and stuff).
Thirdly, the userinfo API call now serves content as application/xml.
Fourthly, we now have XML output for the active list.
Today's Stupid Idea: Plurk Karma
Ok I actually forgot to post about this earlier. On plurk they have this stupid thing called "Plurk Karma". What a kak idea. Basically they are saying that if you go and plurk away like mad then you score massive karma. Ahem... You should not encourage people to do that! Basically this is a lesson we learned from Twitter. For a while it got pretty addictive. Now Twitter is a waste as they can't keep up with the traffic and the signal to noise ratio got really horrible.
People should plurk because they have something to say, not just to score more Karma.
And sorry for all the crap I've just been posting to plurk a few minutes ago as I was testing my PHP script. If I develop a lot of that kind of crap I'll open up a separate account just for development purposes.
Plurk PHP Post Script
Plurk seems to be the latest South African internet obsession. As various people including Stii mentioned, Plurk lacks an API. That never got me down though. Most people would probably like to have a script to post updates, so I thought I should start with that.
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($curl, CURLOPT_COOKIEFILE, 'cookie.txt');
curl_setopt($curl, CURLOPT_URL, 'http://www.plurk.com/Users/login');
curl_setopt($curl, CURLOPT_POSTFIELDS, 'nick_name=noob&password=pwned');
curl_exec($curl);
curl_setopt($curl, CURLOPT_URL, 'http://www.plurk.com/TimeLine/addPlurk');
curl_setopt($curl, CURLOPT_POSTFIELDS, 'qualifier=%3A&content=' . urlencode('i r l33t h4x0r') . '&lang=en&no_comments=0');
curl_exec($curl);
curl_close($curl);
The script is simple enough to be self-explanatory but please comment if you have any questions.
Optimus Microformats Parser
Stii has been doing some really cool things with Optimus recently. Although it seems to be a really powerful parser, I took a look at the code and it seems to be generally something I would like to stay away of. First of all they are using very experimental XSLT PHP functionality that apparently means you need to custom-compile the latest PHP CVS checkout or something. Then secondly, the actual XSLT documents they are using are not exactly some of the simplest. Although I really have great respect for what these guys have done, I would much rather stick to something really simple and straight forward. Microformats parsing is actually really simple; all you need is some kind of getElementsByClassName or similar. I would much rather go the efficiency route myself.
However the last version of hKit I used also was a bit more than I needed and I found a couple of bugs in it; maybe it's better now but I'm thinking something minimal and something custom at the moment.
XFN Discovery
I have been thinking about writing some scripts that does analysis of how people have relationships with each other in the blogosphere. Obviously I am going to base this on XFN which just seems to be the most widely used format for expressing relationships between people. I can then use a variety of existing microformats parsers out there or just write my own. However, I'm unfortunately not so sure about the completeness of this.
To illustrate my problem, let's use an example. Stii has his XFN information on the front page of his blog. If my crawler starts at his blog, I would gather a list of the links in his blogroll and then start checking each one of those links for XFN information. Then I would take each one of those links and carry on until I visited all the different blogs.
This works fine if everybody is publishing their complete XFN contact lists on the front pages of their blogs. However, in reality it doesn't work like that. Firstly, if I had to list all the people in my Facebook account alone, I have more than a hundred people! All the people I am linked to in total across the various social networking sites would probably end up making one massive page! That I would certainly not want to put on the front page of my blog.
In addition to that, take this case. Stii is linking in his XFN list to this blog. However, my XFN contacts are not on this blog; it's actually currently on the front page of my main site.
Here many people would probably be talking about Yadis; however if we link to our OpenID providers and FOAF documents from link elements in our head sections, why not do something similar for XFN documents. For example:
<link rel="xfn" href="http://charlvn.za.net/">
Any thoughts?
Google Social Graph API
I just read a fairly old post titled URLs are People, Too on the Google Code Blog. The following paragraph sounded very similar to our initial discussions regarding SDSN:
So you've just built a totally sweet new social app and you can't wait for people to start using it, but there's a problem: when people join they don't have any friends on your site. They're lonely, and the experience isn't good because they can't use the app with people they know. You could ask them to search for and add all their friends, but you know that every other app is asking them to do the same thing and they're getting sick of it. Or they tried address book import, but that didn't totally work, because they don't even have all their friends' email addresses (especially if they only know them from another social networking site!). What's a developer to do?
I experimented with the Google Social Graph API for a couple of weeks now but I'm not entirely sure I want to make use of it. With my experience, the data gets cached on Google like all of its search results. In other words, if you make changes on the web, it won't necessarily be immediately reflected on the API. If you do your own parsing, obviously this places you in control, but if you want to rely on Google that might be a frustrating thing for people who just set up their XFN blogrolls (for example) and then want to have your site make use of it.
This is at least as far as outgoing links are concerned. As far as incoming links are concerned, it's an entirely different story. To find all of those you would have to go and crawl the entire web, much like Google! Certainly not something I have the resources for at this point in time. So although the results might not always be 100% complete and updated, at least you can get a rough idea of who is linking to you.
Copyright © 2004-2009 Charl van Niekerk. All articles are released under the Creative Commons Attribution 2.5 South Africa licence, unless where otherwise stated.










