import java.io.File; import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; import java.sql.Connection; import java.sql.Driver; import java.sql.DriverManager; import java.sql.SQLException; import java.util.Properties; public class LoadJarClassloader { ...
1.         Table and class By default,Active Record assumes that the name of the table is the plural form of the name of the class.But you can specify the name of the table which the class is corresponding in class with ‘set_table_name’ ...
When you are developing a java project,you maybe want to log the history of the reason of changing your java code.You can write some comment on the head of a java file,but if there are too many files you changed which have the same reason,you need write the same comment in every java file.It's very ...
2008-01-08

Migration

1、Generate migrations l         You can use the “ruby script/generate model model-name” command to generate model and the corresponding migration file. l         You can also generate a migration o ...
This method was wrote by dcaoyuan in one of his blogs. Open the nbrubyide.conf file(in etc directory) and change the default_options value to: default_options="-J-Xms32m -J-Xmx128m -J-XX:PermSize=32m -J-XX:MaxPermSize=160m -J-Dnetbeans.logger.console=true -J-ea -J-Dapple.laf.useScreenMenuBar=true - ...
"pluralize" is a very insteresting helper of Rails,but it may be not very useful.It can return the plural word of what you pass into it.I have tested the 'knife' word and it returned the right answer:'knives'. Then you can implement a util which pluralizes any words.
Thread is a very important concept in every computer language,for example in java,in c++ or in c.So Ruby have its own Thread concept. Create a new Thread If you want to create a new thread in java,there are two ways(first,you can write a class which extend the java.lang.Thread class;second,you can ...
2007-12-05

AspectR

The concept of aspect-oriented programming (AOP) is an interesting one. In AOP, we try to deal with programming issues that crosscut the modular structure of the program. In other words, some activities or features of a system will be scattered across the system in code fragments here and there, rat ...
In the same way that the class could include some singleton methods,the Module could include some singleton methods,too.But if we implement a class which include a Module which contians some singleton methods,does these methods become to the class's singleton methods?The answer is 'no'.There is a ho ...
Recently,I'm reading the <Ruby Way> book.Some people said that the book is suitable for someone who have some experience in Ruby and they must be right.Because there aren't any words to explain how to develop a ruby program and there are only some usage about Ruby hacks. This blog is to blog som ...