petek, 24. november 2006

DB2 IMPORT

It's been a long time since my last post. It has been a wild roller coaster at my job, as someone said.
During this time I also discovered something about DB2 IMPORT command. It doesn't work as the docs say. What does this mean? Sometimes you get "SQL0100W No row was found for FETCH, UPDATE or DELETE; or the result of a query is an empty table. SQLSTATE=02000" and the row is rejected.
Hmmm. How can this be since the docs say that UPDATE should be performed via primary key? So if there were no rows to UPDATE, why does IMPORT not perform an INSERT?
What I found out is that on my target table there was a UNIQUE key defined and removing the UNIQUE key solved the problem.
Does this mean there is a bug ? In the IMPORT command itself or in the docs ? Maybe this is right for a PMR.

ponedeljek, 6. november 2006

Cold

Oh well.. I guess it's just that time in the year. I think I've got cold, termperature and my throat is a bit sore.
I'll have to start drinking tea with honey and lemon. And more vitamins too. :))
I just hope I don't get too sick.

petek, 3. november 2006

DB2: Fast Delete Large Tables

Have you ever wanted to delete a table with millions of rows? Using
DELETE FROM TABLE1 SQL statement? Then you know this is very, very slow and it fills transaction logs. The fastest delete methond I've ever seen goes little like this:
1.) First you export 0 rows from the table:
EXPORT TO TABLE_NAME.IXF OF IXF SELECT * FROM TABLE_NAME WHERE 1 = 2
2.) Then you do a LOAD with REPLACE:
LOAD FROM TABLE_NAME.IXF OF IXF REPLACE INTO TABLE_NAME

I've been able to delete rows from tables with tens of millions of rows in a second.
I hope this little tip is usefull for a lot of DBA's out there.

ponedeljek, 30. oktober 2006

New NetBeans modules

I'm sorry I didn't post any updated/new modules for NetBeans. The thing is that I'm busy at work and I don't have much free time. I promise I will update every module that can be found on my homepage to version 5.5. I also have some idea for new modules and I hope to get them done till 2007 :)))

NetBeans 5.5 released

Woohoo!!!
Together with a new netbeans.org page design, version 5.5 was released. It IS a great improvement over 5.0 since it supports Java EE5.
But myself will be more eager to use version 6.0 as it will contain many new improvements for the editor itself. Can't wait! :)) I've tried them with a build from the trunk and the editor is much better compared to now. Code completion is more context aware and a lot faster. I still have to test it with a large projects that I'm working on, but the infrastructure itself promises a lot. :))

ponedeljek, 23. oktober 2006

HDTV channels

Woopie!! :)
Yesterday my ISP company T-2 (provides Internet and IPTV for me) just started to broadcast 8 HDTV channels. They are the first ones to do it in my country. I know they are the first who do it over IPTV and I also didn't hear that there are any HDTV channels on cable, so they are probably the first all together. But if I'm wrong, I'm sorry. :)

Now I just have to get a good HDTV television. :)) Any recommendations ?

nedelja, 22. oktober 2006

Internet on flight

Last 14 days I've been in North Carolina working at the Triangle Research Park with IBM on a project, so I didn't have much time to post something interesting. Now this one is of some interest. At least to me. What happened? as I write this we are flying somewhere over Atlantic ocean. Isn't it great to use Internet on the plane, when you have sme time to do some work. :)))
And the best thing about it is that it is FREE. Well, at least on this flight. I home the companies will figure it out to offer free access on the flights. :)))
Best regards from 10000 m over sea. :))

EDIT: The provider of the FREE Internet was Lufthansa

nedelja, 15. oktober 2006

NC State Fair

I've (and some of my co-workers) have been in North Carolina for a week now. Since we have the weekend off, yesterday we made a trip to Wilmington, then to a battle ship from the WWII that is near by. At the end we went to a beach at the Atlantic Ocean and finally had a dinner at the nearby hotel.
I can say that the water in Atlantic Ocean is not at all salty. Our Adriatic see is more salty. :)
Well, today we are going to the NC State Fair. I've looked at the program for today and the best thing I can see there is the Tractor Pull. I'm not soo keen to pay 6$ for enty fee to go and see cattle, pigs, chicken, ... I can imagine for a typical American child that is living in a city this is interesting, but for me it is not, since we had those animals at home. Well, we still do. :)))
We'll see....

petek, 29. september 2006

DB2 Cultural Correct Collation

I think that we all know that DB2 does not support cultural correct collations in it's databases, even if they are created as a UTF-8 database.
I've been pointed to one article that does solve the issue (at least until DB2 implements this in it's engine).

DB2 "Virtual" tables

In DB2 you sometimes need a virtual table. I call table a virtual if you don't know in advance what the structure of it will be and you don't need the virtual table to be persistent.
Let's say that you have a table on you GUI form that has three columns (C1, C2, C3) and the data there are: (1, 2, 3) (4, 5, 6) (7, 8, 9) and you would like to do some SELECT statements over this table:
SELECT * FROM TABLE(VALUES((1, 2, 3), (4, 5, 6), (7, 8, 9))) T(C1, C2, C3)
With T(C1, C2, C3) you say that table T has columns named C1, C2 and C3. This table T acts like any other ordinary table. You can so SUMs, GROUP BYs, .... on it.

I've heard this is DB2 v2 stuff, but I still find it powerful. :)))

petek, 22. september 2006

Mandriva 2007.0 RC2

Yesterday I've tried Mandriva 2007.0 RC2. All I have to say is WOW. :)))
Especially for the XGL/AIXGL stuff. It's working out of the box. couple of months ago I've been trying it on various distributions (SuSe, Ubuntu, ...), but none of them was working good. Some had some painting issues and on some distributions my mouse froze after a while. i was planning on using XGL/AIXGL on my machine, but I had to give the idea up. Until now. :))) I'll see how the final release will be and then I might use it.
Maybe not on my machine at work since it has a SIS graphics card (integrated of course :(((( ) which has terrible performance. My machine at home has a nVidia 6600 GT card so everything should work on it. I llok forward to trying the final release.

petek, 15. september 2006

Strange C++ errors

If you have a code:
std::vector vec;
vec.push_bacnk(3); // push_bacnk is not a member of type vector

and you compile it you get an error:

main.cc: In function ‘int main(int, char**)’:
main.cc:311: error: ‘class std::vector, std::allocator >, std::allocator, std::allocator > > >’ has no member named ‘push_bacnk'


I have to say that this one was easy to track down. :)
What's all about std::shar_trails, std::basic_string, .... ?!?

Power of Java

I've been involved with C++ for about two weeks now and I'm beginning to understand the power of Java that I've always taken for granted. :)
Java and C++ are much the same except that Java's power lies in it's libraries and it's GUI. In Java there is java.util.* that has a lot of helper classes (like Properties for example) that I couldn't find in C++ so I had to write it myself. Another thing is the GUI. If I program in Java there is no question about what GUI I'll be using. Swing it is! There is no such thing in C++. There are tons of different GUIs there. Some are cross-platform and some are not.
I also have to say that I like C++ generics (called templates) more that ones found in Java. Maybe it's just me. :)) there is a lot of strange systax involved in this, but C++ generics are a lot more powerfull.

sobota, 9. september 2006

Learning C++

I've been learning C++ for last couple of days. I must say I briefly met with C++ during my university years (1995 - 2001), but I've always considered myself more of a Java programmer. In fact I've been doing 100% Java for the last 5 years developing server applications.
My newly aquired hobby in genetic algorithms will probably require me to program them in C++. I've tried Java, but I have to make it faster.
Of course I wanted to see how fast parts of the code are in Java and in C++. If you want to see that in Java you just write:
long beginTime = System.currentTimeMillis();
..... code you want to measure
long endTime = System.currentTimeMillis();
System.out.println("Code took " + (endTime - beginTime) + " ms to execute");

this way you get fairly good feeling what parts of your code are slow. Of course you could use Profilers, but usually I don't.
Well.. I tried the same thing in C++. Guess what. You cannot do that. There is no elegant way to do that. You cannot get time in milliseconds/nanoseconds in C++. You have to use a hack (IMHO).
there is a function clock() that returns how many CPU ticks have elapsed. Then your code looks something like:
int startTime = clock() / CLOCKS_PER_SEC;
..... code you want to measure
int endTime = (clock() / CLOCKS_PER_SEC) - startTime;
Ugly if you ask me!!!

If anyome has a better solution, please come forward. :)

petek, 1. september 2006

Jet Lag

Since the day I came back from the US, I feel sleepy and others say I look tired. Wonder why? I think it is the jet lag. But I thought it wears offf after couple of days. I never had a jet lag this powerfull. Hmm...
Finally I installed DB2 V9.1 and it got a feture we'll need a lot, because Slovenia will change it's currency on the 1st of January 2007. We'll have Euros. So no more exchanging Slovenian Tolars when I go to Germany, Austria, .... Woohoo!! It's kinda sad to see the Tolar go (especially because we waited for a long long time to get our own state and currency), but I like the fact I'll have Euros in my pocket. :)
Now. back to DB2. In the latest version you can do something like this:
ALTER TABLE TABLE1 ALTER COLUMN PRICE SET DATA TYPE DECIMAL(18, 6)
So you can change data type on columns of the fly :))
This is what we've been waiting for for almost two years. :)) Sure one can do export, create, import, but this a lot faster and easier.

ponedeljek, 28. avgust 2006

Finally back :)

Finally I am back! :) It was very nice to see my girl again after a week. :)
We've done a lot of work in USA. Unfortunately I cannot discuss what we have been doing for now. Maybe when the official announcement will be out. Ant what I have been hearing it will be soon. And it will rock this region. :)))
I've been sleeping for 11 hours and I'm still sleepy. Maybe because my body still goes by an hour that is 5 hours behind my local one.

torek, 22. avgust 2006

Japanese restaurant

Yesterday was a good working day. We've done so much. I've also heard one of the guys that are helping us with our project that we are three days ahead of schedule.
We went to some Japanese restaurant to get dinner. They have multiple chefs that prepare your food right at the table. I've never seen or experienced it. It was great ! :)) Our chef talked like Latka. :)

nedelja, 20. avgust 2006

First day in Raleign - Durham

I'm writing this in my hotel room and the air-conditioning is turned on. Outside is very hot and humid. I hate it. :((
Of course I also had problems with my luggage, since they managed to tear my suitcase apart. Ahhhhh !!!!
I reported my damaged baggage and hope I get refunded for it. Now I have to buy myself a new suitcase. Since this is my second suitcase that got trashed on the trips to America I guess I won't spend much money on it. I hear you can get 4-5 suitcases for 30-40 USD in Target or Walmart. Next time I'll wear all my clothes. :))

torek, 15. avgust 2006

Raleigh, NC

It is confirmed. :) I'm going to Raleigh, NC on Saturday. Me and some of my colleagues are going to be working at IBM site there on a project I cannot discuss now (there is an NDA in place).
This is not the first trip to the USA (in fact it is my fifth or sixth) and I hope I'll go to some game there. Weather it is basketball, football, ... I don't care. I just want to see what the fuss is all about. :)

četrtek, 10. avgust 2006

Ubuntu 6.06

I'm using Ubuntu 6.06 from when it was released. I've never used Ubuntu before (I was a Mandriva guy), so when I got a new machine (with my HDD from previous machine) today it didn't start into gdm. Hmm... I knew that the graphics card is not the same anymore and I couldn't find the program to set X up. So I changed the graphics driver to vesa, boot it up and searched for a solution. I only found out that X does support SIS graphics cards (this one is integrated into motherboard). So I changed the graphics driver to sis, rebooted and it dows work now. At last! :)))
I'd really like to know what programs to use, to update the system and tell it what drivers to use, ....
Any help is welcome. :)