Thursday, March 31, 2011

Thoughts: Wicket, GIT

On Git: use git for any text file that you might perform edits on that isn't already part of an existing source control repository.

Simply do:

git init
git add [some file or directory]
git commit -m "adding message"



Apache Wicket is a component based web framework for the Java platform. It has seen increased popularity over heavier frameworks like Struts and JSF.

Here is a basic example:

import org.apache.wicket.Application;
import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.proxy.IProxyTargetLocator;
import org.apache.wicket.proxy.LazyInitProxyFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.berlin.model.LoadableDetachableList;
import org.berlin.model.SelectionOptionBean;
import org.berlin.wicketspring.easy.service.IPersonListService;
import org.berlin.wicketspring.easy.service.PersonListServiceImpl;

/**
* Keywords: wicket-spring, wicket, jetty
*/
public class MainPage extends WebPage {
private static final Logger LOGGER = LoggerFactory.getLogger(MainPage.class);
private final IPersonListService PersonListService;
public HomePage() {
this(null);
}
public HomePage(final PageParameters parameters) {
super(parameters);
PersonListService = (IPersonListService) LazyInitProxyFactory.createProxy(PersonListServiceImpl.class,
new IProxyTargetLocator() {
private static final long serialVersionUID = 1L;
public Object locateProxyTarget() {
return ((WicketApplication) Application.get()).context().getBean("PersonListService");
}
});
final LoadableDetachableList list = new LoadableDetachableList() {
private static final long serialVersionUID = 1L;
@Override
protected List load() {
return PersonListService.fetchStates();
}
};
final ListView listView = new ListView("PersonList", list) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(final ListItem item) {
final CompoundPropertyModel model = new CompoundPropertyModel(item.getModelObject());
item.setDefaultModel(model);
item.add(new Label("name"));
item.add(new Label("value"));
}
};
this.add(listView);
}
}
...
...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<div style="margin: 40px; padding: 10px">
<div style="width: 900px; height: auto; background-color: white; border: 1px solid #000; padding: 10px">

<h3>Wicket Spring - Demo</h3>
<div>
<div wicket:id="PersonList">
<span wicket:id="name"></span> |
<span wicket:id="value"></span>
</div>
</div>

</div>
</div>
</body>
</html>

Simple maven jetty config (supports start/stop)

Usage: 'mvn jetty:run'


<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<version>${jetty.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-util</artifactId>
<version>${jetty.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-management</artifactId>
<version>${jetty.version}</version>
<scope>provided</scope>
</dependency>

<profiles>
<profile>
<id>local</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
...
<build>
<plugins>
<!-- Clean all jars before build -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>

...

<build>
<finalName>${project.artifactId}</finalName>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>test</testSourceDirectory>
<resources>
...
...
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.source.version}</source>
<target>${java.target.version}</target>
</configuration>
</plugin>
<plugin>
...
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.4</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<stopKey>X</stopKey>
<stopPort>9999</stopPort>
</configuration>
<executions>
<execution>
<id>start-jetty</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<scanIntervalSeconds>15</scanIntervalSeconds>
<daemon>true</daemon>
</configuration>
</execution>
</executions>
</plugin>

...
<plugin>
...
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.4</version>
<configuration>
<scanIntervalSeconds>6</scanIntervalSeconds>
<contextPath>/</contextPath>
<webAppSourceDirectory>${basedir}/target/wicket-spring-simple-jetty</webAppSourceDirectory>
<tmpDir>target/work/jetty.tmp</tmpDir>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>7181</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
<requestLog implementation="org.mortbay.jetty.NCSARequestLog">
<filename>target/yyyy_mm_dd.request.log</filename>
<retainDays>30</retainDays>
<append>true</append>
<extended>false</extended>
</requestLog>
</configuration>
</plugin>

</plugins>

</build>
</project>

Monday, March 28, 2011

Thoughts - Bottom Up AI

Overview

The field of artificial intelligence in computer science focuses on many
different areas of computing from computer vision to natural language
processing. These top-down approaches typically concentrate on human behavior
or other animal functions. In this article we look at a bottom-up approach to
artificial life and how emergent cell behavior can produce interesting results.
With this bottom-up alife approach, we are not interested in solving any
particular task, but we are interested in observing the adaptive nature of the
entities in our simulation. We also wanted to introduce those more familiar with
software engineering to biological systems and evolutionary theory concepts.

Life is all around us. Even with inorganic material it is possible that
microscopic organisms are covering that surface. Moving forward if we want to
study, analyze and work with artificial agents, we might consider systems that
have evolved behavior over a series of steps. We should not necessarily build a
specific tool with a specific purpose but the creature that is built from the
system may produce interesting properties which are unlike the clean-room
created software that we create today. Most software and hardware today is
written to specification, line for line, most code written for today's systems
are created by man. That software is designed, coded and tested. It would be
interesting if we could start a biological like system and interesting behavior
from the system evolves over time.

When studying life, it also makes sense to go all the back to pre-life on earth
and the creation of this planet. When you look across the globe, there are
millions of species, a lot of life out there. All of that life occurred from
mutations, replications, chaotic collisions with other organisms. What is
organic life? compared to inorganic life? Life evolves, minute after minute,
day after day, year after year for millions of years across a vast planet.
Inorganic matter interacts with organic matter and from within that very complex
system, complex behavior emerges. When you look at computing systems, every
piece of software, most software was created by some person. Every line of
code, every machine instruction is mostly known to the developer or the hardware
manufacturers. The intelligent designer in this case are teams of intelligent
software and computer engineer building complex machines to act as a tool for
some purpose. Some application.

Human beings and other animals have complex machinery embedded in them. Animals
have eyes, ears. Human beings have the neocortex that allows us to predict
events that may occur in the future based on past memories. But all of these
tools that animals use to survive evolved over time. Iteration after iteration
of successes and failures. The human brain has a purpose in the context of
human survival just like the eyes and ears have a purpose. But do human beings
have a purpose? Computers have a purpose. Smart phones are tools that have a
purpose.

With software, we add all of that complex behavior. Human beings posses amazing
skills and we use our brains to adapt to the environment. All of that behavior
and response to the world around us was created by millions of years of
mammalian evolution. We are autonomous beings. All of that behavior created by
seemingly random events over time. The machinery that makes up the human being
just happen to have happened. That is a powerful thought. If we can understand
parts of that evolutionary process, maybe we can model some of of those events
through computer simulations and also generate complex behavior. Imagine if we
could instantly absolute control over the evolutionary process. Imagine if we
could remove an animals brain or ears or eyes so that future generations don't
have those functions. That animal would be helpless and couldn't function but
it just happens that they do have those capabilities and can survive as long as
their abilities allow them to. Imagine if this force could remove your brain so
that future generations of humans didn't have a brain. Or we removed the
ability to walk, see or hear. Once again, we would be helpless and human
progress would halt that instance. The evolutionary process is a complex one but
all of the creatures of the earth that have survived up to this point all posses
skills that allow them to survive. The tools given them given them through that
process.

Basic Biology Concepts

Human beings may have 100 trillion cells. There are several hundred distinct
human cell types.

The most basic cells may have a cell wall, chromosomes, plasma membrane,
fibrils, ribosomes.

DNA is the blue print for life of a cell. It mostly static, mutations may be
introduced. DNA contains the instructions for a cell's structure and function.
It is the blueprint for how the cell runs, reproduces, builds and repairs
itself, and every other function necessary for cell life. Metabolism is a
chemical reaction

A protein is a generic term for anything that is made of amino acids. Proteins
are considered the "cellular machinery"; they are constantly being synthesized,
and play many essential structural and enzymatic roles within the cell. How
does a cell die? Proteisn sythensis may be interrupted. Protein synthesis uses
about 75 percent of a cell'ss energy. Protein is a macromolceule Macromolecules
that make up cell material

Bacterial cells can change patterns of enzymes, in order to adapt them to their
specific environment.

With traits, in order to show-up, a dominant trait needs only one trait unit
from one of the parents, and the recessive one needs two, from both parents, in
order to prevail, that is the reason why the ratio between occurrences of
dominant traits and recessive traits is. The same explanation applies to the
shape traits.

keywords: earth, biosphere, inorganic vs organic material, water, DNA,
mutations, replication, simple organisms, more complex organisms, animals, human
beings, life, death, mutations, evolution, blind watchmaker, mitochrondria,
flagella, pili, cell walls, cytoplasmic membranes, ribosomes, cytoplasm.

Introduction to Artificial Life

Conway's Game of Life cellular automaton is one of the most prominent examples
of cellular automata theory. The one dimensional program consists of a cell grid
typically with several dozen or more rows and similar number of columns. Each
cell on the grid has an on or off Boolean state. Every cell on the grid survives
or dies to the next generation depending on the game of life rules. If there are
too many neighbors surrounding a cell then the cell dies due to overcrowding. If
there is only one neighbor cell, the base cell dies due to under-population.
Activity on a particular cell is not interesting but when you run the entire
system for many generations, a group of patterns begin to form.

You may notice some common patterns in the figure. After so many iterations
through the game of life rules, only a few cells tend to stay alive. We started
with a large random number of alive cells and over time those cells died off. In
a controlled environment you may begin with carefully placed live cells and
monitor the patterns that emerge to model some other natural phenomena.

The name Stephan Wolfram has been mentioned several times in this post. He is
the founder of Wolfram|Research, his company is known for the popular
Mathematica software suite and Wolfram|Alpha knowledge engine. He did not
initially discover cellular automata but recently he has been a prominent figure
in its advocacy. He spent 10 years working on his book, A New Kind of Science.
In the 1300 page tome, he discusses how cellular automata can be applied to
every field of science from biology to physics. NKA is a detailed study of
cellular automata programs.

The diagram above depicts the rule 30 program (or rule 30 elementary cellular
automaton). There are 8 input states (2 ^ 3) and an output state of one or zero.
If you look at the diagram from left to right. The first sequence of blocks on
the left depict an input state of { 1 1 1 } with an output of 0. Given input of
cells { 1 1 1}, the output will be set to 0. Subsequently, the next set of
blocks consist of an input state of { 1 1 0 } with an output of 0.

Artificial Life Object Model

Here is a basic model for simulating basic cell life using a bottom-up
approach. I will look at modeling basic cells. Adding DNA. The cells survive and die in a
primordial pool of water, sun. Even with this basic demo, emergent behavior
forms. I hope have made a case that organic life is interesting. The machinery
has already been created but we don't have a easy blueprint to recreate such complex
life, we can only use knowledge base to model as much as we can.

Here is a model for DNA. Game of Life, Cell Grid. 2D visual simulation, cells,
grid, iterations or cell game cycles, cell entities, bacteria.

The most basic units in the life simulation consist of Chemical Life Elements.
This enumeration contain the element types. The element types are closely tied
to the proteins on the grid but in reality they are synonymous with chemical
life elements like Carbon, Oxygen, etc.

Each grid in the life simulation consists of a chemical element unit. The
element unit contains an element level or weight. The elements react with other
elements.

The DNA represents the CODE in this simulation. We will decode the DNA code for
protein synthesis.

For the bacteria cell, DNA can effect:

Size, weight, energy level, color, reproduction rate, food consumption rate,
ability to handle water, sunlight/temperatures.

All forms of algae are composed of eukaryotic cells but for our demo, we are
treating Food/Algae as a type of non organic entity. But the cells in our
system feed on this non organic form of algae.

When constructing the object model for this DNA simulation, I wanted to focus
three key components, the DNA, mutations, cell properties or traits. But also,
there is some validation given to the water and the sunlight. These attributes
don't effect the system as much but are part of the environment.

import org.berlin2.bottomuplife.ui.BaseUIComponents._
import BaseLifeComponents._
import java.awt.{ Image, Color, Dimension, Graphics, Graphics2D, Point, geom }
import LifeSimulation._

import org.berlin2.bottomuplife.ui.RenderSimulation
import BaseLifeComponents._
import org.berlin2.bottomuplife.code.DNATranslationParser
import org.berlin2.bottomuplife.life.TraitToSystem._
/**
* Living bacteria cell, single celled organism.
*/
class Bacteria(size:Int, pos:GridPos) extends BaseLifeComponents.LifeEntity(size, pos) with BaseLifeComponents.SingleCellLivingEntity {
def deadSize = 6
private val dna = initDNA
private var bactericaAliveState = true
private var mutableSize = size
/**
* Process chemical reactions with water.
* @param water
*/
def chemicalReactionWithWater(water:Water) : Unit = {
chanceMutationForBlue = chanceMutationForBlue * 1.0007
for (element <- elementUnits) {
element.elementWeightLevel = element.elementWeightLevel * (1.0 - decayFactorForBacteriaFromWater)
}
}
}
/**
* Base Life simulation classes and objects.
*/
object BaseLifeComponents {
/**
* The most basic units in the life simulation consist of
* Chemical Life Elements. This enumeration contain the element types.
* The element types are closely tied to the proteins on the grid
* but in reality they are synonymous with chemical life elements like Carbon, Oxygen, etc.
*/
object Element extends Enumeration {
type Element = Value
val BacteriaWallProteinElement, WaterElement, SunLightEnergy, AlgaeFoodElement = Value
} // End of object
import Element._
type ElementType = Element

/**
* Interface living and non-living types.
*/
trait NonLivingEntity
trait LivingEntityCell {
def getName : String
def getDNA : DNA
def alive : Boolean
def processDNA() : Unit
def produceProteins() : Unit
def onStepSimulationProcessCell() : Unit
def getMutableSize : Int
def setImmutableSystemTraits : Unit
def onStepSetSystemTraits : Unit
/**
* Metabolic reaction and process to convert energy.
* In our system, amount of energy for this cell.
*/
def getCellularRespirationEnergyLevel : Double
def hasConsumeForReplication : Boolean
/**
* If child available, consume and add to core list.
*/
def consumeChildCellReplication : LivingEntityCell
def onInitializeReplicate(cell:LivingEntityCell) : Unit
def mutateDNAOnReplication(targetCell:LivingEntityCell) : DNA
}
trait SingleCellLivingEntity extends LivingEntityCell
trait MultiCellLivingEntity extends LivingEntityCell

/**
* Basic properties for a life agent.
* All entities for the life simulation are life agent entities.
*/
trait LifeAgent {
def setElementPositions : Unit
def sizeElements : Int
def onInitialize : Unit
def chemicalReactionWithSun(sun:SunLight) : Unit
def chemicalReactionWithWater(water:Water) : Unit
def chemicalReactions(sim:SimulationObjects) : Unit
}

/**
* Each grid in the life simulation consists of a chemical element unit.
* The element unit contains an element level or weight. The elements
* react with other elements.
*/
class ChemicalElementUnit(val initElementLevel:Double, val elementType:ElementType, val gridPos:GridPos) {
var elementWeightLevel = initElementLevel
var color:java.awt.Color = java.awt.Color.gray
}
/**
* Model DNA bases, Adenine, Cytosine, Guanine, Thymine.
*/
object DNABase1 {
def A = 1
def G = 2
def C = 3
def T = 4
def a = 1
def g = 2
def c = 3
def t = 4
}
type DNABase = Int
/**
* The DNA Word tuple consists of 4 ints/digits.
* The highest value of the left most outer digit could be represented by: 4 * pow(4, 3) or 4 * (4 ^ 3).
*/
type DNAWord = (DNABase, DNABase, DNABase, DNABase)
type Gene4 = DNAWord
} // End of Object


Summary

Moving forward if we want to study, analyze and work with artificial agents, we
might consider systems that have evolved behavior over a series of steps. We
might not build a specific tool with a specific purpose but the creature that is
built from the system may produce interesting properties which are unlike the
clean-room created software that we create today.

With this artificial life approach, but we also want to study the simple life
forms first before moving too fast forward like human behavior.

Sunday, March 27, 2011

Updated software review - notes

In the software industry, as you might expect, we use a lot of software. Here is my cursory review of software I used recently.

- Git (8/10) - the distributed source control tool - Not bad, looks useful, I have only done a couple of commits with it. From a cursory review, it looks like it would be useful for making commits locally without a need for some remote server system (like with subversion)

- Eclipse LaTex Plugin (7/10) - works, doesn't crash, does what I need it to.

- Eclipse Scala Plugin IDE (7/1) - works, crashes sometimes. I have a need for Scala development and this one of a handful of syntax highlighters

- Notepad++ (10/10) - Awesome software. It highlights Haskell, nice.

- Leksah (??/10) - So far, I haven't got into it. I don't like the GTK looks but it is a developer tool so it doesn't matter. I hope it does what I need.

Thursday, March 17, 2011

Java static source code analysis - Part 2

Here is the source count output for the Oracle JDK Java libraries (jdk1.6.0 22) and various packages (java lang, swing, net)

Larger projects, Oracle JDK 1.6.0.22 (src.zip)

Oracle JDK 1.6.0.22 (src.zip)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 7209 244417 910071 931087
C 7 437 1304 3186
C/C++ Header 7 56 128 169
-------------------------------------------------------------------------------
SUM: 7223 244910 911503 934442
-------------------------------------------------------------------------------

$ src/java/lang/ Oracle JDK 1.6.0.22 (src.zip)
169 text files.
169 unique files.
0 files ignored.

-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 169 3598 34295 17117
-------------------------------------------------------------------------------
SUM: 169 3598 34295 17117
-------------------------------------------------------------------------------

$ src/java/lang/ Oracle JDK 1.6.0.22 (src.zip)
$ perl cloc-1.53.pl src-large-nocommit/src/java/util/
233 text files.
233 unique files.
0 files ignored.

-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 233 8775 60767 48541
-------------------------------------------------------------------------------
SUM: 233 8775 60767 48541
-------------------------------------------------------------------------------

$ src/java/lang/ Oracle JDK 1.6.0.22 (src.zip)
$ perl cloc-1.53.pl src-large-nocommit/src/java/net/
67 text files.
67 unique files.
0 files ignored.

-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 67 2292 13774 10703
-------------------------------------------------------------------------------
SUM: 67 2292 13774 10703
-------------------------------------------------------------------------------

$ src/java/lang/ Oracle JDK 1.6.0.22 (src.zip)
$ perl cloc-1.53.pl src-large-nocommit/src/javax/swing/
620 text files.
620 unique files.
0 files ignored.

http://cloc.sourceforge.net v 1.53 T=20.0 s (31.0 files/s, 16211.1 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 620 33091 122986 168146
-------------------------------------------------------------------------------
SUM: 620 33091 122986 168146
-------------------------------------------------------------------------------

Java static source code analysis (analysis of various open projects)

If you were ever curious about how many classes your top projects had, this post contains the source code line count for top open source Java projects.
The listing is not any particular order, use your browser's find command to see the count for top projects like wicket, spring or hibernate.

Maven and cloc tools were used to generate the output.


# du -ha
1.9M ./ant-1.8.2.jar
16K ./ant-launcher-1.8.2.jar
436K ./antlr-2.7.6.jar
8.0K ./aopalliance-1.0.jar
44K ./asm-3.1.jar
172K ./bsf-2.3.0.jar
12K ./bytelist-1.0.6.jar
276K ./cglib-2.2.jar
3.1M ./clojure-1.2.0.jar
188K ./commons-beanutils-1.7.0.jar
32K ./commons-codec-1.2.jar
564K ./commons-collections-3.2.1.jar
60K ./commons-fileupload-1.2.1.jar
300K ./commons-httpclient-3.1.jar
88K ./commons-io-1.3.2.jar
276K ./commons-lang-2.5.jar
60K ./commons-logging-1.1.1.jar
240K ./constantine-0.6.jar
308K ./dom4j-1.6.1.jar
184K ./dwr-1.1.3.jar
860K ./freemarker-2.3.15.jar
628K ./google-collections-1.0.jar
544K ./guice-1.0.jar
2.5M ./hibernate-core-3.5.1-Final.jar
248K ./jaffl-0.5.1.jar
228K ./jaxen-1.1-beta-8.jar
236K ./jcodings-1.0.4.jar
152K ./jdom-1.0.jar
468K ./jetty-6.1.4.jar
32K ./jetty-management-6.1.4.jar
128K ./jetty-util-6.1.4.jar
88K ./jffi-1.0.1.jar
88K ./jline-0.9.93.jar
56K ./jnr-netdb-1.0.jar
92K ./jnr-posix-1.1.4.jar
532K ./joda-time-1.6.2.jar
180K ./joni-1.1.4.jar
7.7M ./jruby-1.5.6.jar
16K ./jta-1.1.jar
472K ./log4j-1.2.16.jar
1012K ./lucene-core-3.0.3.jar
400K ./mx4j-3.0.1.jar
488K ./mx4j-tools-3.0.1.jar
236K ./ognl-2.7.3.jar
136K ./servlet-api-2.5-6.0.1.jar
132K ./servlet-api-2.5-6.1.4.jar
24K ./slf4j-api-1.5.8.jar
12K ./slf4j-log4j12-1.5.8.jar
2.9M ./spring-2.5.6.jar
320K ./spring-aop-2.5.6.jar
480K ./spring-beans-2.5.6.jar
280K ./spring-core-2.5.6.jar
180K ./spring-test-2.5.6.jar
740K ./struts2-core-2.1.8.jar
1.9M ./wicket-1.4.15.jar
2.7M ./xalan-2.7.0.jar
988K ./xercesImpl-2.6.2.jar
108K ./xml-apis-1.0.b2.jar
124K ./xmlParserAPIs-2.6.2.jar
424K ./xom-1.1.jar
1.5M ./xwork-core-2.1.6.jar
38M .
{SCRIPT} begin processing{SCRIPT} Counting source ./target/sources/antlr-2.7.6-sources.jar

'In computer-based language recognition, ANother Tool for Language Recognition (ANTLR) is the name of a parser generator that uses LL(*) parsing'
http://en.wikipedia.org/wiki/ANTLR

100 files
200 files
227 text files.
classified 227 files
Duplicate file check 227 files (219 known unique)
Unique: 100 files
Unique: 200 files
227 unique files.
Counting: 100
Counting: 200
11 files ignored.

Processed in T=4.0 s (54.0 files/s, 13931.2 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 216 5648 8409 41668
-------------------------------------------------------------------------------
SUM: 216 5648 8409 41668
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/aopalliance-1.0-sources.jar
30 text files.
classified 30 files
30 unique files.
0 files ignored.

Processed in T=0.5 s (60.0 files/s, 2832.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 26 186 822 229
HTML 4 46 58 75
-------------------------------------------------------------------------------
SUM: 30 232 880 304
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/bytelist-1.0.6-sources.jar
2 text files.
classified 2 files
2 unique files.
1 file ignored.

Processed in T=1.0 s (1.0 files/s, 1322.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 1 140 607 575
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/cglib-2.2-sources.jar
100 files
122 text files.
classified 122 files
Duplicate file check 122 files (118 known unique)
Unique: 100 files
122 unique files.
Counting: 100
1 file ignored.

Processed in T=2.0 s (60.5 files/s, 6733.5 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 121 1494 3130 8843
-------------------------------------------------------------------------------
SUM: 121 1494 3130 8843
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/clojure-1.2.0-sources.jar
35 text files.
classified 35 files
35 unique files.
35 files ignored.
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/commons-beanutils-1.7.0-sources.jar
87 text files.
classified 87 files
87 unique files.
0 files ignored.

Processed in T=1.0 s (87.0 files/s, 22855.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 81 3557 10322 7922
HTML 6 117 0 937
-------------------------------------------------------------------------------
SUM: 87 3674 10322 8859
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/commons-collections-3.2.1-sources.jar
100 files
200 files
289 text files.
classified 289 files
Duplicate file check 289 files (281 known unique)
Unique: 100 files
Unique: 200 files
289 unique files.
Counting: 100
Counting: 200
3 files ignored.

Processed in T=5.0 s (57.2 files/s, 12882.8 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 273 6426 31103 26323
HTML 13 29 203 330
-------------------------------------------------------------------------------
SUM: 286 6455 31306 26653
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/commons-fileupload-1.2.1-sources.jar
35 text files.
classified 35 files
35 unique files.
3 files ignored.

Processed in T=1.0 s (32.0 files/s, 6230.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 27 655 3333 1967
HTML 5 13 75 187
-------------------------------------------------------------------------------
SUM: 32 668 3408 2154
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/commons-io-1.3.2-sources.jar
65 text files.
classified 65 files
63 unique files.
5 files ignored.

Processed in T=1.0 s (60.0 files/s, 12924.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 55 951 7295 4406
HTML 5 18 70 184
-------------------------------------------------------------------------------
SUM: 60 969 7365 4590
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/commons-lang-2.5-sources.jar
99 text files.
classified 99 files
99 unique files.
3 files ignored.

Processed in T=4.0 s (24.0 files/s, 13909.5 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 85 3502 32390 19394
HTML 11 32 158 162
-------------------------------------------------------------------------------
SUM: 96 3534 32548 19556
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/commons-logging-1.1.1-sources.jar
20 text files.
classified 20 files
20 unique files.
3 files ignored.

Processed in T=1.0 s (17.0 files/s, 7253.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 14 944 3317 2680
HTML 3 55 42 215
-------------------------------------------------------------------------------
SUM: 17 999 3359 2895
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/dom4j-1.6.1-sources.jar
100 files
179 text files.
classified 179 files
Duplicate file check 179 files (177 known unique)
Unique: 100 files
179 unique files.
Counting: 100
0 files ignored.

Processed in T=3.0 s (59.7 files/s, 14334.3 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 166 6134 18875 17854
HTML 13 30 0 110
-------------------------------------------------------------------------------
SUM: 179 6164 18875 17964
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...

{SCRIPT} Counting source ./target/sources/dwr-1.1.3-sources.jar
'DWR, or Direct Web Remoting, is a Java open source library that helps developers write web sites that include Ajax technology'
http://en.wikipedia.org/wiki/DWR_(Java)

100 files
120 text files.
classified 120 files
Duplicate file check 120 files (111 known unique)
Unique: 100 files
112 unique files.
Counting: 100
6 files ignored.

Processed in T=2.0 s (54.0 files/s, 9812.5 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 86 1764 5345 8157
Javascript 8 312 518 2251
HTML 8 118 4 766
XML 3 33 11 149
DTD 1 12 90 54
JSP 1 4 2 17
CSS 1 5 0 13
-------------------------------------------------------------------------------
SUM: 108 2248 5970 11407
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/freemarker-2.3.15-sources.jar
100 files
200 files
300 files
309 text files.
classified 309 files
Duplicate file check 309 files (306 known unique)
Unique: 100 files
Unique: 200 files
Unique: 300 files
309 unique files.
Counting: 100
Counting: 200
Counting: 300
4 files ignored.

Processed in T=5.0 s (61.0 files/s, 14335.2 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 283 4753 19554 40884
XSD 4 876 83 3006
DTD 4 594 1368 395
HTML 14 12 0 151
-------------------------------------------------------------------------------
SUM: 305 6235 21005 44436
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/google-collections-1.0-sources.jar
100 files
133 text files.
classified 132 files
Duplicate file check 132 files (130 known unique)
Unique: 100 files
132 unique files.
Counting: 100
2 files ignored.

Processed in T=3.0 s (43.7 files/s, 10706.7 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 131 3628 12159 16333
-------------------------------------------------------------------------------
SUM: 131 3628 12159 16333
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/guice-1.0-sources.jar
95 text files.
classified 95 files
95 unique files.
1 file ignored.

Processed in T=1.0 s (94.0 files/s, 9094.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 94 1242 3174 4678
-------------------------------------------------------------------------------
SUM: 94 1242 3174 4678
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/hibernate-core-3.5.1-Final-sources.jar
'Hibernate an open source Java persistence framework project'

100 files
200 files
300 files
400 files
500 files
600 files
700 files
800 files
900 files
1000 files
1100 files
1200 files
1287 text files.
classified 1287 files
Duplicate file check 1287 files (1151 known unique)
Unique: 100 files
Unique: 200 files
Unique: 300 files
Unique: 400 files
Unique: 500 files
Unique: 600 files
Unique: 700 files
Unique: 800 files
Unique: 900 files
Unique: 1000 files
Unique: 1100 files
1287 unique files.
Counting: 100
Counting: 200
Counting: 300
Counting: 400
Counting: 500
Counting: 600
Counting: 700
Counting: 800
Counting: 900
Counting: 1000
Counting: 1100
Counting: 1200
13 files ignored.

Processed in T=20.0 s (63.7 files/s, 10976.5 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 1221 24633 66087 125761
DTD 2 141 177 804
HTML 50 51 1199 563
XML 1 0 0 115
-------------------------------------------------------------------------------
SUM: 1274 24825 67463 127243
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/jaxen-1.1-beta-8-sources.jar
100 files
200 files
300 files
358 text files.
classified 358 files
Duplicate file check 358 files (341 known unique)
Unique: 100 files
Unique: 200 files
Unique: 300 files
358 unique files.
Counting: 100
Counting: 200
Counting: 300
6 files ignored.

Processed in T=6.0 s (58.7 files/s, 10097.3 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 297 5796 24262 19991
XML 34 1398 118 7706
XSLT 3 240 22 631
HTML 16 24 0 245
CSS 2 20 7 124
-------------------------------------------------------------------------------
SUM: 352 7478 24409 28697
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/jcodings-1.0.4-sources.jar
79 text files.
classified 79 files
79 unique files.
1 file ignored.

Processed in T=2.0 s (39.0 files/s, 11206.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 78 1136 1823 19453
-------------------------------------------------------------------------------
SUM: 78 1136 1823 19453
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/jdom-1.0-sources.jar
68 text files.
classified 68 files
68 unique files.
0 files ignored.

Processed in T=2.0 s (34.0 files/s, 11144.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 61 2737 11121 8362
HTML 7 17 0 51
-------------------------------------------------------------------------------
SUM: 68 2754 11121 8413
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/jetty-6.1.4-sources.jar
100 files
138 text files.
classified 138 files
Duplicate file check 138 files (138 known unique)
Unique: 100 files
138 unique files.
Counting: 100
3 files ignored.

Processed in T=4.0 s (33.8 files/s, 11128.8 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 133 5336 10641 27878
XML 1 25 234 143
DTD 1 62 159 37
-------------------------------------------------------------------------------
SUM: 135 5423 11034 28058
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/jetty-management-6.1.4-sources.jar
32 text files.
classified 32 files
32 unique files.
26 files ignored.

Processed in T=1.0 s (6.0 files/s, 1165.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 6 150 148 867
-------------------------------------------------------------------------------
SUM: 6 150 148 867
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/jetty-util-6.1.4-sources.jar
46 text files.
classified 46 files
46 unique files.
1 file ignored.

Processed in T=2.0 s (22.5 files/s, 6007.5 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 45 1384 2713 7918
-------------------------------------------------------------------------------
SUM: 45 1384 2713 7918
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/jline-0.9.93-sources.jar
28 text files.
classified 28 files
28 unique files.
4 files ignored.

Processed in T=1.0 s (24.0 files/s, 5370.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 23 875 1816 2670
HTML 1 1 0 8
-------------------------------------------------------------------------------
SUM: 24 876 1816 2678
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/joda-time-1.6.2-sources.jar
100 files
177 text files.
classified 177 files
Duplicate file check 177 files (177 known unique)
Unique: 100 files
177 unique files.
Counting: 100
15 files ignored.

Processed in T=4.0 s (40.5 files/s, 16090.2 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 154 5562 32438 25916
HTML 8 47 96 302
-------------------------------------------------------------------------------
SUM: 162 5609 32534 26218
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/jta-1.1-sources.jar
18 text files.
classified 18 files
18 unique files.
0 files ignored.

Processed in T=0.5 s (36.0 files/s, 3730.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 18 179 1414 272
-------------------------------------------------------------------------------
SUM: 18 179 1414 272
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/junit-4.8.2-sources.jar
100 files
177 text files.
classified 177 files
Duplicate file check 177 files (172 known unique)
Unique: 100 files
177 unique files.
Counting: 100
2 files ignored.

Processed in T=1.0 s (175.0 files/s, 12067.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 175 1484 3810 6773
-------------------------------------------------------------------------------
SUM: 175 1484 3810 6773
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/log4j-1.2.16-sources.jar
100 files
200 files
227 text files.
classified 227 files
Duplicate file check 227 files (225 known unique)
Unique: 100 files
Unique: 200 files
227 unique files.
Counting: 100
Counting: 200
4 files ignored.

Processed in T=3.0 s (74.3 files/s, 14588.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 207 6233 16155 20630
HTML 15 107 220 182
DTD 1 50 52 135
-------------------------------------------------------------------------------
SUM: 223 6390 16427 20947
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/lucene-core-3.0.3-sources.jar
100 files
200 files
300 files
400 files
413 text files.
classified 413 files
Duplicate file check 413 files (397 known unique)
Unique: 100 files
Unique: 200 files
Unique: 300 files
413 unique files.
Counting: 100
Counting: 200
Counting: 300
Counting: 400
6 files ignored.

Processed in T=7.0 s (58.1 files/s, 12036.3 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 393 10089 26448 45840
HTML 14 159 220 1498
-------------------------------------------------------------------------------
SUM: 407 10248 26668 47338
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/mx4j-3.0.1-sources.jar
100 files
200 files
255 text files.
classified 255 files
Duplicate file check 255 files (249 known unique)
Unique: 100 files
Unique: 200 files
255 unique files.
Counting: 100
Counting: 200
0 files ignored.

Processed in T=5.0 s (51.0 files/s, 7246.2 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 255 4390 8040 23801
-------------------------------------------------------------------------------
SUM: 255 4390 8040 23801
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/mx4j-tools-3.0.1-sources.jar
100 files
200 files
299 text files.
classified 299 files
Duplicate file check 299 files (269 known unique)
Unique: 100 files
Unique: 200 files
298 unique files.
Counting: 100
Counting: 200
6 files ignored.

Processed in T=4.0 s (73.2 files/s, 6849.8 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 264 3254 4826 14781
XSLT 25 269 268 3141
XML 1 23 3 197
CSS 1 248 17 171
Python 2 38 54 109
-------------------------------------------------------------------------------
SUM: 293 3832 5168 18399
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/ognl-2.7.3-sources.jar
100 files
125 text files.
classified 125 files
Duplicate file check 125 files (123 known unique)
Unique: 100 files
125 unique files.
Counting: 100
3 files ignored.

Processed in T=2.0 s (61.0 files/s, 12465.5 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 121 2881 6056 15942
HTML 1 7 27 18
-------------------------------------------------------------------------------
SUM: 122 2888 6083 15960
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/servlet-api-2.5-6.1.4-sources.jar
66 text files.
classified 66 files
64 unique files.
3 files ignored.

Processed in T=2.0 s (30.5 files/s, 11085.5 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
XSD 12 1740 273 7382
Java 40 1855 6171 1522
DTD 7 714 1580 888
HTML 2 14 10 22
-------------------------------------------------------------------------------
SUM: 61 4323 8034 9814
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/slf4j-api-1.5.8-sources.jar
29 text files.
classified 29 files
29 unique files.
1 file ignored.

Processed in T=1.0 s (28.0 files/s, 3536.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 24 429 1921 1129
HTML 4 21 0 36
-------------------------------------------------------------------------------
SUM: 28 450 1921 1165
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/slf4j-log4j12-1.5.8-sources.jar
7 text files.
classified 7 files
7 unique files.
1 file ignored.

Processed in T=1.0 s (6.0 files/s, 952.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 6 88 539 325
-------------------------------------------------------------------------------
SUM: 6 88 539 325
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/spring-2.5.6-sources.jar
100 files
200 files
300 files
400 files
500 files
600 files
700 files
800 files
900 files
1000 files
1100 files
1200 files
1300 files
1400 files
1500 files
1600 files
1700 files
1800 files
1828 text files.
classified 1828 files
Duplicate file check 1828 files (1585 known unique)
Unique: 100 files
Unique: 200 files
Unique: 300 files
Unique: 400 files
Unique: 500 files
Unique: 600 files
Unique: 700 files
Unique: 800 files
Unique: 900 files
Unique: 1000 files
Unique: 1100 files
Unique: 1200 files
Unique: 1300 files
Unique: 1400 files
Unique: 1500 files
1828 unique files.
Counting: 100
Counting: 200
Counting: 300
Counting: 400
Counting: 500
Counting: 600
Counting: 700
Counting: 800
Counting: 900
Counting: 1000
Counting: 1100
Counting: 1200
Counting: 1300
Counting: 1400
Counting: 1500
Counting: 1600
Counting: 1700
Counting: 1800
7 files ignored.

Processed in T=33.0 s (55.2 files/s, 7566.3 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 1621 29314 112564 98876
XSD 16 342 27 5338
HTML 179 411 0 1294
XML 3 13 15 210
DTD 2 241 845 199
-------------------------------------------------------------------------------
SUM: 1821 30321 113451 105917
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/spring-aop-2.5.6-sources.jar
100 files
200 files
209 text files.
classified 209 files
Duplicate file check 209 files (205 known unique)
Unique: 100 files
Unique: 200 files
209 unique files.
Counting: 100
Counting: 200
4 files ignored.

Processed in T=2.0 s (102.5 files/s, 12089.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 188 3231 9950 10029
XSD 2 39 2 755
HTML 15 41 0 131
-------------------------------------------------------------------------------
SUM: 205 3311 9952 10915
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/spring-beans-2.5.6-sources.jar
100 files
200 files
278 text files.
classified 278 files
Duplicate file check 278 files (270 known unique)
Unique: 100 files
Unique: 200 files
278 unique files.
Counting: 100
Counting: 200
4 files ignored.

Processed in T=3.0 s (91.3 files/s, 14521.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 251 4605 17594 17150
XSD 6 188 21 2584
DTD 2 241 845 199
HTML 15 36 0 100
-------------------------------------------------------------------------------
SUM: 274 5070 18460 20033
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/spring-core-2.5.6-sources.jar
100 files
162 text files.
classified 162 files
Duplicate file check 162 files (158 known unique)
Unique: 100 files
162 unique files.
Counting: 100
2 files ignored.

Processed in T=2.0 s (80.0 files/s, 10894.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 144 2363 10067 9236
HTML 16 32 0 90
-------------------------------------------------------------------------------
SUM: 160 2395 10067 9326
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/spring-test-2.5.6-sources.jar
100 files
107 text files.
classified 107 files
Duplicate file check 107 files (104 known unique)
Unique: 100 files
107 unique files.
Counting: 100
2 files ignored.

Processed in T=1.0 s (105.0 files/s, 15359.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 90 2107 6128 6979
HTML 15 35 0 110
-------------------------------------------------------------------------------
SUM: 105 2142 6128 7089
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/struts2-core-2.1.8-sources.jar
100 files
200 files
300 files
400 files
500 files
563 text files.
classified 563 files
Duplicate file check 563 files (481 known unique)
Unique: 100 files
Unique: 200 files
Unique: 300 files
Unique: 400 files
561 unique files.
Counting: 100
Counting: 200
Counting: 300
Counting: 400
Counting: 500
166 files ignored.

Processed in T=5.0 s (79.4 files/s, 9522.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 366 6620 17838 20914
Javascript 7 79 148 698
DTD 3 74 93 268
XML 1 41 56 221
HTML 16 3 352 62
CSS 4 4 81 58
-------------------------------------------------------------------------------
SUM: 397 6821 18568 22221
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/wicket-1.4.15-sources.jar
100 files
200 files
300 files
400 files
500 files
600 files
700 files
800 files
900 files
965 text files.
classified 965 files
Duplicate file check 965 files (896 known unique)
Unique: 100 files
Unique: 200 files
Unique: 300 files
Unique: 400 files
Unique: 500 files
Unique: 600 files
Unique: 700 files
Unique: 800 files
963 unique files.
Counting: 100
Counting: 200
Counting: 300
Counting: 400
Counting: 500
Counting: 600
Counting: 700
Counting: 800
Counting: 900
45 files ignored.

Processed in T=14.0 s (65.7 files/s, 13348.6 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 826 16752 78673 85378
Javascript 6 506 612 2095
HTML 83 172 1249 1139
CSS 1 21 16 99
XML 4 21 57 91
-------------------------------------------------------------------------------
SUM: 920 17472 80607 88802
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/xalan-2.7.0-sources.jar
100 files
200 files
300 files
400 files
500 files
600 files
700 files
800 files
900 files
946 text files.
classified 946 files
Duplicate file check 946 files (896 known unique)
Unique: 100 files
Unique: 200 files
Unique: 300 files
Unique: 400 files
Unique: 500 files
Unique: 600 files
Unique: 700 files
Unique: 800 files
946 unique files.
Counting: 100
Counting: 200
Counting: 300
Counting: 400
Counting: 500
Counting: 600
Counting: 700
Counting: 800
Counting: 900
19 files ignored.

Processed in T=28.0 s (33.1 files/s, 12432.5 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 906 51376 135087 161008
HTML 21 48 335 257
-------------------------------------------------------------------------------
SUM: 927 51424 135422 161265
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/xercesImpl-2.6.2-sources.jar
100 files
200 files
300 files
400 files
500 files
600 files
668 text files.
classified 668 files
Duplicate file check 668 files (628 known unique)
Unique: 100 files
Unique: 200 files
Unique: 300 files
Unique: 400 files
Unique: 500 files
Unique: 600 files
667 unique files.
Counting: 100
Counting: 200
Counting: 300
Counting: 400
Counting: 500
Counting: 600
17 files ignored.

Processed in T=15.0 s (43.4 files/s, 13456.3 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 651 21715 93608 86521
-------------------------------------------------------------------------------
SUM: 651 21715 93608 86521
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/xml-apis-1.0.b2-sources.jar
100 files
177 text files.
classified 177 files
Duplicate file check 177 files (175 known unique)
Unique: 100 files
177 unique files.
Counting: 100
8 files ignored.

Processed in T=4.0 s (42.2 files/s, 10044.8 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 153 5269 17698 12855
DTD 4 699 811 2027
HTML 11 156 22 636
make 1 1 0 5
-------------------------------------------------------------------------------
SUM: 169 6125 18531 15523
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/xom-1.1-sources.jar
100 files
200 files
252 text files.
classified 252 files
Duplicate file check 252 files (249 known unique)
Unique: 100 files
Unique: 200 files
252 unique files.
Counting: 100
Counting: 200
0 files ignored.

Processed in T=6.0 s (42.0 files/s, 13381.2 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 243 13507 17243 49086
HTML 9 103 166 182
-------------------------------------------------------------------------------
SUM: 252 13610 17409 49268
-------------------------------------------------------------------------------
NEXT PROJECT PROCESSED ON NEXT LINE...
{SCRIPT} Counting source ./target/sources/xwork-core-2.1.6-sources.jar
100 files
200 files
300 files
340 text files.
classified 340 files
Duplicate file check 340 files (331 known unique)
Unique: 100 files
Unique: 200 files
Unique: 300 files
340 unique files.
Counting: 100
Counting: 200
Counting: 300
2 files ignored.

Processed in T=3.0 s (112.7 files/s, 14907.3 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 303 5847 16295 21520
DTD 12 206 94 628
XML 2 15 14 61
HTML 21 1 0 41
-------------------------------------------------------------------------------
SUM: 338 6069 16403 22250
-------------------------------------------------------------------------------

Saturday, March 12, 2011

First example EVER on GTK and Haskell, Render Primitives


I give you the first example on the Internet, rendering a primitive, point and rectangle. Next, double buffering.

-- The Glorious Glasgow Haskell Compilation System, version 6.12.3
-- ghc --make SimpleCells.hs
-- See: http://code.google.com/p/ainotebook/
--
-- Berlin Brown

import Graphics.UI.Gtk
import Graphics.UI.Gtk.Gdk.GC
import Graphics.UI.Gtk hiding (Color, Point, Object)

defaultFgColor :: Color
defaultFgColor = Color 65535 65535 65535

defaultBgColor :: Color
defaultBgColor = Color 0 0 0

renderScene d ev = do
dw <- widgetGetDrawWindow d
(w, h) <- widgetGetSize d
gc <- gcNew dw
let fg = Color (round (65535 * 205))
(round (65535 * 0))
(round (65535 * 0))
gcSetValues gc $ newGCValues { foreground = fg }
drawPoint dw gc (120, 120)
drawPoint dw gc (22, 22)
drawRectangle dw gc True 20 20 20 20
return True

main :: IO ()
main = do
initGUI
window <- windowNew
drawing <- drawingAreaNew
windowSetTitle window "Cells"
containerAdd window drawing
let bg = Color (round (65535 * 205))
(round (65535 * 205))
(round (65535 * 255))
widgetModifyBg drawing StateNormal bg
onExpose drawing (renderScene drawing)

onDestroy window mainQuit
windowSetDefaultSize window 800 600
windowSetPosition window WinPosCenter
widgetShowAll window
mainGUI

-- End of File

Friday, March 11, 2011

NOTES: Web Application Development Sucks (or at least frustrating)

I have been wanting to write this for a while, I believe ever since I started web development more than 15 years ago. Web Application Development is pretty frustrating mostly because of issues with the foundation technologies, HTML, CSS and JavaScript. Alone, they are pretty harmless and quite useful but when mixed together they seemed to step over their intended roles (CSS is pretty useless in a self-contained environment). The original intent of websites seemed to involve easily publishing text documents so that others could view information online. The documents also would have functionality to link to other documents. There you have a web of documents. The web of the mid-nineties was functional and didn't seem so bad. In 2011 so many features have been piled on top of past technology and now we are just left with this big pile of mud. Most content online is for presenting text information, like news reports or stock quotes, business profiles. But now businesses are putting their entire applications online in a publicly accessibly way. All you need is a username and password and you are granted access to the business site portal. So what is the problem? Well, we we went from online published text documents to business web applications like online banking website or shopping carts. On top of the web standards groups decided that business applications aren't enough, we need graphics and video streaming and whatever else. All of this is kind of clumped together with the HTML document format.

What is the issue?

A typical HTML document has a declarative format. You include a mix of your text and the formatting associated with that text. If you want to add bold formatting to a piece of text, then add the bold wrapper tags. [b]TEXT I WANT AS BOLD[/b] And the rendered output of that text has a bolder text. Simple. And a full HTML document is equally as a intuitive. Add the [HTML] tag to begin a document. [HEAD] for the header, meta information, BODY tag and then the text content itself.

The problem comes in when you want to start building web applications. Compare a responsive desktop application with a similar web-application. JavaScript, the language is a powerful general purpose programming language. I just have issue with the hybrid mix of HTML for content, JavaScript for handling user events and CSS for styling. There seems to be too much overlap between the three technologies and too much unexpected behavior when you want to do complex tasks. If you want to show or hide a section of the HTML content when you hover over a link. There is an approach you can use with CSS, there is an approach you can use with JavaScript. I don't really understand why CSS should be used to interpret mouse and hover events but apparently it has that capability.

There are overlapping concerns and no real consistent way to handle the overlap. The behavior also varies from browser to browser. The developer has to worry about too many different side-effects that can occur from inconsistent page layouts and where JavaScript is placed, how it is included, possibly when the JavaScript is interpreted by the browser. The environment surrounding HTML, CSS and JavaScript is very error-prone.

My Solution

I am very much in favor compiled languages, possibly translated into some form of vm bytecode. Let the HTML/CSS/JavaScript compiler catch common errors before the code is deployed to a server. This is similar to the approach that Google's GWT Compiler uses.

Haskell GTK on Windows (part 2)

Updated Blog Entry

There seems to be some issues with the documentation as it relates to install GTK and Haskell (at least at present). There are two steps that need to be highlighted if they aren't already.

Task-Remove Install Paths with Spaces:

GTK has an windows installer like most windows apps and normally you would install the application/library to C:/Program[SPACE]Files/GTK[PLUS-SIGN]. Don't do that. The default install of GTK haskell win32 did not seem to work. I recommend the simple:

Install to: C:/gtk

Task-Setup mingw/bin in your PATH env:

Also, you may need to use the mingw install that comes with the haskell platform. Navigate to Haskell Platform/mingw/bin and copy that path and add it to your PATH environment variable setting.

Before doing this, you may see errors, cpp.exe is not found or other such compile errors. Adding mingw adds some of those compiler tools.

Optional

The glade/gtk bundle install to C:/gtk may not have all the dev libraries that you need. Install the bundle first and then visit the gtk site and download the gtk dev packages. Unzip and overwrite to the C:/gtk directory.

Run 'cabal install gtk' again...

More information:

C:\Documents and Settings\Usr Berlin]echo %PATH%
C:\Program Files\Gtk+\bin;C:\Program Files\Haskell\bin;C:\Program Files\Haskell
Platform\2010.2.0.0\lib\extralibs\bin;C:\Program Files\Haskell Platform\2010.2.0
.0\bin; ... and other stuff

C:\Documents and Settings\Usr Berlin>echo %PKG_CONFIG_PATH%
C:\Program Files\Gtk+\lib\pkgconfig;C:\Program Files\Gtk+\include\libglade-2.0;C
:\Program Files\libxml2\libxml2-dev_2.7.7-1_win32\lib\pkgconfig


C:\Documents and Settings\Usr Berlin>echo %INCLUDE%
C:\Program Files\Gtk+\include;C:\Program Files\libxml2\libxml2-dev_2.7.7-1_win32
\include;C:\Program Files\Gtk+\include\libglade-2.0;C:\Program Files\Gtk+\includ
e

C:\Documents and Settings\Usr Berlin]pkg-config.exe --modversion gtk+-2.0
2.16.2

C:\Documents and Settings\Usr Berlin]pkg-config --cflags gtk+-2.0
Files/Gtk+/include/gtk-2.0 -mms-bitfields Files/Gtk+/lib/gtk-2.0/include Files/G
tk+/include/atk-1.0 Files/Gtk+/include/cairo Files/Gtk+/include/pango-1.0 Files/
Gtk+/include/glib-2.0 Files/Gtk+/lib/glib-2.0/include Files/Gtk+/include/libpng1
2 -IC:/Program

C:\Documents and Settings\Usr Berlin]cabal update
Downloading the latest package list from hackage.haskell.org

C:\Documents and Settings\Usr Berlin]cabal install gtk

GTK versions

The GTK version is important. I installed the glade bundle (glade3/3.6/glade3-3.6.7-with-GTK+.exe) but I also downloaded the (gtk+/2.16/gtk+-bundle_2.16.6-20100912_win32.zip) zip file and unpacked, unpacked that archive to the c:/gtk directory. Note, I am installing everything GTK to the c:/gtk directory as opposed to Program Files directory.

Edit: if you have issues with glib.h not being found.

Run 'cabal install -v'. Add the -v verbose flag enable more verbose logging during the compile. You may see that glib.h is not found. I didn't pick a clean solution, I simply just copied the 'glib-2.0' directory (contains the glib.h header file) into the glib-2.0 directory. So you will have:

C:\gtk\include\glib-2.0\glib-2.0

Edit-2:
I ran 'cabal install glade' and got an error trying to install. I searched the mailing list for a solution.

Navigate to the pkgconfig directory and open the libglade pc file:

C:\gtk\lib\pkgconfig\libglade-2.0.pc

Requires: gtk+-2.0 libxml-2.0

Comment out the line with gtk+-2.0... and ensure that the line only has:

Requires: gtk+-2.0

Hopefully, that will resolve compile issues with glade.

GHC Haskell version: ghc-6.12.3

Summary

You may have issues with the wiki documentation on building with GTK under windows. Start with installing GTK to a directory that does not include spaces or non-alphanumeric characters. Setup your PATH to point to a the Haskell/mingw/bin directory to pick up the mingw compiler tools. Setup the PATH, INCLUDE, PKG_CONFIG... environment variables (these should be correct in the wiki document). Check your glib.h file and make sure it is included (maybe setup glib-2.0/glib-2.0/*.h, glib.h). For glade (cabal install glade), modify the libglade-2.0.pc configuration.

Resources

[1] http://www.haskell.org/haskellwiki/Gtk2Hs

Example Hello World Source (ghc --make Hello.hs)
import Graphics.UI.Gtk
main = do
initGUI
window <- windowNew
widgetShowAll window
mainGUI