Zeroconf made easy: Bonjour for Java, Part 2, Client Implementation

I’ve been writing about the server side implementation aspects of Bonjour for Java a while ago, and I promised to explain the client side, which is a bit more tricky. The reasons therefore is that it makes heavy use of asynchronous callbacks, leaving you no other choice but to implement some interfaces and understand the way things work behind the curtain. Continue reading

Why PHP should be banned.

Neither is Basic! Really, normally I’m trying to be objective, but I just can’t when it comes to PHP. I’ve done a lot of stuff in PHP over the years ( yes, including a CMS, Portal, Guestbook and Gallery ) but as far as I can tell this language meets every requirement to be disqualified as something to consider when it comes to serious, professional software development.

There is certainly good software ( or software that pretends to be good ) written in PHP. But it’s not the majority. PHP just encourages programmers to do everything insecure, non-reusable and not really portable.

Just think of the word PHP/MySQL, which is nothing but a pain in the ass. I’ve been running Postgres for years, and every now and then a small PHP script comes my way requiring MySQL. Whhuuzza. No Database Abstraction. And now that there is one, all popular software still uses these funny mysql_do_whatever() methods.

Function naming is certainly another thing that terribly went wrong at some stage of the development. Has someone ever scanned the PHP sources for the functionNameObfuscator.c? I guess there is none, as no program could ever obfuscate stuff that badly. Now, in the upcoming PHP release there will be finally support for Namespaces, though I’m not really convinced that any of the built-in stuff will be used there prior to 2010.

PHP is perfect to learn some concepts. Like OOP, because there is no need to compile stuff, no need to worry too much about data types and stuff, but once you’re about to do a real project, keep in mind that type checking, namespaces etc. are stuff that could potentially matter at some point of the development. 

What I find most confusing is that simple statements just don’t work. Why? I don’t know, they just don’t. Example? There you go

// assuming the function foobar() returns some array.
// this won't work.
echo foobar()[0];

Cool, hu? Not really. And as far as anything WebProgramming is concerned, I just learned my lessons and use something like Merb, Rails or even Java EE. G’day.

The happy nerd versus the crying record industry: a diagnosis on filesharing

In the past years, filesharing has been claimed as being the death of the music and film industry. Maybe. But let’s take a look at how they work and compare it to how programmers, that are distributing their work under a free license, do their job. 

The record and movie industry emerged in a time where it was virtually impossible to create, copy or share both kinds of media on your own. Thus, this industries specialised on recruiting talented people, called artists, and help them to create a product, either a movie or music. Back in that days, the audience had to take what this industry served, and did it.

At that time, this model just worked fine and everyone was happy with it. Really? No. If you were a talented musician who just didn’t fit in with your style and music, it was almost impossible to become successful without being signed at a big label. Of course, being signed meant almost guaranteed success and financial security.

Today, the internet opens up ways no one dared to think of even a few years ago. Masses of data can be transmitted in a matter of minutes and stored on huge disk drives. This decentralised means of getting and creating information also impacts the way people search and retrieve information. There is no need for a newspaper subscription or a TV set. All you need is a broadband internet collection and you can access virtually any information existing digitally.

Decentralised also means that in contrary to old mass media, like television and newspapers, there is no single instance controlling the information accessible. Everyone can easily provide content, from wherever he wants to. There are no borders. No working system of censorship ( almost any censorship besides the plug-the-cable method can be broken using Tor or something similar ).

Of course, to some people this is threatening. Easy ways of copying and storing information. Home recording studios are almost built-in if you buy a computer these days. It’s hard for an industry survive that was built under completely different conditions. There is not one homogenous mass to provide with music anymore. There are millions of people listening to exactly the music they want to. Independent artists, with no major label backing them, are finally having the chance to get some attention. And use it. 

The maybe only way for this industry to be a part of that new culture is by adapting. Adapting their way of distributing, of interacting with customers, of recruiting artists, of using the internet. But certainly not by trying to sue everyone who leverages the blessings of this new kind of experiencing culture. 

Most likely you’ve never heard of the French band SoKo. It’s one of my favourite bands, but unfortunately i couldn’t find it on iTunes or Amazon. Industry: 0, Internet: 1. And unless you tell me the story of an artist who actually got homeless because of filesharers stealing his content, I don’t think there will be any reason this count will change the next time. 

As I promised, a short look on who programmers, who really keep the 2.0 world spinning, do their job. For fun. Really. Many friends of mine are just involved in projects for fun or improving their skills. Earning money is maybe sometimes a nice extra, but the motivation is something non-materialistic. An overwhelming share of the software used today is created by small groups of people with an idealistic attitude. No one writes articles about them, though their impact on your live maybe bigger than you expect, take Firefox or the Wikipedia alone, both based on voluntary work. And while some Blockbusters still get their crying companies $200 million, Wikipedia was hardly able to raise $6 million to ensure their ad-free service. But no one there tries to sue anyone. 

What’s the difference? We are adapting and changing the way we work and think. And we are damn happy to share our work, and to be proud of it. Real musicians ( with a plastic share of less than 30% ) are quite the same i guess. Placing a microphone on stage without the explicit intent of sharing?

Improving your Software efficiently: Talking to users.

Yes, I know, it sounds very, very odd. Users, bah, just keeping everyone from doing really useful stuff. Users, always finding bugs that turn out to be not-so-well implemented features. Users, not understanding the big ideas powering the programs we develop and the time we spend. Users, still using that outdated 5-year-old version of a product just because they are used to it. Users, not willing to switch just for the sake of having switched. I don’t understand it. 

But it’s users using ( and sometimes even buying ) software. And maybe you are involved at building a software product. I bet you consult your friends or fellow colleagues from time to time seeking input for a form, text, feature whatsoever. People who are just like you are the worst giving you advise on how to do something. I do have friends who are still pretty happy using zsh and rocking the world using the shell. But that’s just not the majority. 

Everytime I’m thinking about something cool in terms of a new project, I talk to my strategic consultants. I meet them when I’m at my parents house at dinner. They consist of: My father, my mother and my brother. And it sounds odd again, but explaining something to people who are potentially end-users, you’ll get a clue about how useful your software idea is considered in an instant. And that’s the kind of feedback I’m looking for. I know that most of my fellow students are used to the most weird kinds of application, expecting valuable feedback from them considering anything computer-related is like asking a priest for his opinion about the existence of god. 

So my message at the end of the year is simple: Talk to users. Not only when it comes to usability testing ( which is also crucial ), but at just every step of your project. That’s where the focus should be. For me that means: having dinner regularly. Nice, hm?

Diskrete Mathematik – Skript für Einsteiger

Im Laufe eines Studiums stolpert man öfters über Themengebiete, die in der Essenz leicht und verständlich sind, durch fremde Formulierungen und ungewohnte Schreibweisen aber fast unlösbar sind. Im Nachhinhein lacht man vielleicht darüber, aber wenn man drinsteckt eben nicht. Zusammen mit meinem Freund Thomas Fankhauser habe ich deshalb dieses ( ziemlich unvollständige ) Skript zum Thema verfasst, unter anderem gehts um Mengenlehre, Matrizen etc.. Viel Spaß damit.

Diskrete Mathe Skript

C++ Pitfall prevention Cheatsheet

I posted this also on my “old” blog. Please be good in judging it, I did it for a C++ course in Espoo. C++ Cheatsheet

Edit: One thing not discussed in the cheatsheet, but at least from my point of view a error-prone area is the const-modifier. I found a good explanation about it and its various uses and meanings here.

Whats next – Sharer: Better File Sharing.

Good morning. It seems I have to stay wake so i don’t oversleep. Oversleeping would mean something like missing a flight, not really desirable. 

Staying wake always makes me do weird stuff in the middle of the night. That is, reading all feeds I recently ignored, taking care of stuff that has to be taken care of ( that is university ) and scheduling my activities for the upcoming, lets say, 3 weeks. 

Blogging is definitely a part of it, as I’m not exactly happy with the posts here. I’m working on it, to be more sepcific: I’m planning to do an article series on a .. secret topic. You’ll see, but I still have to finish work on Sharer, my LAN-Filesharing utility. I’ll tell you something about it. 

Sharer is at the moment simply a damn simple binary protocol and a Application implementing it. The protocol structure is quiet simple. A connection between two clients is initiated by establishing a control-connection. Thats the one used to retrieve metadata like file information etc.. If a client wants to get a specific file, it requests a transfer connection. File is being sent over it. I’m still working on it, as it appears to be more work than I initially planned. 

This whole project is based on the idea that simple file sharing that is decentralised and restricted ( or at least primarily designed ) for use in local networks is pretty much a lame topic. Every major company is proud to have some own protocol there, them being not compatible bla bla bla. So i decided to waste some time on this proof of concept. To make it really useful and simple to use ( remember \mycomputer or \192.168.0.12 ? that is _not_ user friendly! ), Sharer uses the Bonjour for Java Bindings provided by Apple. The Usage is quite straightforward, and it works well. I haven’t checked out yet if these Bindings are also available for Linux, but I hope so. At least for Windows and Mac(!) they are. 

I think I’ll try to online check-in now. Window seat.

Online Password Storage

The user home screen.I wrote one. Based on Rails, working reliable. The encryption is designed in way that prohibits even the database administrator to access them. I showed it to a few people. The response was that it seems that no one is willing to give away passwords.
But the project is cool. By installing a bookmarklet you can easily login to any page you registered at _my_ service by simply clicking on that bookmarklet.. works mostly. Maybe I’m going to put it online someday, but not until I fixed the encryption so that it happens only in the browser, to prevent any passwords being sent in plain.
I would really appreciate some comments.