Sunday, July 1st, 2007
During this Challenge of the Month: Don’t use refined sugar.
According to my friend Wouter, refined sugar is basically pure poison. Refined sugar is the sugar you buy in bags to put in your coffee, tea or whatever. It’s bad for your teeth and bad for your body. Sugar breaks down vitamins and other stuff your body needs and gets from the food you take in.
Since I only put sugar in my tea (used to be in my coffee), it shouldn’t be too hard to stop using any sugar. All I need to do is acquire a taste for sugarless tea which, according to another friend, isn’t that hard. So it’s been decided: no more sugar.
Previous challenge: Coffee
I stopped drinking coffee almost completely. Every once in a while (when visiting my parents or when I’ve been out to dinner) I have a single cup. About one in 1.5 weeks. That’s just fine with me.
Thursday, June 28th, 2007
Most people know about this one:
>>> from this import *
"""
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
"""
But most don’t know this:
>>> from __future__ import braces
File "", line 1
SyntaxError: not a chance
Thursday, June 28th, 2007
Well, the blog is back online. And it only took me a year and 5 months! I’m now running under WordPress. I’d be using MvBlog, but it’s not as mature as I need yet. WordPress offers lots of plugins such as Wiki-style editing and syntax color highlighting; two things I absolutely need.
Converting all my old blog entries was quite a challenge. I wrote a little script which read from the old database, converted some stuff and then wrote them back into the wordpress database. For some reason though, the inserted entries would not list. It took me almost 15 minutes to figure out that I had written post_status = 'published' instead of post_status = 'publish'. Whoops! Then I couldn’t get source code from my old log to display properly in the WordPress log, so I had to write some more converters that mangled the old BBCode I used to use in my old blog before converting it to WordPress.
Ah well, it’s up and running now, and I hope I’ll find some time to actually write articles for this thing.
Update: Wow! WordPress’ editor really really SUCKS! It’s basically impossible to get quotes in there right. It doesn’t allow me to use my remote editor (Vim), unless I’m on the code tab. It keeps removing spaces, empty lines I insert, tags it doesn’t know, etc. This is one bad piece of shit. I’ll probably get used to it though.
Friday, June 1st, 2007
During this Challenge of the Month: Don’t drink any coffee.
I drink too much coffee. And I really mean too much. About twenty mugs a day during weekdays; five a day on the weekend. It’s an addiction, plain and simple. When I stop drinking coffee, I’ll get a headache for two days. Recent scientific research has shown that two cups a day is good for you, but I’m not buying it. Most of the media-quoted ‘scientific’ research I’ve seen in the last couple of years has been flawed beyond hope.
So I’ve decided: No more coffee. As with any addiction, I don’t believe you’ve fully overcome the addiction if you completely stop using whatever ‘drug’ it was you where taking. It’s all about moderation, and you’ve only conquered your addiction if you can use the previously over-used drug in moderation. In light of this, I’ll note that I consider it okay for me too drink, say, one cup of coffee after I’ve been out to dinner (which happens maybe once every two to three months). Let’s see how it goes.
Notice: This challenge actually goes for both the month May and June, but whatever.
Friday, June 1st, 2007
When it comes to computers, I’m what I call a ‘tweaker’ (no relations to tweakers.net, thank you very much). I spend a lot of time getting my computer setup, my directory structure, my documentation, my configuration, my everything just right. This can often take up a lot of my time, but I think I more than earn that back because it makes my computer and the tools I use easier and faster to use.
Now, I was thinking. Why not apply the same tweaking principle to my own life? I mean, I’ve got more than enough personal flaws. I smoke too much, I drink too much beer, (used to) drink too much coffee, I don’t exercise, etc. So I decided to start a ‘Challenge of the Month’. Here’s how it works:
On the first day of each month, I’ll set a goal for myself. Something that will make my life better, no matter how trivial it is. ‘Stop drinking coffee’, ‘Visit all your friends at least once this month’, ‘Shave every two days’. It doesn’t matter what it is, as long as I consider it a ‘tweak’ of my life. I’ll try to keep up the challenge for the duration of the month, with the hope (but not guarantee) that I’ll keep on doing it after that month.
So, from now on, each month I will write on this blog about the outcome of the previous challenge and post a new challenge for the next month.
Thursday, March 9th, 2006
Nobody’ll probably get a chance to read this because not before long my connection will undoubtedly be dead again, but for the moment things seem to working again. I hope, I pray, I beg for my connection to actually keep working, but I’m not holding my breath.
Anyway, everything will soon be moved over to my new server which is hosted behind a real internet connection.
Saturday, March 4th, 2006
I never really gave it much thought, but it turns out that, naturally, Javascript supports Object Oriented programming. It’s a bit awkward, but still:
/*****************************************************************
* Class description
*****************************************************************/
function MyClass(param1, param2) {
/*------------------------------------------------------------
* PROPERTIES
*-----------------------------------------------------------*/
this.property1 = false;
thisObj.eventHappened = false;
/*------------------------------------------------------------
* METHODS
*-----------------------------------------------------------*/
/**
* method1
*/
this.method1 = function(param2) {
this.property1 = param2;
}
/*------------------------------------------------------------
* CONSTRUCTOR
*-----------------------------------------------------------*/
this.property2 = param1
this.method1(param2)
var out = "";
out += "<div id='"+param1+"'>"+param2+"</div>";
document.write(out);
this.div1 = document.getElementById(param1);
/*------------------------------------------------------------
* EVENTS
*-----------------------------------------------------------*/
/* Because 'this' in events is actually the event, we assign a
* special variable here so we can reference this object from
* the events.
*/
var thisObj = this;
this.div1.onkeyup = function(e) {
alert("key");
thisObj.eventHappened = true;
}
}
var myClassInstance = MyClass('myDiv', 'Hello!');
Monday, February 27th, 2006
This is for Dutch people only I’m afraid. If you’re curious…
RaboBank internet bankieren heeft een kicken ‘Download’ feature waar je je volledige rekeningen overzicht kan downloaden. Dat scheeuwt natuurlijk om het genereren van zinloze statistieken. (Lies, damned lies and statistics!).
Zie hier, RaboGRAP. (Ik weet het; zinloze titel. Het betekend ‘Rabo Gegenereerde Rapportages’. Hip, ey?).
‘k Zal er binnenkort eens een mooi projectje van maken.
Screenshots:
Titel pagina
Jaar overzicht
Maand overzicht
Thursday, February 23rd, 2006
CorePHP took the PHP 6 Developer Meeting notes minutes, which covers the discussion on the upcoming changes in PHP6, and made it into an nice summary article. Interesting stuff.
Looks like they’ll be breaking a lot of stuff such as removing the dreaded ‘Register Globals’ option, Safe mode and Magic Quotes. Good.
This piece of the minutes intrigued me:
Issue: PHP only supports type hinted arguments and not for return values or properties.
I recently saw that PHP supports type hinted arguments, but it only supports objects and arrays, not strings, integers, etc. I understand that this may seem useless to support anyway since PHP is a loosly typed language and integers will just get converted to strings and the other way around. But from my experience it’s still nice to do checking on parameter types; it catches a lot of programmer errors. Too bad strings and integers aren’t going to be supported as type hinted arguments.
The other thing I’m disappointed about is that there doesn’t seem to be any steering towards objectifying the primitive types such as string, integer and float. I like $foo = "bar:bas"; $foo->explode(':'); better than $foo = "bar:bas"; explode($foo, ':');. And if you’ll look closely at the previous example, you’ll know exactelly why. (hint: it has to do with argument order).
Oh well, I’ll just wait for PHP7 I guess ;-)
Tuesday, February 21st, 2006
I used to name my projects based on really cool acronyms like “PROMS” (Project Management System) and “Nimf” (Non-irritating Manager of Files). When I got a bit more serious about my little programmings, I decided not to give them nonsensical names anymore but instead tried to come up with original, but more importantly, meaningful names. It’s a lot easier to guess what a program called “ListPatron” or “DataQ” does.
Check out these absolutely brilliant project names:
- Pessulus
- Sabayon
- Yelp
- Ekiga
- Metacity
Can you guess what function these programs fulfill? Neither can I. If you’re curious, they’re names of programs and utilities in the upcoming Gnome 2.14 release. I got the names from the ‘A look at GNOME 2.14‘ article.
Their functions are as follows:
- Pessulus: Functionality lockdowm administrator tool
- Sabayon: Group profile creator administrator tool
- Yelp: Gnome help browser
- Ekiga: The formerly known ‘GNOME Meeting’
- Metacity: The GNOME window manager
Who would’ve guessed?! Where did they get these names from? Who comes up with this stuff? I guess you can get away with shitty names like these if you’re a small-time developer nobody has ever heard of or if you’re only making low-level tools (such as GIT). But for an end-user desktop environment like GNOME, stuff should be called ‘Group profile administrator’ and ‘GNOME Help browser’.
Let’s hope they don’t actually but these names in the menu’s like this.
The text of all posts on this blog, unless specificly mentioned otherwise, are licensed under this license.