Wednesday, August 10, 2011

Metaprogramming in Ruby - Basic

What's metaprogramming?

It's writing code that manipulates language constructs at runtime. language construct could be classes, modules and instance variable,etc.

In Ruby, we can write new code at runtime and execute the new code without restarting the program.

Example:

add custom method in Ruby classes, this just an example, no any specific purpose for this custom method

class Array
def customsize
   self.size + 1
end
end
puts [1, 2, 4, 2].customsize

Be careful before you do any changes in open ruby class. It may end up with bugs.

Sunday, August 7, 2011

Ruby 1.9.3 preview1

Ruby Community has been release Ruby 1.9.3 preview1.

See ChangeLogs and NEWS for the descriptions. Ruby Inside has published a review of this release.

Eclipse - Java 7 Support


The Eclipse Foundation released Eclipse 3.8M1, which is the first milestone release with Java7 support. Although there were beta releases available before, it could not be officially called Java7 until after the latter's release, and as such, the recently-released Eclipse Indigo (3.7).

Java7 support will come to Eclipse 3.7.1, which is due to be released in September. The integration builds for 3.7.1 already contain the Java7 support found in Eclipse 3.8M1, which is already supported in IntelliJ IDEA 10.5 and NetBeans 7.0.1

For more information on the new Java7 support, see the what's new page at Eclipse.

Wednesday, August 3, 2011

Java 7 - HotSpot Loop optimizations issue

Java 7 GA was released last week, Unfortunately it contains hotspot compiler
optimizations, which miscompile some loops. This can affect code of several
Apache projects. Sometimes JVMs only crash, but in several cases, results
calculated can be incorrect, leading to bugs in applications (see Hotspot
bugs 7070134 [1], 7044738 [2], 7068051 [3]).

For more details, Have a look these links

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7070134
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7044738
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7068051
https://issues.apache.org/jira/browse/LUCENE-3335
https://issues.apache.org/jira/browse/LUCENE-3346
http://s.apache.org/StQ

http://www.lucidimagination.com/blog/2011/07/28/dont-use-java-7-for-anything/

Java 7 released!


Last week oracle released Java 7. thank-you to everyone who contributed to this release -- from Sun, Oracle, and elsewhere. Here you find out more details