Posted by hatim
Sat, 09 Aug 2008 22:13:00 GMT
In my Summer of code project I have to use already established DAOs (well some times adding a few tid bids) and using them to replace JDBC code. Testing DAOs with Hibernate tools made it alot easy to play with both HQL and criteria, but I was stuck when it came to injection. It seems that OpenNMS uses lots of technologies like JMX which I have never even touched before
attached is a log of a conversation which I had with a devel on #opennms. Based on this conversation I some how was able to bug the devel into writing all of this into a wiki page.
There was one small confusion though, I was working with Poller which was infact Pollerd, there being a naming inconsistency. Following this wiki page I should be now able to easily inject Dao's to my required daeomons and other classes.
Posted in Technology | Tags coding, soc | no comments | no trackbacks
Posted by hatim
Fri, 01 Aug 2008 21:43:00 GMT
My summer of code midterm review was done and I am some what content with it. Although I have not been able to achieve much tangibally but I have covered some ground. My project involves some very interesting things most of which I had not touched before in my previous encouter with Spring/Hibernate. For now I am focused on finishing the task.
I am behind schedule so I am thinking of following tweaks to schedule. As you probably already know that I would be moving to Sweden soon, I will be going to another city and get some shopping done so I wont be working on 22nd - 25th. so skipping these days and just barely meeting the review deadline of 1st Sep 2008 I have a good 25 days left with me. I will be finalizing some stuff in the last days of August which I admit would be tricky as I would be in a totally different place.
Posted in Technology | Tags programming, soc | no comments | no trackbacks
Posted by hatim
Tue, 01 Jul 2008 17:39:00 GMT
For past few days I have been working on OpenNMS poller tests. I have to adapt the curretn tests so that they can better utilize the Hibernate upgradation i am taked for do for my SoC project. A quick grep led me to find the following java files in my svn branch.
Under trunk/opennms-services/
src/test/java/org/opennms/netmgt/config/PollerConfigFactoryTest.java
src/test/java/org/opennms/netmgt/config/PollerConfigManagerTest.java
src/test/java/org/opennms/netmgt/mock/MockPollerConfigTest.java
src/test/java/org/opennms/netmgt/poller/PollerTest.java
src/test/java/org/opennms/netmgt/poller/remote/PollerBackEndIntegrationTest.java
src/test/java/org/opennms/netmgt/poller/remote/PollerBackEndTest.java
src/test/java/org/opennms/netmgt/poller/remote/PollerFrontEndIntegrationTest.java
src/test/java/org/opennms/netmgt/poller/remote/PollerFrontEndTest.java
Under trunk/opennms-webapp/
src/test/java/org/opennms/web/services/PollerServiceTest.java
I have skipped remote poller tests for now. I have started with PollerTest as it seems to be the most obvious. As per suggestions of OpenNMS community I am extending this Test class from AbstractTransactionalDaoTestCase. But since AbstractTransactionalDataSourceSpringContextTests comes in its parent hierarchy, which sets setUp and tearDown as final. This means that eiteher a new way of setUp and tearDown have to be figured out, or spring context has to be provided from with in the indivisual tests. I think the second way means much of boilerplate code in different unrelated places and hence duplication.
I am still updating the code, more to come on this blog entry.
Posted in Technology | Tags coding, opennms, soc | no comments | no trackbacks
Posted by hatim
Sat, 28 Jun 2008 17:43:00 GMT
I was in need of checking my HQL queries from within Eclipse so I could check for their validity. Furthermore since it was for a Spring/Hibernate based project (namely OpenNMS for my Google Summer of code) so there was no hibernate.cfg.xml to begin with (OpenNMS has loads of other configurations in which it stores what it needs to do with hibernate and databases). So the solution was simple, to make a brand new hibernate.cfg.xml for own use (this file wont be committed, but i think a provision of such thing should be there so there is easy way for new comers to startup hibernate tools)
I have been reading up alot for my Summer of Code, I have completely read Harnessing Hibernate and am currently taking reference from Beginning Hibernate and from Java Persistence with Hibernate. These are all excellent books. Harnessing hibernate was helpful in the setup of hibernate tools in Eclipse.
Following are some screenshots of hibernate tools on my system.

Hibernate tools tab completion.

Hibernate tools executing HQL query on OpenNMS model
Posted in Technology | Tags coding, opennms, soc | no comments | no trackbacks
Posted by hatim
Fri, 27 Jun 2008 08:18:00 GMT
I have to confess that I have never owned a DSL connection. It was always a Fiber optic connection or a shared T1 line at the workplace/university. With the ongoing price wars for DSL connections I decided to get a connection for my self at home (actualy it was for my sister). The connection was ordered in April 2008 and then there was a long wait. Every time I would call to them they would make up some excuse. In the end around June 15th I decided to lynch the call center guys. In limits of decency I lynched him on the phone, and the next thing you know that with in 24 hours the installation of modem was done. It was running fine for one week, when it suddenly it stopped working.
On inquiring from the people in Tech support I was told that this connection was not installed to begin with. I admit that there were probably few loose ends to tie, for example when ever there was an incoming or outgoing phone call the DSL connection would drop. And even though the connection was dropped if the DSL device was on, there would be noise. I had to literally beg the equipment installation guy to make my connection work as I had lots of work to catch up to, he gave me some one elses ID (how typical of Pakistan, solve a problem by breaking rules).
Then I lodged a complains a few times with PTCL(the telephone company) to clear the noise and they always give me a token number (like its a big prize). In short getting a DSL connection in Pakistan is not easy even though as compared to previous years prices have come down considerably. With no electricity or sane internet I wonder why people think Pakistan is an ideal place for outsourcing.
Posted in Technology | Tags Internet, review | 1 comment | no trackbacks
Posted by hatim
Fri, 06 Jun 2008 19:28:00 GMT
My telephone line at home was out of order for about 3 weeks now and I was in need of an internet connection at home. I decided to give using internet through my cell phone (GPRS) a try. The reason for this was simple, I needed an internet connection which would make me truly mobile and was cost effective as well. And ofcourse an implied requirement was that it should work with Linux(easily). So I searched up the internet for tarrifss of local cellular companies and compared them with other options which I had. I decided to go with Zong's (a China Mobile comapny) unlimited GPRS package. I was skeptical about the internet speed and was not even sure how I would be ablt to connect my laptop with the internet as it was only recently that I had begun using internet through my Mobile.
First I got hold of a Sony Erricson data cable as I had lost the one which came with my phone. This cost me 200Rs (3 US$), then I purchased some Zong credit for testing. Then using another internet connection I searched on how to use ubuntu with GPRS enabled phones. I found an article at softpedia to be very helpful. I found through dmesg that on my system, my phone was registering itself at ttyACM0 as well
[528.702039] usb 4-1: new full speed USB device using uhci_hcd and address 3
[528.873965] usb 4-1: configuration #1 chosen from 1 choice
[528.987405] cdc_acm 4-1:1.1: ttyACM0: USB ACM device
[528.989688] cdc_acm 4-1:1.3: ttyACM1: USB ACM device
[528.991639] usbcore: registered new interface driver cdc_acm
Then I installed gnome-ppp and used it as per described in the article. The APN for Zong is zonginternet and apprently there is no username and password, but I still used zon/zong so that gnome-ppp could dial out. I also had to ensure that my user was in the modem/dial_out group. I tested the internet connectivity and was delighted to see that after dailing in there was nothing else to be done. Later I called up Zong customer services after feeding in some extra credit of 550 Rs (roughly 8US$) and activated my monthly unlimited internet package.
Later I tried watching a Youtube video, the bandwidth was not enough for me to stream it live but I was able to download a 9 MB file in a relatively short time compared to dialup connection. I was able to go to a download speed of 15KB/sec which I think is more than enough for day to day browsing and coding related tasks. I am looking forward to using this connection for my summer of code activities.
Posted in Technology | Tags gprs, Internet, linux, ubuntu | 1 comment | no trackbacks
Posted by hatim
Wed, 28 May 2008 12:36:00 GMT
I have always wanted to try out skype. I had an idea about it's excellent voice quality from guys a Twit, but today I witnessed it first hand. The thing which was holding me up was the unavailibility of Mic (input sound) on my laptop. Today I figured out what the problem is. On my Acer 7720-6604 I have an internal mic, for some reason it does not work, but an external mic does. I for some reason was thinking that no mic works what so ever. I added a line in /etc for proper module loading (I didn't have it in my fresh Hardy installation) and in options for volume control I chose Mic as input source. When recording from Gnome's sound recorder I chose Digital as input of recording. So atleast I am able to record sound now (although not with my internal mic)
Then I checked out this link for installation of Skype on my linux box. On 64 bit machines you have to fool the thing to use 32 bit libraries. I made a test call and it soudedd perfect. Then i even tried a call with webcam and it worked well too. I actually have a conference call with browzow from OpenNMS regarding my summer of code assignment, which has started since this Monday. I have not coded any thing worth committing yet and lets hope I have some small stuff cooked up by the end of this week.
Posted in Technology | Tags opennms, skype, soc, ubuntu | no comments | no trackbacks
Posted by hatim
Wed, 21 May 2008 07:02:00 GMT
Well its no longer a surprise that Google sends out goodies to its Summer of code students before the start of Summer of Code, but it is still a surprise that which title would they be sending. I recieved (with apologies to those who still want this surprise to be secret) Beutiful Code by Andy Oram & Greg Wilson. I had this book in e-format previously, but i would probably never have read it. I already started reading it's Chapter 20 which is reltaed to a Java based information portal which was devloped for Mars Rover missions. This is an excellent gift for an aspiring Software engineer like me. Thank you Google :)
Posted in Technology | Tags coding, opennms, soc | no comments | no trackbacks
Posted by hatim
Tue, 20 May 2008 18:33:00 GMT
I have finally broken the taboo. I am posting this blog from my Sony Erricson W810i.
Edit: Actually the above two sentences were the only things which i was able to post from my cell phone (this I am posting from my Desktop at work). Yesterday I decided to enable WAP over my cellphone. It was much easier than the last time I had tried. My cellphone service provider is an old memoth and is loosing its customers fast to new rivals, so I guess they have made their customer services much better. Any who I only used it to reply to one messege which i got on my gmail and to post this blog micro entry above. Poisting blog from a cell phone like mine is a big hassle in my opnion, but still its better than not posting at all.
Posted in Technology | Tags Blog, mobile | no comments | no trackbacks
Posted by hatim
Fri, 16 May 2008 14:56:00 GMT
I had been reading up on the Ubuntu security breach since this Tuesday and was concerned that my system would also have been compromised. A little searching yielded a site which described the venerability in some detail and shows how to exploit it. It also has a bunch of private/public keys which were generated on a 31 core machine (some thing which only a serious computer venerability researcher would do).
I looked up into the keys and I was not able to find my public keys. Perhpas the vernerability is more than it seems (or perhaps lesser). But In any case I have changed my keys :)
Posted in Technology | Tags linux, ubuntu | no comments | no trackbacks