Wednesday, December 23, 2009

How to set Java memory usage of Tomcat 4.1 started as a Windows service

If you try to set Java parameters -Xms or -Xmx in catalina.bat it would work only if you start Tomcat with startup.bat.
If you want to start Tomcat as a service you must dig through registry.
Taken from jguru.

1. Open up the registry (Run -> Regedit)

2. Find the entry for your Tomcat service entry. Either do a search for the service name in the registry or navigate to:
HKEY_LOCAL_MACHINE.SYSTEM.CurrentControlSet.Services.Apache Tomcat 4.1.Parameters

3. You should see several numbered "JVM Option Number" parameters

4. Add two new "String Value" parameters, succeeding the ordinal count of those already there, in my case 4 and 5

5. Add your arguments. I used: -Xms128m and -Xmx128m

6. Modify the JVM Option Count accordingly.

7. Restart your service.

Thursday, October 22, 2009

Punished By Rewards

I'm interested in reading:
Punished By Rewards: The Trouble with Gold Stars, Incentive Plans, A's, Praise, and Other Bribes

Can't find it in bookstores and I have trouble ordering it from Amazon since my country is not in love with the rest of the world!

Interesting review from Yolanda on Amazon:
"Rewards fail for five reasons.
- First, rewards punish and control by seduction. The failure to win a reward or the threat to remove a reward is functionally identical to the threat to employ a punishment.
- Second, rewards rupture relationships both vertically (student/teacher) and horizontally (student/student). Both rewards and punishment are really about someone maintaining power and control over another and they induce a behavior pattern whereby the subordinate tries to curry favor and impress the rewarder rather than encourage a relationship of trust and openness. Also, rewards lead to destructive competition.
- Third, employing rewards can change superficial behavior effectively, but it ignores the underlying reasons for the problem behavior and so does not effect long-term change. Rewards are not solutions, they are gimmicks, shortcuts, quick fixes that mask problems.
- Fourth, rewards discourage risk taking, creativity, and taking on challenges because the task is now just something that stands in the way of gaining the prize. - Finally, and most tragically, rewards change the way people approach the task. To reward someone for something that many find intrinsically interesting and enjoy doing is to destroy motivation. For example, the Pizza Hut "Book It" reading incentive and summer library reading incentive programs are, according to Kohn, very destructive. Reading is presented not as a pleasurable experience, but as something one has to be bribed to do with a food reward or other token."

Tuesday, October 13, 2009

Exporting pdf from Jasper (problem with unicode)

In my other post I described how to export from Jasper.

There is potential problem if you need to use unicode fonts.

In order to export Jasper to pdf, you need TrueType font that has all the characters that your exported pdf is going to contain.
I had a lot of trouble to find free font that has all the glyphs I need.
Found it on myfonts.


All you need to write in jrxml file is:

<font pdffontname="myPathToFonts\fontFileName.ttf" pdfencoding="Identity-H">

Monday, July 13, 2009

VIM code formatting

I'm experimenting with Vim.
It's geeky!

Sandeep Singhal made Vim more interesting to me with his post about formatting:

Tuesday, June 30, 2009

Thursday, February 19, 2009

Monday, February 9, 2009

Open source company business model

Interesting article about business model for open source company.
Hacking Business Models

Monday, January 26, 2009

Eclipse Singletone template


Pattern should look like:

// *** SIngletone impl
private static class InstanceHolder{
private static ${enclosing_type} instance = new ${enclosing_type}();

private ${enclosing_type}() {}

public static ${enclosing_type} getInstance() {
return InstanceHolder.instance;
// ***

Now every time you need quick singletone implementation you just type single and ctrl+space...

Tuesday, January 13, 2009

I looove eclipse

We are bringing code review in our small team as an experiment. And I like it!
I liked it until I got "... and put brackets around every one statement if/else block..." in review of my code.
Thank you Oisin and thank you Eclipse!

Keep your code clean with Eclipse V3.3