Subscribe to RSS

Some rights reserved

Except where otherwise noted, content on this site is licensed under a Creative Commons License


blog

WordReference Java Library

posted Aug 7, 2011 4:13 AM by Davide Angelocola

Check it out: https://bitbucket.org/dfa/wr

It features also a command line client.

Dollar 1-0-alpha2

posted Jul 18, 2010 2:56 AM by Davide Angelocola   [ updated Jul 18, 2010 4:17 AM ]

A new version of dollar is out. Major changes:
  • defined a contract: copyiteratorequals and hashCode
  • copy() for ListWrapper, SetWrapper and MapWrapper always returns a new object 
  • improved generics usage
  • improved internal design (e.g. OCP violations)
  • removed TODO exceptions
  • countless bugfixes 

Javadoc is still missing, maybe you can contribute it? :-)

Dollar 1.0-alpha1 is out

posted Jun 30, 2010 3:19 AM by Davide Angelocola   [ updated Jun 30, 2010 3:49 AM ]

After spending a week fixing  bugs I've decided to tag revision 2b48f56e7c75 as 1.0-alpha1

Furthermore all wrappers now are well tested using JUnit Theories. You may find useful the ObjectTester class.

First Dollar review

posted Jun 1, 2010 9:54 AM by Davide Angelocola

"An experimental Java API that shows how much you can bend the Java syntax to suit your personal taste. Through inspiration by this project I’ve come to some unique ways to make my code more expressive – without using funny signs. Thanks to Davide Angelocola for his unique approach."


My new laptop: Asus UL30A

posted Mar 31, 2010 4:58 AM by Davide Angelocola   [ updated Jun 30, 2010 3:19 AM ]

PROs
  • looooong battery life, about 10 hours
  • light (1.5 Kg)
  • very small power supply, compared to my old one 
  • easy to use keyboard
  • 4 GB DDR3 ram
  • wifi N with a very good antenna
  • cool palm rest
CONs
  • glossy display
  • too many sticks :-(
  • noisy and slow hard disk (Update: I've just replaced  it with Intel X-25V, zero noise)

Learning JSR 299

posted Mar 19, 2010 11:24 AM by Davide Angelocola   [ updated Mar 19, 2010 1:41 PM ]

Since I'm taking a break from my master thesis, IA and JavaScript these days I'm studying JSR-299, the Java Contexts and Dependency Injection. CDI is the new Java standard for dependency injection and contextual lifecycle management that I was excited some time .

During this learn process I've done some experiments with Weld, the reference implementation of JSR 299. Today I've published two experiments on bitbucket.org, feel free to use it as you want :-)


@ApplicationScoped
public class RandomNumberGenerator {

    private Random random = new Random(System.currentTimeMillis());

    @Produces
    @RandomInt
    @Named
    public int getRandomInteger() {
        return random.nextInt(100);
    }
}

Please note the new main, it is very elegant:

@ApplicationScoped
public class Consumer {

    @Inject
    @RandomInt
    int random;

    @Inject
    @Parameters
    List<String> parameters; // the String[] args for your main 

    // listen for container event "Initialized"
    public void main(@Observes ContainerInitialized event) {
        System.out.println("I'm a random number " + random);
    }
}

Whereas the second project is a simple MVC framework based on JSR-311 (with Jersey as implementation) and, of course, weld-servlet.

pure Javascript Poisson Process Simulator

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:

In the case you care clone the mercurial repository at bitbucket.

2010: the year of HTML5?

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. 

strtotime for Java5

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"); 


RhinoRunner

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 {
}

1-10 of 38