Sunday, May 10, 2009

stocks-suggest is now on Java 6

My general depression on the stock market had put down all my excitement on stocks-suggest. This is the application i had been writing for a while that can suggest changes (BUY or SELL) on a given portfolio based on a set of rules;besides the fact that it is one of the most interesting architecture i have ever done. Here is the report from some of my past runs.


********************************************************
Report at: Tue Jan 29 11:38:02 IST 2008
********************************************************
[Report: stockName: RENUKA.NS result: BUY buyPrice: 1003.7 change: -9.700000000000045]
[Report: stockName: JPASSOCIA.NS result: BUY buyPrice: 374.5 change: -1.1999999999999886]
********************************************************
Report at: Tue Jan 29 11:44:36 IST 2008
********************************************************
[Report: stockName: RENUKA.NS result: BUY buyPrice: 1003.7 change: -11.700000000000045]
[Report: stockName: JPASSOCIA.NS result: BUY buyPrice: 374.5 change: -4.699999999999989]
********************************************************
Report at: Sun May 10 22:35:24 EDT 2009
********************************************************
No stock decisions for the moment
********************************************************




Tonight, i got it compiled successfully on Java 6. Boy, it took a lot of commitment from me to finally start on this again. Latest source is at stocks-suggest google code repo.

Drools and JibX dependencies had to be updated to the latest to get rid of the Xerces Abstract method error after migrating from Java 1.5. Here is the output of mvn eclipse:eclipse for all dependencies.

o commons-logging:commons-logging:1.1
o log4j:log4j:1.2.12
o logkit:logkit:1.0.1
o avalon-framework:avalon-framework:4.1.3
o javax.servlet:servlet-api:2.3
o junit:junit:4.4
o org.drools:drools-compiler:5.0.0.M5
o org.drools:drools-core:5.0.0.M5
o org.mvel:mvel2:2.0.6
o org.drools:drools-api:5.0.0.M5
o joda-time:joda-time:1.5.2
o org.antlr:antlr-runtime:3.1.1
o org.eclipse.jdt:core:3.4.2.v_883_R34x
o janino:janino:2.5.15
o org.jibx:jibx-extras:1.2.1
o org.jibx:jibx-run:1.2.1
o org.codehaus.woodstox:wstx-asl:3.2.1
o stax:stax-api:1.0.1
o quartz:quartz:1.5.2


I am gonna work on this for a while now. Changes i intend to do in future releases.

1. Refactor test cases
2. Change rules appropriately.
3. Load it on a Spring DM server
4. Create a UI on Webflows (Not decided on the framework. Might as well do it on something simpler like Struts also)
5. De couple reader, binder, renderer, rule engine and report generation modules and have them talk to each other on Mule bus.

Sunday, March 1, 2009

Setting cutom screen resolution on Sabayon

My Dell XPS 1330 has 1280x800 as standard screen resolution; but the Sabayon installation didn't pick it up because 1280x800 is not one of the standard screen resolutions. At least that is what i understood from my readings. 1280x800 is one of those wide screen resolutions which is pretty normal is every other laptop these days. Then why didn't Sabayon pick it up on my installation on Virtual Box!! That is not a good thing.

However, you can tell Sabayon to pick up 1280x800 with a small configuration.

'su' to root


pjames@localhost ~ $ su
Password:
localhost pjames #


open xorg.conf in your favorite editor. I am using 'nano'


localhost pjames # nano /etc/X11/xorg.conf



Under screen section, look for default depth.


# **********************************************************************
# Screen sections.
# **********************************************************************

Section "Screen"

# The Identifier, Device and Monitor lines must be present

Identifier "Screen 1"
Device "VESA"
Monitor "Generic Monitor"
#Option "AddARGBGLXVisuals" "true"

# The favoured Depth and/or Bpp may be specified here

DefaultDepth 24

SubSection "Display"




Now look for display configuration for depth 24.

The Modes line will be commented by default. Uncomment this line, and add your custom screen conguration to it. Here is how it looks on my machine for 1280x800.


SubSection "Display"
Depth 24
ViewPort 0 0
Modes "1280x800" "1024x768" "800x600" "640x480"
EndSubsection


Now, save the file and reboot system for new resolution to become effective.