Angel \”Java\” Lopez on Blog

April 23, 2014

End Of Iteration 2014w16

Filed under: Aktores, C Sharp, Iteration, JavaScript, NodeJs, Open Source Projects, Rust, RustScript — ajlopez @ 6:43 pm

Previous Post

Aktores

I added a new sample, PingPong, to my actor model implementation in C#

https://github.com/ajlopez/Aktores

The idea is to start measuring message processing performance. I added a variable number of worker threads, that affects the performance. I want to add a TryEnter method call but with a timeout. If some actor is busy, its messages retry process could be intensive in terms of time.

SimpleCards

I started the project

https://github.com/ajlopez/SimpleCards

to implement simple cards and deck to be rendered in web application (browser and mobile). I remember the great HyperCard. This project is simpler: only the cards and their content are specified, no position or render info are needed. There is render code adapted to the application (web browser, mobile) but the decks/cards are agnostic to device.

RustScript

My Rust language interpreter in JavaScript:

https://github.com/ajlopez/RustScript

I added the for command (parse and evaluation), and the built-in range function (to produce an iterator).

SimpleKache

I wrote and published version 0.0.1 of:

https://github.com/ajlopez/SimpleKache

A simple in-memory, in-process cache for Node.js/JavaScript.

SimpleAsync

My project to call a sequence of async/sync functions:

https://github.com/ajlopez/SimpleAsync

now has a map function that support functions with callback, not only sync functions. So, map can received an array and it can transform each elements calling asynchronous functions. I fixed a previous bug related to do, and published the version 0.0.3. Now, I’m starting to refactor the internal implementation. TDD rocks!

Others

I also worked on three non-public projects.

More fun is comming.

Keep tuned!

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

April 17, 2014

Dynamic Applications in Node.js

Filed under: JavaScript, MyApps, NodeJs, Open Source Projects, Video — ajlopez @ 6:55 pm

Last year I participated in the competition Node.js Knockout organized by Nodejitsu. Working alone, in the Solo Ninja team, I was coding two days in a weekend. My project, largely written using the TDD flow, aims to define one or more online applications. An application can have one or more lists of entities. Each entity can have properties defined interactively. I should add one to many relations between entities.

You can see the video presentation of my work to the judges:

http://youtube.com/watch?v==GQdyyNWCasI

After the competition, I moved my code into my GitHub account:

https://github.com/ajlopez/MyApps

I found interesting to dynamically define an application, rather than write it or generate code from a model. JavaScript and Node.js is a dynamic duo that helped me to implement this type of applications. My goal is to extend the ideas in order to have a simple implementation of what could be armed with Force, Salesforce. Some ideas:

- Add programming tasks (written in controlled JavaScript)
- More viewers (for web and mobile)
- Public and private application store
- Deploy an application written by others

In recent weeks I’ve been studying SharePoint Online. Now, I have new ideas for implement an Application Store for dynamic applications.

More fun is coming!

Keep tuned!

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

April 9, 2014

End Of Iteration 2014w14

Previous Post
Next Post

Code Generation

I updated my template engine in JavaScript, with a minor change to skip new lines in some contexts:

https://github.com/ajlopez/SimpleTpl

Then I consumed the new version in AjGenesis for Node:

https://github.com/ajlopez/AjGenesisNode

I published the first version of my Sinatra code generation tasks and templates:

https://github.com/ajlopez/AjGenesisNode-Sinatra

The simple generated site can manage list of entities, persisted using sqlite3 and data-mapper.

I removed bower from my Express code generation tasks and templates:

https://github.com/ajlopez/AjGenesisNode-Express

because I think it is more clear to have directly the assets in the repository, instead of installing via bower.

And I updated my Php tasks and templates:

https://github.com/ajlopez/AjGenesisNode-Php

so now it is using a first page with Bootstrap.

Complexo

I wrote a simple library to support complex number operations in JavaScript

https://github.com/ajlopez/Complexo

As usual, I wrote the code using TDD workflow. You can check the commit history.

Learning Node.js

I updated my

https://github.com/ajlopez/NodeSamples

with a simple sample of a web server. I recorded a Google Hangout (see Spanish post)

Others

Additionally, I started new code kata in JavaScript, https://github.com/ajlopez/JavaScriptSamples

I did a minor internal refactor in ScalaSharp https://github.com/ajlopez/ScalaSharp my Scala interpreter in C#.

I added a do operation to my https://github.com/ajlopez/SimpleAsync simple asynchronous library. The do operation launch a “parallel” function. You can chain do operations, to launch more than one operation. The next then or map operation will receive the result of the do operations as elements in an array, after full completion of the “launched” functions. Usually, those functions perform asynchronous calls.

I was working in two non-public projects, too.

More fun is coming.

Keep tuned!

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

April 3, 2014

New Month’s Resolutions: April 2014

Review of my March’s resolutions:

- Work on DictSharp [complete] see repo
- Give talk about Node.js Distributed Applications [complete] see repo see online slides
- Improve SimpleGammon [complete] see repo
- Improve Annalisa [complete] see repo
- Add @for to Templie [pending]
- Work on PreciosaAnnalisa online web services [complete] see repo
- Improve my Node.js Distributes Applications samples [complete] see repo see repo see repo
- Work on ScalaSharp [complete] see repo
- Improve ClojSharp [complete] see repo
- Improve SimpleAsync, do operation (functions in parallel) [pending]
- Improve Aktores [pending]
- Distributed messages in AjErl [pending]
- Add variable scope to Mass language [pending]
- Start code generation as a service [partial]

Additionally, I worked on:

- Complexo, simple complex numbers operations in JavaScript [complete] see repo
- Started RustScript, a Rust programming language interpreter in JavaScript [complete] see repo
- Continue RuScript, a Ruby interpreter in JavaScript [complete] see repo
- Continue RubySharp, a Ruby interpreter in C# [complete] see repo
- Started AjLispScala, a Lisp interpreter in Scala, using TDD and SBT [complete] see repo
- Recorded a second video Node.js Spanish tutorial [complete] see post

For this new month, my resolutions are:

- Continue AjLispScala
- Continue AjGenesisNode-Express
- Continue AjGenesisNode-PHP
- Continue RuScript
- Continue RustScript
- Distributed Messages in AjErl
- Give a talk Intro to Node.js
- Publish a new Node.js video tutorial

More fun is coming.

Keep tuned!

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

March 25, 2014

End Of Iteration 2014w12

Filed under: AjGenesis, Code Generation, JavaScript, NodeJs, Ruby, RubySharp, RuScript — ajlopez @ 10:41 am

Previous Post
Next Post

Ruby Interpreters

I updated my projects

https://github.com/ajlopez/RubySharp
https://github.com/ajlopez/RuScript

The first in a Ruby interpreter in C#. I started to add the support to detect the local variables in an scope. In Ruby, there is the function local_variables() that returns a list of the names of local declared variables (not only the already initialized).

The second project is the seed to my next talk: it implements Ruby in JavaScript, as an interpreter. I added more support for modules and classes, and function declaration with and without arguments and parenthesis. I’m using my grammar/parser generation:

https://github.com/ajlopez/SimpleGrammar

It was updated to support new use cases (dog fooding!).

RustScript

I added some simple features to

https://github.com/ajlopez/RustScript

My Rust Programming Language interpreter in JavaScript. Not, it has function definition with arguments, let and let mut (mutable), some new arithmetic, bitwise and logical operators, with precedence. And a powerful assert! to start writing test programs.

ScalaSharp

I updated

https://github.com/ajlopez/ScalaSharp

My Scala interpreter in C#. The additions were simple: more node support. A node is the product of a parser, and define a part of the program. It has a type to be checked. That is the main difference with expression: a node has a type that can be inferred from the rest of the program, or by explicit declaration. As a typed language, an Scala interpreter cannot directly evaluate expression. I should check the types of the nodes, and THEN, generate a correct expression tree.

Code generation

I created

https://github.com/ajlopez/AjGenesisNode-Model

A new global tasks to be used by AjGenesis and related tasks to modify the model using command line. I started the new global tasks

https://github.com/ajlopez/AjGenesisNode-Php
https://github.com/ajlopez/AjGenesisNode-Django

to generate code for PHP and Django. There are only the skeletons, but I want to generate code for these languages/frameworks using a free model. Meanwhile, you can check the simple pages generated from:

https://github.com/ajlopez/AjGenesisNode-Express

The next big step: having a code-as-a-service application, written in Node.js, using AjGenesisNode, and deployed on Heroku.

I worked on two non-public projects, too.

More fun is coming!

Keep tuned!

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

March 17, 2014

End Of Iteration 2014w11

Previous Post
Next Post

Talks

I finished my presentation about Node.js Distributed Applications:

https://github.com/ajlopez/Talks/tree/master/NodeDistributedApps
http://ajlopez.github.io/Talks/NodeDistributedApps/index.html

Last week I gave this talk at the JSConf Uruguay http://jsconf.uy/ Great days, interesting people, projects and ideas. I should post about my experience. In this talk I mentioned my projects:

https://github.com/ajlopez/AjFabriqNode
https://github.com/ajlopez/SimpleStorm
https://github.com/ajlopez/SimpleActors
https://github.com/ajlopez/NodeSamples/tree/master/Fractal/distributed
https://github.com/ajlopez/SimpleGA/tree/master/samples/tspdistr

And I did a quick description of some other basic projects I used to build the demos:

https://github.com/ajlopez/SimpleBus
https://github.com/ajlopez/SimpleQueue
https://github.com/ajlopez/SimpleRemote
https://github.com/ajlopez/SimpleBroadcast
https://github.com/ajlopez/SimpleMessages
https://github.com/ajlopez/ObjectStream

SimpleGammon

I updated my project

https://github.com/ajlopez/SimpleGammon

Now it has to samples: one, with position evaluation at browser, and another with position evalution at server side. Next steps: add worker nodes, at server side, to distributed the position evaluation, maybe with a tree search in many levels (now it explores 2 plies), or more levels using montecarlo.

RustScript

After talking with @LostOracle at JSConfUy, I started an interpreter for Rust Language, in JavaScript:

https://github.com/ajlopez/RustScript

The hello world is working:

https://github.com/ajlopez/RustScript/tree/master/samples/hello

I use and updated my grammar generator

https://github.com/ajlopez/SimpleGrammar

Dog fooding is good!

Annalisa

I added new rules and some refactor to my projects:

https://github.com/ajlopez/Annalisa
https://github.com/ajlopez/PreciosaAnnalisa

I want to add a JavaScript application running at client side, to cover the main use case of Preciosa Project.

I worked on two non-public projects. Now, I’m back at Buenos Aires. More fun is comming!

Keep tuned!

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

March 10, 2014

End Of Iteration 2014w10

Filed under: C Sharp, Distributed Computing, Iteration, JavaScript, NodeJs, ScalaSharp — ajlopez @ 4:21 pm

Previous Post
Next Post

Talks

I added initial slides to my upcoming talk, Distributed Applications in Node.js, for JsConf Uruguay 2014:

https://github.com/ajlopez/Talks/tree/master/NodeDistributedApps

I updated my projects: SimpleGA, SimpleActors, SimpleBus, SimpleStorm, SimpleQueue, SimpleRemote, SimpleMessages, and ObjectStream.

ScalaSharp

I started to parse nodes, with type information, instead of expressions

https://github.com/ajlopez/ScalaSharp

In this way, I can check the type of the nodes BEFORE generating the expression tree to run. One thing is the node, of an abstract syntax tree, and another thing is the expression to execute. That is, a + b could be represented by a node, but the expression to execute depends on the types of a and b.

Others

I worked on two non-public projects, and some updates on Annalisa, DictSharp, and ScalaSamples. I published the heroku version of PreciosaAnnalisa. And I updated my backgammon evaluation library, SimpleGammon, with a work-in-progress html sample.

More fun is coming.

Keep tuned!

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

March 5, 2014

End Of Iteration 2014w09

Previous Post
Next Post

More interesting stuff for my neuron, and deliberate TDD (Test-Driven Development) practice.

Annalisa

A lot of new work at

https://github.com/ajlopez/Annalisa

It takes an string and extract information based on rules. For example, it can detect the brand of a product description, its weight, weight unit, etc. I put an online demo in Spanish for analyze or search into Preciosa project data:

http://preciosaannalisa.herokuapp.com/

DictSharp

I started a simple in-process, in-memory key/value store in C#:

https://github.com/ajlopez/DictSharp

A dictionary with a an internal tree, instead of using hashes. I should complete the node split operation, enumerate the keys, and compress the keys. A key is an string, and the associated value could be typed or a generic object.

SimpleGeoLoc

Motivated by a use case of Preciosa project, I wrote:

https://github.com/ajlopez/SimpleGeoLoc

A simple JavaScript module to manage a list of geolocated items (via latitude, longitude), and then retrieve the items near a point in a given radius.

OStore

I refactored my in-memory repository:

https://github.com/ajlopez/OStore

to support optional autonumeric ids, and tests using SimpleUnit. Notably, I found an issue: SimpleUnit can be installed as global module in NPM (Node Package Manager) but the bin file has a shebang (!#) in the first line, ending with \r\n (carriage return line feed). Then, Linux operating system take the shebang, and use it as the name of the program to execute the script, WITH THE CARRIAGE RETURN in the name. So, I fixed it removing the carriage return. Weird thing in the third millenium. I updated

https://github.com/ajlopez/AjGenesisNode
https://github.com/ajlopez/SimpleUnit

to have no carriage return in bin scripts.

Others

I worked on two non-public projects, using C#. I started my Python samples https://github.com/ajlopez/PythonSamples. I added some nodes to AST (Abstract Syntax Tree) in https://github.com/ajlopez/ScalaSharp.

More fun is coming.

Keep tuned!

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

February 26, 2014

End Of Iteration 2014w08

Filed under: C Sharp, Iteration, JavaScript, NodeJs, Open Source Projects, Python — ajlopez @ 5:02 pm

Previous Post
Next Post

More interesting projects and code TDD practices

Annalisa

A new JavaScript project:

https://github.com/ajlopez/Annalisa

to solve some use cases of Preciosa project. Preciosa is written in Django/Python, but I want to explore how to solve:

- Given an string, return associated properties (ie. analyze a product description, then return detected weight (from “10 gr” substring), brand (from “… Axe … “ substring). I create rules to detect some patterns (simple normalized substrings) and return a JavaScript object with detected properties/values.

- Search by word combination (done), and approximated words (WIP)

Now, I’m working on implementing Preciosa use cases, using its data for products, companies, brands, etc.  I’m implementing console programs, and I will to implement a web service with associated test page.

AcquarellaJS

I started:

https://github.com/ajlopez/AcquarellaJS

A new implementation, this time in JavaScript, for my syntax highlighter Acquarella (in C#). I plan to use it to generate colored HTML for my code snippets, and add them to my posts (in blog software that doesn’t allow JS scripts).

Templie

Someone asked on Twitter about a template engine in Java, without dependencies, a lightweight version. Then, I wrote

https://github.com/ajlopez/Templie

Now, it has expansion of variables in ${variable}, and process of @if commands. Next steps: adding @for, adding ${variable.property} using reflection.

ScalaSharp

My Scala interpreter in C#, in progress:

https://github.com/ajlopez/ScalaSharp

I was adding more INode concrete nodes. Instead of having expression tree, I want a node tree, to have type checking BEFORE evaluation, according to a typed compiled language.

Talks

I modified

https://github.com/ajlopez/Talks/tree/master/NodeIntro

It was published to

http://ajlopez.github.io/Talks/NodeIntro/index.html

And created a new one (WIP):

https://github.com/ajlopez/Talks/tree/master/NodeDistributedApps

for upcoming JSConf Uruguay 2014. Yes! I’m an speaker.

SimpleAsync

After attending JavaScript meetup with @getify talk, I wrote, following TDD as usual, a simple async library:

https://github.com/ajlopez/SimpleAsync

I want to add: .do to launch a “parallel” tasks (many consecutive .do returns an array with the collected result), and .map to process an array in “parallel”.

Silabeo

I wrote a new TDD exercises

https://github.com/ajlopez/TddRocks/tree/master/Python/Silabeo

this time in Python: syllable separation in Spanish. Good code kata. It was useful to me to learn and practice more Python.

Others

Minor additions to https://github.com/ajlopez/DylanSharp, https://github.com/ajlopez/MeteorSamples, https://github.com/ajlopez/SimpleReact

I also worked on two non-public projects. More fun is coming.

Keep tuned!

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

February 19, 2014

End Of Iteration 2014w07

Filed under: .NET, C Sharp, Iteration, JavaScript, NodeJs, Open Source Projects, Scala, ScalaSharp — ajlopez @ 7:15 pm

Previous Post
Next Post

A lot of interesting topics and code.

MeteorSamples

I started to explore Meteor:

https://github.com/ajlopez/MeteorSamples

You can see one of my samples deployed at:

http://mycompany.meteor.com/

A simple CRUD (WIP) application. Next steps: code generation using AjGenesis for Node.js, mobile look, and wrap up as a PhoneGap application.

I also wrote posts:

Programming Meteor (1) First Steps
Meteor: Links And Resources (1)

ScalaSharp

My Scala interpreter in C#:

https://github.com/ajlopez/ScalaSharp#

I started to switch from a tree of expression to a tree of nodes (a classical AST). In this way, I could implement type checking, compilation, etc… visiting the node tree. There are differences between an expression and a node. A node could be a name, but that name, in Scala, could be a val, a var, or a def. I have not the full context to decide what kind of expression to invoke. So, I need a previous step. A node is the first parser output. A tree node could be visited, performing type checking and then producing the correct expression.

SimpleReact

Inspired by Meteor .autorun method, I wrote a react library in JavaScript

https://github.com/ajlopez/SimpleReact

As usual, simple code, using TDD workflow.

SimpleScraper

I continue adding features to

https://github.com/ajlopez/SimpleScraper

A simple JavaScript library to process an HTML string. I should add more features, and write a sample, scraping an e-commerce site.

Others

A minor addition in ClojSharp https://github.com/ajlopez/ClojSharp using recur in a function

Completing the model in https://github.com/ajlopez/AjGenesisNode-Express supporting that an entity references another entity.

I worked on two non-public projects, too. More fun is coming.

Keep 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 57 other followers