2007-01-30

Gratis Linux-driver til maskinvaren din

Har du noen maskinvare du gjerne skulle ha støttet under Linux? Nå kan du få det gjort gratis! Se Free Linux Driver Development!:
Yes, that's right, the Linux kernel community is offering all companies free Linux driver development. No longer do you have to suffer through all of the different examples in the Linux Device Driver Kit, or pick through the thousands of example drivers in the Linux kernel source tree trying to determine which one is the closest to what you need to do. All that is needed is some kind of specification that describes how your device works, or the email address of an engineer that is willing to answer questions every once in a while.
Oppdatering! Greg har produsert en FAQ basert på noen av tilbakemeldingene han har fått:
Q: Are companies really going to do this? A: Yes, already we have received a number of serious queries from companies about producing Linux drivers for their devices. More information will be available later when details are firmed up. Q: Are companies actually taking you up on this offer? A: Yes, the initial response to this was amazing, a measurable number of new Linux drivers will be created thanks to this program.

2007-01-29

Null safety in Java revisited

In a previous post, I ranted on the problem of null in Java leading to NullPointerExceptions appearing when you least expect it. Well, years have passed, and JDK versions also. JDK 7 is in the works, and null safety is one of the issues in question. As far as I can tell, three suggestions have surfaced:
  1. Symbols in relation to the type or dereference, like ? in the Nice Option Types, or # instead of .
  2. @NotNull and @Nullable annotations to method parameters, return values and instance variables. This exists in IDEA and FindBugs, and possibly Eclipse
  3. A new keyword, nonnull
In my view, the following requirements for compile-time nullable tests are most essential to focus on:
  1. The ability to declare whether a method's parameters or return value could be null and issue a compiler error if a known null is passed, and a warning if a possible null is passed
  2. Compile-time warnings for dereferencing where there's risk of null variables.
Research done on the ratio of parameters in a number of Java projects indicate that 80% of all parameters are non-nullable by design, i.e. the method intends for the parameter to be non-null. The paper continues in arguing that due to this, the default rule for references should change from nullable to non-nullable. My suggestion is to reuse the null keyword for this in method declarations. For instance, the following method does not accept nulls in any argument, and never returns one either. If the implementation does not assert this, the compiler must issue an error:
public Object get(String query, Object value);
Conversely, the following implementation accepts null for its second argument, and might also return a null:
public null Object get(String query, null Object value);
But what's the alternative to returning a null? The NullObject design pattern has addressed this : return a special case instance which is a valid return type, but identifiable as meaning "nothing".

2007-01-27

Om å sette sammen et godt team

Building a software team: Making room for different:
We all know that everyone is different, and yet we go on treating software engineers as interchangeable, plug replaceable units. You can hear it in the management jargon: we talk about resources when we mean people, about full time equivalents, about needing a architect, two mid-levels and a few grunts. Well guess what: it really doesn't make much difference which architect you pick, which full time equivalent you use, what particular resources you move onto a project. It is just the difference between success and spectacular, debris spewing failure. I'm not talking about good people vs. bad people here: you not only need good people to succeed, you need the right good people.

Hvordan blir du arkitekt?

Tek Tok with Teflon Ted: How do you become an Architect?
Always be the guy in every meeting with the best design idea. Be able to recognize and vocalize the pros and cons of every idea. Read, read, read! I am a bookworm. I read books on design patterns, frameworks, methodologies, programming languages, antipatterns, usability, etc.

2007-01-22

Pet Projects 2006

Paul René challenge me on pet projects I've been doing in 2006. Well, here goes:

Linux Desktop

My employer is a Microsoft customer, and the laptop issued to me had Windows 2000 Pro, and later XP pro, as standard software.

Being a long-time Linux advocate and addict, I opted to liberate myself from the Microsoft monopoly and attempt to use a Linux desktop for all my daily work.

The results? I do have a VMware Workstation installation with XP Pro, Office and Groove Virtual Office. This is used for in-house Internet Explorer-only applications, really troubling spreadsheets or documents, and PDA / mobile synchronisation.

But email, development, almost all web-based applications, most documents,presentations, and spreadsheets, and printing, work like a charm. The Linux installation started as Fedora Core 4 on a Compaq Evo N600c, and is currently a Fedora Core 5 on a Thinkpad T60, on its third disk drive. All upgrades have been very smooth -- disk switches were performed as LVM volgroup migrations, often on line.

My current plan is to migrate it to Fedora Core 6 on a Dell laptop. More on that later.

Home Automation

Clas Ohlson had a closing sale on X10 modules spring 2006, and I took the opportunity to buy the start kit with PC interface, RF interface, lamp and appliance modules, and an infrared motion sensor. Via heyu and xtend, my PC controls lighting and heating, ensuring that the heaters are switched off when nobody's home and switched on the second we enter the door.

I also considered using it as an alarm system, but realised that getting an SMS with what might be a false positive or a burglar when many miles from home would be more traumatizing than ignorance..

SMS server

I use an old mobile phone connected to the computer via SMS Server Tools to send alerts and receive commands. It's also connected to the Jabber server monitor described below, so short messages sent to this phone is distributed via Jabber. I can also send replies via a special command to the Jabber agent.

Temperature monitoring

TermometerI've also purchased a one-wire temperature controller kit from Quasar Electronics (designed by Quozl), and hooked up two DS18S20 sensors, one in the "server room" and one outside. RRDtool now ensures that I have access to historical temperature data from outside my living room for years to come. I also plan placing a sensor in the living room, and perhaps controlling the heater there based on both outside and inside temperature.

I had plans on monitoring the temperature of my freezer also, but this stopped when I realised my laptop only had a 5V serial port, and not 12V as the Link45 one-wire controller demands. Perhaps I should have gone for the USB version..

Jabber server monitoring

My main server runs a Perl Net::Jabber client with a command handling API and monitoring capability. It features a monitoring plugin interface, capable of testing temperatures, available memory and disk, system load, etc. against threshold values and sending me an IM when the thresholds are exceeded.

Computer fan control

My computer sits in an outside shed on the south side of the building, and experiences vast temperature variations. Due to this, air throughput has to be varied significantly between sun, shade, and winter. The CPU and exhaust fans are thermistor controlled, but the intake fans are controlled by computer. I found some fans with resistor control of fan speed, and connected the resistor wires to a parallel port relay board. With the relay open, the fan stays at its idle speed, and when the relay closes it runs at full speed. A small cron job checks system and disk temperatures and toggles between idle speed and full speed.

YaGoohoo!gle and Twingine

Twingine was a 2005 project, but was alive and kicking also in 2006. It had a total of 1,539,760 hits throughout the year.

2007-01-17

iTunes DRM gagner først og fremst Apple

Trodde du iTunes har FairPlay DRM bare fordi utgiverne krever det? Ikke i følge Want an iPhone? Beware the iHandcuffs:
Terry McBride, Nettwerk’s chief executive, said that the artists initially required Apple to use copy protection, but that this was no longer the case. At this point, he said, copy protection serves only Apple’s interests . Josh Bernoff, a principal analyst at Forrester Research, agreed, saying copy protection "just locks people into Apple." He said he had recently asked Apple when the company would remove copy protection and was told, "We see no need to do so."

2007-01-12

Exceptionhåndtering i Java

One of the most important architectural decisions a Java developer can make is how to use the Java exception model. Java exceptions have been the subject of considerable debate in the community. Some have argued that checked exceptions in the Java language are an experiment that failed. This article argues that the fault does not lie with the Java model, but with Java library designers who failed to acknowledge the two basic causes of method failure. It advocates a way of thinking about the nature of exceptional conditions and describes design patterns that will help your design.

2007-01-11

Enkel Linux-drift gir mye skole-IT til lav pris

Les i digi.no:
I dag har skolen med 443 elever og 40 årsverk, 200 Linux-klienter. Det skal være rundt 2,3 elever per PC, mens hver lærer har sin egen PC. Skolen har ingen leverandøravtale. Den alminnelig oppfatningen av ikke å ha en leverandøravtale, er at IT-driften er mer sårbar. IT-sjef Rognså avfeier dette: Han mener han har mindre å gjøre nå enn i 2000. IT-driften krever nå bare 0,65 årsverk. 200 Linux-klienter er 35 prosent mindre ressurskrevende enn 200 Windows-PC-er. (...) Rognså har regnet ut at skolen bare på lisenskostnader sparer rundt 100 000 kroner i året. I tillegg kan skolen med bruk av Linux klare seg med utdaterte PC-er som koster en femtedel av hva de normalt ville ha måtte punget ut.
Gammelt nytt for mange av oss, men bra at utdanningssektoren evner å bevise at det funker, og at ministrene tar seg tid til å lytte.

Er iPod en suksess fordi den er enkel?

Ikke ifølge Joel Spolsky. I Simplicity skriver han:
A lot of software developers are seduced by the old '80/20' rule. It seems to make a lot of sense: 80% of the people use 20% of the features. So you convince yourself that you only need to implement 20% of the features, and you can still sell 80% as many copies. Unfortunately, it's never the same 20%. Everybody uses a different set of features. (...) I think it is a misattribution to say, for example, that the iPod is successful because it lacks features. If you start to believe that, you'll believe, among other things, that you should take out features to increase your product’s success. With six years of experience running my own software company I can tell you that nothing we have ever done at Fog Creek has increased our revenue more than releasing a new version with more features. Nothing. The flow to our bottom line from new versions with new features is absolutely undeniable. It's like gravity. When we tried Google ads, when we implemented various affiliate schemes, or when an article about FogBugz appears in the press, we could barely see the effect on the bottom line. When a new version comes out with new features, we see a sudden, undeniable, substantial, and permanent increase in revenue.
Så enkelheten ligger i så fall i at den er enkel og intuitiv å bruke, ikke i å redusere funksjonalitet. Men U.S. Robotics uttalte i sin tid at Palm Pilot ble en suksess på grunn av den funksjonaliteten de tok bort, ikke den de tok med. Les PalmSources The Path to Enlightenment for mer informasjon.

2007-01-09

Ytelse på forskjellige JDK-versjoner

Et eksempel på hvor store endringer det har vært i ytelse gjennom de siste to JDK-generasjonene fra Atlassian Developer Blog: JIRA uberbox:
The other bit that I found interesting was the performance increases between JDK 1.4, JDK 1.5 and JDK 1.6: * JIRA Functional Tests for Enterprise JDK 1.4: 25 mins * JIRA Functional Tests for Enterprise JDK 1.5: 19 mins * JIRA Functional Tests for Enterprise JDK 1.6: 16 mins

Antitestdrevet utvikling

Testdrevet utvikling sier man skal skrive tester for ønsket atferd til koden, og at kode som feiler, skal rettes straks. Men hva dersom feilretting utsettes av ulike årsaker? Skal testen feile? Dette gjør det vanskeligere å skille kjente feil fra uventede feil. Charles Miller foreslår et alternativ i The Fishbowl: Revenge of the Anti-Test!:
The solution, perhaps, is the anti-test. Write a test that verifies the bug. One that goes green when the application is misbehaving in the way that you expect it to misbehave. Make sure you annotate it with the issue that it's verifying. That way your continuous integration environment will let you know immediately if something's suddenly worse than it was before. Or perhaps, when something is spontaneously better.

2007-01-01

Godt nytt år!

Julen 2006


Juletreet pyntes
Originally uploaded by asgeirn.
Julen 2006 ble feiret på Korsberg hos mine foreldre sammen med begge mine søsken og deres barn og samboere. Vi var ialt 12 mennesker på julaften, og koste oss storveies.

Feiringen startet med at vi pyntet vårt eget juletre før vi dro, og ble avsluttet med gaverunde #2 på 3. juledag med de pakkene som ikke fikk plass i kofferten.