Oct 4

I have spent quite a bit of time on this and also Google around.  So I figured I will share:

This assume you are using rails 3.0 or above, Warbler, and Tomcat 7.0 above

  1. Download latest log4j.jar and put it in your rails project’s lib directory
  2. Put your log4j.properties file in the rails root directory
  3. Add this line in warble.rb: config.java_classes = FileList["log4j.properties"]
  4. Add this line in warble.rb:  config.webxml.jruby.rack.logging = ‘log4j’

Explaination:

Step 2 and 3 will allow warbler to put log4j.properties into the WEB-INF/classes directory

Step 4 will make sure jruby-rack using log4j for logging.

If you run into any issue, check your log4j.properties.

Here is the standard one I use:

log4j.rootLogger=INFO, R

log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=${catalina.base}/logs/production.log
log4j.appender.R.MaxFileSize=10000KB
log4j.appender.R.MaxBackupIndex=5
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

Apr 26

http://blog.blenderbox.com/2011/01/07/installing-rvm-ruby-rails-passenger-nginx-on-centos/

Mar 13

I just finished another iphone app.  It is a fun app that mix Chinese Fortune Cookies with pictures.  Here it is : http://itunes.apple.com/us/app/ipicfortune/id423065900?mt=8

Nov 3

Yes, everyone woke up find out Google analytics has missed yesterday data?  What’s up Google?

Jul 21

The winner is Palm Pre SDK.  Why?  Palm picks a good architecture using javascript, html and css as its core technologies.  There is little learning curve. Unlike iphone which you need to learn Objective-C, xcode, Cocoa, etc.   It also follows convention over configuration (similar to rails).  Using Eclipse as IDE is also a good choice.  Using VirtualBox as the base of the Emulator is a very smart engineering choice.  I like people who don’t reinventing the wheel.  Setting up is esay and so is getting the helloworld app up.   Good job Palm.  I think you will have a good future in competing with Apple.

Jul 17

I am reading Erlang programming by Francesco Cesarini and Simon Thompson.  The book show you how to start up a debugger. by typing debugger:start(). in the erlang shell.  However, that is not enough.  The book implies that you will see the modules automatically.  Not true.  You will have to type ii(YourModule). in the erlang shell to load it up in the debugger window.  After that, you can have call iaa([init]).  Then you can run your module’s function in the erlang shell.  So here is an example:

13> debugger:start().
{ok,<0.140.0>}
14> ii(test2).
{module,test2}
15> iaa([init]).
true
16> test2:fac(3).
6

Jun 10

I am learning scala and erlang the same time to get an idea of FP.  So far, I like Erlang better in term of syntax.  Scala is good but its syntax is just getting too complicated.  It is trying to replace java but the its syntax is no simpler than java.  I think if Scala is not static type, the syntax would be simpler.

Jun 8

I am starting to learn Scala. This will be my first step to Functional programming world (even though Scala is not a pure functional programming language, it supports OO too).  I highly recommended this article for anyone who wants to take the first step: http://www.artima.com/scalazine/articles/steps.html .

Jun 8

As if the great firewall of China is not enough, they want to put a Dam on its people’s computers to reduce the flood of  porn (so they say). The software is called “Green Dam-Youth Escort”.  However, I really don’t think Chinese Communist/Capitalist government really cares about blocking porn.  They require every new computer to install this software because they want to block other political websites and control the information flow.   China wants to have its cake and eat it too.  It likes to get the benefit of modern technologies and internet but also want to control information flow.   I think they are fighting a losing battle.  Sooner or later, they will lose.

Jun 4

Eclipse is a great tool but like any great tool with long history.  I think Eclipse is getting bloated.  It is so easy to break by just doing a simple upgrade.

« Previous Entries