PowerDNS under MacOS X 10.6.4

Thanks to an entry on LSD::RELOAD I was finally able to get powerdns to run on my MacOS X 10.6.4 system.

Out of personal preference I wanted it to run with postgresql instead of mysql, so there was a little figuring out involved in how to get things going without the mysql driver — apparently, the make files only take one database backend and do not compile multiple drivers at the same time.

Also, secondary software omes from MacPorts, so paths had to be appropriately matched. And then, there was some hand-tweaking of Makefiles because -Bstatic, -Bdynamic and -lcrypt warrant special handling.

This leads to the following command line:

CXXFLAGS="-I/opt/local/include -DDARWIN" \
./configure --with-pgsql-lib=/opt/local/lib/postgresql84 \
--with-pgsql-includes=/opt/local/include/postgresql84 \
--prefix=/usr/local --with-modules="gpgsql"

Requiring code in PHP

While writing the code to handle a small form in PHP, I just realized that I have a very bad habit — and many just do the same.

When I write a new file, I place all the includes at the very top, before anything else happens. But in my current script, there are many code paths that do not require the major part of all those includes. Only in one specific instance do we require the bulk of the code. Previously, any invocation of that script would have gotten all the code dragged in. Now, I’ve moved the include to just where I need the code (basically, going into a specific case of a larger switch statement … And the load on the web server has just been reduced, without any change to the functionality.

So why do we all put the includes on top?

eBooks

So there’s a new Kindle that looks quite attractive. Many things on the Kindle plattform appear quite nice: You can read the Kindle books on multiple devices (the Kindle app for iPhone and iPad just as well as your desktop and laptop computer) and have your library available on all devices equally. The way I understand it, you even see your own notes and progress on your books on all platforms; this is how storage should be done (local copies for offline, but basically be accessible from anywhere).
And yet, as with many other of the new media consumption gadgets, you get a big bag of concerns that at least still give me second thoughts on all of this.
For one, I don’t want to leave such a well-documented trail of what I read, when and for how long. I know that by shopping at Amazon, I already leave quite the trail about my reading habits, and buying stuff on the Kindle does not change that all too drastically. And still, I feel that the more data Kindle transfers to Amazon, the less comfortable I am with reading stuff on such an electronic gadget.
Also, we’ve seen that Amazon is able to change the library on the Kindle without your approval or interaction. This gives an entirely new meaning to the concept of „purchasing a book.“ It’s actually much more like a public library: You pay for the privilege of being allowed to read a book, but only little of the experience is under your control.
And that brings us around to the next point: I want to be able to pass on books. Once I’ve read them, I want to have somebody else have them. Or I want to be able to loan them; either just for an afternoon of leisure or for others to completely read those books. That’s just not possible on the Kindle. But then, I also think that it’s not possible on iBooks, so that levels the playing field.
For the time being, I just might be stuck with paper books.

Software I like: Evernote

I’ve been a user of Evernote for quite a while now, and I must admit that I’m also one of the lovers of that service. It does data storage the way I felt it should be done. You can access your notes via local applications on desktop and laptop, and that works well. I personally use only the Macintosh version (but that on multiple machines) for workstation use. But I can also access my data via the iPhone application, or with the evernote web app from just about anywhere. There’s also a Windows version available, but I’ve never played around with that.
I journal all the ideas that are on my mind within Evernote; that way, I am sure that I have all ideas that might warrant revisiting at a later point are caught, because it’s just so easy and quick to write them down and have them stored in a way that I can access from anywhere.
I know that there are many more features (uploading PDFs, capturing images and storing them, image recognition and many more), but none of those have provided important to me. The fact that I can get to all my notes from anywhere, and with software that makes using the storage easy and fast — it does feel like it’s a local application, because it is — that’s what has me convinced.
And the best thing? It just works.
Highly recommended.

Home media integration and other televisory matters

Following up on my last posting, there are a few more things that come to mind when thinking about the future of TV sets. With all those video streaming services that I want, I also would like integration with my lapop (or iPhone or iPad, or whatever other media consumption devices there are in the household). If I see a video on one of my devices, I’d like to be able to easily transfer that running stream onto my TV set. So, for instance, I am browsing TED and find a presentation that I’d like to continue watching while I do something else on an iPad (which I currently don’t own, but that is another topic). So then, I’d like to bounce the stream off to the TV set in the room I’m currently in and continue to use the iPad for other things.
And on the subject of transfers: I more often than not carry my iPhone on me. I can easily have my earphones plugged in there, and the cable not tangle with anything. So then, my laptop should link up with the audio output of the iPhone and transfer it’s sound out via the iPhone. That way, I could walk around and continue to listen to what I have on the computer — or just not be tied to the computer by means of headphone cable.
I’d like to be able to watch HD content, record and playback it at my leisure. And get HD content in such a way so that I can watch different HD channels on different TV sets concurrently, and without paying a monthly sum for every single device. We can do that now, with the plain analog cable service that we have. By means of cabling, we can distribute the signal to multiple TV sets. Anything but that would be a step backward, to my mind. It would be a great plus if the HD content could also be watched on laptops (and we have both Windows and Macintosh devices in the household, of which one Windows laptop regularly gets used for watching TV with a USB TV tuner), but that is even a secondary goal. I’d be happy if we could just get two TV sets. Of course, if we just had one media storage solution so that recordings of TV shows could be shown on any screen around, that would be a plus — but that seems to currently not be easily available.
It seems there’s still a great many challenges out there to get media stuff working conveniently and easily …

TV sets and online experience

It seems that TV sets that offer some form of web connectivity are the latest craze, right next with the 3D stuff that is not yet ready for consumption, at least to my mind. I say web connectivity because it’s about the web more than it is about internet connectivity — the TV sets are even a far cry from fully giving you a decent browser experience, let alone thinking about other protocols or applications. Not that this is necessarily a bad thing—but one still should be honest about what kind of experience a device is delivering.
What this is about, though, is that youtube is not enough. Of course it’s fun to look at various video clips and that one site is very rich in all the content it offers. Maybe, if the manufacturer is kind, they’ll also include other online video systems (vimeo, ustream.tv, or sevenload and myvideo.de in Germany) But as we all know, the web is filled with so many more opportunities. Being in the german TV market, I also want to be able to look at the online video offerings of the local TV stations; incidentally that also requires a Flash player on the device. I presume that other markets will have other offerings that the consumer might be interested in—a constant, steady battle for the manufacturer if the want to follow this all. And then, there’s video podcasts, there’s streaming stuff coming up that we don’t yet even dream about. A nightmare to keep current, even more of a nightmare if you have to keep pushing updates to the sets at the consumers constantly.
So we have established that the requirements for the TV online experience are high: Flash player, a decent full browser to support all the various offerings, a good update path to get new versions released (just imagine if IE6 had been distributed with every TV set that a certain manufacturer shipped five years ago, with no clear way for the customer to update). I think we’re getting dangerously close to having a full operating system on the TV set. And then we haven’t even touched integrating the normal TV services, video on demand, time-lapse watching, new ideas about pay per view.
Watching a home entertainment system for the living room certainly won’t be getting easier!

My code sucks.

Chasing a link via Twitter, I recently read Your code sucks. Having gone over a lot of other people’s code myself, and writing code for long enough to have a good history of my own work to go over, it resonated with me.

I recently had the mispleasure of debugging a piece of code that I wrote almost ten years ago. It was, in many ways, painful to read. Although I still use the same language as back then, things have way evolved: The language, for one. Development tools. (Well, not mine: I still use Emacs.) But most of all: My knowledge and my mental horizon in programming. I’ve looked at various other things to enrich my skill set, bringing to my own coding habits tools that work well in other languages. I also got to understand the tools I use better (especially database tools — those are so rich, and so few tools ever really use them). So, with that experience in mind: My code does suck. But I much prefer something that I wrote ten years ago to be painful to read, because it means that I have learned a lot. Even though I feel great satisfaction with the things I write today, I am sure that in another ten years time, I will look back at todays work and feel a slight sensation of being ashamed of what I did.

And this humbles me in reading other people’s code. It does not hurt to assume competency in others; they may have different routes they take in solving problems. But if one gets to think like they do, understand why they wrote the code the way that they did, that certainly may lead to your taking away something for yourself.

Now, if only everyone adhered to K&R indentation, I could read all the other people’s stuff so much more easily …