ponedeljek, 10. december 2007

Insert Unicode

If you need Insert Unicode module you can get it here. I didn't develop this module, I only compiled it to work on NetBeans 6.0. The original author is Jesse Glick.

petek, 7. december 2007

FoodTube

If you'd like to learn how to cook, go to FoodTube

ponedeljek, 3. december 2007

NetBeans 6.0 Released !

A good day it is. Long awaited NetBeans 6.0 is released !!! Rejoice :))

petek, 30. november 2007

Depp Copy of Objects

Ever wanted to do a clone of a Vector for example. You could use the clone() method on all objects that are in the Vector, but there are better solutions:
- Exploit Serialization To Perform Deep Copy
- Faster Deep Copies of Java Objects
- Low-Memory Deep Copy Technique for Java Objects

Whatever approach suits you best is the one for you. :)

četrtek, 8. november 2007

Migrating Class libraries between NetBeans versions

There is a nice entry in NetBeans Wiki on how to migrate class libraries between different IDE versions, so you don't have to manually enter them.

Cooler T60

After a week of using Ubuntu 7.10 I've noticed that my T60 is much cooler that it was running Ubuntu 7.04. I'm running BOINC all day long and the temperature of the CPU is 10˚C lower than on Ubuntu 7.04.

petek, 2. november 2007

Ubuntu 7.10

I've upgraded my T60 to Ubuntu 7.10. the main thing I noticed is that now hibernate/resume works as it should. Ubuntu 7.04 had a nasty bug when sound did not work anymore after resume. This has been fixed now.
And since I have an ATI x1400 card inside I also wanted to test the latest ATI drivers that support composite so compiz-fusion can work. But the drivers have a bug which prevents a notebook to go to hibernate mode. So now, until ATI releases new driver's, I'll not be using compiz-fusion since hibernate is more important to me. And for me these compiz gets in a way after a while, but it has some very nice graphics effects.

sobota, 29. september 2007

Description of DB2 sqlcodes

Did you ever need a description of a sqlcode in a programming language like Java? Did you ever wanted to know if an sqlcode is an error or a warning?
You can use SYSPROC.SQLERRM function for that:
VALUES(SYSPROC.SQLERRM('SQL0911N', '', '', 'en_US', 0))

There is a sqlcode: in the description and id this is negative then you have an error, otherwise a warning. I consider sqlcodes that don't have sqlcode: in the description as not important. :)

nedelja, 23. september 2007

Tetris

In my early days I played a lot of Tetris. On my 486 with a Turbo button :)) I even got so may points that the score counter flipped over, but I was never as good as this guy. :))
He truly is a Tetris Master.

sobota, 15. september 2007

Newline

Yesterday one of my coworkers said something that I'm laughing even today over it.
He was trying to open a CSV file with Excel, but he got some strange results. Then he noticed that a description column had newline characters in, so Excel made more lines as it should.
So he said: "Why don't they put newline in one line." :)))

nedelja, 2. september 2007

Easter Egg in Google Earth

Remember a while back when I blogged about Easter Eggs ?
There is a great one in the newest Google Earth. Download it and press CTRL-ALT-A. you'll see a flight simulator and here are the controls you can use.
Have a lot of fun. :)
What are the best Easter Eggs you've found in software?

sreda, 22. avgust 2007

How to get modem in T60 working?

Steps:
- install driver using program provided at:
http://www.linuxant.com/drivers/hsf/downloads-installer.php
or look at section "Identifying your modem"
- run "sudo sh cnxtinstall.run"
- follow instructions
- reboot
- run "sudo hsfconfig --country" to set the country
- run "sudo hsfconfig --license" to set the license. Choose FREE here.

When I start minicom, the program can initialize the modem. I have to admit I did not try if the modem really works.

torek, 21. avgust 2007

DB2 and string functions

If you have ever worked with DB2 and Unicode database, you must have stumbled across this problem:
If you are using characters that are not in ascii table, but nation specific ones, like đšžćč in my case, then function like LENGTH, SUBSTR, ... are not working right. Especially with JCC DB2 driver.
Example:
ResultSet rs = stmt.executeQuery("SELECT SUBSTR(NAME, 1, 10) AS NAME FROM TABLE1")
and then the tenth character is one of đšžćč(for example) then calling
rs.getstring("NAME") will give you an Exception.
There are three solutions:
- use APP/NET driver, so you at least don't get the exception
- do a substring in Java code
- use VARGRAPHIC like SELECT SUBSTR(VARGRAPHIC(NAME), 1, 10) AS NAME FROM TABLE1

At least I hope DB2 developers will fix this soon. Sometimes it really gets on my nerves.

četrtek, 9. avgust 2007

Specs

On Monday I got back from my R&R and started doing some work with a device that is connected to RS-232. I was following the specs for the protocol that it supports. But the device returned something that was not in the specs. Strange. Luckily I had a contact person at the company that provided the device. We figured out that the software on the device is not the right one, the one that supports the specs I got. Then we updated the software. And did it the second time, since the first was not the right version. The device still didn't function as written in the specs. Then we figured out that is was not set up correctly. Now after couple of days I have a working device as per spec. So the company says. :)
Then I found out that the specs are not right. They say something and the device says something else. Now who to believe? After three days I'm still not 100% sure if the spec and the device are on the same level.
Don't you just hate when this happens? And then your manager asks you why it took so long to send two lousy packets to the device. They are both 60 bytes long! Arrrgggg

petek, 3. avgust 2007

R&R

Last 14 days I've been on R&R. :))
The first of there magnitude this year. I really needed it. I've been involved in couple of large project this year (introduction of Euro currency in my country, introduction of Selfcheckout tills, ....).
During my R&R I've kinda started some work on Neural networks. We'll some where it takes us.

četrtek, 19. julij 2007

JSP form and UTF-8

Today I was trying to help one of my coworkers who had a problem accessing a value on a JSP page and storing it into a database. Of course he was using UFT-8 characters, so they ended up in database all wrong.
A solution is very simple :))))
Just add
request.setCharacterEncoding("UTF-8");

before you access any parameter in the request object.
I got the solution from a blog.

četrtek, 5. julij 2007

T-2 and IPTV and Ubuntu

If anyone has T-2 IPTV and wants to watch it on their computer then follow these steps:
- connect a cable from VOOD TV port to your computer
- have vlc installed and ready
- add a route like:
ip route add 224.0.0.0/4 via YOUR_CURRENT_IP

- get a playlist of all programs
- start vlc, load that playlist and enjoy

6516858 fixed

A bug that I reported about 6 months ago for Java is now fixed and in Java 6u2 and Java 5u12. This is my first reported and fixed bug for Java. :)

sreda, 4. julij 2007

Update on sound on T60

In my last blog I mentioned that sound sometimes is working and sometimes is not. Now I know when it is and then it isn't.
If I put my T60 into hibernation then on next boot sound is not working. If I shut down my T60 and boot it sound is working. Oh well.. :))

My own notebook

Yuppiii! Last week I got my own notebook, a ThinkPad T60:
- Intel Core 2 Duo 2.16 GHz
- 2 Gb RAM
- 120 Gb HDD
- Atheros wireless card
- ATI Technologies Inc Radeon Mobility X1400
- 15.4" display with 1680x1050

Of course it came with Windows XP, but I soon deleted it from the machine. :))) I put Ubuntu 7.04 on following this and this tutorials.
You have to use text installer to install Ubuntu 7.04, because ATIs card is not supported in this stage. After installing Ubuntu I had to follow this thread.
I had a lot of problems with the Atheros wireless card, since it was not recognized by the system, so I had to go and download the latest drivers from MadWifi homepage and do a simple make, make install. Of course every time I upgrade kernel-modules I have to do this again. Now wireless works like a charm. :))
The second problem was my sound card. It is an Intel AD1981. At first it didn't work, meaning that when I tried to play something I got a lot of Device not opened type of errors. Then I read something about this in Ubuntu forum and this thread. It seems that you have to have modem enabled in your BIOS. Doing this I still couldn't hear sound, so I followed this part of UbuntuGuide. I still kinda have a feeling that sound sometimes works and sometimes does not, like it would have a mind of it's own. :))) The main thing is that I know it does work. :)) For the most part. :))
OSD (On Screen Display) for sound and brightness (Fn + Home, Fn + End) were working from the ground up.
Of course I wanted to try beryl on T60. I have done everything that is described in these steps, but display was are mixed up. You couldn't see anything. For now I'm going to stick to GNOME and maybe later try another approach.
What is still not working is my modem. I'll have to look into this problem a bit more.

Bottom line I'm now working with a T60 for a week now and I love it. :)))
I'll keep you informed.

petek, 22. junij 2007

Glassfish on Windows and "space hell"

If you want to run Glassfish as a service on Windows than you have to use sc.exe and appservService.exe.
At first I tried this (D:\Apps\glassfish is my GLASSFISH_INSTALL directory):

D:\Apps\glassfish\lib>sc.exe create domain1 binPath="d:\Apps\glassfish\lib\appservService.exe
\"d:\Apps\glassfish\bin\asadmin.batstart-domaindomain1\"
\"d:\Apps\glassfish\bin\asadmin.bat stop-domain domain1\"" start= auto DisplayName= "SunJavaSystemAppServer DOMAIN1"

and it didn't work. Why? Look at the command that does work:

D:\Apps\glassfish\lib>sc.exe create domain1 binPath= "d:\Apps\glassfish\lib\appservService.exe
\"d:\Apps\glassfish\bin\asadmin.batstart-domaindomain1\"
\"d:\Apps\glassfish\bin\asadmin.bat stop-domain domain1\"" start= auto DisplayName= "SunJavaSystemAppServer DOMAIN1"

See the difference? No... Well, there is a space after binPath= operation. This is not the first or the second or the third, ... time I had to deal with this. And I HAVE IT ENOUGH!!!

nedelja, 10. junij 2007

Funny game

It's been a while since I played a game, but then I came accross this one.
It is very funny one to play. First time I saw it I laught for an hour. :)))

četrtek, 24. maj 2007

četrtek, 17. maj 2007

Ubuntu and PPTP

Today I had to connect to a VPN server using PPTP.
Since this is a Microsoft protocol, my coworkers thought it won't work. So naturally I had to prove them wrong. Google to the rescue. :)))
If you have the same problem, just follow this link. I managed to get it to work using "configuring a tunnel by hand" part of the manual.

ponedeljek, 14. maj 2007

I'm sooo sleeepyyy

Yesterday we went and prepared a big shop (17 POS systems) to be opened this morning. I'm still in work and haven't had any sleep for more that 24 hours .... The day before only 5 hours. I'm about to break down. My mind is not doing exactly what I want it to. :))) Ever felt like that ? Ever went without a sleep for three or four days... :)) Unforgettable experience.

petek, 11. maj 2007

Additional IP on Ubuntu 7.04

I've been using Ubuntu (6.10 and now 7.04) for couple of months now and I love it.
In my company there are a lot of computers with different IPs and netmasks and I need to access them. I haven't found a way how to do it with a GUI, since a lot of things can be done via GUI in Ubuntu.
So, for you who are interested in the solution, here it is:

sudo vi /etc/network/interfaces

and edit the file to get something like:

auto eth0 eth0:1 eth0:2
iface eth0 inet static
address 192.168.0.2
netmask 255.255.255.0
gateway 192.168.0.1

iface eth0:1 inet static
address 10.10.33.10
netmask 255.255.255.0

iface eth0:2 inet static
address 10.10.50.10
netmask 255.255.255.0


Now I have three IPs (192.168.0.2, 10.10.33.10 and 10.10.50.10).

sreda, 9. maj 2007

Frustration

Damn !!!
I'm struggling with one "bug" in my program. Bug is in quotes because I'm not 100% sure it is a problem in my code. Why?
I'm doing an UPDATE of a table in DB2. DB2 has locking mechanism in behind, so until this transaction is committed no one can do anything on this row/table and their program is locked. Why I'm not sure the problem is in my code? Because there is only one thread and only one place in my entire project that does anything with that particular table. It drives me crazy !!!

petek, 4. maj 2007

Vacation

I just can't believe that I've been on vacation the whole week. :))) It was good and I'd love some more. hehe...
I hear that JavaOne is around the corner and as usual I won't be attending. :((
I will be attending our local conference OTS 2007. In fact my article was accepted. :)) A coworker will be on the stage with a big stage fright. :))))
I was planning to get my IPTV hooked up to my compuiter during this vacation, but didn't manage to. Ah, pitty... Maybe on my next vacation in couple of months. hehe...

petek, 6. april 2007

Easter

Easter is coming. Families will get together, talk, have fun and great food. :))) I like great food. :)
And I like easter eggs. This ones too.
And the best of all, i get to stay at home for three days. Yuupiii!

četrtek, 5. april 2007

Digital books

I just read an article in a local computer magazine about why digital books, magazines, ... don't do well. As an example the author showed a case with Steven King when he tried to publish one of his books only in digital form and failed. He concludes that the problem is that each customer can get a digital form of the magazine easy and even not pay for it and he puts his hopes in an efficient methods to secure digital copyrighted work. Hmm... why do I smell DRM here ? I think that now more and more music record labels recognize that DRM is evil. :))
My opinion is that there are NO devices that would have properties of regular paper. I refuse to look at PDFs(for example) on LCDs or some other semi-appropriate device for reading them. I'd like to have a light device, that is nondestructable and easy to handle, like paper is. :)))
Maybe technologies like E-Ink, Digital ink and others will bring the ease of use.

sreda, 14. marec 2007

New server

At my job, we are planning in developing a new version of our server application. More can be read at Javalobby. What I'd like to see in our new server:
- multiprotocol support: support for RMI, JMS, socket so the client can for example initiate a communication via RMI and server sends a reply via JMS. Server can also initiate a connection with a client.
- scalability: server would have to support hundreds, maybe even thousands of concurrent users
- support for file, ftp, mail monitors: sometime we have to import some data from a file that resides on ftp, mail, .... Now we are doing this by hand. I'd like a component that would monitor those things and notify me, maybe even call appropriate method based on where the file came from and it's name.
- transaction support on Object level: this is more a wish than a requirement. We can still use database transactions
- AOP support: this is also a wish, but in this way I'd only have to write my log statements once, maybe I could use it also for transaction support via database transactions.

I like Mule and ServiceMix. The problem is that I don't know how they will behave in real world, mission-critical application. What do you suggest?

torek, 13. marec 2007

NoMachine NX

Usually I use VNC to access my machine. But VNC is slow and it even doesn't transfer characters like {} and such. Maybe it's an issue with Ubuntu's VINO VNC server. I don't know. The fact is that VNC is slow.
Today I discovered that NoMachine provides free NXServer. It only supports 2 simultaneous connections, but it is enough since I'm the only one that accesses my computer remotely. The installation is easy (at least on Ubuntu 6.10):

sudo apt-get install openssh-server
sudo apt-get install libstdc++2.10-glibc2.2
sudo dpkg -i nxclient_2.1.0-17_i386.deb
sudo dpkg -i nxnode_2.1.0-15_i386.deb
sudo dpkg -i nxserver_2.1.0-18_i386.deb

I got nxclient_2.1.0-17_i386.deb, nxnode_2.1.0-15_i386.deb and nxserver_2.1.0-18_i386.deb
from NoMachine.
And that's it. Then you run nclient from a remote machine. :)))

četrtek, 8. marec 2007

New LCD monitor

I decided to buy a new LCD monitor. Today I'm using an old CRT Samsung 19" SyncMaster. It is a good monitor, but it does show it's age.
I'm a programmer so I need a good picture quality and a resolution at least 1280x1024. I'm thinking about an Samsung 971P. What do you think?

sreda, 28. februar 2007

NetBeans Book

I can wait to get my hands on this book . :)))
It should clear up a lot of things regarding developing modules for NetBeans and also using NetBeans Platform.

torek, 27. februar 2007

Linux editor's macro support

At work I'm working a lot with text files (data that is comma delimited, ...) and usually I have to change something in the files, like adding comma at the end of every line, ... So I need an editor with macro support. Well, with macros that can be recorded.
My favourite text editor is vi, but I didn't find that functionality in it. You can write a map command for it, but it is time consuming and not exactly what I want.
Since I'm using GNOME I've tried gedit and no macro support there too. :((
Then I tried Emacs. You can record key strokes, but you cannot link them to a keyboars shourtcut. At least I don't know how. :)))
Since I program in Java a lot I thought maybe some Java editor will help me. I've tried NetBeans (my main development environmet) and Jedit, but they don't feel like text editor to me. :))
Then I though: "Google is your friend." and it was. :))) I've found nedit editor. There you can record a macro and link it to a keyboard shourtcut. I has an ugly GUI, but it does the job fast. I'm happy with it. For now at least. :)))
Are any other editors that know macorded macros out there?

četrtek, 15. februar 2007

SelfCheckout progress

My last post is old :))) 
This is because the work I've been doing. I had to do some catch up on the work I didn't do because of the "secret project"  :))).
Now I also have to so some work on the communication between our application and the government customs application. It appears that our government is pushing XML into their processes. Interesting... The problem is that the specifications they gave out on how the XML document should look like is not exactly the same as their system want to receive it. The second problem is that when you send an XMl document you don't always get an answer back what was wrong with it. Oh, well... In couple of weeks everything should be OK. :))

petek, 2. februar 2007

Secret project revealed :))

Some of you may remember me mentioning a "secret" I was working on.
Now this "secret" project was just revealed on the 31st of January 2007.
It's a SelfCheckout terminal at one of our biggest retailer!!! Woohooo!! :)) It's also the first in this part of the Europe and the first commercial installation of the new version of IBM's SelfCheckout in the world (at least I was told so :))) .
Here are some news, but sadly only in Slovenian language:
- Siol
- Finance
- Planet.si
- Dnevnik

sreda, 24. januar 2007

First snow and my first Java bug

Today has started good. :)))
During the night we had our first snow, well only a couple of snowflakes, but nevertheless. :)))
When I came to work I found this in my Inbox:
We have determined that this report is a new bug and entered the bug into our internal bug tracking system under Bug Id: 6516858.

You can monitor this bug on the Java Bug Database at
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6516858


Woohoo... My first Java but was accepted!!!! It is not yet visible to the external world, since it takes a day or two to propagate through the infrastructure, I guess. :)))

torek, 23. januar 2007

New Java update soon ?

Now you all know that Slovenia's currency is Euro. The problem is that this change is still not propagated into Java. Why? There is a bug reported, but is it closed as NOT A BUG. :))) It says that they will fix the problem as soon as ISO 4217 announced the change. I guess they still didn't do that. Why do standard bodies have to be so slow? It's a simple change!

nedelja, 21. januar 2007

Experiences with €

Slovenia is using € for 21 days now. The prices have gone up a bit (some even for 100,% 200 % :(( ) , my wallet is full of coins and I still don't have a right sence of the value of the currency. I'm sure with time I'll get the feeling. For example before you had to pay for a car couple of millions, but now "only" couple of tens of thousends, so it's a bit different.
The "secret" project I blogged about couple of weeks ago is comming to an end and more will be revealed by the end of the month. Stay tuned ! :))

ponedeljek, 1. januar 2007

Happy New Year 2007

I whish to you all a happy new year 2007, full of health, happiness and love. To my countryman I also wish welcome to euro-zone and may you see a lot of big euro notes. :))