Code migration

January 24, 2010 Leave a comment

It is not fun at all to wake up at midnight and operate a live ‘patient’. I have been through many of this battle but some how the feeling is still the same.

Even you have run all the tests on SIT, UAT,… The codes may still break when it go to actual production environment. And if your code is responsible to thousand of accounts especially with financial transaction then good luck!

Heading to bed now! The migration is done. We have tested everything is fine! I don’t wish to hear any call from anyone in the next few hours.

Categories: Uncategorized Tags: , ,

Grails + GWT + Cloud computing

December 13, 2009 Leave a comment

I have over 8 years of Java development, to me Java is the best programming language.  After 3 years venturing in Ruby on Rails I started to find Java and Rails is a great combination.

After a few project with JRuby on Rails, I found something is still not right util I found Grails.

After reading Matt Raible blog post on GWT and Grails: http://raibledesigns.com/rd/entry/building_sofea_applications_with_gwt I think this is something worth to explore. And this will be much better with EC2 or Google App Engine as the infrastructure component.

As Matt says, there is no one size fit all or no framework will be the best for all project. But I do believe that there is some framework will fit most project out there.

Categories: Uncategorized

Concurrent Session Sontrol in Spring

October 29, 2009 Leave a comment

I am using Spring Acegi for my application security. It is amazing. It works perfectly fine and also very open for customization. Recently, there is a request from the customer to disallow concurrent sessions. I thought it may be a challenge but yet again, it prove that I have made the right choice:

After googling for a couple of minutes I found this

http://static.springsource.org/spring-security/site/docs/2.0.x/reference/ns-config.html#ns-concurrent-session

So add:

<listener>
<listener-class>org.springframework.security.ui.session.HttpSessionEventPublisher</listener-class>
</listener>

and

 

<http>
<concurrent-session-control max-sessions=”1″ exception-if-maximum-exceeded=”true”/>
</http>

to web.xml

And that’s it. Everything is running smoothly after restarting the app server.

 

Categories: Uncategorized

Spring applicaion context access from backend system

October 28, 2009 Leave a comment

It is something very simple when you know how it work. My application is based on Spring / Strut but also have some component to received SMS from end-user. When the customer log in through the web interface the application context is set. But when an SMS is received the SMS Controller will need to access the beans. it will be good if there a way for me to access the application context.

import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

public class AppContext implements ApplicationContextAware{

public static ApplicationContext ctx;
public void setApplicationContext(ApplicationContext applicationContext) {

ctx = applicationContext;

}

}

and in the applicationContext.xml add:

<bean id=”appContext” class=”AppContext”></bean>

 

and whenever you need to get a bean object:

UserManager userManager = (UserManager) AppContext.ctx.getBean(“userManager”);

Categories: Uncategorized Tags:

I am 25

July 20, 2006 Leave a comment

It is a busy busy week but there is a important day – my birthday. Yeah! I am 25 years olad now. So what is so special about 25 years old. Well, that means I have lived for a quater of a century.

And here is what I find out about number 25:

In mathematics

It is a square number, being 52 = 5 × 5, and it is also the sum of two squares, 32 + 42, often used in demonstrations of the Pythagorean theorem. It is the smallest square that is also a sum of two squares. 25 is a centered octagonal number and an automorphic number.

It is the smallest base 10 Friedman number as it can be expressed by its own numbers: 52.

It is also a Cullen number. 25 is the smallest pseudoprime satisfying the congruence 7n = 7 mod n. It is also a Somer pseudoprime based on 6.

25 is an aspiring number – its aliquot sequence converts to a perfect number. It is the smallest aspiring number.

Within base 10 one can readily test for divisibility by 25 by seeing if the last two digits of the number match 25, 50, 75 or 00.

[edit]

In science

[edit]

Astronomy

[edit]

In other fields

Twenty-five is:

  • The number of years of marriage marked in a silver wedding anniversary.
  • The minimum age of candidates for election to the United States House of Representatives. “Under 25″ provides a common cut-off point for designating youth.
  • The number of cents in a quarter, an American coin with George Washington’s portrait on the obverse and an eagle on the reverse (or special reverses for the special state quarters since 1999), and a Canadian coin with Queen Elizabeth II on the obverse and a moose on the reverse (or special reverses lately).
  • The usual TCP port for SMTP.
  • The designation of United States Interstate 25, a freeway that runs from New Mexico to Wyoming.
  • The designation of the M25 London Orbital motorway.
  • The (critical) number of Florida electoral votes for the 2000 U.S. presidential election.
  • The name of the national card game of Ireland. Twenty-five is played widely in rural pubs and at home. The game moves quite quickly – it does not take long to play a hand – and although there is a fair amount of luck in it, there is also some scope for skill. It is played by four people. The ranking order of the cards may seem a little arcane at first, but with a little practice it becomes second nature. Apart from the scoring it is more or less the same as the old games of Maw and Spoil Five.
  • The size of the full roster on a major league baseball team
  • The number of playable characters in Super Smash Bros. Melee, if Zelda and Shiek count as one character.
  • In Pokémon, the Pokédex I.D. number of Pikachu.

[edit]

Historical years

25 A.D., 25 B.C., 1925, 2025, etc

Categories: Uncategorized

Configure Dual CPU on Ubuntu

May 21, 2006 Leave a comment

My server is a PIII 800Mhz dual CPU. But after 3 months of running, yesterday I found out that there was only one CPU was actually working. I was so fed up. But it was obviously that I didn’t check it carefully…

Hmm, whatever! What I really want to do is make the two CPU working. So I went to google and try to find out if there is anyone have the same situation like me. Suprisingly there were so many people facing the same problem.

The solution is very simple. All what you need to do is either compile or install a SMP (Symmetric Multi Processing) kernel in order to utilize multiple CPUs.

So I installed the following packages:

-linux-image-2.6.12-9-k7-smp

-linux-image-k7-smp

-linux-restricted-modules-2.6.12-k7-smp

-linux-restricted-modules-k7-smp

-> run cat /proc/cpuinfo:

processor : 0

vendor_id : GenuineIntel

cpu family : 6

model : 8

model name : Pentium III (Coppermine)

stepping : 3

cpu MHz : 796.053

cache size : 256 KB

fdiv_bug : no

hlt_bug : no

f00f_bug : no

coma_bug : no

fpu : yes

fpu_exception : yes

cpuid level : 2

wp : yes

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse

bogomips : 1576.96

processor : 1

vendor_id : GenuineIntel

cpu family : 6

model : 8

model name : Pentium III (Coppermine)

stepping : 3

cpu MHz : 796.053

cache size : 256 KB

fdiv_bug : no

hlt_bug : no

f00f_bug : no

coma_bug : no

fpu : yes

fpu_exception : yes

cpuid level : 2

wp : yes

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse

bogomips : 1589.24

So now the server is much faster! But how much faster, I am not very sure. How to compare a single CPU to a dual CPU server? I will try to find if there is such comaprision and post here later.

Categories: Uncategorized

Google Calendar

May 17, 2006 1 comment

An other tool from google. I have the feeling that google wants to do everything. I will not be supprised if there will be a Google labtop, Google computer, Google server, Google operating system,… in the future.

But anyway, it is a very good tool. I am trying to find out a way to import the calendar to my PDA.

Check it out at: www.google.com/calendar

Categories: Uncategorized
Follow

Get every new post delivered to your Inbox.