Archive for the ‘Programming’ Category

Yet another programing language

Google have declared a new programming language – Go. Contrary to how the title might read, this post is not a tirade about the abundance of programming language – I just like this sort of expressions (and Google could have easily named Go as YAPL instead 😉 ). On the contrary – I’m all for a large selection of good programming language to choose from, and a programming language coming from there, like any other Google product released, definitely warrants a more serious test then what I can offer in this rather quick post.

But I actually found out about Go from a friend that asked about it, didn’t mention Google, and gave me a link to the home page at GoLang.org where Google is not mentioned. So my review below was not influenced by any Google hype, and on the face of it, after reading through about half of the tutorial and a couple of other documents, I don’t like it.

(more…)

How many lines should a function have?

This question is probably one of the most debatable in programming, ever, and I wasn’t much surprised to find it also on Stack Overflow1.

Actually, I wasn’t surprised to find about a dozen different questions in the same gist, but here is the one that I really liked, especially some of the more interesting answers: How many lines should a method typically have?.

(more…)

  1. The best programming questions and answers site – if you’re a programmer by trade or hobby and you’re not familiar with Stack Overflow, then go register. []

Script day: grep in jar (or zip) files

Here is another script I wrote for work and I thought it will be interesting enough to share:

Say you want to check which JAR files (or ZIP files for that matter, as Java ARchive files are just ZIP files with a different extension) contain files that contain some text. grep is the obvious answer, but how to grep files in JARs?

(more…)

The Insanity of Upstream

Sometimes the Java community, or more specifically the people that write Java open source software, drive me nuts!

For the past couple of week I’ve been trying to build a new version for the Jetty package based on the current Jetty6 package from JPackage1, and in the process combating its hellish dependency tree and the way open source Java projects build opon each other in a complicated, confusing and often circular manner.

(more…)

  1. an excellent excellent project that is operated by talented people in what I can only guess is what little free time they have []

Script day – Shutting down multiple servers at once

A system administrator in my company recently approached me with a problem – how to shutdown multiple Linux servers at the same time from a central location. Apparently this is something that people in the MS-Windows world use all kinds of applications, like the Remote Shutdown Tool from Microsoft (though I don’t understand how they handle the authentication – this tools doesn’t seem to require any authentication so it appears that any person with network access can shutdown any computer).

Anyway, apparently searching the web for “Linux remote shutdown” yields no useful results (or so I’ve been told), but frankly – when you have standard UN*X tools at your fingertips, a remote shutdown tool is simply typing ssh root@server shutdown -r now at your local console. But still, for people who want a “tool” – read on.

(more…)

פניני קוד

מדי פעם יוצא לי לתחזק התקנת PHP Nuke ממש ישנה, ואני כל פעם מופתע מחדש מה”איכות” של הקוד: PHP Nuke הוא הדוגמה לכל מה שגרוע ב-PHP – זו טכנולוגיה לא רעה שהביאה את תכנות ה-Web להמוני אנשים שלא היתה להם דרך אחרת להתחיל, אבל זה גם הצד הרע שלה – PHP הביאה את התכנות להמוני אנשים שאין להם מושג בתכנות ואז אתה מקבל דברים כמו קוד שמביא פריטים מעץ הירארכי בעזרת הפונקציות GetKids ו-GetBabies (שקוראות אחת לשניה בלולאה), או את הקוד המבריק הזה:
(more…)