Monthly Archives: April 2014

End Of Iteration 2014w17

Previous Post
Next Post

SimpleScraper

I started a refactorization of this project:

https://github.com/ajlopez/SimpleScraper

Now, I have a document object with find method to produce a sequence of elements. I want to add filter to this sequence, ie: give me all elements (tags) that are “h1”, or that have such attribute or class. I prefer a code solution (calling methods) instead of having XPath queries. I have the first use cases “in pectore”, to be explored in May.

SimpleFlow

Every one writes his/her own flow library for JavaScript. Me too! I wrote this library some months ago, and then I switched to implement SimpleAsync. But then I realized the use cases are similar, so I went back to design board and started a new implementation in SimpleFlow:

https://github.com/ajlopez/SimpleFlow

Now, I have a more clear sequence implementation, with explicit .success and .fail methods. My next steps: implement parallel execution instead of a sequence. And map and reduce apply of a function.

SimpleNeuron

Yes, it’s time to write simple neural networks in JavaScript. I have a threshold neuron implementation. I’m in doubt about the reactive events to fire: most use cases don’t need such features. Check the code and tests at:

https://github.com/ajlopez/SimpleNeuron

Others

I started to add binary serialization of message to AjErl, Erlang in C# project. I started to implement super in AjTalkJs, Smalltalk in JavaScript. I added some events to SimpleValues, a simple model with events. I added the number of workers to use in the constructor of ActorSystem in Aktores, Akka ideas in C#. I wrote a new simple sample for SimpleCards. I worked on three non-public projects, too.

More fun is coming.

Keep tuned!

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

Angular, Links And Resources (5)

Previous Post
Next Post

Spring Scala
http://www.infoq.com/presentations/spring-scala

Death to cookies, long live JSON Web Tokens – YouTube
http://www.youtube.com/watch?v=yo2sG5NMhhg

Death to Cookies, Long Live Tokens // Speaker Deck
https://speakerdeck.com/woloski/death-to-cookies-long-live-tokens

Anant Narayanan – Building Realtime Apps With Firebase and Angular – NG-Conf 2014 – YouTube
http://www.youtube.com/watch?v=e4yUTkva_FM&t=0m3s

Learn JavaScript Part 3 – AngularJS and Langton’s Ant – CodeProject
http://www.codeproject.com/Articles/696943/Learn-JavaScript-Part-3-AngularJS-and-Langtons-Ant

Karma – Spectacular Test Runner for Javascript
http://karma-runner.github.io/0.10/index.html

10 Reasons Web Developers Should Learn Angular – CodeProject
http://www.codeproject.com/Articles/718046/10-Reasons-Web-Developers-Should-Learn-Angular

How to Make an Email Web App using Angular – CodeProject
http://www.codeproject.com/Articles/718036/How-to-Make-an-Email-Web-App-using-Angular

Real-time, multi-user, co-browse tech for web and mobile apps: GoInstant
https://goinstant.com/

Implementing a Flowchart with SVG and AngularJS – CodeProject
http://www.codeproject.com/Articles/709340/Implementing-a-Flowchart-with-SVG-and-AngularJS

DI v2 talk Links (ng-conf 2014)
https://docs.google.com/document/d/1p8B_ESXKDnvl7l3RzuAgf5m7vLkXisWBAswalXI42_A/pub

angular/angular-seed
https://github.com/angular/angular-seed

Structuring an Angular Project | John Papa
http://www.johnpapa.net/structuring-an-angular-project/

Cookies vs Tokens. Getting auth right with Angular.JS
http://blog.auth0.com/2014/01/07/angularjs-authentication-with-cookies-vs-token/

Controller in AngularJS
http://www.c-sharpcorner.com/UploadFile/cd7c2e/controller-in-angularjs/

Modular AngularJS NuGet Packages | John Papa
http://www.johnpapa.net/modular-angularjs-nuget-packages/

Building a Single Page Application with AngularJS and Neo4J – Setup | a thousand lines of code
http://1000linesofcode.wordpress.com/2013/12/30/building-a-single-page-application-with-angularjs-and-neo4j-setup/

Deploying a Yeoman/Angular app to Heroku – SitePoint
http://www.sitepoint.com/deploying-yeomanangular-app-heroku/

Building a Startup Stack with AngularJS
http://www.slideshare.net/fitc_slideshare/building-a-startup-stack-with-angularjs

Angular Models
http://rtorr.com/angular-models/

Deconstructing AngularJS Injector | NeverFriday
http://neverfriday.com/2013/11/30/deconstructing-angularjs-injector/

AngularJS Buenos Aires – 2° Meetup – YouTube
http://www.youtube.com/watch?v=nASgfEcXoRg

traider is an open source to ecommerce | coded with love (and javascript: nodejs, angularjs and mongodb)
http://traider.io/

My Links
http://delicious.com/ajlopez/angularjs

Keep tuned!

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

Smalltalk from Scratch

I think Smalltalk is a wonderful technology that influence the past decades in programming. But not directly: its influence is not via its killer apps. Smalltalk influenced programmers. The Smalltalk mark can be traced in Python and Ruby design decisions. And many programmers have been touched by Smalltalk ideas. But Smalltalk, as technology, didn’t exploded. We can discuss the reasons: early “balkanization” of providers, no early open source implementation. My thoughts: it is too couple to its own “GUI IDE”, and it is a bit overwhelming (too many pieces).

I think that is time to explore alternatives path. In the past decades, I visited many technologies and languages, and in the past ten (more or less) years, I took again Smalltalk and tried to follow an alternative path.

My position: we should try a simpler Smalltalk. An Smalltalk not tied to GUI IDE, not tied to thousands of classes. A simple implementation that can access the rest of the world advances in programming.

So, I started three own implementations: Smalltalk hosted in .NET, in Java and in JavaScript/Node.js:

https://github.com/ajlopez/AjTalk
https://github.com/ajlopez/AjTalkJava
https://github.com/ajlopez/AjTalkJs

More info in https://ajlopez.wordpress.com/category/smalltalk/.

But this post is not dedicated to review those implementation. Its purpose is to write down some ideas about how to create an Smalltalk, without struggling with the shrinking of a previous image.

The Core

I think that a new Smalltalk from scratch could be developed. An Smalltalk that runs in a host environment, like .NET, Java or JavaScript. Or another one. But it’s time to have an Smalltalk that is not an autism program: it should leverage the work of other technologies. For example, an Smalltalk running on JavaScript could access the JS ecosystem, via browser modules and libraries, or using Node.js or other engine package ecosystem.

The core Smalltalk should implement:

Object: the base object and class, with some base methods, like #subclass:.

Array: for arrays with numeric index, starting from 1 (to not break with Smalltalk tradition)

Dictionary: to map keys (names) to values

Primitive types: the underlying language (.NET, Java, JavaScript) could implement numbers (integers and floats), bytes, chars, strings, etc.

Access to native objects and types: to create them, to call type methods, to call instance methods.

The Library

First, a minimal implementation of some classes, that can be shipped with the initial implementation.

But then, and this is important: try to live in an ecosystem of packages. Instead of having all classes in the image, try to have an ecosystem of packages. Each Smalltalk application could define the needed packages, and then, the packages could be installed from the package ecosystem. In my implementations, I started to explore the use of NPM (Node Package Manager) to publish new package, and to install them per application, even with the use of explicit package version, so we have a less brittle ecosystem.

Package candidates:

– Test library (with an initial assert method)
– HTTP server
– MVC web framework (I have a minimal sample using Node.js Express)
– Distributed messages (I have a naive implementation in C#)
– etc.

In this way, the adoption of a package will be easy: not need of porting a package, only consume it, given the right dependencies in place. And, as in other technologies (Python, Ruby with gems, and notably, Node.js with NPM), each package can keep the description of the needed dependencies (NPM takes care of versions too).

Additional Items

I want to have an environment feature: that a class/package can load other classes, but only for internal use, without pollute the global Smalltalk environment.

I want to have an image running with the help of other image. That is, the Smalltalk VM should manage MORE THAN one running image. And one image could help another one. For example: one minimal image could have no compile method, but this method could be provided by the host image. In this way, a minimal image could be created, without any convoluted “shrinking” step. I already implemented this feature in my C# implementation.

In some implementations, I want to have an image (save and restore). But it is time to explore the development without the need of an image.

Any GUI should be created over the host environment. Use Windows.Form if your Smalltalk is running over C#. Or use another library, in Java (Swing? SWT?). But the idea is that the GUI management should be something clearly separated from the core implementation. Current popular Smalltalk implementations are too coupled with GUI management. Look at other technologies: Python, Ruby, Node.js, Go, etc.. There are lots of developers not using a technology so tied to a GUI IDE. And they are producing useful applications.

As I usually say: explore. That is the verb. We must explore alternative path, even when the outcome and gains are not clear. If I had seen killer applications in Smalltalk, or the use of Smalltalk in the creation of application that are really used by other developers (like in Python, Ruby, Java, JavaScript, Node.js, and others), I should stop thinking in this way. But, for some reason, Smalltalk is not taking the world by storm. Alternatives are here, floating around us, ready to be taken and to be explored.

Keep tuned!

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

Applications Creating Applications

I was working in different approaches to make programs create more programs. This post is a brief review of the path I took in the past years/months/weeks, and that it is still work in progress. I think they are interesting ways of doing programming, to be explored.

Dynamic Applications

The idea is to describe an application (entities, some relations, some code), and run it in a web runner that knows how to interpreted the application definition. I wrote a first implementation for past year Knockout competition:

More info at Dynamic Applications in Node.js.

The application could be described in a simple structure (in this example, a simple JavaScript object that can be serialized to JSON). The same structure could be interpreted and run by different host applications: a web application, an SPA, a mobile app, etc. And it could be used as a seed to generate code in a “concrete” technology, like Sinatra, Express+MongoDB, etc.

Code Generation

One of my preferred topics. I created tasks, templates and free models to generate applications in Express, and in other technologies (Sinatra, Django, Flask, PHP, all work in progress). I have implementations in C#, Ruby and Node.js. But my latest work is on Node.js:

https://github.com/ajlopez/AjGenesisNode

You can have a simple example in:

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

Screenshots of a simple generated application:

 

And I’m working on creating an online site where you can describe the application (the free model, the features, databases, entities, web framework to use) and then download the generated application code.

Cards

In the project:

https://github.com/ajlopez/SimpleCards

I describe each application as a set of cards (a deck). A card can have simple values, or a another card or deck. For example, a card could have an id, a name, a title to be displayed, and additional info. A card could have another deck of cards as a property (ie an Chemical Elements card could have a deck with one card by element). They can be rendered in different context: a web application, a web application as a Single Page Application, a mobile app (in Phonegap, or native). One thing is the structure and content of a card, and another thing is the render of a card. The later depends on the context of the host application.

A simple example

https://github.com/ajlopez/SimpleCards/blob/master/samples/deck/js/model.js

var model = {
    title: "My Deck",
   
    cards: [
        { title: "Card 1", text: "This is the card 1" },
        { title: "Card 2", text: "This is the card 2" },
        { title: "Card 3", text: "This is the card 3" }
    ]
}

Another sample, with screenshots:

https://github.com/ajlopez/SimpleCards

A card content could be a simple text, a long text, an URL, an image, or a widget to be displayed by the hosted application (ie a Google Map). The card description could be static or could be generated on the fly (ie, a feed could be transformed to a card/deck, or it could be retrieved from a REST API). A card could have partial content (id, title), and a resolver can retrieve the rest of its content, using the id (ie, a card could represent a Wikipedia Page, and the id would be the URL; the resolver downloads the page content, and complete the card, if needed).

More fun is coming.

Keep tuned!

Angel “Java” Lopez

http://www.ajlopez.com

http://twitter.com/ajlopez

Erlang: Links, News And Resources (11)

Previous Post
Next Post

Erlang String Handling — Functional Erlang — Medium
https://medium.com/functional-erlang/7588daad8f05

Your first Erlang program (in style). – Ward Bekker
http://blog.equanimity.nl/blog/2014/03/29/your-first-erlang-program/

oubiwann/jlfe
https://github.com/oubiwann/jlfe

Erlang — Advanced
http://www.erlang.org/doc/efficiency_guide/advanced.html

Orleans Actors Analysis – Tech stuff that interests me
http://shinolajla.tumblr.com/post/81199345476/orleans-actors-analysis

reedr/slides/efsf2014-whatsapp-scaling.pdf at master · reedr/reedr
https://github.com/reedr/reedr/blob/master/slides/efsf2014-whatsapp-scaling.pdf

High Scalability – High Scalability – How WhatsApp Grew to Nearly 500 Million Users, 11,000 cores, and 70 Million Messages a Second
http://highscalability.com/blog/2014/3/31/how-whatsapp-grew-to-nearly-500-million-users-11000-cores-an.html

Elixir is for programmers
http://blog.pluralsight.com/elixir-is-for-programmers

LambaJam Chicago – Welcome
http://www.lambdajam.com/

homepages.inf.ed.ac.uk/wadler/papers/erlang/erlang.pdf
http://homepages.inf.ed.ac.uk/wadler/papers/erlang/erlang.pdf

ErlangSolutions Youtube channel – YouTube
https://www.youtube.com/user/ErlangSolutions?feature=watch

10 Billion a Day, 100 Milliseconds Per: Monitoring Real-Time Biddin…
http://www.slideshare.net/BrianTroutwine1/10-billion-a-day-100-milliseconds-per-monitoring-realtime-bidding-at-adroll

Scaling HTTP connections // Speaker Deck
https://speakerdeck.com/benoitc/scaling-http-connections

odie2630463/ercheme · GitHub
https://github.com/odie2630463/ercheme

altenwald – YouTube
http://www.youtube.com/channel/UCsx08xYUIVx0CTMKbGZtPuw/videos

My Links
http://delicious.com/ajlopez/erlang

Keep tuned!

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

End Of Iteration 2014w16

Previous Post
Next 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

Angular, Links And Resources (4)

Previous Post
Next Post

I was exploring web development for my code generation projects. Angular.js is in my radar, but I should write an spike or demo. Meanwhile, more links:

Ionic: The Most Advanced HTML5 Mobile App Framework
http://ionicframework.com/

The Web Weekly Newsletter Edition #3
http://us7.campaign-archive1.com/?u=65e00aa00c80d98f762ebeb6e&id=65473c6ff7

ng-embereño: Angular.js from the perspective of Ember.js – Google Drive
https://docs.google.com/presentation/d/1e0z1pT9JuEh8G5DOtib6XFDHK0GUFtrZrU3IfxJynaA/preview#slide=id.p

Isomorphic JavaScript: The Future of Web Apps – Airbnb Engineering
http://nerds.airbnb.com/isomorphic-javascript-future-web-apps/

Building Huuuuuge Apps with AngularJS
http://briantford.com/blog/huuuuuge-angular-apps.html

A Shopping Cart Application Built with AngularJS – CodeProject
http://www.codeproject.com/Articles/576246/A-Shopping-Cart-Application-Built-with-AngularJS

DanWahlin/CustomerManager
https://github.com/DanWahlin/CustomerManager
CustomerManager AngularJS/BreezeJS Application with a custom route provider

A dumb easy model for promises
http://www.vittoriozaccaria.net/blog/2013/09/23/a-dumb-easy-model-for-promises.html

Remastered Animation in AngularJS 1.2 – yearofmoo.com
http://www.yearofmoo.com/2013/08/remastered-animation-in-angularjs-1-2.html

AngularJS Best Practices: I’ve Been Doing It Wrong! Part 3 of 3 | Art & Logic Blog
http://blog.artlogic.com/2013/05/08/angularjs-best-practices-ive-been-doing-it-wrong-part-3-of-3/

AngularJS Sticky Notes Pt 1 – Architecture | One Hungry MindOne Hungry Mind
http://onehungrymind.com/angularjs-sticky-notes-pt-1-architecture/

Code Organization in Large AngularJS and JavaScript Applications — Cliff Meyers
http://cliffmeyers.com/blog/2013/4/21/code-organization-angularjs-javascript

John Papa | Evangelist on the loose
http://www.johnpapa.net/

Create an Angular App in Seconds with Hot Towel | John Papa
http://www.johnpapa.net/hot-towel-angular/

Home | Breeze.js
http://www.breezejs.com/
Rich data for JavaScript apps

Build Apps with Angular and Breeze | John Papa
http://www.johnpapa.net/build-apps-with-angular-and-breeze/

angular-ui/ui-utils
https://github.com/angular-ui/ui-utils
Swiss-Army-Knife of AngularJS tools (with no external dependencies)

AngularJS and Bootstrap ☢ DeanSofer.com
http://deansofer.com/posts/view/20/AngularJS-and-Bootstrap

Lessons Learned: A Year with a Large AngularJS Project – @jhooks
http://joelhooks.com/blog/2013/05/22/lessons-learned-kicking-off-an-angularjs-project/

My Links
http://delicious.com/ajlopez/angularjs

Keep tuned!

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