Angel \”Java\” Lopez on Blog

January 5, 2016

New Month’s Resolutions: January 2016

Filed under: C Sharp, JavaScript, NodeJs, Open Source Projects — ajlopez @ 9:34 am

A new year started, it’s time to write the new month’s resolutions. But first, let review the past month’s ones:

– Prepare a FinTech-related talk [pending]
– Work on Husky [pending]
– Work on SharpGo [complete] see repo
– Improve AjGenesis for Node [complete] see repo
– Publish AjLispJava [pending]
– Work on Golin [pending]
– Work on RkModel [pending]
– Improve SimpleDT [complete] see repo

Additionally I was working on:

– Improving Memolap [complete] see repo
– Improving SimpleMemolap [complete] see repo
– Improving ElixirJS [complete] see repo
– Improving SimpleDatabase [complete] see repo
– Improving SimpleLisp [complete] see repo
– Starting SimpleTasks [complete] see repo
– Publishing a new version of SimpleAsync [complete] see repo
– Starting MoneyPool [complete] see repo
– Starting and Publishing MongoRepo [complete] see repo
– Refactoring SimpleGA and adding a new traders sample [complete] see repo
– Updating AjGenesisNode-Entity to a new version [complete] see repo
– Updating AjGenesisNode-Model to a new version [complete] see repo
– Updating AjGenesisNode-Express to a new version [complete] see repo
– Simplifying SimpleRules and adding a DSL [complete] see repo
– Improving OStore and publishing a new version [complete] see repo
– Adding JSON support to SimpleDSL [complete] see repo
– Adding recursive option to SimpleUnit [complete] see repo
– Starting BTraderLib [complete] see repo

A lot of work! My new month’s resolutions:

– Work on SimpleGA trader samples
– Work on SimpleDatabase
– Work on SimpleMemolap
– Work on Memolap
– Improve AjGenesisNode
– Improve SharpGo
– Improve Husky
– Work on GoLin

Stay tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

December 5, 2015

New Month’s Resolutions: December 2015

Filed under: C Sharp, Java, JavaScript, NodeJs, Open Source Projects — ajlopez @ 6:35 pm

The last month of the year have started. Time to review past month’s resolutions:

– Work on SJonT [partial] see repo
– Work on SparkSharp [complete] see repo
– Work on Husky [complete] see repo
– Work on MessiJS [pending]
– Work on ElixirJS [complete] see repo
– Work on GStones [pending]
– Work on SharpGo [complete] see repo
– Prepare a NodeJS one-day course [complete]
– Prepare a FinTech-related talk [partial]

Additionally, I worked on:

– Start MeliLib, access to Mercado Libre API using NodeJS [complete] see repo
– Start RkModel, reactive model [complete] see repo
– Start Golin, Lisp interpreter in Go [complete] see repo
– Improve AjGenesisNode-Express [complete] see repo
– Start Go samples [complete] see repo
– Improve AjGenesisNode-Entity [complete] see repo
– Improve AjGenesisNode-Model [complete] see repo
– Improve AjGenesisNode using SimpleJson [complete] see repo
– Start GccSamples [complete] see repo
– Improve SimpleJson [complete] see repo
– Improve AjLispJava [complete] see repo

My new month’s resolutions:

– Prepare a FinTech-related talk
– Work on Husky
– Work on SharpGo
– Improve AjGenesis for Node
– Publis AjLispJava
– Work on Golin
– Work on RkModel
– Improve SimpleDT

Stay tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

November 4, 2015

New Month’s Resolutions: November 2015

Filed under: C Sharp, JavaScript, NodeJs, Open Source Projects — ajlopez @ 8:48 am

A new month has started. Time to review the resolutions for previous month and write down the new ones.

– Work on Husky [complete] see repo
– Work on SimpleJson [complete] see repo
– Work on GStones [pending]
– Work on ErlSharp [pending]
– Work on ElixirJS [complete] see repo
– Work on OStore [pending]
– Work on SharpGo [pending]

Additionally I work on:

– Start SJsonT [complete] see repo
– Improve SparkSharp [complete] see repo
– Start MessiJS [complete] see repo

My new month’s resolutions:

– Work on SJonT
– Work on SparkSharp
– Work on Husky
– Work on MessiJS
– Work on ElixirJS
– Work on GStones
– Work on SharpGo
– Prepare a NodeJS one-day course
– Prepare a FinTech-related talk

Stay tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

October 5, 2015

New Month’s Resolutions: October 2015

Filed under: .NET, C Sharp, JavaScript, NodeJs, Open Source Projects — ajlopez @ 9:58 am

It’s a new month, time to write down the new resolutions, and to review the previous month ones:

– Work on ElixirJS [complete] see repo
– Work on ErlSharp [complete] see repo
– Work on MathelSharp [complete] see repo
– Work on MathelJS [complete] see repo
– Work on GStones [complete] see repo
– Work on OStore [pending]
– Work on SparkSharp [pending]

In addition, I worked on:

– Start Husky, Haskell-like interpreter in C# [complete] see repo
– Start SimpleJson, JSON model from many files [complete] see repo
– Improve SharpGo [complete] see repo

My new resolutions:

– Work on Husky
– Work on SimpleJson
– Work on GStones
– Work on ErlSharp
– Work on ElixirJS
– Work on OStore
– Work on SharpGo

Stay tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

September 5, 2015

New Month’s Resolutions: September 2015

Filed under: .NET, C Sharp, JavaScript, NodeJs, Open Source Projects — ajlopez @ 9:45 pm

The Spring season is near, at Southern Hemisphere. Time to write my new month’s resolutions, and to review past month ones:

– Work on MathelSharp [complete] see repo
– Work on SparkSharp [pending]
– Work on MathelJS [complete] see repo
– Work on Messi [pending]
– Work on renaming, refactor AjErl, to ErlSharp [complete] see repo
– Work on OStore [complete] see repo
– Work on DynApp [pending]

Additionally, I worked on:

– Start GStones, Gobstones language implementation in JavaScript [complete] see repo
– Improve SharpGo [complete] see repo
– Improve BScript [complete] see repo
– Work on ElixirJS [complete] see repo

My new month’s resolutions:

– Work on ElixirJS
– Work on ErlSharp
– Work on MathelSharp
– Work on MathelJS
– Work on GStones
– Work on OStore
– Work on SparkSharp

Stay tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

July 5, 2015

New Month’s Resolutions: July 2015

Filed under: C Sharp, JavaScript, Meteor, NodeJs, Open Source Projects — ajlopez @ 7:11 pm

A new month begins, and it’s time to write my new resolutions and review the previous ones:

– Give a talk about Meteor [complete] see presentation
– Write posts about JavaScript and Artificial Intelligence [pending]
– Improve ClojJS [pending]
– Add NPM support to ClojJS [pending]
– Continue work on SparkSharp [pending]
– Start Message project in C#, a la Apache Camel [complete] see repo 
– Improve Liqueed Project, kudos features [pending]
– Improve Templie, template engine in Java [pending]
– Improve BScript, Basic-like interpreter in C#[pending]
– Continue work on OStore [complete] see repo
– Continue work on SharpMongo [complete] see repo

Additionally, I worked on:

– Started ObjectChannel, object serialization in C# [complete] see repo
– Started Elixir samples [complete] see repo
– Give a talk about Machine Learning [complete] see presentation
– Started Elixir samples [complete] see repo
– Started NRiak, key-value store in JavaScript/NodeJS [complete] see repo

– Started Android samples [complete] see repo

This new month’s resolutions:

– Continue work on SparkSharp
– Continue work on BScript
– Continue work on DynApp
– Give a talk about TDD
– Continue work on SharpMongo
– Continue work on NRiak
– Continue work on Elixir samples
– Continue work on Android samples

Stay tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

June 4, 2015

New Month’s Resolutions: June 2015

Filed under: .NET, C Sharp, Java, JavaScript, Liqueed, NodeJs, Open Source Projects — ajlopez @ 9:48 am

It’s the time for review my May’s resolutions and write the new ones:

– Improve ClojJS [pending]
– Add NPM support to ClojJS [pending]
– Write posts about JavaScript and Artificial Intelligence [pending]
– Give a talk about Meteor [partial]
– Prepare a talk about Clojure or ClojureScript [partial]
– Improve BScript [pending]
– Improve AjErl, distributed features [partial] see repo
– Improve Liqueed Project, kudos features [complete] see repo

I also worked on:

– Start SparkSharp, Apache Spark-like in C# [complete] see repo
– Improve SharpMongo, MongoDB-like in C# [complete] see repo
– Improve OStore, object store in memory, JavaScript/NodeJS [complete] see repo
– Improve PythonSharp, Python interpreter in C# [complete] see repo
– Improve RedPython, compile Python to C using JavaScript/NodeJS [complete] see repo

My new month’s resolutions:

– Give a talk about Meteor
– Write posts about JavaScript and Artificial Intelligence
– Improve ClojJS
– Add NPM support to ClojJS
– Continue work on SparkSharp
– Start Message project in C#, a la Apache Camel
– Improve Liqueed Project, kudos features
– Improve Templie, template engine in Java
– Improve BScript, Basic-like interpreter in C#
– Continue work on OStore
– Continue work on SharpMongo

More fun is coming ;-)

Stay tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

May 5, 2015

New Month’s Resolutions: May 2015

Filed under: .NET, C Sharp, JavaScript, NodeJs, Open Source Projects — ajlopez @ 9:41 am

It’s the time for review my April’s resolutions and write the new ones:

– Write posts about JavaScript and Artificial Intelligence  [pending]
– Improve ClojJS [complete] see repo
– Add npm modules support to ClojJS [pending]
– Improve Chip8 emulator [pending]
– Improve BScript [complete] see repo

Additionally, I worked on:

– Improve AcquarellaJS, first operators in match dynamic object [complete] see repo
– Improve AjErl, refactor type utilities [complete] see repo
– Improve OStore, first operators in match [complete] see repo
– Improve SimpleLists, intersect operation [complete] see repo
– Improve MeteorSamples, using Windows version 1.1 [complete] see repo
– Participate in Google Code Jam, pre-round [complete] see repo
– Liqueed Project coding [complete] see repo
– Record Liqueed Project team programming session using TDD [complete] see post/video
– Write posts about Liqueed Project [complete] read English posts read Spanish posts

The new month’s resolutions are:

– Improve ClojJS
– Add NPM support to ClojJS
– Write posts about JavaScript and Artificial Intelligence
– Give a talk about Meteor
– Prepare a talk about Clojure or ClojureScript
– Improve BScript
– Improve AjErl, distributed features
– Improve Liqueed Project, kudos features

Stay tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

April 25, 2015

Liqueed Project (6)

Filed under: Express, JavaScript, Liqueed, NodeJs, Test-Driven Development — ajlopez @ 4:26 pm

Previous Post

Let review another tests from test/personapi.js in project:

https://github.com/liquid-co-ops/liqueed

There are API entrypoints that are called using PUT or POST. They receive data in the body of the sent message. Using Express middleware, that message (formatted as JSON) is analized, parsed and converted into a JavaScript object. That object resides in the body property of the received request parameter. As the API uses that field, we should provide it in the test. An example:

exports['login person'] = function (test) {
    test.async();
    
    var request = {
        body: {
            username: persons[1].username,
            password: persons[1].username
        }
    };

    var response = {
        send: function (model) {
            test.ok(model);
            test.equal(model.id, persons[1].id);
            test.equal(model.name, persons[1].name);
            test.equal(model.username, persons[1].username);
            
            test.done();
        }
    };
    
    controller.loginPerson(request, response);
};

As in the previous example, we use the send function in the response object, to check the result.

Another example, sending not only the body but also sending parameters:

exports['change password first person'] = function (test) {
    test.async();
    
    var request = {
		params : {
			id : persons[0].id.toString()
		},
        body: {
            password: 'new' + persons[0].username
        }
    };

    async()
    .then(function (data, next) {
        var response = {
            send: function (model) {
                test.ok(model);
                test.strictEqual(model, true);
                
                next(null, null);
            }
        };
        
        controller.updatePassword(request, response);
    })
    .then(function (data, next) {
        var request = {
            body: {
                username: persons[0].username,
                password: 'new' + persons[0].username
            }
        };

        var response = {
            send: function (model) {
                test.ok(model);
                test.equal(model.id, persons[0].id);
                test.equal(model.name, persons[0].name);
                test.equal(model.username, persons[0].username);
                
                test.done();
            }
        };
        
        controller.loginPerson(request, response);
    })
    .run();
};
 

Next posts: MVC controller actions tests, tests launching the HTTP server, tests using a DSL (Domain-Specific Language)

Stay tuned!

Angel “Java” Lopez

http://www.ajlopez.com

http://twitter.com/ajlopez

April 20, 2015

Liqueed Project (5)

Filed under: Express, Liqueed, NodeJs, Test-Driven Development — ajlopez @ 5:38 pm

Previous Post  
Next Post

Let review two more tests from test/personapi.js. The second test is actually:

exports['get persons'] = function (test) {
    test.async();
    
    var request = {};
    var response = {
        send: function (model) {
            test.ok(model);
            test.ok(Array.isArray(model));
            test.ok(model.length);
            test.ok(model[0].id);
            test.ok(model[0].name);
            test.done();
        }
    };
    
    controller.list(request, response);
};

After building the domain model in memory (the first test taks), now we can test a controller action method, named getPersons. It requires to receive two arguments, request and response object. In the above code, two stubs were built and used. The response object has a send function that  it should be invoked to pass the tests. It receives the model to send to the client, as a JavaScript object (in the real environment, the object is serialized to JSON via Express response send method).

The third test is:

exports['get first person'] = function (test) {
    test.async();
    
    var request = {
        params: {
            id: persons[0].id.toString()
        }
    };

    var response = {
        send: function (model) {
            test.ok(model);
            test.equal(model.id, persons[0].id);
            test.equal(model.name, persons[0].name);
            test.done();
        }
    };
    
    controller.get(request, response);
};

The action needs something from request object, an aditional argument having the person primary key to be retrieved. There is a send method in request object, to test the result.

The tests are not using HTTP nor GET method. They are directly testing the controller code. Indeed, that code was written AFTER the tests, and its first execution was from test launch, without the need of launch a web server.

Next posts: other tests for API methods, sending objects, and tests for MVC controllers

Stay tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

Older Posts »

The Shocking Blue Green Theme. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 72 other followers