amazing development » Rants http://amazing-development.com ruby, java and the rest Fri, 29 Nov 2013 18:57:08 +0000 en-US hourly 1 http://wordpress.org/?v=3.4.2 Dear Garmin… http://amazing-development.com/archives/2010/02/28/dear-garmin/ http://amazing-development.com/archives/2010/02/28/dear-garmin/#comments Sun, 28 Feb 2010 09:22:29 +0000 Frank Spychalski http://amazing-development.com/?p=444 Dear Garmin,

I don’t know if anyone told you that you build pretty good hardware but your firmware SUCKS! It’s Nearly March 2010 and your customers still have to fight with an embarrassing Y2010 bug in your code, the UI is horrible and getting anything on or off the device is a pain. I am the not-so-proud owner of an eTrex HCx but I can’t remember the last time I actually used it. Why? Because a Nexus One with My Tracks is way better than anything you have to offer. No need to jump through hoops to get tracks off the device, no proprietary drivers that work with one and a half operating systems and I carry it anyway…

Do you want me back as a customer?

Build the eTrex Android.

Specs:

  • rugged version of the Nexus One (same screen, processor, etc.)
  • replaceable batteries (with a tiny battery in the device to let me switch batteries without shutting it down)
  • better GPS antenna & chips
  • tiny solar panel on the back

If you or any other company would build a device like that, you could ask ANY price and I would buy it. So please build it. Please…

]]>
http://amazing-development.com/archives/2010/02/28/dear-garmin/feed/ 0
I love starbucks http://amazing-development.com/archives/2008/01/06/i-love-starbucks/ http://amazing-development.com/archives/2008/01/06/i-love-starbucks/#comments Sun, 06 Jan 2008 16:52:49 +0000 Frank Spychalski http://amazing-development.com/archives/2008/01/06/i-love-starbucks/ I moved to Munich a few month ago – well actually I move to Munich only a few days ago but my stuff is here for a few months already. But anyway, I don’t have DSL yet. There are 6 or 7 WLANs in my building but these damn neighbors know how to set a password. This means I feel like living on a remote island far away from civilization when I’m at home. About an hour ago I brought my GF to the train station and luckily there is a Starbucks with a hotspot. With my iPass account I can access it without paying to 8EUR/h and get my fix of internet today ;-)

]]>
http://amazing-development.com/archives/2008/01/06/i-love-starbucks/feed/ 5
Perfect customer service http://amazing-development.com/archives/2006/12/24/perfect-customer-service/ http://amazing-development.com/archives/2006/12/24/perfect-customer-service/#comments Sun, 24 Dec 2006 10:04:00 +0000 Frank Spychalski http://amazing-development.com/archives/2006/12/24/perfect-customer-service/ On Thursday I ordered an Ixus 800 IS with a 2gb SD card from amazon.com as a christmas gift for myself. As promised the camera arrived yesterday morning but without the memory card. Amazon screwed up but why am I writing an article titled “Perfect customer service”?

First I read amazon.de Help but I found no phone number. Then I checked Imprint, where I found a link label Callback service. Less than a second after I entered my phone number, my phone rang. Less than 30sec later I was explaining my problem to a customer service person. I was really suprised as he told me something like “the card is in stock, you will have it tomorrow”. Me: “What?!?” Him: “Yes, I will send it by express. 99.9% of the packages are delivered the very next day.” Me: “Cool, that’s great. Thank you VERY MUCH!”. And for the happy ending the package did arrive today :-) Thank you, Amazon!

]]>
http://amazing-development.com/archives/2006/12/24/perfect-customer-service/feed/ 1
java.sql.SQLException: Got error 28 from storage engine http://amazing-development.com/archives/2006/08/16/javasqlsqlexception-got-error-28-from-storage-engine/ http://amazing-development.com/archives/2006/08/16/javasqlsqlexception-got-error-28-from-storage-engine/#comments Wed, 16 Aug 2006 08:48:00 +0000 Frank Spychalski http://amazing-development.com/archives/2006/08/16/javasqlsqlexception-got-error-28-from-storage-engine/ I had a strange problem with MySQL the other day. After I optimized a query which took too long I got a error 28. The logfile said:

WARN  [org.hibernate.util.JDBCExceptionReporter] SQL Error: 1030, SQLState: HY000
ERROR [org.hibernate.util.JDBCExceptionReporter] Got error 28 from storage engine

which is somehow related to

>perror 28
OS error code  28:  No space left on device

I checked my filesystem and no device was full. I expected to see at least one device with 90-something percent use but strangely “No space left on device” means “Hey, there is only 170mb left on /tmp and I need MORE!”. After I moved the MySQL tmpdir to another partition, everything worked like it should. So I guess this is another case of “Why should we provide useful errormessage when we want to sell consulting”TM.

]]>
http://amazing-development.com/archives/2006/08/16/javasqlsqlexception-got-error-28-from-storage-engine/feed/ 0
XSL Best Practice http://amazing-development.com/archives/2006/07/18/xsl-best-practice/ http://amazing-development.com/archives/2006/07/18/xsl-best-practice/#comments Tue, 18 Jul 2006 07:45:58 +0000 Frank Spychalski http://amazing-development.com/archives/2006/07/18/xsl-best-practice/ I have to work with XSL templates again and in addition to XML being a terrible language to write any kind of code in I found this anti-pattern.

If you want to output a few attributes with little or not text in between, please refrain from


<xsl:value-of select="@type"/> <xsl:value-of select="@lfd"/> - <xsl:value-of select="@key"/>: <xsl:value-of select="@value"/>

and use concat instead

<xsl:value-of select="concat(@type, ' ', @lfd, ' - ', @key, ': ', @value, ' ')"/>

Why? Less code[1], easier to read, no problems with whitespaces in your result document.

For further reading I found XSLT Best practices fairly informative. Are there any other good compilations of XSL best practices?

[1] before anyone starts argueing that it’s not much of a difference, I just removed examples with 8 calls to xsl:value-of…

]]>
http://amazing-development.com/archives/2006/07/18/xsl-best-practice/feed/ 0
Rubybashing: Why use implicit return? http://amazing-development.com/archives/2006/04/04/rubybashing-why-use-implicit-return/ http://amazing-development.com/archives/2006/04/04/rubybashing-why-use-implicit-return/#comments Tue, 04 Apr 2006 12:10:53 +0000 Frank Spychalski http://amazing-development.com/archives/2006/04/04/rubybashing-why-use-implicit-return/ I like Ruby, I really do. But there is one thing I just don’t get. I seems to be good Ruby style to use as much implicit returns as possible. Why?

If you take a look at the code from this very interesting article

class DataRecord
[...]
      end
      data.close
      array
    end
  
    klass
  end
    
end

Why not use a additional return here:

class DataRecord
[...]
      end
      data.close
      array
    end
  
    return klass
  end
    
end

Leaving out the return saves you 7 characters but I think at the cost of clarity. But I’m wondering if I’m missing something here…

Addendum

I learn a lot and like Emmet said:

The really big win you get from implicit return isn’t in functions like the one you gave as an example, it’s in functions like this…

Thanks everybody for the great responses.

]]>
http://amazing-development.com/archives/2006/04/04/rubybashing-why-use-implicit-return/feed/ 6
Errorhandling Ruby vs. Java http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/ http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/#comments Sat, 01 Apr 2006 09:29:15 +0000 Frank Spychalski http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/
At my daytime job I had to rewrite a class which sends a Message to a Queue. Sounds simple? With EJB3 it is reasonably simple and can be done in around 10 lines of code involving lots of lookups. But if you are looking for a reliable solution which works even when the application server reboots every once in a while your code gets messy. My current solution has 120 lines of code and there are still some things to add like buffering of unsent messages.

Bloated Exceptionhandling

Why do I have to write so much more code to get a reliable solution? Part of the blame is on Java, because of its verbose exception handling – there is no elegant way of catching 2 or more exceptions[1] without catching Exception or Throwable, which I try to avoid where possible. Ruby has this simple solution compared to the bloated solution in java, especially with EJB where you have to catch half a dozend different exceptions.

begin
  eval string
rescue SyntaxError, NameError => boom
  print "String doesn't compile: " + boom
rescue StandardError => bang
  print "Error running script: " + bang
end
Retry

Repeating whole blocks of code needs too much code, too. Ruby has the retry command, which restarts the current block:

c = 0
for i in 1..100
  tries = 0
  begin
    c = c + 1                 # dummy code
    if c % 4 != 0             # to create
      puts "failed for #{i}"  # a few
      raise "uups"            # exceptions
    end
    puts "action #{i}"
  rescue
    puts "rescue"
    tries = tries + 1
    retry if tries < 3
  end
end

This is just another name for goto, which might be harmful. Actually, I wouldn’t use this solution anyway because there is a better, more reusable way, to achieve the same.

closures

In ruby, it is possible (and very simple) to pass some code to a method. This allows me to create a method which excecutes my code multiple times, if an exceptions occurs:

def try(max_tries = 3)
  tries = 0
  begin
    yield
  rescue
    puts "rescue"
    tries = tries + 1
    retry if tries < max_tries
  end
end

c = 0
for i in 1..100
  try do
    c = c + 1                 # dummy code
    if c % 4 != 0             # to create
      puts "failed for #{i}"  # a few
      raise "uups"            # exceptions
    end
    puts "action #{i}"
  end
end

When I started this article, I just wanted to write a short rant about the missing features for errorhandling in java. While writing, I noticed that Ruby has them. Perhaps that’s the reason why I enjoy programming in ruby so much :-)

[1]to clarify this point just for Jason: In general, there is no elegant way of catching two or more exceptions. If you look at the number of direct subclasses in java.lang.Exception, it is nearly impossible to catch the exceptions you want using a superclass without catching some ‘innocent bystanders’.
I would very much like to see a elegant solution which catches only java.sql.SQLException and java.util.concurrent.TimeoutException, you may use as much OOP and polymorphism as you like. This might not be the fault of the language but the plattform but as I cannot get one without the other, it doesn’t really matter to me. Don’t get me wrong, I think Java is pretty damn good, but there is still a lot of room to improve. And Ruby is showing some of the things which can be done better.

]]>
http://amazing-development.com/archives/2006/04/01/errorhandling-ruby-vs-java/feed/ 12
meetings, discussions and the color of the bike shed http://amazing-development.com/archives/2006/03/15/meetings-discussions-and-the-color-of-the-bike-shed/ http://amazing-development.com/archives/2006/03/15/meetings-discussions-and-the-color-of-the-bike-shed/#comments Wed, 15 Mar 2006 09:57:01 +0000 Frank Spychalski http://amazing-development.com/archives/2006/03/15/meetings-discussions-and-the-color-of-the-bike-shed/ I found this piece via Damien Katz. It is originally from a freebsd mailing list:

In the specific example involving the bike shed, the other vital
component is an atomic power-plant, I guess that illustrates the
age of the book.

Parkinson shows how you can go in to the board of directors and
get approval for building a multi-million or even billion dollar
atomic power plant, but if you want to build a bike shed you will
be tangled up in endless discussions.

Parkinson explains that this is because an atomic plant is so vast,
so expensive and so complicated that people cannot grasp it, and
rather than try, they fall back on the assumption that somebody
else checked all the details before it got this far. [...]

A bike shed on the other hand. Anyone can build one of those over
a weekend, and still have time to watch the game on TV. So no
matter how well prepared, no matter how reasonable you are with
your proposal, somebody will seize the chance to show that he is
doing his job, that he is paying attention, that he is here.

I don’t know how many times I had to endure pointless arguments in meetings. At least this explanation is less depressing than the one I had before about people just being plain stupid. People should be forced to read this mail before every single meeting.

]]>
http://amazing-development.com/archives/2006/03/15/meetings-discussions-and-the-color-of-the-bike-shed/feed/ 0
Please do not apologize! http://amazing-development.com/archives/2006/02/04/entschuldigt-euch-nicht/ http://amazing-development.com/archives/2006/02/04/entschuldigt-euch-nicht/#comments Sat, 04 Feb 2006 14:20:53 +0000 Frank Spychalski http://amazing-development.com/?p=182 I can’t present my opinion in such a nice way, that’s why I’ll just link to some pages which reflect my opinion of this whole mess.

A little bit older, but still very true “If You’re a Christian, Muslim or Jew – You are Wrong”. You can find these ‘offending’ images among a lot of other older images in the Mohammed Image Archive.

Spiegel: Aber es kann im Ernst in unserer demokratischen Kultur keine Frage sein, dass nicht Dänen den Islam angegriffen haben, nicht einmal eine dänische Zeitung, sondern umgekehrt Muslime tragende Grundlagen der europäischen Zivilisation attackieren. Das ist der Kern des Problems und wer das verständnisvoll durcheinander bringt oder gleichsetzt, liegt schief.

]]>
http://amazing-development.com/archives/2006/02/04/entschuldigt-euch-nicht/feed/ 0
Ehrenrettung für den Denker? http://amazing-development.com/archives/2006/01/31/ehrenrettung-fur-den-denker/ http://amazing-development.com/archives/2006/01/31/ehrenrettung-fur-den-denker/#comments Tue, 31 Jan 2006 08:27:13 +0000 Frank Spychalski http://amazing-development.com/?p=181 Der Spiegel berichtet in Ehrenrettung für den Denker über eine Veröffentlichung des Wissenschaftsrates (bei dem wieviele Mitglieder selber Geisteswissenschaftler sind?), in der versucht wird, das Image der Geisteswissenschaftler aufzubessern. Aber was kann man von einer Arbeit mit dem Titel “Entwicklung und Förderung der Geisteswissenschaften” anderes erwarten, als Argumente, eben diese Geisteswissenschaften mehr zu fördern. Aber vielleicht hätten sie ein paar Zahlen besser weglassen sollen:

Spiegel: Die renommierte Wissenschaftsorganisation verwehrt sich gegen eine “deplatzierte Krisenrhetorik” und verweist auf Erhebungen, wonach 73 Prozent der geisteswissenschaftlichen Absolventen fünf Jahre nach ihrem Abschluss einen festen Job haben. Das liegt nicht allzu weit unter dem Mittelwert aller Studienfächer von 87 Prozent.

Orginal Seite 8: Fünf Jahre nach Studienabschluss nähert sich jedoch der Anteil regulär berufstätiger Geistes- und Sozialwissenschaftler (73 %) dem Durchschnitt über alle Fächer (89 %) an.

Also nochmal, 5 Jahre nach Abschluss haben 27% der Geisteswissenschaftler immer noch keinen Job, und das ist ‘fast’ soviel wie die 11% des Durchschnitts. Zum Glück findet man auch noch den Anteil der Geisteswissenschaftler unter allen Studenten:

Orginal Seite 19: Auch der Anteil der Studierenden in den Geisteswissenschaften an allen Studierenden verzeichnet zwischen 1990 (rd. 19 %) und 2003 (rd. 26 %) einen deutlichen Anstieg.

Wenn die oben angegebenen Zahlen aktuell sind und ich mich nicht verrechnet habe, gilt 0.26 * 0.73 + (1 – 0.26) * x = 0.89, d.h. x = 0.946. Also sind 27% der Geisteswissenschaftler nach 5 Jahren noch immer ohne festen Job im Gegensatz zu 5% der restlichen Absolventen. Da kann man natürlich nachvollziehen, daß Geisteswissenschaftler gefördert werden sollten – vor allem mit der Anerkennung des Personenbeförderungsscheins als Praktikum.

]]>
http://amazing-development.com/archives/2006/01/31/ehrenrettung-fur-den-denker/feed/ 0
The great linux mystery http://amazing-development.com/archives/2005/11/23/the-great-linux-mystery/ http://amazing-development.com/archives/2005/11/23/the-great-linux-mystery/#comments Wed, 23 Nov 2005 15:55:28 +0000 Frank Spychalski http://www.spychalski.de/blog/archives/2005/11/23/the-great-linux-mystery/ Why do my fonts have to change every n-th time when I update my system? I just don’t get it – just updated my system and after a short scare everything is running fine except that my konsole font looks like crap. And every other font available und Settings->Font looks even worse.

]]>
http://amazing-development.com/archives/2005/11/23/the-great-linux-mystery/feed/ 0
Short OW2 Wiki Review http://amazing-development.com/archives/2005/07/06/short-ow2-wiki-review/ http://amazing-development.com/archives/2005/07/06/short-ow2-wiki-review/#comments Wed, 06 Jul 2005 14:14:15 +0000 Frank Spychalski http://www.spychalski.de/blog/archives/2005/07/06/short-ow2-wiki-review/ Today I finally found the time to install and test the OW2 wiki. The basic idea sounds very promising: a wiki with build in support for tagging.

Installation:
Installation took less than 10min, create a DB, import a sample DB, edit 2 files. As promised everything was working and the start page welcomed me with

To try and log on, you may want to log on as:
* Admin (password test)
* zebru (password hello)

This is nice, but after playing around as Admin I tried to change the password, but this seemed impossible via the web interface. The password is stored in plain text in the database, so it is possible to change it, but this should be easier.

Log out and click on the “create user” link. This left me with this error message:

Warning: Failed opening ‘skins/default.osk’ for inclusion (include_path=’.:/usr/share/pear’) in /var/www/ow2wiki/userManager.php on line 286

this change fixed the problem:

286c286
< include( “skins/$skin/template.osk” );

> include( “skins/$skin.osk” );

Wiki markup

The only documentation about possible markup is this short example in the sandbox:

La sandbox è lo spazio in cui fare le proprie prove….
prova
prova provata

<<<AAA>>>

<<bbb
cc>>

>>bbb
cc<<

>>bbb
cc<<

>>bbb
cc<<

This is where I stopped because I didn’t want to waste any more time on a tool which has IMHO a neat idea but still very far away from being easily usable.

]]>
http://amazing-development.com/archives/2005/07/06/short-ow2-wiki-review/feed/ 0
Anti-Software Patent Bribe http://amazing-development.com/archives/2005/03/10/anti-software-patent-bribe/ http://amazing-development.com/archives/2005/03/10/anti-software-patent-bribe/#comments Thu, 10 Mar 2005 16:36:39 +0000 Frank Spychalski http://www.spychalski.de/blog/archives/2005/03/10/anti-software-patent-bribe/ I’m not really against software patents but I’m sure against the recent anti-democratic behaviour shown by the EU to ignore all public opinions. Here’s a page which tries to raise funds to bribe the EU Council Presidency.

via Julian and symlink.ch

]]>
http://amazing-development.com/archives/2005/03/10/anti-software-patent-bribe/feed/ 0
About user interface http://amazing-development.com/archives/2005/03/03/about-user-interface/ http://amazing-development.com/archives/2005/03/03/about-user-interface/#comments Thu, 03 Mar 2005 09:06:28 +0000 Frank Spychalski http://www.spychalski.de/blog/archives/2005/03/03/about-user-interface/ A few minutes ago bloglines showed me that Daniel wrote a comparison between Java and C# (seem’s like he only changed the article because the date was 2005-02-08 but that’s not the point of this rant). I was annoyed that the only thing I could see was

I&#39;ve been developing with C# for about three months, and I guess it&#39;s time to draft a comparison to my (previous)…

some sites don’t publish all content, I can live with that so I clicked on the link to read the article to get

You are not authorized to view this resource.
You need to login.

ok, go to main page and find article. where’s the link to the main page. First thing I notice and click on is the orange “gewinnt-immer” at the right top – just an image, nothing happens – ahh there’s a smaller home on the left side that takes me to the home page to find the article in the middle of the page. Finally I can read the article…

A few minutes later I want to leave a comment about the broken link from the rss feed and was not happy to see

Only registered users can write comments.
Please login or register.

IMHO another annoying feature which I will leave in my soon-to-be-written comment. Being used to not-underscored links on this page I click on register part of “Please login or register” only to see – nothing. Scroll to the top again and locate the register (“create one”) link. Insert details, wait a few seconds, click on link in email to activate account. Type login and password and click [Login] to enjoy the beautiful grey messagebox which tells me

index.php could not be found. Please check the name and try again.

To summarize: I read my share of blogs but this mambo software gets the prize for worst piece of junk which tries to publish a blog.

]]>
http://amazing-development.com/archives/2005/03/03/about-user-interface/feed/ 4
preaching about xml http://amazing-development.com/archives/2005/03/02/81/ http://amazing-development.com/archives/2005/03/02/81/#comments Wed, 02 Mar 2005 10:22:40 +0000 Frank Spychalski http://www.spychalski.de/blog/archives/2005/03/02/81/ Uli linked to an articles by Johannes Link which tries to tell us about the problems of XML. I read this article one or two years ago and is was the main reason not to subscribe the “xml magazin”.

Probleme einer XML-zentrierten Entwicklung
Fassen wir noch einmal zusammen, was bislang klar geworden sein sollte:

* XML bietet keinen standardisierten Mechanismus, um Querbezüge zwischen XML-Knoten herzustellen.

* Viele Abhängigkeiten in XML-Konfigurationen sind ungesichert, d.h. ein bloßes Parsen – auch unter Zuhilfenahme eines Schemas – genügt nicht, um die Konsistenz der XML-Datei sicherzustellen.

* Schon einfache Konfigurationsmöglichkeiten können einen Einfluss auf die tatsächliche Programmlogik haben.

my pretty free translation :

Problems with XML-centric development.
To summarize:
1. in XML no standardized way to crossreference between nodes
2. many dependencies in XML an not checked, parsing alone is not sufficient
3. simple configuration options can influence the program logic

1. Ever heard someone say, a text document has no standardized way to crossreference between something? XML is just the format. Maybe the author never heard of XML Schema and key/keyref elements

2. One example I could imagine is the configuration of a classname and checking wether this class exists and has the correct type. But I’m still looking for a better solution.

3. I always thought that’s the point of using a config file.

Don’t get me wrong, I’m not saying that XML is the solution. The author has a very valid point when he says

Eine zu generische Applikation ist ebenso unbrauchbar wie eine zu unflexible.
Too generic applications are as useless as an inflexible ones.

Unfortunately I can not propose a better solution, so my main point is XML is not as bad as this author tries to tell us…

ps: I’m working on one configfile which I will move away from XML, which contains a configuration similar to a programming language, to make it more readable and easier to modify by non-programmers.

]]>
http://amazing-development.com/archives/2005/03/02/81/feed/ 0
goodbye climbing.de/forum http://amazing-development.com/archives/2005/03/01/goodbye-climbingdeforum/ http://amazing-development.com/archives/2005/03/01/goodbye-climbingdeforum/#comments Tue, 01 Mar 2005 08:32:12 +0000 Frank Spychalski http://www.spychalski.de/blog/archives/2005/03/01/goodbye-climbingdeforum/ As Uli wrote, the climbing.de forum was closed yesterday by its administrator due to misuse by some stupid users. I share some of Uli’s grief about the shutdown but no very much because I gave up on climbing.de quite some time ago for the same reasons Martin closed the forum.

The only climbing forum which is left is rockclimbing.com which nearly the opposite of climbing.de. There’s a ‘community’ sub-forum with very little moderation and heavy flaming going on and a lot of other forums where the strict terms of service are enforced. It might be sad, but on the average, the internet population is so damn stupid that moderation is the only way a open forum can operate…

]]>
http://amazing-development.com/archives/2005/03/01/goodbye-climbingdeforum/feed/ 0