Just A Programmer We’re Just Programmers…

25Dec/071

If you have too much free time, use Java.

Posted by Tomaj

Now, I am no superstar programmer, this I admit. However, I do believe I am fairly intelligent, and have a decent breadth of knowledge and ability when it comes not just to programming, but IT as a whole.

This weekend, I decided to spend a little time attempting to re-invent an intranet app I created using Java in Applet form, as opposed to the present PHP/Ajax solution. To provide a little background, the present application is basically an administrative tool which keeps track of computers & users. It presents several tables identifying e-mail accounts, Southware users, PCs, and the relationships of these various items to each other. For now, I use PHP5 with Smarty templating, and use XMLHttpRequest calls to update just certain portions of the page instead of reloading the whole thing each time you want to sort a table, or edit a field.

I am pretty pleasd with the solution thus far, however I like to experiment. Previously, I tried using Flex — and did OK until the point that I hit what I believe was a limitation of Flex itself, having to do with binding controls to the gridview and having changes propagate back to the control that the edit controls were bound to. So this time around, I said to myself “Hey, I took Java back in college and even did my senior project in that!”.

Can’t be too hard right? Taking some data, displaying it on a grid, edits, etc. Boy was I wrong!

CHALLENGE #1 — Finding a decent IDE

Good luck! I tried probably 5 different IDEs, and ditched them all for various reasons — mostly because they weren’t free. Finally I ended up with Netbeans, which I happened upon completely by accident, as I was browsing around Sun’s website. It’s actually a pretty nice IDE. It has several built in project templates, a drag & drop WYSIWYG designer, code completion, etc. This IDE also had a cool feature where you can easily set up a JDBC connection to several database servers, in my case PostgreSQL. I was able to connect, browse around the tables (however, you must have a primary key before any tables can be used!?), and bind the tables to various controls for example a list or a data grid. I had some problems with the IDE though — I had a tough time wrestling for control. It wouldn’t let me delete function declarations, variables, etc.. They were just simply a different shade of gray, and somehow untouchable.

CHALLENGE #2 — Getting anything done

Once I had finally gotten everything set up with my little project, I tried to compile it. UHOH it seems it couldn’t find javax.persistence. WTF is that you may ask? Well, apparently it’s necessary (at least with this IDE) to bind the database to the control. After another half an hour of searching, I resigned myself to having to download the enterprise edition of the SDK (100+ megs..) and then trying again. After that was finally done, I tried to run it again… It compiled, but now it was giving exceptions on start, and it STILL wouldn’t work..

CHALLENGE #3 — Debugging!

There may be a nice quick solution for this (if there is, please let me know). If you’re writing an applet you should be debugging in your browser right? Well if you do, then your browser will cache the Applet, and your subsequent rebuilds will not be represented.. I am using firefox, and to counter this, it is suggested you load up your Tools -> Java Console, and hit ‘x’ to clear the java cache.. So I did it. And did it again. And again and again. NO EFFECT! I discovered I had to exit firefox in its entirety after clearing the cache, then re-launching, and THEN it would show the new applet. SO, what kind of way to debug is that?? As I said above, i’m no superstar.. I like to code a little, then check it. Then code, then check. I just can’t work like that. Yes, you can run the program as a regular application then switch to be an applet, but then you have various security permissions issues which may come back to bite you if you’re not careful no?

The above may not seem particularly frustrating, but all of this came after several hours of playing around with SOAP. I had gotten one of the functions of my app set up via SOAP, and was going to test that with java. I was looking around the web, and all the samples I saw were horrible… They were hand-crafting the request XML, OR using some 3rd party framework to get the job done. I didn’t want to do either of those things, so eventually I gave up on SOAP, and that is when I tried the direct database connection.

In closing, those of you out there who are PROs at Java will read this and laugh — no problem there. What should be taken away from this though, is that while Java may be perfectly good once you immerse yourself in the intricacies, it is not for the faint of heart, and in the age of integration, polished languages & IDEs, it’s just not up to the hype.

Tagged as: , , , 1 Comment
8Dec/070

These are a Few of My Favorite Open Source Sites

Posted by Justin

I’m a big fan of sites about open source. Especially those that categorize, index, and report information about them. I’ve probably spent more time marketing my pet Open Source project PlaneDisaster.NET on these sites then writing code for it. So I’ve compiled this list of sites I use.

SourceForge (http://www.sourceforge.net)

The true power of open source is allowing anyone to contribute your project. In order to have a successful open source projects, you need to build a community where users and contributors can collaborate. This means a source code repository, forums, bug tracking, a wiki, project webspace, and of course a system of mirrors to download project releases. One place that allows you to do all that for free is SourceForge. In recent years new players have entered the market including Microsoft CodePlex and Google Code. However, SourceForge is still the most popular.

Freshmeat.NET (http://www.freshmeat.net)

While Sourceforge will host anyones project, few released are handpicked to appear on their frontpage. The site that fills that void is FreshMeat. If you release a new version of your software, you can notify FreshMeat, and the announcement will appear on the SourceForge home page. Unfortunately for myself, it does not accept windows only software. They are a site that lists unix software, not open source software. This means that they will list closed source souftware, but not windows only open source software. Despite this policy, they will list open source operating systems, and you can specify that your software will work on windows if it also happens to have a version that works on some unix variant. Finally there is a special category for OSX software.

ohloh (http://www.ohloh.net)

Ohloh is a unique site. It is a combination of social networking and open source software metrics. If you write open source software you can list it on the site, and have it scan your version control repository. It will report metrics about your software. It will also generate metrics about the lines of code you write across all open source projects on the site. You can also list software you use, and give other users on the site “kudos” if you enjoy their work. Finally, all these metrics are used to sort every user on the site by a single ranking system. The exact formula is a secret like those used to calculate credit scores.

koders (http://www.koders.com)

A simple code search engine. I can honestly say I have yet to find source code with the site that I’ve used. However, I think the idea has potential. While there are better forms of code reuse such as static and shared libraries, sometimes you need a small snippet of code.

osalt Open Source as Alternative (http://www.osalt.com/)

This is a strange site. The way the site is supposed to work is that you select a piece of commercial software listed on the site and it lists equivalent open source software. While they have a form on the site for suggesting software there site, the content is highly editorialized. The content on most other sites on this list is more directly user generated. I think a more open format would lead to a site with more information. However, until a more open competing site opens up, this is best in breed by virtual of being the only one of its breed.

Conclusion

These are my favorite sites. Feel free to list yours in the comments. If I get enough feedback I will post a follow up article.

Tagged as: No Comments
8Dec/070

Microsoft and the OLPC – Red Tape and Misconceptions

Posted by Justin

It would appear that Microsoft is making significant progress in porting XP to the XO laptop. While I think the third world is better off learning Linux, I have no problem with them learning on a Microsoft platform, provided they make it suitable for their needs. They seem to be attempting to do that. I can’t say for sure that the OLPC is what the third world needs regardless of operating system, therefore I really can’t make a judgment as to which OS better serves said undefined needs. However, this is not a post to judge the merits of the OLPC or any OS that would run on it. Rather, its about red tape and misconceptions.

First the red tape. The technet article states that Microsoft cannot contribute to the OLPC project directly because of the open source license. It then seems to imply that Microsoft must reverse engineer the hardware because their engineers would somehow be tainted if they read the specs. I am quite ignorant of the OLPC project licenses, as well as open source hardware in general. So I have to assume that their lawyers are correct in their interpretation of whatever licenses govern the spec of the hardware.

This seems to be quite a hindrance. Granted the hindrance might be intentional. It seems to be similar to the hindrance that the GPL places on you reusing the code in a non open source project. I would expect many people that have worked on the OLPC project to be glad of this hindrance, just as many are glad of the hindrance that the GPL provides to their code being reused in a closed source project. However, many companies such as Sun and IBM are able to donate their programmers time and talents to Open Office, Apache, Firefox and other open source projects without “tainting” them. I think Microsoft could do similar. Even if it was impossible not to “taint” there developer, they are not in the business of making hardware or drivers. I doubt it would hurt Microsoft if the drivers they created for the custom XO hardware were all released as open source.

Now to tackle the misconception. James Utzschneider, the author of the technet blog, seems to think that the projects plan for supporting the laptop is to have the children patch the source code themselves.

And we have a different support model than OLPC is envisioning: we are not expecting K-6 school children to access the source code and do their own programming in the event they have to fix a problem in the computer. Certainly, we think there is a role for students in the support of school computers — in fact, as part of our Partners in Learningprogram we have trained over a million kids in a student helpdesk program (like in this case study from Brazil) — but we also think that local entrepreneurs and businesses need to play an important role here when you are talking about deployments involving tens of thousands of computers.

The angry young idealist in me started screaming of FUD immediately when I read this one. Just because the source is available, doesn’t necessarily mean you have to edit it. There has got to be a better support model than this. So I looked on the OLPC wiki page linked to by the article for more information and I found the following.

The laptop is an open-source machine: free software gives children the opportunity to fully own the machine in every sense. While we don’t expect every child to become a programmer, we don’t want any ceiling imposed on those children who choose to modify their machines. We are using open document formats for much the same reason: transparency is empowering. The children—and their teachers—will have the freedom to reshape, reinvent, and reapply their software, hardware, and content.

The article contains no explicit statement of their support model. It does allow for students and teachers to modify the laptop, but acknowledges that not every child will become a programmer. A cursory search does not turn up a formal support model. However, very few support issues require a code change, especially for commodity software that have a much larger usage in testing scenarios than most code gets in production. So while the support model may be lacking, I don’t see where they assume the children will be hacking their own laptops except as a learning exercise.

I honestly hope this port of XP is successful, and that they ship some OLPCs running Windows. First of all it gives people more choices. Secondly, I’d like to see that translate in to a first world consumer oriented $200 laptop.

Tagged as: , , No Comments
2Dec/070

Comparing the Ohloh.net to Koders.com

Posted by Justin

When I start or join a new open source project, I usually make sure they are registered on several websites relating to open source that I frequent. Two of them are http://koders.com and http://ohloh.net. These sites offer different services. However, they both take the code from your version control repository, download it periodically, and report information derived from that data on their website. What the derived information is different.

Koders is a source code search engine. It lets you search for source code. Ohloh is a website that calculates and reports various metrics about open source projects. While you cannot compare the services they offer directly, you can compare how their project submission and user interactions work.

The first thing you will notice if you register with both sites is that ohloh is totally automated and koders reviews all projects individually. Ohloh will let you register in minutes. If you are lucky and server load is low enough, your project will be imported in less than an hour and you will have what it calls “shallow metrics,” or statistics about your code such as code to comment ratios and the breakdown of languages used in it. Koders, on the other hand, will inform you that your project must be reviewed by hand. My personal experience is you will have to wait over a month to be informed that your project was approved. They claim the purpose of the review is to ensure the code is legitimately open source.

Feedback mechanisms are similar for both sites. They both have forums and the site admins read and respond to support requests on them. Both sites are small in terms of forum volume at the moment. I’ve used Ohloh’s forums at various time, but never had a need to use Koders’. I predict Ohloh’s forum volume will grow faster than Koders’ simply because Ohloh is a community and Koders is a search engine. There are various activities that you can do at Ohloh, such as review projects, give other users “kudos” and updaste your “stack”, a list of open source applications you use. However, at koders, your options are to register a project or search source code. Therefore, there is more to talk about on the Ohloh forums than the Koders ones.

Another thing you will notice about Ohloh is the extensive use of the honors system. For example, I can login, find a project with a developer not associated with an Ohloh account, and click on the button that says “I am this user.” I’ve not tried to see what happens if I claim to be Linus Torvalds, but I do know if click on that developer profile for linux or git I see the “I am this user” button. There is no honors system or trust in the community at Koders. They hand reviews projects, and once the project is in the system, its in the system.

One final thing I noticed about Koders is unlike Ohloh, they seem to seek open source project to add to the repository themselves. In a blog article they proudly announce they have “partnered” with IBM to add all their developer works projects to the repository. Ohloh is using crowdsourcing to get all their data, where koders uses it as one avenue, but also seeks out projects on their own.

To put all this in perspective we must look at each websites motivation, or to more clearly define it, business model. Ohloh is building a community. It is a social networking site of sorts. I expect either ads to start appearing, the site to start selling aggregate data, or some other income source that basically revolves around selling their demographic. Koders, on the other hand, sells a professional version of their product. You can buy Koders Pro Edition, install it on your network, point it at your repositories and search your internal code. Ohloh needs active members that constantly go to the site, so they offer things to do there. Koders, on the other hand, needs people to find their search engine useful enough to want to use it internally, so they would want all the source code to be legitimately under the license it is listed under and would want to make sure that the majority of the source code on their site is worth reading and reusing.

Tagged as: , , No Comments