28 July 2007

Golfer-Riddle (Prolog-Version)

In my ongoing quest for improved awareness for rule-based systems, I solved the golfer-riddle in Prolog and published the solution together with an explanation here.

It's a pretty straightforward translation of the riddle itself - Prolog rocks!
(I'm open to improvisation suggestions...)


gcolor(blue).
gcolor(plaid).
gcolor(orange).
gcolor(red).

gpos(1).
gpos(2).
gpos(3).
gpos(4).

golfer( [_, C, P] ) :- gcolor(C), gpos(P).

golferRiddle( G1, G2, G3, G4) :- golfer(G1),golfer(G2),golfer(G3), golfer( G4),
G1 = [fred, FredCol, FredPos ],
G2 = [joe, JoeCol, 2],
G3 = [tom, TomCol, TomPos],
TomPos =\= 1, TomPos =\= 4,
TomCol \= orange,
G4 = [bob, plaid, BobPos],

/* unique colors */
is_set([FredCol, JoeCol, TomCol, plaid]),

/* unique positions */
is_set([FredPos, TomPos, BobPos, 2]),

/* Fred's right neighbour wears blue */
plus( FredPos, 1, FP1),
member( [_, blue, FP1], [G1, G2, G3, G4]).

22 July 2007

Amazon: Success in a (not-so-small) logistical problem

For something not directly related to IT: Today (July 21st 2007) was a special day in three ways:

  1. (12th) anniversary of our marriage - a reason to celebrate (what we did, read on).

  2. First day of our first-holiday-ever in the Austrian moutains.

  3. Harry-Potter's latest novel hits the stores, completely unrelated to the previous two events...



Now for the logistical problem: I preordered the Harry-Potter at Amazon and gave them our hotel address to deliver to. Beeing one of more than 100.000 Potter-addicts, I was really curious wether Amazon would succeed in delivering my parcel to the Austrian mountains on time.

To my surprise they did: When we arrived after a smooth 7-hour-ride, the "Deathly Hallows" awaited me...

Congratulations to Amazon and their logistics partner DHL: You earned mental bonus points today. Well done.

19 July 2007

Virtualization on the Mac

Yesterday I installed the new version of Parallels Desktop (3.0). It feels a bit smoother, but still cannot handle two monitors... (my usual setup at home).

What every Windows user will surely like: The excellent snapshot manager, which allows even branches :-)

Too bad I don't have any graphics-intensive games to test the DirectX improvements...


18 July 2007

Pragmatic Re-Re-Branding

A good move: The (awesome) rule-engine "Drools" is back- including a new version of its logo:

jboss-drools-logo

Mark Proctor writes in his blog:

"Having received community feedback 4.0 will start the push to reclaiming the Drools name.... So to help speed up this process, I would please encourage everyone now to use "JBoss Drools" in any articles, blogs, talks etc."


I'll start: JBoss-Rules will be called "JBoss-Drools" from now on (again)...

13 July 2007

Why JSR 94 is a futile attempt to solve a no-problem

Q: What's a no-problem?

A: A problem which never occurs in practice but is defined to be one by some committee.

---
Q: What's JSR 94?

A: An initiative to define a Java runtime API for rule engines by providing a simple API to access a rule engine from Java. In theory, rule engines can be seamlessly interchanged if they comply to JSR 94.

---
Q: Why is JSR 94 solving a no-problem?

A: IMHO there at least two reasons:
1. JSR 94 covers only the rule engine API, but NOT the rule language (which might, one day, be covered by RuleML).
+ This API describes how a rule engine should be invoked from Java. That's (simple) infrastructure code - you need a couple of classes and interfaces for it.
+ If you change your rule-engine, just rewrite those few classes and you're set... at least with the infrastructure.
+ You'd have to rewrite (and re-test) ALL your business rules to change the engine - and rule languages are by no means similar to each other...
2. Who wants to change the database? In more than 20 years I have not seen a single customer migrating a productive system from one database to another - although database independency long seemed a crucial issue.
+ I've experienced cases where we used MySQL for development and Oracle for production - but they behaved differently, even with powerful OR-Mappers we could not resolve those issues.
+ Don't tell me anybody wants to try this with their business rules... nobody wants them in two different rule-languages.

---
Q: What do the rule-engine vendors say about it?

A: I don't care. SQL-vendors blubbered about interoperability for ages. But they always found ways around it.

---
Q: What shall I do if I care about rule engines?

A: Choose the best one for your purpose. And be prepared to stick to it for a long time.

Putting `make` to a good use...

I thought that make died a quiet death some years ago, at least for the web-guys. Now I started compiling a few web pages based upon Markdown - but how to automate the process of compiling markdown to html??

make to the rescue - It even contains a nice makefile template for the job... The first time I use perl for myself :-)

(I know, I shouldn't do such things in my holiday... but it's rainy and the children enjoy getting wet'n sandy jumping down the dunes)

02 July 2007

My walkthrough of a JBoss-Rules Example...

I originally planned to blog on this later this year, but as Mark Proctor of JBoss
has already published it
...

"Dr. Gernot Starke has created a walk through of the Golfing example which can be found here: http://rbs.gernotstarke.de/samples/samples/golfer-riddle-jbr.html.

It's great that someone has taken up the role of documenting our examples, this is something we've purposefully held back on doing, hoping the community would take up this role - Thank you Dr Starke."



my pleasure, Mark!

Is it "Engineering" or not? a debate...

A good writeup (by Eric Wise) why building software is not "engineering". Especially interesting: The comment by (famous) Steve McConell, who speaks strictly in favor of "YES, it's engineering".

I personally think it immature engineering - we're just learing how to "engineer" software... and in this learing process we sometimes simply build it.