Skip to content

www.rolfje.com

Tag: programming

Hacking Your Way Through Codebases

Posted on 2008-07-02 By rolfje 1 Comment on Hacking Your Way Through Codebases

I found a nice blog post which describes how it is after you leave school and start programming for a real company. You discover that programming is more like 80% reading and 20% coding.

Read the article at the Tired Architect’s blog titled “Hacking Your Way Through Codebases”.

Software

Migrate CVS repository to GForge

Posted on 2008-03-05 By rolfje 13 Comments on Migrate CVS repository to GForge

At work we were testdriving SourceForge Enterprise Edition. It is a great system to keep all your project information, source code, documents, bug reports and changes together, and linked. As you may have noticed, the pricing model of the Enterprise Edition is a well kept secret on the site. Our management bargained with the Colabnet people, but the costs (or TCO) were way to steep to keep SourceForge as our main system.

Another product which promises to do almost the same thing is GForge Advanced Server. GForge originally started as a fork of the (then open source) SourceForge code, and is not as advanced as SourceForge is today. But their pricing is more to the likings of our financial people, and we decided it has a good tradeoff between function and price.

Having said all this, we need to migrate a few projects from SourceForge to GForge. If you’d like to know how to do this, this article is for you. It describes how to get your CVS repository into GForge in 6 steps.

Read More “Migrate CVS repository to GForge” »

Software

GForge CVS/SSH Authentication Failures

Posted on 2008-02-26 By rolfje No Comments on GForge CVS/SSH Authentication Failures

Recently we had a problem connecting to our GForge CVS through SSH. We added the public RSA key to the GForge user, but because of wrong configuration on the client we tried to connect a couple of times with the wrong key. After a while the GForge CVS will return the following error:

Received disconnect from <GForge ip>: 2: Too many authentication failures for <username>

To solve this, simple ask a GForge administrator to edit the GForge user, and press the “Save” button without changing anything. You will be able to reconnect immediately after the administrator has pressed “Save”.

Software

Link CVS/SVN commit to GForge Tracker Item

Posted on 2008-02-21 By rolfje 3 Comments on Link CVS/SVN commit to GForge Tracker Item

Today I spent some time figuring out what the exact format of the CVS comment is when I want to link a commit to a GForge tracker item. I’ll try to explain it a bit simpler:

  • We have GForge installed at work. We use GForge to manage a software project for a customer.
  • The customer reports a bug in the Tracker of GForge. This bug gets assigned to me.
  • I read the code, find the problem and fix it. Now I want to commit the fix to the GForge integrated CVS, and have it automatically linked to the Tracker item for future reference.

I spent 30 minutes Googling for an example, and did find a lot of info, but no real usage examples. The info says “Include the tracker item id in the commit comment”. I spent anther 10 to 20 minutes trying to figure out if this meant just the number, the number with the prefix, or brackets, or both. To save more people from searching, you should copy-paste the complete tracker id from the tracker item screen.

Read More “Link CVS/SVN commit to GForge Tracker Item” »

Software

SVN is missing the point?

Posted on 2008-02-16 By rolfje 19 Comments on SVN is missing the point?

Our company was using Rational Clearcase for version control about 6 years ago. The developers decided it was way to clunky, error prone and WAY too expensive. We introduced CVS and it has been working fine for a few years now. CVS is widely known, stable and simple. I looked into using SVN a few years ago but the clients were unusable at that time. This year, the SVN discussion came to life again and some of my collegues started playing with it after I mentioned it as being a step forward from CVS.

Read More “SVN is missing the point?” »

Software

Essential Color Design Tool

Posted on 2007-10-15 By rolfje 1 Comment on Essential Color Design Tool

For those people out there designing user interfaces, web frontends or anything else displayed on a screen: About 8% of all males are color blind. This could mean that because of a simple color choice, 8% of your target audience (customers) could have serious difficulty in using your design. 5% of all males can’t distinguish green from red, although they are regarded as high contrast to eachother.

Do you want to test how your design looks to colorblind people? Now you can, with Color Oracle, a tool for Mac OSX and Windows which transposes the colors of your screen to reflect what it would look like if you were color blind. In fact, it can simulate 3 different kinds of color blindness.

From the site: “Color Oracle takes the guesswork out of designing for color blindness by showing you in real time what people with common color vision impairments will see. Color Oracle applies a full screen color filter to art you are designing – independently of the software that you are using. Eight percent of all males are affected by color vision impairement – make sure that your graphical work is readable by the widest possible audience.”

Software

Programmer Personality Test

Posted on 2007-06-06 By rolfje No Comments on Programmer Personality Test

Just found this funny page where you can take a Programmer Personality Check.

My programmer personality type is DHTB, which is explained as follows:

You’re a Doer.
You are very quick at getting tasks done. You believe the outcome is the most important part of a task and the faster you can reach that outcome the better. After all, time is money.

You like coding at a High level.
The world is made up of objects and components, you should create your programs in the same way.

You work best in a Team.
A good group is better than the sum of it’s parts. The only thing better than a genius programmer is a cohesive group of genius programmers.

You are a liBeral programmer.
Programming is a complex task and you should use white space and comments as freely as possible to help simplify the task. We’re not writing on paper anymore so we can take up as much room as we need.

Software

Parameter List Too Long

Posted on 2007-04-17 By rolfje 1 Comment on Parameter List Too Long

If your are “fortunate” enough to have to delete a lot of file from a directory on a Unix system, you are likely to encounter the “Parameter List Too Long” problem. This problem is caused by Unix trying to replace the “*” you just used by all names in the directory. This list is then passed to the rm command, which complains that it can not handle that much parameters.

To get around this limitation, you have a couple of options:

Delete all files in the current directory
By far the fastest and most compatible way to delete all files in the current directory without recursing into subdirectories is:
ls | xargs rm
This is the fastest command, because xargs makes sure the maximum allowed number of parameters is passed to rm, resulting in fewer calls/startups to rm.

Delete all files in the current directory and all subdirectories
To delete files not only from the current, but also from all subdirectories, use
find . -name "*" -exec rm -rf {} \;
This is somewhat slower, since rm is executed seperately for each file.

Above commands are tested on AIX and Linux.

Software

Thoughts on Widgets, Gadgets, Screenlets

Posted on 2007-04-11 By rolfje No Comments on Thoughts on Widgets, Gadgets, Screenlets

Just now, I was listening to the Java Posse podcast about the ab5k screenlet framework for Java, and I am finally convinced that software developers are a bunch of crazy, unrealistic, memory-hungry, cpu cycle stealers and by lack of normal people telling them otherwise are proud of it, too. The problem? Look at this list (no particular order):

  • Linux screenlets or applets
  • Windows Sidebar Gadgets
  • Apple Dashboard Widgets
  • Google Desktop Gadgets
  • Yahoo Widgets
  • and recently added: ab5k.org java screenlets

Read More “Thoughts on Widgets, Gadgets, Screenlets” »

Software

Java 5 BigDecimal.toString() and Oracle 10g jdbc

Posted on 2007-01-31 By rolfje 2 Comments on Java 5 BigDecimal.toString() and Oracle 10g jdbc

Yesterday a collegue of mine discovered a very ugly problem when storing BigDecimals from a Java 1.5 program into an Oracle 10g database. Not by experience, but by reading the article at http://www.javalobby.org/java/forums/t88158.html. We had not encountered the problem ourselves, but when passing the dredded 12500000 value to the BigDecimal constructor and passing it to the database, we discovered that we too were affected by this bug. So off I went to search a solution.

The root of the problem lies not only in the fact that the BigDecimal.toString() method behaviour has changed in Java 1.5, but also the way BigDecimals are constructed. The Oracle driver relies on a specific formatting of the BigDecimal.toString() method, and can not handle the output of the “new and improved” BigDecimal in Java 1.5. All discussions about not using toString() for passing values and flaming Oracle and/or Sun aside, we have no option but to fix the problem right now. Oracle promised to fix this problem not sooner than in release 11g, so waiting is not an option.

Option 1: Overriding BigDecimal.toString()
In our project, we use Ibatis. This gives us a nice handle to implement our own BigDecimalTypeHandler, where we can choose to do anything to the BigDecimal before storing it into the database, and revert that when retrieving it from the databse. One of the options we thought of was to override the BigDecimal’s toString in an anonymous subclass inside our IbatisTypeHandler, like so:


public void setParameter(PreparedStatement ps, int i,
                        Object parameter, String jdbcType)
                        throws SQLException {
  BigDecimal colVal = new BigDecimal(
              ((BigDecimal)parameter).toPlainString()){
    public String toString(){
      return toPlainString();
    }
  };
  ps.setBigDecimal(i, colVal);
}

The anonymous subclass lets you add or change behaviour to an existing class without cluttering your codebase with a classfile which looks rather strange when places out of context. We tried various ways of locally changing the behaviour of BigDecimal to make it go into and out of the database in a way that our unittest would not know the difference, but at some point gave up. There is not really a good way to do this without compromising in scale or resolution in the conversion.

When using the setParameter described above, you will not get a situation where originalBigDecimal.equals(storedBigDecimal) returns true. In most cases this will not be a very big problem, since originalBigDecimal.subtract(storedBigDecimal) will always return 0.

If somebody thinks of a way to store BigDecimals into the database and retrieving them in a way it is totally transparent to the caller (compared to JDK 1.4 behaviour) please feel free to post it here.

Option 2: Loosing your BigDecimals

Perhaps this option had to be considered when thinking of using BigDecimals in the first place. BigDecimals are very awkward to calculate with, are relatively heavy both performance and memory wise. Very often they get converted to doubles before doing any calculations with them, which eliminates most of the reasons for using BigDecimals anyway.

The easy way to loose only those BigDecimals which get stored in the Database, rewrite the typeHandler you just created into the following:


public void setParameter(PreparedStatement ps, int i,
                        Object parameter, String jdbcType)
                        throws SQLException {
  throw new UnsupportedOperationException(
    "Oracle can not handle Java 5 BigDecimals properly");
}

Now, run all Unittest (you have unittests covering at least 80% of your software, don’t you?) and replace BigDecimals with other appropriate datatypes where you see the UnsupportedOperation popup.

Software

Posts navigation

Previous 1 … 4 5 6 Next
         

Recent Comments

  • rolfje on Exit WordPress
  • Guus on Exit WordPress
  • rolfje on Exit WordPress
  • rolfje on Methode Buijs uitgelegd
  • LinkedIn is at Peak Enshittifaction – Will Chatham's Blog on Linked-In not really Opt-in?

Tags

Apple backup design DIY DRM eclipse environment fix Fun gmail google hacking hamradio Hardware helicopter iphone ipod iTunes Java Keynote linux modelling motorcycle music news opinion oracle osx photo photography programming repair review security Software technology Time Machine Twitter Ubuntu usability Utilities vacation vista windows Workshop

Categories

  • Apple (105)
  • Divorce (1)
  • Electronics (3)
  • Fun (57)
  • Games (7)
  • Hardware (72)
  • Microsoft (18)
  • Racing (15)
  • Software (138)
  • Uncategorized (68)
  • Workshop (20)

Archives

Brought to you without adds, banners, cookies or tracking. This one is on me. Yes, life can be this good. Pay it forward.

Copyright © 2026 www.rolfje.com.

Powered by PressBook WordPress theme