posted Feb 6, 2010 6:10 AM by Davide Angelocola
[
updated Mar 7, 2010 8:39 AM
]
One of my last courses for my master degree in Computer Science is about the Poisson Process and Markov's Chains. As my passion for programming devolves I've implemented two Poisson Process simulators using flot (and thus jQuery) and LambdaScript, a functional Javascript library that I'm slowly evolving:
|
posted Feb 2, 2010 1:22 AM by Davide Angelocola
[
updated Feb 2, 2010 1:37 AM
]
Today Google send us a very informative mail about their plans for 2010:
"In order to continue to improve our products and deliver more sophisticated features and performance, we are harnessing some of the latest improvements in web browser technology. This includes faster JavaScript processing and new standards like HTML5. As a result, over the course of 2010, we will be phasing out support for Microsoft Internet Explorer 6.0 as well as other older browsers that are not supported by their own manufacturers."
Also Apple said that they will support HTML5 in place of flash. Recently, Microsoft has been engaging more and more with the HTML 5 community.
Is this the year of HTML5? I don't know but I'm already in charge reading Dive Into HTML5 in my free spare time. |
posted Jan 12, 2010 4:22 PM by Davide Angelocola
[
updated Jan 27, 2010 8:15 AM
]
About five months ago I've answered this question on stackoverflow. Then I've created a project on bitbucket. Feel free to browse the source, send patches, write documentation, and please contribute whatever you can do make it better for everyone.
Examples import static com.humaorie.strtotime.strtotime.*;
Date now = strtotime("now"); Date yesterday = strtotime("yesterday"); Date dayBeforeYesterday = strtotime("2 days");
|
posted Dec 26, 2009 4:08 PM by Davide Angelocola
[
updated Dec 27, 2009 4:14 AM
]
During my thesis work I'm slowly creating a very small functional JavaScript library. I write a lot of JavaScript these days and I write many bugs too. I want a nice integration with my IDE of choices for running unit tests for JS (no, HTML with tests inside is not a viable solution for me):
Leveraring JUnit's API I created a very simple RhinoRunner. It is very simple to use, yet not perfect:
import org.junit.runner.RunWith;
@RunWith(RhinoRunner.class) @JavaScriptSourceFile("src/test/javascript/LambdaScriptTest.js") public class LambdaScriptTest { }
|
posted Nov 30, 2009 3:55 PM by Davide Angelocola
[
updated Dec 27, 2009 3:49 AM
]
I'm very excited about these news JSRs: and about these new versions (in preview as time of writing) of my Java toolchain: - Netbeans 6.8
- maven 3.0
- Glassfish v3 (JBoss AS 6 too)
|
posted Nov 24, 2009 6:31 AM by Davide Angelocola
[
updated Dec 26, 2009 4:40 PM
]
Today I need a way to quickly generate the n-th square, iteratively. I'm wondering about several naive approaches, all involving at least one multiplication. Maybe we can try an alternative approach based on these results:
1 = 1 (the square of 1)
1 + 3 = 4 (the square of 2)
1 + 3 + 5 = 4 + 5 = 9 (the square of 3)
1 + 3 + 5 + 7 = 9 + 7 = 16 (the square of 4)
It is clear now that the sum of the first n odd itegers is n2. The proof is left to thes an exercise for the reader. I used this simple observation to write an iterator that uses no multiplications, only additions:
public class SquaresIterator implements Iterator<Integer>, Iterable<Integer> {
private int square = 0;
private int nextOdd = 1;
@Override
public boolean hasNext() {
return true;
}
@Override
public Integer next() {
square += nextOdd;
nextOdd += 2;
return square;
}
@Override
public void remove() {
throw new UnsupportedOperationException("Not supported.");
}
@Override
public Iterator<Integer> iterator() {
return this;
}
}
the testcase:
for (int square : new SquaresIterator()) { System.out.println(square); }
print:
|
posted Nov 11, 2009 10:03 AM by Davide Angelocola
[
updated Nov 22, 2009 1:49 AM
]
I've just terminated migration to bitbucket.org.
I lost some perl scripts and boehm gc sample programs during migration but I hope to restore them somehow. However most of the publishable code that I produced since 2004 is there, ready to be cloned :-)
|
posted Oct 29, 2009 3:32 AM by Davide Angelocola
[
updated Nov 24, 2009 7:23 AM
]
"Unlike traditional resumes, a Stack Overflow CV gives hiring managers insight into a developer’s real work and skills instead of just a list of acronyms."
|
posted Oct 11, 2009 2:53 PM by Davide Angelocola
[
updated Oct 11, 2009 3:02 PM
]
A quick hack in Java, it comes handy when supporting old Java code (pre Java 5, where Closeable is missing):
public static void universalClose(Object o) { try { o.getClass().getMethod("close", null).invoke(o, null); } catch (Exception e) { throw new IllegalArgumentException("no close() method"); } } testcase: public static void main(String[] args) { Socket socket = new Socket(); universalClose(socket); } |
posted Oct 9, 2009 10:44 AM by Davide Angelocola
[
updated Mar 7, 2010 8:42 AM
]
I've been using Mercurial, a distributed revision control tool, for a few months now and it has changed the way I work since it is practical, simple, discoverable and well documented.
In the past I was managing a server of my own, with manual backups on Amazon S3, but it was very time consuming: bitbucket comes to the rescue acting as mercurial hosting service as well as backup service. It integrates a wiki, a simple but effective bug management tool and some "social network" features like follow and patch queue. |
|