Tuesday, October 20, 2009

Tips for solving "Too many open files" issue

When I tried to start Eclipse today, my Eclipse just popup an error which points to an log doesn't exists. I kept getting this error when I tried to restart it again.

So I executed it from command line console, and I got this error said:
java.util.zip.ZipException: error in openning zip file

So I removed some of jar files in features & plugins directory, and then the error change to:
and there's a line in frone of error said:
ZoneInfo: /usr/lib/jvm/java-6-sun-1.6.0.07/jre/lib/zi/ZoneInfoMappings (Too many open files)

I use the lsof to check the open file count of eclipse and found it's only 2107, so I use:
ulimit -n 4096 
to change the limitation to 4096, but it still doesn't work.

So I google a little and found someone said that actually eclipse will open files more than 10000, which are all in temporary directory. So I change the ulimit to 65535, and the probem solve.

To make the change permanently:
vi /etc/security/limits.conf

or 
echo 65535> /proc/sys/fs/file-max
echo 65535 > /proc/sys/fs/inode-max

use other number in your case.


Saturday, October 10, 2009

when i saw Micello

I know that digital earth will finally come true.

we just need more people create these kind of fun application.

check micello from video on their website:

I promise this is not an ad.

Saturday, September 26, 2009

那个年代

你一定随着春天温暖的风,又踏着严寒冬天的雪,你经过春风的吹送和踏雪的足迹,已经深入到祖国的高山、平原,也飘进了黄河、长江,经过黄河、长江的运移,你进入了无边无际的海洋

Wednesday, July 1, 2009

Template Toolkit + CGI::Ajax Sample

I would like to say at the beginning that this would be the first and most detail sample for people who wants to use TT and CGI::Ajax together. Because I googled for a long time and cannot find any workable example. So I know the pain and hope this can help someone who has the same pain as me.

This example will not solve every problem of TT and CGI::Ajax integration, only one aspect of it, the basic one, and it's not the best one I think.

Okay, let's directly go to a workable code, the default CGI:
#!/usr/bin/perl

use strict;
use warnings;

use lib qw/ . /;
use vars qw/ $vars /

use Mypackage::User;

use Mypackage::CGI;
use CGI::Ajax;

my $cgi = Mypackage::CGI->cgi; # here we wrap the template into my own CGI so that they can use together easily
my $template = Mypackage::CGI->template;

print $cgi->header;

$vars->{title} = "test ajax";
$template->process( "header.html.tmpl", $vars ) or throw( $template->error ); # just process a html template file
my $ajax = CGI::Ajax->new( 'get_reservation' => 'ajax.cgi');
$ajax->JSDEBUG(1);
$ajax->DEBUG(1);

print $ajax->build_html( $cgi ); # inject CGI::Ajax

$template->process( "b.html.tmpl", $vars ) or throw( $template->error ); # do anything else
$template->process( "footer.html.tmpl", $vars ) or throw( $template->error );


exit 0;
__END__


Here we request the external cgi to deal with the request:

#!/usr/bin/perl

use strict;
use warnings;

use lib qw/ . /;
use vars qw/ $vars /;

use Mypackage::User;


use Mypackage::CGI;
use CGI::Ajax;

my $cgi = Mypackage::CGI->cgi;
my $template = Mypackage::CGI->template;

print $cgi->header;
my @args = $cgi->param( 'args' );
my $team = $args[0]; # you can get more than one parameter from here
print &get_users_func($team);

sub get_users_func
{
my ( $team ) = @_;
my $users = new Mypackage::User();
my $teamusers = $users->get( $team);
$vars->{users} = $teamusers;# vars is the VARIABLES of TT, you can see we use the same way that passing variables in an ajax context
$template->process( "c.html.tmpl", $vars ) or throw( $template->error ); // c.html.tmpl shows a list a user in this team
return $vars->{content}; # we simply return the content of processed template, you can have other way to return the content, but this will be the simplest way I think
}

exit 0;

Here's the codes you need to add into your default html file (b.html.tmpl):
<input type="text" id="team" value="[% team %]">
<div id="users"></div>
<p><input type="button" name="submit" value="show all users" onclick="get_users(['team'],['users'])"/></p>

Thursday, May 14, 2009

Tips for installing Netmeeting on Vista

http://joshuamaher.com/2007/02/21/netmeeting-on-vista/
Thanks Josh.


Why the heck would anyone want to use Netmeeting on Vista? The Windows Meeting Space is built in and is far superior and has a feature set that is much more useful…but if your corporate masters are WAY behind the times (despite the millions of Microsoft investments)…..here’s how to get it working…

Thanks to BlackDiamond’s post at TechRepublic, here is how to do it:

  1. Download NM30.EXE from Microsoft.com
  2. Save the executable to your computer somewhere
  3. Right click on the file and select “Properties”.
  4. Click the “Compatibility” tab.
  5. Put a check in “Run This Program In Compatibility Mode For:”.
  6. Select Windows NT 4.0 (Service Pack 5).
  7. Click “OK”.
  8. Double click the shortcut and install normally.Yeah….NetMeeting now works in Vista.

When you run NetMeeting you will be able to enter all the information as normal and will have to unblock netmeeting in the firewall.

The only thing that does not appear to be working is the Remote Desktop Sharing option, if anyone knows how to make it work, let us know!


Sunday, May 10, 2009

fedora installation options - can be used in most redhat based li

Fedora Installation Options


Boot time command args:
-----------------------

expert Turns on special features:
- allows partitioning of removable media
- prompts for driver disk

noshell Do not put a shell on tty2 during install.

lowres Force GUI installer to run at 640x480.

resolution=<mode> Run installer in mode specified, '1024x768' for example.

nousb Do not load USB support (helps if install hangs
early sometimes).

nofb Do not load the VGA16 framebuffer required for doing
text-mode installation in some languages

nofirewire Do not load support for firewire devices

askmethod Do not automatically use the CD-ROM as the install
source if we detect a Red Hat Linux CD in your CD-ROM drive.

nousbstorage Do not load usbstorage module in loader. May help with
device ordering on SCSI systems.

noparport Do not attempt to load support for parallel ports

noprobe Do not attempt to detect hw, prompts user instead.

nopcmcia Ignore PCMCIA controller in system.

skipddc Skips DDC probe of monitor, may help if its handing system.

graphical Force graphical install. Required to have ftp/http use GUI.

text Force text mode install.

vnc Enable vnc-based installation. You will need to connect
to the machine using a vnc client application.

vncpassword=<password> Enable a password for the vnc connection. This will
prevent someone from inadvertantly connecting to the
vnc-based installation.

Requires 'vnc' option to be specified as well.

vncconnect=<host>[:<port>] Once installation is up and running, connect to
the vnc client named <host>, and optionally use port <port>.

Requires 'vnc' option to be specified as well.

updates Prompt for floppy containing updates (bug fixes).

isa Prompt user for ISA devices configuration.

dd Use a driver disk.

driverdisk Same as 'dd'.

mediacheck Activates loader code to give user option of testing integrity
of install source (if an ISO-based method).

rescue Run rescue environment.

nomount Don't automatically mount any installed Linux partitions
in rescue mode.

nopass Don't pass keyboard/mouse info to stage 2 installer, good for
testing keyboard and mouse config screens in stage2 installer
during network installs.


serial Turns on serial console support.

ksdevice Takes an argument like 'eth0', tells install what network
device to use for kickstart from network.

ks Kickstart over NFS.

ks=cdrom: Kickstart from CDROM

ks=nfs:<path> Kickstart from NFS.

ks=<url> Kickstart via HTTP.

ks=hd:<dev> Kickstart via harddrive (dev = 'hda1', for example)

ks=file:<path> Kickstart from a file (path = 'fd0/ks.cfg')

ks=ftp://<path> Kickstart from FTP.

ks=http://<path> Kickstart from HTTP.

kssendmac Adds HTTP headers to ks=http:// request that can be helpful
for provisioning systems. Includes MAC address of all nics in
a CGI environment variable of the form
HTTP_X_RHN_PROVISIONING_0, HTTP_X_RHN_PROVISIONING_1, etc, for
all nics.

dhcpclass=<class> Sends a custom DHCP vendor class identifier. ISC's dhcpcd can
inspect this value using "option vendor-class-identifier".

upgradeany Don't require an /etc/redhat-release that matches the
expected syntax to upgrade.

lang=<lang> Language to use for the installation. This should be a
language which is valid to be used with the 'lang' kickstart
command.

keymap=<keymap> Keyboard layout to use. Valid values are those which can be
used for the 'keyboard' kickstart command.

ip=<ip> IP to use for a network installation, use 'dhcp' for DHCP.

netmask=<nm> Netmask to use for a network installation.

gateway=<gw> Gateway to use for a network installation.

dns=<dns> Comma separated list of nameservers to use for a network
installation.

method=nfs:<path> Use <path> for an NFS installation.

method=http://<path> Use <path> for an HTTP installation

method=ftp://<path> Use <path> for an FTP installation

method=hd://<dev>/<path> Use <path> on <dev> for a hard drive installation

method=cdrom Do a CDROM based installation.

vnc Do graphical installation via VNC. Instead of
starting a normal X server, vncserver will be started
and you can then connect remotely to do the
installation.

vncpassword=<password> Set a password for the vnc session.

vncconnect=<host>[:<port>] Once installation is up and running, connect to
the vnc client named <host>, and optionally, on port <port>.
Requires 'vnc' option to be specified as well.

Something else:
test
debug Start up pdb immediately
nofallback If GUI fails exit
rootpath= Where to install packages (default /mnt/sysimage)
pcic= Specify pcmcia controller
overhead= Override LVM overhead calculation
testpath=
mountfs
traceonly Don't run, just list modules we use
kickstart= Set serial install and kickstart file
kbdtype= Set the type of keyboard
module= Load additional kernel modules
class= Choose install class to use
autostep Make kickstart non-interactive
noselinux Disable Security Enhanced Linux
selinux Enable Security Enhanced Linux
vnc=
cmdline Use command line installer
headless Automate install for machines with no display
virtpconsole=
xfs Allows the creation of a xfs filesystem
reiserfs Allows the creation of a reiserfs filesystem
jfs Allows the creation of a jfs filesystem
syslogd

Friday, May 8, 2009

GWTAE first try

I just try the Google AppEngine with GWT. The eclipse plugin is pretty cool and simple to use.

But it's not perfect in:
  1. i want to use servlet context listener, but it doesn't support --> use filter to do it instead
  2. i want to share my data with other applications but seems it's hard to do that, except I use external database service like Amazon S3
  3. i want to add some big file but it has a memory restriction for big files < 1M ....

or i need more tries

IT 演义

IT战场烽烟四起
谁是真正的钢铁巨人:HP,IBM,DELL加上新来的Oracle

云之战:GoogleyahooAmazon加上新来的微软OracleIBM
ERP:SAPOracleM$加上IBM

大户来了,散户散开

我们翘首以盼

IT如此精彩,引无数英雄竞折腰

Fedora 11 Issues

I met a lot of installation issues while trying fedora 11 preview release on ProLiant server, it spent me a half day to find out why the default installation failed:

  1. can not find enough free space error
  2. can not cancel bug report dialog issue
  3. cannot find a certain package issue
  4. failed to create partition
  5. hang while installing
  6. hang while finding storages
  7. cannot reboot system after finished the installation post operations

something we can use to skip these issues:
  1. make sure your disk is clean or with enough free space
  2. make sure no lvm or other fancy stuffs
  3. use expert and text installation option while install
  4. don't install all packages
  5. select ssh installation for further debugging

just some tips

Thursday, March 19, 2009

Go ApacheCon, Go Amsterdam

This is the second time I attend the ApacheCon EU. I just can't tell you how impress I'm last time I back from ApacheConEU 2008.

This year I got a great opportunity to present my small idea to you: AntUnit Your Functional Test.

Please go and join the big event.
Thanks
- Jimmy

Thursday, March 5, 2009

Top Pains of Engineer


From management:

What sales said is the truth.

Don't over engineering.


Manager thinks Architecture and Design as the same thing





From other developer:
My codes are so unreadable that they always rewrite everything



From QA:
I'm shame creating a bug, it's my fault

From my self:
I know how to do things elegant, but I lack of time





Saturday, February 21, 2009

Questions About Burndown Chart

One of my colleagues had some questions about the usages of burndown chart while using Scrum.

Questions:



A. What burn-down means?


B. Why we need it?

C. It's something for boss, why I need to care about it?

D. Even if we found something strange, they are all explainable. It means nothing to developer. Why people treat it as a important tool in Scrum?

At the same time, my friend also had question about Scrum:
E. Scrum is not really good at status tracking and task dependency management.


I fully understand these questions, and I think he got the key idea of burn-down chart -- it's used for management, and it's really easy to be understand by the management. Management can get the trend of development from this simple chart.

And as a scrum master, I think the burndown chart means more.

Basic usage

A burn-down chart can tell us (some of them are extended from the changes of chart)
  • Sprint progress
  • trend of development
Well, these are easy to be understand.

Advanced usage

Further more, it is really a great tool which summarized the whole sprint. It's a graphic log of sprint. From the rising or falling of the line, you will be able to tell what happened in your sprint.
  • if your burndown chart is smoothly linearly going down
    • and if join point is the near your estimation, that means your project is in good state
    • if join point largely ahead your estimation, then maybe your developers have really good performance, or maybe your scope cut
    • if the join point is after your estimation, that means you have problem now, check your estimation with developer for further reason
  • if your burndown chart shows an suddenly up, that means your scope changed, new task added
  • if a suddenly down, that means
  • if the line is flat, well, maybe your developer forgot to update their status, or it means task delayed
All of these mean one word: STATUS. Any unexpected up or down will tell us the issue or exception happened, you must update your plan.

Now we have a great tool for sprint retrospective, we can sit together and let each of the members tell us what happened during the sprint. And we can easily summarize the lessons or issues or risks or wrong estimations or technical issues, wow, everything. And Scrum master can use to adjust the plan, better manage the release and sprint. And the developer can adjust their estimation, think about how they solve the issues they met.

And an important usage of burndown chart, actually I already mentioned above, using for comparison and adjusting the plan. The most difficult part of an agile team is the velocity. Normally, we can get the estimation from each developer, but the velocity of agile team will not come from estimation. The velocity comes from the real work done before. And the burndown chart is the right place we can got this information, well, you can get it from the task list too, but burndown chart is more straightforward, as I said, it also includes the exceptions of sprint execution.

Now we still lack of tool to better using the Scrum, I'm thinking about a tool which we can dynamically add issue/exception/risks/holiday or vacation to to system and they can be shown on the burndown chart. Then everything I said here will be easier for scrum teams. I'm waiting for this kind of tool.

At the end, I'm using a tool call IceScrum, you can try it if you want. Check http://icescrum.org for more details. It's a spring+jsf+hibernate implementation, a good application for studying.

Wednesday, February 18, 2009

Zen Aquarium

Fish Tank

Monday, February 16, 2009

Sessions I'm interested in:

Sessions I'm interested in (and of course my session is included, cheers):

The full session list is at:


Wed Mar 25 10:30by Grant Ingersoll
Wed Mar 25 11:30by Marcel Offermans
Wed Mar 25 11:30by Adrian Trenaman
Wed Mar 25 13:00by Jim Jagielski
Wed Mar 25 13:00by Lars Eilebrecht
Wed Mar 25 14:00by Sanjiva Weerawarana
Wed Mar 25 14:00by Michael Busch
Wed Mar 25 14:00by Paul Fremantle
Wed Mar 25 14:00by Olga Natkovich
Wed Mar 25 15:00by Tom White
Wed Mar 25 15:00by Michael Stack
Wed Mar 25 15:00by Kevan Miller
Wed Mar 25 15:00by Gianugo Rabellino
Wed Mar 25 16:30by Sanjiva Weerawarana
Wed Mar 25 16:30by Jukka Zitting
Wed Mar 25 16:30by David Jencks
Wed Mar 25 16:30by Allen Wittenauer
Wed Mar 25 17:30by Steve Loughran
Wed Mar 25 17:30by J. Chris Anderson
Wed Mar 25 17:30by David Jencks
Thu Mar 26 09:00by Ruwan Linton
Thu Mar 26 10:00by Paul Fremantle
Thu Mar 26 16:30by Andreas Gies
Thu Mar 26 17:30by Filip Hanik
Thu Mar 26 17:30by Emmanuel lecharny
Fri Mar 27 09:00by Jimmy Zhao
Fri Mar 27 10:00by Norman Maurer
Fri Mar 27 10:00by Felix Meschberger
Fri Mar 27 14:00by Wendy Smoak
Fri Mar 27 15:00by Carlos Sanchez
Fri Mar 27 16:30by Dave Johnson
Fri Mar 27 16:30by Bertrand Delacretaz
Fri Mar 27 17:30by Steve Loughran