Posts

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 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 else summation' x (y...

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