It's a whole new world out there
How's this for a foreign concept. You're developing with a product and you find a bug. Nothing strange in that. But, instead of calling a black hole of a support line you open your chat client and see if the developer happens to be online. You see he is and tell him about the bug. Ten minutes later and you've just received a patch. Everything is working as expected. Can you tell what it is yet? Indeed, it's Puakma.
Talking of Puakma and foreign concepts I am currently switching mindsets from flat to relational data. Not all that easy for somebody who's been a Notes developer for just about the whole of their career. As I've been finding SQL is a right royal pain. Maybe developing on MySQL for a target platform of PostgreSQL isn't such a bright idea after all. Something tells me my fun has only just begun and that this book will end up with a lot of dog ears. As will this one. Note to self:
if ( ActionDocument.getItemValue( "ContactStatus" ) == "I" )
Is NOT the same as:
if ( ActionDocument.getItemValue( "ContactStatus" ).equals( "I" ) )
In writing this out I am hoping I will never again spend two hours scouring at my code convinced there can't possibly be any errors.
Jake,
henceforth, you shall be known as Puakman.
I think we should reserve that honour for Erwin who owns the first Puakma based blog {Link} in the world and a range of PMX merchandising - {Link}
Thanks Jake... I'm not worthy... ;-)
As unlikely as it may sound I got a very similar service from Microsoft.
I'd had a problem with blips in cd music, played only with media player, they used a flash version of the messenger client and were able to talk you through suggestions etc!
For MS - I thought that was very good.
Jake,
Practical Java, by Peter Haggar, formerly of IBM, is a ver good reference. It's mostly a programming guide. The book is divided into Praxis rather than chapters. I knew exactly what you meant with regards to = not equal to .equals as a result of reading this book 4 years ago.
Pete is also pretty good about answering emails.
I like the fact that equals() means whatever I want it to -- overriding is just about my favorite thing in the whole world (next to overloading, that is). Gotta watch the old polymorphism, though -- some objects are more equals() than others....
BUGGGSSS???!! Those were "undocumented features"!
Next week we'll work on:
if ( ActionDocument.getItemValue( "ContactStatus" ).equalsIgnoreCase( "i" ) )
...and getItemValue() may return a null which can get you into all sorts of trouble ;-)
I have to admit, chat is fantastic for this kind of distributed development.
Brendon.
I have a professor that says that everytime he teaches a C programmer SQL it always starts with the C programmer taking a quick look at all those simple UPPERCASE commands and saying something like, "Give me five minutes, and I'll get this all sorted out." Then thirty minutes later they are still working out the first JOIN conditions. All I know is that when I skip from DB2 to MYSQL, code of any complexity seems to fail. I love the ease of MySQL, but if your target is Postgres, and you have RedHat, I would get the rpm distribution of the Postgres system and stay with that for your work.
The other wonderful tool I have appreciated is a query writer. The one we use is Showcase (not at all open source, unfortunately). It does a lot of clean-up behind me patching up my almost correct SQL. I do a lot of SQL editing and major surgery in the vi editor, but for some tasks I love having the OLAP tool pick up after me. I wonder if there are any good open source equivalents.
All of you struggeling with such issues as the one Jake reported should get into the habit of writing the constant on the left instead of on the right.
An example should clarify what I mean. To test whether an item is empty write:
if (null == doc.getItemValueString("Form") {
...
}
instead of:
if (doc.getItemValueString("Form") == null) {
...
}
There doesn't seem to be much to this other than it looks wierd... :-) The purpose of wrinting it like this is twofold:
1. If you by mistake do an assignment (=) instead of a test for equality (==) it will be caught by the COMPILER since you cannot assign a constant to to variable.
2. I find that once you get into habits like this the frequency doing the String-equality-test-error is reduced (some_string == "abc123").
Thats my two cents...
lekkim
Jake == Puakapimp...
;-?
if (!LastPoster.getRealName().equals("me"))
{
goto(hell);
}
Humm.... Jake, In Java normally the sintax is with the first letter in lowercase, so you are throwing and exception at line 1.
Your second error is the "hell" variable since is not defined, and the Javadoc for that program says that the syntax for the error method is:
public void goto(String place){
//Your code goes here
}
Replace with:
if(!lastPoster.getRealName().equals("me"))
{
String hell = new String("Hell");
goto(hell);
}
Just my two cents, as you can see my java is weak :-S
.::AleX::.
Dominocode.Net
No no no! Goto? GOTO?!?!??!
I guess instead of
goto(hell);
this would be better in terms of java:
if(!lastPoster.getRealName().equals("me"))
{
lastPoster.moveToLocation(Hell);
}
I'd have checked the object with getStuffed() first....
Jake,
Since you're using Eclipse, maybe this plugin {Link} could come in handy. It supports both MySQL and PostgreSQL.
Henk.
Thanks Henk. That looks like a must-have to me. Trouble is I can't get it to run with Eclipse 3. Do you know if it's supported??
I'm sorry Jake, I don't know. I'm using Eclipse 2.1.1 myself, as probably should you, because Eclipse 3 hasn't reached alpha yet.
It wouldn't surprise me a bit if many plugins don't work with Eclipse 3. And it's a shame missing out on 369 available plugins
{Link}
I asume you used the update manager to install the Clay plugin and installed GEF first?
Anyway it works perfectly with Eclipse 2.1.1
Good luck,
Henk
if ( ActionDocument.getItemValue( "ContactStatus" ) == "I" )
Is NOT the same as:
if ( ActionDocument.getItemValue( "ContactStatus" ).equals( "I" ) )
Well it oughta be! That's why God invented operator overloading.
And why isn't HTML allowed? I wanna underline and <blink>