Coder’s Eyeball

I think I have coder’s eyeball. OK, so I just coined that term myself, but after weeks of trying to write a rather involved extension in a very large, very convoluted, object-oriented PHP system, I think my eyes are suffering and need a break.

For anyone who works with OO PHP projects, I don’t personally recommend trying to tackle the new assignment module in Moodle 1.5.2. It’s brand new, and completely, utterly, unapologetically undocumented. I’ve also asked several questions in the Moodle forums about specifics regarding the assignment module code, to no avail. Never have I seen a less helpful development community. The user community is great. The development community is nowhere to be found.

I started to get a bit suspicious about that when I noticed that Moodle has created a burgeoning commercial support and development service around the product. They’re even hiring in-house developers to support external Moodle users and developers, for a fee. Guess it doesn’t exactly pay the bills to do things like help people for free in the forums, then, does it?

Nicecast is…. Nice!

I listen to a lot of streaming music — especially when I’m on a project where I’m writing code. I go into the office, put on my headphones, plunge into the code, and at the end of the day, I take off the headphones, look at my progress, and I’m usually surprised at how much I got done. I guess it helps drown out distracting background noise, so it helps me concentrate.

Anyway, one thing I’ve noticed is that the “catalog” of songs on a lot of the streams is pretty small. I end up hearing the same stuff just about every day. As a result, I spend time looking for new stations every day to avoid this. Then I thought, “maybe it’s time for me to set up a streaming server at the house so I can just stream my own library of music to the office”.

The first decision I made was that I didn’t want to spend any time doing this. I wanted something that worked the first time, without compiling dependencies, without wondering if I’m running the latest version of library “x” or whatever. Then I remembered that I also have a lot of music that I purchased through iTunes that I wanted to play, and those are in m4p format (which is a DRM-encrusted, security-smothered version of m4a). I wouldn’t be able to serve them up, as-is, from a Linux box without first going through what looked like a pretty painful process of scraping off all the gook and making the m4p files usable. I’ll do this some day — it is not that day.

Instead, I found Nicecast. I downloaded it, installed it on my Mac, launched it, configured it, and had a working stream in under 3 minutes. I really mean it. It’s so Mind-Numbingly Easy(tm) I can’t believe it. Turns out it’s a great way to get familiar with what I actually *want* out of a music stream, too.

For one thing, I want to be able to treat the streaming server like a radio and listen to any one of various “channels”. If I’m having trouble with my code, I want to hear metal. If it’s early morning or tea time, I might want to hear jazz. I don’t know of a way to pull that off without using Nicecast and the OS X security model in ways for which they were not intended.

I’d also ultimately like a remote control for my library — like a web front end to iTunes that’ll let me stream my iTunes music as if I’m sitting at my Mac. Pause, skip, play a different list… all the major features would be awesome. I don’t need everything. Just the basic browse and play functionality. Apple could probably pull this off. I wonder if someone else can do it in a more open way, though.

The debian apt-get utopia myth

Debian users love the apt package manager. In fact, I’m pretty sure that *every* time I’ve asked a Debian user why they use Debian, they’ve answered with one word: “apt”. They take great joy in picking on Red Hat newbies who have no clue what they’re doing and are subsequently taking their lumps in RPM-land. They make apt out to be some kind of cure-all for what Linux users call “dependency hell”.

Dependency hell occurs when you download a piece of software and try to install it, only to find that it requires two or three *other* software packages to run. Upon downloading *those* packages, it turns out that *each* of those requires still *more* packages to run. This is nightmarish at best. Debian users would have you believe that you’ll never have this problem if you just use Debian, which uses apt as its native package mangement tool. They would be dead wrong.

Tonight I tried to install kiax on my Ubuntu 5.10 system (I refuse to use Ubuntu’s stupid nicknames). Kiax was not available in any of the apt repositories that my system knew about, so I downloaded the .deb package from the kiax Sourceforge project page. I then ran “dpkg -i kiax…” on the package, and it turns out it requires libqt3c102-mt, which I’ve never heard of. This package is also not listed in any apt repository my machine knows about, but I try using the libqt-dev package just in case. No go. So I go to the debian website and download it and run “dpkg -i” against that. No go. It conflicts with the locally installed libqt package. So the bottom line is I can’t install it, and therefore can’t install kiax.

This happens in every Linux distro I’ve ever tried, but no community of users is in such absolute denial about it as the debian user community. Get over yourselves.

PHP Object Casting is Cool

I’m from the PHP 3 school of PHP coding. Before that Java was shoved down my throat, and I was happy to be away from project management type stuff and back into Perl and PHP. Doing nothing but procedural coding for a while helped me understand more where an object could really be useful, but I continued to be largely unhappy with how objects worked in PHP — seemed like a lot of overhead, and (in the case of PHP4) a bit of a hacked-up OO implementation in general.

Well, I found one awesome feature that is immediately useful to all PHP web coders, whether you’re pro- or anti- OO: object casting. Sounds hard, but it’s so easy it’s silly. It’s only *technically* OO – in practice, you can use it inline pretty transparently. No declaring, defining, constructing, blah blah blah. Here’s how I’m currently using the feature:

$form = (object)$_POST;

Ta-da! $form would typically be declared in a script that serves as the “action=” to a form. $_POST is an array of stuff that came in from the form. Now, the variables in the $_POST array become attributes of the $form object, and you can refer to them by name without doing anything else. For example, if one of the variables in $_POST was named “test”, you could echo that value to the screen by just doing:

echo $form->test;

Very handy, indeed!
:-)

Now I’m a Roofer, Too

Ugh.

My new wife woke me up this morning with news that a small drip in our roof that was just discovered yesterday had graduated into a larger problem. What we thought we had under control with a simple bucket requires 7 buckets today. Two in the kitchen, and 5 in the crawl space over the kitchen.

New Jersey has been getting pounded by unrelenting rain for the past few days, and apparently it has revealed a flaw in the roof. So this morning, I went to Home Depot, bought some flashing compound, and some plastic sheeting, and up on the roof I went, in the pouring rain. If you ever have the chance to do this, my advice to you is to skip it if you can, and wait until it’s not raining.

Anyway, I discovered a couple of shingles that were not quite lying flat, so I glued those back down. I also discovered a weak board in the roof where it meets up with a dormered section. Next I tacked on a 10′x25′ plastic sheet starting just on the oppossite side of the ridge, and extending over the area where water is evident and all the way down to the gutter. If the dripping stops, then at least I know it originates somewhere under the plastic sheeting, which makes inspection easier. Water can travel considerably from the origination point of a leak and the point where you see it dripping from the ceiling, so this is significant.

When I went back in the house, it appeared that all dripping had ceased, which is good news, so I went to work. We’ll see what things look like tonight, and hopefully I can do more work when it stops raining, which looks like it won’t be until next week.

Congratulations, Yahoo – I’m sorry for your loss

Well, Yahoo just lost me as a loyal user. From now on, my home page is going to be the Google personalized home page (did you know you can create a homepage at google? It’s cool).

For about 6 years now, I’ve had a My Yahoo! page. A couple of years ago, they got a little out of hand with their advertising, which prompted my research into ad-blocking software for firefox on Linux. Turns out, lots of geeks hate ads, and there’s a ton of ad-blocking software. I now run firefox’s native popup blocker, a rather generic ad blocker extension, and a really cool extension that replaces anything made with Flash with a button that you can click if you really want to see the flash content. This is great if you go to a site to see a flash movie or cartoon, but don’t want to see flash ads. You’re in control, and it’s not all or nothing.

For a very long time, this setup worked flawlessly. However, today I’ve come across an ad on Yahoo so intrusive I just can’t be bothered anymore. The ad was one of those things that floats over the text on the page. The problem is, you can’t ever close it. Even after it runs its course, it just stays there, so I can never read the headlines on the page. And, of course, the ad’s content was completely irrelevant to my life.

So off I go now to finish setting up my google homepage. I’ve already changed firefox to use it as my default home page instead of yahoo.

I no longer, uhhh, Yahoo.

Random Stuff, and testing trackback

I’m a blog dope. I don’t have a great understanding of what trackback is all about. However, my buddy Steve wrote a sentiment regarding the recent Tannenbaum talk here that we often look at eachother and repeat, so I thought I’d track back to it here. We’ll see what happens.

2 mins later: UPDATE – blogger doesn’t support trackback :-( How can you create a social network without this particular feature? Seems kinda lame to me. Maybe I need to check out haloscan or something.

Tannenbaum Speaks at Princeton

Andrew Tannenbaum is a highly acclaimed lecturer, researcher, and author on various topics in computer science, most notably operating systems. His volumes on the design of modern operating systems are used in many if not most university systems courses.

This is not to say he isn’t controversial, however. His public debates with Linus Torvalds on the finer points of microkernel vs. monolithic kernel design are well known and well documented. More recently, he rebutted claims made by alleged UNIX history researchers (funded, of course, by Microsoft), that Linux was actually stolen by Linus Torvalds, from Tannenbaum. These claims hardly needed to be addressed for the technical community at large who saw through them at first sight, but it’s still a great read.

Today’s talk was about global distributed objects. About 10 minutes into the talk I mentioned to a coworker that it sounded a lot like LDAP with some minor bells and whistles thrown in. Five minutes after that, my coworker pulled up a copy of the schema being used as part of the research. It is an LDAP schema. Sometimes I think I might not be totally lost in the woods. ;-)

Next week, Bill Gates is heading into town to talk to computer science students. I’m not likely to attend, but if I do, I’ll report back here.