royvanrijn: Nouja, gewoon lelijke icoontjes etc.. verder werkt het wel allemaal haha

Handling null in Java

February 1st, 2010

Its a problem I encouter in most JEE projects I’ve worked on so far. Handling null-values. But why is this a problem? And what strategies can we follow to reduce the problem? That is what I’m trying to find out in this post.

Continue reading »

Share this:
  • DZone
  • Digg
  • del.icio.us
  • Twitter
  • Facebook
  • StumbleUpon
  • Reddit
  • Technorati
  • Google Bookmarks
  • RSS
  • Print

Placement of circle over points

January 27th, 2010

For the Queue ICPC programming game Capture I ran into a geometrical problem.
While programming my little robot I wanted to have an algorithm calculate this for me:

  1. I have a field with 122 points
  2. I have a circle of fixed size

How do I calculate where to put the circle so it encapsulates the most points?

This is what I came up with, three algorithms:
Continue reading »

Share this:
  • DZone
  • Digg
  • del.icio.us
  • Twitter
  • Facebook
  • StumbleUpon
  • Reddit
  • Technorati
  • Google Bookmarks
  • RSS
  • Print

I hate printers

January 27th, 2010
  1. Why, when one color has run out of ink, you can’t print anything!?
  2. Why does a pencil cost $0,50 and does an ink-cartridge cost $30,-?
  3. Why does a pencil still work after 5 years and is an ink-cartridge completely dried up?
  4. Why is a new printer (including ink cartridge) sometimes cheaper then a seperate ink-cartridge (crazy!)
  5. Why do printers eat paper for lunch?
  6. Why is printer-software so invasive? What happened to a simple ‘driver’
  7. Why does most hardware run perfectly under Linux, except printers?

Screw this, I’ll just mail my report instead of printing it…

Printer-bashing comic: Why I believe printers were sent from Hell

Share this:
  • DZone
  • Digg
  • del.icio.us
  • Twitter
  • Facebook
  • StumbleUpon
  • Reddit
  • Technorati
  • Google Bookmarks
  • RSS
  • Print

Guess the algorithm

January 23rd, 2010

Yesterday I found and programmed a nice little algorithm. I’m not going to tell you (yet) what it does and how its called, but I’ll just show the code:

	private int function(int x, int y) {
		int r = 0;
		while(x!=0) {
			if((x&1)==1) {
				r+=y;
			}
			x>>>=1;
			y<<=1;
		}
		return r;
	}

So tell me, what does this do, and what is the algorithm called?

Edit:

And indeed (it was a simple one) the correct solution is multiplication, and to be specific, Ethiopian or Russian Multiplication.

I’ll probably do more, harder ones, in the future..!

Share this:
  • DZone
  • Digg
  • del.icio.us
  • Twitter
  • Facebook
  • StumbleUpon
  • Reddit
  • Technorati
  • Google Bookmarks
  • RSS
  • Print

What kind of woman would your web framework be?

January 20th, 2010

Struts

This would be Struts

If Struts was a woman, she would probably be around their 40s. She is mature and has a lot of experience, but she has lost her glamour and her good looks. Everything still kind of works, but not ‘like it used to’. Young new JEE developers don’t want anything to do with her and try to stay away. But the older mature managers still have feelings for her and long back to when she was young and the world was a better place.

Continue reading »

Share this:
  • DZone
  • Digg
  • del.icio.us
  • Twitter
  • Facebook
  • StumbleUpon
  • Reddit
  • Technorati
  • Google Bookmarks
  • RSS
  • Print
Page 1 of 612345...Last »