Thursday, April 23, 2009

Using water to create nanoscale power cells - Ars Technica

Using water to create nanoscale power cells - Ars Technica: "Using water to create nanoscale power cells

Chemists use computational modeling to figure out why a hydroelectric voltage is generated when water is pushed through a single-walled carbon nanotube.
By Yun Xie | Last updated April 22, 2009"

== Summary == A diagram showing the types of c...Image via Wikipedia

Reblog this post [with Zemanta]

Apache Ant - Frequently Asked Questions

Apache Ant - Frequently Asked Questions: "Why do you call it Ant?

According to Ant's original author, James Duncan Davidson, the name is an acronym for 'Another Neat Tool'.

Later explanations go along the lines of 'ants do an extremely good job at building things', or 'ants are very small and can carry a weight dozens of times their own' - describing what Ant is intended to be."

Wednesday, April 22, 2009

Dijkstra's algorithm

Dijkstra's algorithm, conceived by Dutch computer scientist Edsger Dijkstra in 1959, [1] is a graph search algorithm that solves the single-source shortest path problem for a graph with nonnegative edge path costs, producing a shortest path tree. This algorithm is often used in routing.

For a given source vertex (node) in the graph, the algorithm finds the path with lowest cost (i.e. the shortest path) between that vertex and every other vertex. It can also be used for finding costs of shortest paths from a single vertex to a single destination vertex by stopping the algorithm once the shortest path to the destination vertex has been determined. For example, if the vertices of the graph represent cities and edge path costs represent driving distances between pairs of cities connected by a direct road, Dijkstra's algorithm can be used to find the shortest route between one city and all other cities. As a result, the shortest path first is widely used in network routing protocols, most notably IS-IS and OSPF (Open Shortest Path First).

Monday, April 20, 2009


Java (programming language)Image via Wikipedia

"Groovy is like a super version of Java. It can leverage Java's enterprise capabilities but also has cool productivity features like closures, builders and dynamic typing. If you are a developer, tester or script guru, you have to love Groovy.'

Groovy is a relatively new language which emerged in about 2003. It has attracted a large following of Java programmers/developers who appreciate the enhanced, advanced features which extend Java. Groovy is not commercial software but open source software supported by a large community of developers. As indicated above, it is a way to simplify and enhance Java Programming."

Groovy facts:
  • Since the passage of JSR-241, Groovy is the second standard language for
    the Java platform (the first being the Java language)
  • GROOVY “A situation or an activity that one enjoys or to which one is especially well suited (found his groove playing bass in a trio). A very pleasurable experience; enjoy oneself (just sitting around, grooving on the music). To be affected with pleasurable excitement. To react or interact harmoniously.” [Leo]
  • Groovy can give you relief and bring back the fun of programming by providing advanced language features where you need them: in your daily work. By allowing you to call methods on anything, pass blocks of code around for immediate or later execution, augment existing library code with your own specialized semantics, and use a host of other powerful features, Groovy lets you express yourself clearly and achieve miracles with little code.
  • Groovy's relaxed Java syntax allows you to drop semi-colons and
  • Everything in Groovy is public unless you state otherwise.
  • Groovy permits you to define simple scripts without having to define a
    formal class object.
  • Groovy adds some magical methods and shortcuts on normal everyday
    Java objects to make them easier to work with.

Reblog this post [with Zemanta]

Twitter jilts Ruby for Scala

"For this sort of heavy lifting, languages like Java and C++ may be as fast as Scala. But Payne wants more than speed. He prefers Scala because it combines functional and object-oriented techniques. 'Functions are objects, and objects are functions,' he said. 'Scala asks can you have the best of these two worlds together? And you can.'

But he also prefers Scala because it's, well, beautiful. 'It's a fuzzy thing. But we like writing beautiful code, code that you're proud of, code that you can show to non-programmers and they get it.'

When Twitter made the Scala switch, it wasn't using Java Virtual Machines (JVMs). But, Payne argues, the language is that much more attractive if you're already running Java.

'The biggest selling point for certain organizations is that Scala is 100 per cent compatible with your existing JVM code. There's no wrappers. There's no bullshit. You just load up your JVM code and call in to it, and there's no performance penalty. If you have a big investment in Java infrastructure, Scala is the ideal language.'"

Tuesday, April 7, 2009

G.M. Conjures Up a People-Moving Pod - Wheels Blog -

G.M. Conjures Up a People-Moving Pod - Wheels Blog - "G.M. Conjures Up a People-Moving Pod
By Jim Motavalli
P.U.M.A. prototype G.M.’s P.U.M.A. prototype in Manhattan.

General Motors may be so short of cash that bankruptcy is among its dwindling options, but the company is still in the business of creating dreams."

Saturday, April 4, 2009

Jython Programming

  • Rapid application development - Python programs are typically 2-10X shorter than the equivalent Java program. This translates directly to increased programmer productivity. The seamless interaction between Python and Java allows developers to freely mix the two languages both during development and in shipping products.
  • Dynamic compilation to Java bytecodes - leads to highest possible performance without sacrificing interactivity.

  • Ability to extend existing Java classes in Jython - allows effective use of abstract classes.

  • Optional static compilation - allows creation of applets, servlets, beans, ...

  • Bean Properties - make use of Java packages much easier.

  • Making Jython Scripts Executable

    To make a jython ".py" file executable on a Unix system:

  • Make sure that jython is on your standard PATH.
  • Make the ".py" file executable. Typically, this is done with the command chmod +x
  • Add the following line to the top of the file:

#! /usr/bin/env jython

About performance
Because Jython is interpreted, it can be slower than a compiled language such as Java. In most applications, such as scripts or GUIs, this difference is hardly noticeable. In most cases, Jython's increased design and coding flexibility more than makes up for any small performance loss.

Because Jython code is dynamically converted to Java byte code, the latest enhancements to the Java platform (such as JITs and Sun's HotSpot JVM) can also eliminate many performance issues.

For an additional performance boost it is possible to implement code sections in the Java language and call them from Jython. For example, you could prototype your programs in Jython, test them out, and (in the case of performance issues) convert the critical sections to Java code. This technique is a good combination of the powers of Jython and the Java language, as prototyping is much easier in Jython than in Java.