Posts

Showing posts from 2011

Building the OpenJDK on Linux x86 with logs

Some have had difficulty building the OpenJDK. The OpenJDK build system is designed for different operating system platforms, different architectures, and different host configurations so there are some steps that aren't entirely intuitive. Here is a full listing of the commands I used to build on x86 Linux. Ubuntu 10.04 as of June 2011. sudo apt-get install gawk alsa alsa-base alsa-utils alsa-tools libasound2-dev sudo apt-get install libx11-dev libxt-dev x11proto-xext-dev libxext-dev x11proto-input-dev libxi-dev sudo apt-get install libxtst-dev libmotif-dev xutils-dev libfreetype6-dev sudo apt-get install libcups2-dev ant g++ libxrender-dev libfreetype6 libfreetype6-dev freetype2-demos sudo apt-get install x11proto-print-dev # Run these at the command line: export LANG=C export ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk export ALT_JDK_IMPORT_PATH=$ALT_BOOTDIR export ALLOW_DOWNLOADS=true make sanity make Using OpenJDK version: openjdk-6-src-b22-28_feb_2011.tar.gz Additional Comman

Simple OpenJDK compiler build

If you are interested in a simple build for the open jdk compiler. See this mirror project: http://jvmnotebook.googlecode.com/svn/trunk/javac_compiler/JavaSource To build, type: mvn package To run the compile: mvn exec:java -e -Dexec.mainClass="berlin.com.sun.tools.javac.MainJavac" -Dexec.args="Test.java"

Basic Math : Basic Summation

Given the basic expression for summation: \[ \begin{align} \sum_{i=1}^n i \end{align} \] Calculating the scalar sum: 1 + 2 + 3 + 4 ... public class ScalarSum { public int sum(final f f, int j, int n) { int sum = 0; for (int index = j; index <= n; index++) { sum = sum + f.$(index); } return sum; } public interface f { public int $(final int x); } public static class Fx implements f { public int $(int x) { return x; } } public static class Fx2 implements f { public int $(int x) { return x*x; } } public static class Fx3 implements f { public int $(int x) { return x*x*x; } } } System.out.println("Sum: " + new ScalarSum().sum(new ScalarSum.Fx(), 1, 100)); With haskell: summation1 :: Integer -> Integer -> Integer summation1 x y = summation' x y 0 summation' :: Integer -> Integer -> Integer -> Integer summation' x y sum = if (y<x) then sum

MathJax Test - Looks like it is working

\[ \begin{align} \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}} {\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\ \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\ \nabla \cdot \vec{\mathbf{B}} & = 0 \end{align} \] \[ \begin{align} \sum_{k=0}^n a \end{align} \] \[ \displaystyle \sum_{j=1}^n a_j = \left({a_1 + a_2 + \cdots + a_n}\right) \] \[ \displaystyle \sum_{k=m}^n f_k \left({g_{k+1} - g_k}\right) = \left({f_{n+1} g_{n+1} - f_m g_m}\right) - \sum_{k=m}^n \left({f_{k+1}- f_k}\right) g_{k+1} \]

Functional Java Code

Minimalist blog on wordpress

http://berlinbrowndev.wordpress.com/

Stats on the hotspot java virtual machine, open jdk

Here are some notes, source code analysis of hotspot: # perl cloc-1.53.pl src 1786 text files. 1716 unique files. 121 files ignored. ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- C++ 673 64909 97522 340057 C/C++ Header 796 25928 49603 101144 XML 61 474 179 15360 Java 78 1908 2397 8663 C 11 1194 2327 7236 XSLT 7 560 166 4406 Assembly 6 89 36 2245 D 4 83

Thoughts of the day

Spring Framework is a general purpose framework with modules for inversion of control, aspect oriented programming and other features. Scala is programming language. Resources: http://www.scala-lang.org/

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; impor

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-cle

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 necessari

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.

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 u

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 62