Angel \”Java\” Lopez on Blog

November 30, 2011

Social Online Games Programming (Part 5) New Azure Toolkit

Previous Post
Next Post

Two weeks ago, a new version of Windows Azure Toolkit for Social Games was released. See @ntotten posts:

Windows Azure Toolkit for Social Games Version 1.1.1
Windows Azure Toolkit for Social Games Version 1.1

The new version implements two simple HTML5 games: tic-tac-toe and four-in-a-row, backed up by ASP.NET MVC views, WCF Web API services, ACS federated security, and Azure Storage. You can play them online at:

http://watgames4.cloudapp.net/

I think this is a more clear example than the previous one (Tankster) that was great but a bit overwhelming ;-) . Let’s dive into some implementation details of this new example.

Totten wrote:

The biggest change we have made in this release is to separate the core toolkit from the Tankster game. After we released the Tankster sample game we received a lot of feedback asking for a simpler game that developers could use to learn. To meet this need we developed two simple games, Tic-Tac-Toe and Four in a Row, and included in the toolkit. The Tankster game is now available separately as a sample built on top of the toolkit.

While the new games included in the toolkit are much simpler than Tankster, they still show the same core concepts. You can easily use these samples as a starting point to build out any number of types of games. Additionally, you will find that many of the core components of the game such as the leaderboard services, game command services can be used without any modification to the server side or client side code.

In my previous post, I mentioned a minor but important change in game action processing: any game logic was removed from server code. Adopting this approach, you can write new games without changing the ASP.NET MVC code. You still can add server side code if you want (to have more control over the actions, to avoid player cheating, etc..) but it is interesting to have a base code with game-agnostic code.

Opening the solution in Visual Studio, you will find Javascript files used by the two games. You can write a new game, reusing these files:

The games are implemented as areas:

You could add new games and publish them as NuGet packages.

Visually, the client Javascript code is organized as:

Each game X (TicTacToe, FourInARow, yours) has:

- XGame: the game logic

- XBoard: to draw board on canvas and to detect click events on it

- XViewModel: containing the player and other data to be used at view rendering (the example uses knockout.js, an MVC in Javascript)

- XController: to process new events and to coordinate the above elements

The generic part:

- UserService: methods related to users: login, get friends, etc.

- GameService:  play moves, receives new moves, other actions.

- ServerInterface: Ajax calls (using GET, POST, JSONP, Azure storage…) that are used by the implemention of User and Game Service.

Topics for next posts: analyze the Javascript code, the use of Canvas, Javascript tests using QUnit, communication with server using Ajax, change the Game Service (Javascript) to use a Node.js server.

Keep tuned!

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

November 29, 2011

BDD: Links, News and Resources (1)

My links about Behavior Driven Development:

http://en.wikipedia.org/wiki/Behavior_Driven_Development

Behavior-driven development (or BDD) is an agile software development technique that encourages collaboration between developers, QA and non-technical or business participants in a software project. It was originally named in 2003 by Dan North[1] as a response to test-driven development, including acceptance test or customer test driven development practices as found in extreme programming. It has evolved over the last few years.[2]

Vows
http://vowsjs.org/
Asynchronous behaviour driven development for Node.

Testing Backbone applications with Jasmine and Sinon – Part 1
http://tinnedfruit.com/2011/03/03/testing-backbone-apps-with-jasmine-sinon.html

PHP + BDD
http://www.flexria.com.br/home/?p=815

Test Driven Development: Top-Down or Bottom-Up?
http://msdn.microsoft.com/en-us/scriptjunkie/gg650426.aspx

The future of Cucumber
http://gojko.net/2011/03/24/the-future-of-cucumber/

Try Cuke
http://cukes.info/trycuke/

Why learning TDD is hard, and what to do about it
http://www.davesquared.net/2011/03/why-learning-tdd-is-hard-and-what-to-do.html

TDD/BDD and the lean startup
http://codebetter.com/iancooper/2011/03/08/tddbdd-and-the-lean-startup/

Duplication between BDD and Unit tests
http://gojko.net/2011/01/28/duplication-between-bdd-and-unit-tests/

The RSpec Book: Behaviour Driven Development with Rspec, Cucumber, and Friends (Facets of Ruby)
http://www.amazon.com/RSpec-Book-Behaviour-Development-Cucumber/dp/1934356379

BDD frameworks in .NET
http://groups.google.com/group/behaviordrivendevelopment/browse_thread/thread/93fbf1bb6d527e4a?pli=1

Using Coding Katas, BDD and VS2010 Project Templates: Part 2
http://www.infoq.com/articles/BDD-Katas-2

Should Assertion Library
http://should.codeplex.com/

Why I don’t use TDD or BDD
http://blog.kangasbros.fi/?p=30

Driving CRUD screens with BDD
http://gojko.net/2010/07/22/driving-crud-screens-with-bdd/

Satisfyr
http://satisfyr.codeplex.com/

Behavior Driven Development (BDD) with Cucumber and ASP.NET MVC
http://blogs.visoftinc.com/2010/06/10/Behavior-Driven-Development-BDD-with-Cucumber-and-ASP.NET-MVC/

DDD eXchange 2010: Gojko Adzic on DDD, TDD, BDD
http://skillsmatter.com/podcast/java-jee/ddd-tdd-bdd/zx-486

BDD: la evolución del Desarrollo Dirigido por Tests (TDD)
http://www.scrummanager.net/blog/2010/02/bdd-la-evolucion-del-desarrollo-dirigido-por-tests-tdd/

Cucumber, A Brief Overview
http://lostechies.com/joeybeninghove/2010/06/01/cucumber/

Dan North on Behavior Driven Development
http://www.infoq.com/interviews/dan-north-bdd
Dan North discusses the roots of BDD and what it is today. Dan reviews the early history of BDD and then dives into the details of BDD; what it is, how it relates to teamwork, functional and non-functional requirements, and legacy code.

How TDD/BDD Miss the Point: Introducing EDD
http://www.softdevtube.com/2010/03/22/how-tddbdd-miss-the-point-introducing-edd/

Unit Testing and Integration Testing in Business Applications
http://www.codeproject.com/KB/testing/realtesting.aspx

twilson63 / Pickle
https://github.com/twilson63/pickle
Pickle a JQuery BDD Test Library

Behavior Driven Development (BDD) with SpecFlow and ASP.NET MVC
http://blog.stevensanderson.com/2010/03/03/behavior-driven-development-bdd-with-specflow-and-aspnet-mvc/

Experiment Driven Development – The Post-Agile Way
http://www.infoq.com/news/2010/02/edd-post-agile

Tests Are Code
http://stuartsierra.com/2009/01/18/tests-are-code

xUnit.GWT – Given When Then (GWT) extension for xUnit.net
http://blog.benhall.me.uk/2009/06/xunitgwt-given-when-then-gwt-extension.html

Did I just μBDD in NUnit?
http://torbjorn-gyllebring.blogspot.com/2010/01/did-i-just-bdd-in-nunit.html

BDD in .NET with Cucumber part 3: Scenario outlines and tabular templates
http://gojko.net/2010/01/05/bdd-in-net-with-cucumber-part-3-scenario-outlines-and-tabular-templates/

BDD in .NET with Cucumber, Cuke4Nuke and TeamCity
http://gojko.net/2010/01/01/bdd-in-net-with-cucumber-cuke4nuke-and-teamcity/

Arrange Act Assert and BDD specifications
http://lostechies.com/jimmybogard/2008/07/24/arrange-act-assert-and-bdd-specifications/

BDD in .NET with Cucumber part 2: Making scenarios easier to read with tables
http://gojko.net/2010/01/04/bdd-in-net-with-cucumber-part-2-making-scenarios-easier-to-read-with-tables/

TDD, BDD, or NDD
http://rpheath.com/posts/422-tdd-bdd-or-ndd

Kona 3: Learning Behavior Driven Development (BDD)
http://blog.wekeroad.com/2009/05/14/kona-3

MSDN Flash Podcast 017 – Hadi Hariri talks Behavior Driven Development
http://geekswithblogs.net/iupdateable/archive/2009/12/18/msdn-flash-podcast-017-ndash-hadi-hariri-talks-behavior-driven.aspx

F.I.R.S.T properties of unit tests
http://agileinaflash.blogspot.com/2009/02/first.html

BDD & DDD
http://www.infoq.com/presentations/bdd-and-ddd

My links
http://www.delicious.com/ajlopez/bdd

Keep tuned!

Angel "Java" Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

November 24, 2011

CQRS: Links, News and Resources (1)

Filed under: CQRS, Links, Software Architecture, Software Development — ajlopez @ 9:41 am

Next Post

CQRS (Command Query Responsibility Separation) is  a big topic. CQRS is not accepted by everyone: maybe complete implementations have added implementation complexity, and you have to know when to use it or not. You have CQRS with and without DDD (Domain-Driven Design) and with and without Event Sourcing.

In this post I included links with videos, podcasts, Infoq presentations about CQRS. More links are coming!

From: http://en.wikipedia.org/wiki/Domain-driven_design

Command-query separation (CQRS)

CQRS an architectural pattern for separation of reads from writes where the former is a Query and the latter is a Command. Commands mutate state and are hence approximately equivalent to method invocation on your aggregate roots/entities and Queries query state, but do not mutate it. CQRS is a derivative architectural pattern from the design pattern called Command and Query Separation (CQS) which was coined by Meyer. While CQRS does not require DDD, domain driven design makes the distinction between commands and queries, explicit, around the concept of an aggregate root. The idea is that a given aggregate root has a method that corresponds to a command and a command handler invokes the method on the aggregate root. The aggregate root is responsible for performing the logic of the operation and yielding either a number of events or a failure (exception or execution result enumeration/number) response OR (if ES is not used) just mutating its state for a persister implementation such as an ORM to write to a data store, while the command handler is responsible for pulling in infrastructure concerns related to the saving of the aggregate root’s state or events and creating the needed contexts (e.g. transactions).

Jonathan Oliver on Event Sourcing and EventStore @ E-VAN 25 October 2011
http://vimeo.com/31153808

CQRS and Event Sourcing with NCQRS
http://www.nicholascloud.com/2011/09/cqrs-and-event-sourcing-with-ncqrs/

CQRS, race conditions, and sagas – oh my!
http://skillsmatter.com/podcast/open-source-dot-net/udi-dahan-cqrs-race-conditions-and-sagas

CQRS, not just for server systems
http://skillsmatter.com/podcast/design-architecture/cqrs-not-just-for-server-systems
CQRS is of great use for building things other than server side systems as most people tend to use it for. In this talk, Greg Young will look at the use of CQRS in other kinds of systems and how it can greatly decrease complexity while providing value to users of the system.

Simple is better
http://skillsmatter.com/podcast/design-architecture/simple-is-better/
Very often we take on huge couplings in order to get value. This coupling forces us to build software in certain ways that may or may not be good for us at the time. In this talk, Greg Young looks at some common real world examples of these problems — and, more importantly, how to avoid them

CQRS, CQS y Event Messaging
http://www.altnethispano.org/wiki/van-2010-10-02-cqrs-cqs-event-messaging.ashx
by @cprieto

Abstraction Demo Videos http://abstractiondev.wordpress.com
http://www.youtube.com/playlist?p=PLB3366B17004D5DB9

Unleash your Domain
http://vimeo.com/13852695

Command Query Responsibility Segregation
http://skillsmatter.com/podcast/open-source-dot-net/udi-dahan-command-query-responsibility-segregation/rl-311
London .NET User Group:Command Query Responsibility Segregation

NServiceBus Architectural Principles
http://www.nservicebus.com/ArchitecturalPrinciples.aspx

Erik Rozendaal of Holland talking about CQRS and Event Sourcing
http://cqrs.wordpress.com/2010/09/13/video-presentation/

Distributed Podcast
http://distributedpodcast.com/
CQRS, DDD, Cloud computing and much more!

Command-Query Responsibility Segregation
http://www.infoq.com/presentations/Command-Query-Responsibility-Segregation

Recording of Mark Nijhof on CQRS @ E-VAN 18 November 2009
http://europevan.blogspot.com/2009/11/recording-of-mark-nijhof-on-cqrs-e-van.html

Mark Nijhof on CQRS Sample @ E-VAN 18 November 2009
http://vimeo.com/7838858

A Discussion with Allard Buijze on CQRS with the Axon framework
http://www.infoq.com/articles/cqrs_with_axon_framework

CQRS and Friends: possibly distributed systems, intentionally.
http://www.altnethispano.org/wiki/van-2011-02-19-cqrs.ashx
by @silverspoon

My Links
http://delicious.com/ajlopez/cqrs+video
http://delicious.com/ajlopez/cqrs+podcast

Keep tuned!

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

November 23, 2011

Clojure: Links, News And Resources (2)

Filed under: Clojure, Links, Lisp — ajlopez @ 9:26 am

Previous Post
Next Post

More about Clojure programming language, this time oriented to tutorials:

Quick Ref for Clojure Core
http://clojuredocs.org/quickref/Clojure%20Core
Programming language development: the past 5 years
http://blog.fogus.me/2011/10/18/programming-language-development-the-past-5-years/

Clojure – Getting started
http://dev.clojure.org/display/doc/Getting+Started

How to learn Clojure effectively
http://fronx.posterous.com/how-to-learn-clojure-effectively

Clojure Building Blocks
http://pragprog.com/magazines/2011-07/clojure-building-blocks

Clojure and the CLR
http://odetocode.com/Blogs/scott/archive/2011/08/15/clojure-and-the-clr.aspx

Coming Close To Clojure–Part 1
http://codingndesign.com/blog/?p=239

Using Leiningen to build Clojure code
http://alexott.net/en/clojure/ClojureLein.html

Writing Elegant Clojure Code Using Higher-Order Functions
http://christophermaier.name/2011/07/07/writing-elegant-clojure-code-using-higher-order-functions.html

Compiling Clojure to Javascript pt. 1 of n
http://blog.fogus.me/2011/07/21/compiling-clojure-to-javascript-pt1/

Growing a DSL with Clojure
http://pragprog.com/magazines/2011-07/growing-a-dsl-with-clojure

PragPub—July 2011
http://pragprog.com/magazines/2011-07/content
Four Clojure articles

Clojure on Heroku
http://blog.heroku.com/archives/2011/7/5/clojure_on_heroku/

Cljr
http://www.maybetechnology.com/2011/07/cljr.html
Well this is new: https://github.com/liebke/cljr. A very simple way to move from zero to a working Clojure REPL

Guide to Programming in Clojure for Beginners
http://blackstag.com/blog.posting?id=5

Clojure: Immutability at the Language Level
http://www.developer.com/lang/other/article.php/3874551/Clojure-Immutability-at-the-Language-Level.htm

Clojure: Towards The Essence Of Programming (What’s Next? Conference, May 2011)
http://www.slideshare.net/hlship/clojure-essenceprogramming

Java-Clojure Interop: Calling Clojure From Java
http://java.dzone.com/articles/java-clojure-interop-calling

4Clojure
http://www.4clojure.com/problems

ANTLR via Clojure
http://briancarper.net/blog/554/antlr-via-clojure

Stack-based Calculator Kata in Clojure
http://vimeo.com/23014256

Clojure abstractions
http://tech.puredanger.com/2011/03/11/clojure-abstractions/

Build your own Clojure toolkit
http://amalloy.hubpages.com/hub/Build-your-own-Clojure-toolkit

The Clojure programming language
http://www.ibm.com/developerworks/library/os-eclipse-clojure/

Clojure: Deriving the Y Combinator in 7 Stolen Steps
http://citizen428.net/blog/2010/12/14/clojure-deriving-the-y-combinator-in-7-stolen-steps/

Taking Uncle Bob to school
http://bestinclass.dk/index.clj/2010/10/taking-uncle-bob-to-school.html

Clojure Cookbook
http://www.gettingclojure.com/cookbook:clojure-cookbook

Grokking Functional Data Structures
http://debasishg.blogspot.com/2010/05/grokking-functional-data-structures.html

Clojure Notes
http://clojure-notes.rubylearning.org/

Scalable Scraping in Clojure
http://dev.lethain.com/scalable-scraping-in-clojure/

SICP in Clojure
http://sicpinclojure.com/
Structure and Interpretation of Computer Programs adapted for the Clojure programming language

Software Transactional Memory
http://java.ociweb.com/mark/stm/article.html

Learning Clojure
http://en.wikibooks.org/wiki/Learning_Clojure

My links
http://delicious.com/ajlopez/clojure+tutorial+toblog

Keep tuned!

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

November 21, 2011

Azure: Links, News and Resources (2)

Filed under: Azure, Cloud Computing, Links — ajlopez @ 9:22 am

Previous Post
Next Post

More links related to Azure:

http://en.wikipedia.org/wiki/Azure_Services_Platform

The Windows Azure Platform[2] is a Microsoft cloud platform used to build, host and scale web applications through Microsoft data centers. Windows Azure Platform is thus classified as platform as a service and forms part of Microsoft’s cloud computing strategy, along with their software as a service offering, Microsoft Online Services. The platform consists of various on-demand services hosted in Microsoft data centers and commoditized through three product brands. These are Windows Azure[3] (an operating system providing scalable compute and storage facilities), SQL Azure (a cloud-based, scale-out version of SQL Server) and Windows Azure AppFabric (a collection of services supporting applications both in the cloud and on premise).

Moving Channel9.msdn.com to Windows Azure
http://www.infoq.com/articles/Channel-9-Azure

Build 2011: Windows Azure Tackles the ‘One True Login’ Puzzle
http://www.readwriteweb.com/cloud/2011/09/build-2011-windows-azure-tackl.php

Microsoft to eat its own cloud dog food with Photosynth
http://www.zdnet.com/blog/microsoft/microsoft-to-eat-its-own-cloud-dog-food-with-photosynth/11104

Command-Query Separation on Windows Azure
http://ntotten.com/2011/10/command-query-separation-on-windows-azure/

How to Manage Expiration of Blob Content
http://msdn.microsoft.com/en-us/library/windowsazure/gg680306.aspx

Windows Azure Design Patterns, Part 1: Architectural Symbols
http://davidpallmann.blogspot.com/2011/07/windows-azure-design-patterns-part-1.html

Windows Azure Accelerator for Web Roles Version 1.1
http://ntotten.com/2011/08/windows-azure-accelerator-for-web-roles-version-1-1/

Running Processes in Windows Azure
http://ntotten.com/2011/09/running-processes-in-windows-azure/

pekkah / AzureSamples
https://github.com/pekkah/AzureSamples/tree/master/DataSample

Exercise 1: Using Worker Role External Endpoints
http://msdn.microsoft.com/en-us/gg457890

Building Web APIs in Windows Azure with WCF to reach any device
http://channel9.msdn.com/Events/BUILD/BUILD2011/SAC-798T

pofallon / node-azure
https://github.com/pofallon/node-azure
A node.js library for accessing the Windows Azure REST API’s

Introducing Geo-replication for Windows Azure Storage
http://blogs.msdn.com/b/windowsazurestorage/archive/2011/09/15/introducing-geo-replication-for-windows-azure-storage.aspx

Windows Azure Tables: Introducing Upsert and Query Projection
http://blogs.msdn.com/b/windowsazurestorage/archive/2011/09/15/windows-azure-tables-introducing-upsert-and-query-projection.aspx

Windows Azure Blobs: Improved HTTP Headers for Resume on Download and a Change in If-Match Conditions
http://blogs.msdn.com/b/windowsazurestorage/archive/2011/09/15/windows-azure-blobs-improved-http-headers-for-resume-on-download-and-a-change-in-if-match-conditions.aspx

CloudCopy Command Line Tool
http://cloudcopy.codeplex.com/

Windows Azure Toolkits for Devices – Now With Android!
http://www.wadewegner.com/2011/08/windows-azure-toolkits-for-devices-now-with-android/

Microsoft rolls out Windows Azure toolkit for Android
http://www.zdnet.com/blog/microsoft/microsoft-rolls-out-windows-azure-toolkit-for-android/10503

Windows Azure SDK for PHP
http://blogs.msdn.com/b/mvplead/archive/2011/08/31/windows-azure-sdk-for-php.aspx

Azure Tip: Consider Remote Desktop when Planning Role Endpoints
http://www.davidmakogon.com/2011/01/azure-tip-consider-remote-desktop-when.html

Memcached in Windows Azure
http://blog.smarx.com/posts/memcached-in-windows-azure

NodeJS on Windows Azure
http://ntotten.com/2011/08/nodejs-on-windows-azure/

Using Windows Azure to use as a TCP Server
http://stackoverflow.com/questions/6173763/using-windows-azure-to-use-as-a-tcp-server

Windows Azure Tip: Go Beyond 5 Endpoints per Role, beyond 25 per Deployment
http://www.davidmakogon.com/2011/05/windows-azure-tip-go-beyond-5-endpoints.html

Lightweight Tracing to Windows Azure Tables
http://blog.smarx.com/posts/lightweight-tracing-to-windows-azure-tables

Using ELMAH in Windows Azure with Table Storage
http://www.wadewegner.com/2011/08/using-elmah-in-windows-azure-with-table-storage/

Windows Phone 7 Push Notification QuickApp / Web Service (With Azure Publishing Instructions!)
http://channel9.msdn.com/posts/Windows-Phone-7-Push-Notification-QuickApp–Web-Service-With-Azure-Publishing-Instructions

Various Options to Manage Session State in Windows Azure
http://geeks.netindonesia.net/blogs/wely/archive/2011/08/13/various-options-to-manage-session-state-in-windows-azure.aspx

Windows Azure & WF 4.0 – Creating a Workflow-Driven WorkerRole
http://agileculture.net/lboffi/2011/08/12/windows-azure-wf-40-creating-a-workflow-driven-workerrole/

Microsoft announced Windows Azure Storage Analytics
http://bartwullems.blogspot.com/2011/08/microsoft-announced-windows-azure.html

Azure Cloud to Capture RenderMan
http://www.hpcinthecloud.com/hpccloud/2011-08-08/azure_cloud_to_capture_renderman.html

igrating SQL server Data to SQL Azure using BCP << Paras Doshi
http://beyondrelational.com/blogs/parasdoshi/archive/2011/08/08/migrating-sql-server-data-to-sql-azure-using-bcp-lt-lt-paras-doshi.aspx

Using Windows Azure Blob Storage and CDN with WordPress
http://www.wadewegner.com/2011/08/using-windows-azure-blob-storage-and-cdn-with-wordpress/

Practical Testing Techniques for Windows Azure Applications
http://www.devproconnections.com/article/cloud-computing2/cloud-test-windows-azure-136179

Daytona: Iterative MapReduce on Windows Azure
http://research.microsoft.com/en-us/projects/daytona/default.aspx

Connecting to SQL Azure from Ruby Applications
http://msdnrss.thecoderblogs.com/2011/08/connecting-to-sql-azure-from-ruby-applications/

Ideas about NoSql on Windows Azure: Azure Storage
http://blog.fabse.net/2011/08/02/ideas-about-nosql-on-windows-azure-azure-storage/

Architecture of Tankster– Scale (Part 2)
http://ntotten.com/2011/07/architecture-of-tankster-scale-part-2/

Windows Azure CDN Helpers
http://ntotten.com/2011/06/windows-azure-cdn-helpers/

Social Gaming on Windows Azure
http://channel9.msdn.com/Series/Social-Gaming-on-Windows-Azure

Extending the Windows Azure Accelerator for Web Roles with PHP and MVC3
http://ntotten.com/2011/07/extending-the-windows-azure-accelerator-for-web-roles-with-php-and-mvc3/

Ajax, Cross Domain, jQuery, WCF Web API or MVC, Windows Azure
http://blogs.southworks.net/mwoloski/2011/07/02/ajax-cross-domain-jquery-wcf-web-api-or-mvc-windows-azure/

smarx / blobedit
https://github.com/smarx/blobedit
Simple UI (based on Ace) to edit code files in Windows Azure blob storage

sriramk / winazurestorage
https://github.com/sriramk/winazurestorage
Python client wrapper for Windows Azure storage

Azure BlobStorage Javascript Library
http://azureblobstoragejs.codeplex.com/

Using Windows Azure Page Blobs and How to Efficiently Upload and Download Page Blobs
http://blogs.msdn.com/b/windowsazurestorage/archive/2010/04/11/using-windows-azure-page-blobs-and-how-to-efficiently-upload-and-download-page-blobs.aspx

Building Java applications on Windows Azure gets easier with the new version of the Eclipse plugin
http://blogs.msdn.com/b/interoperability/archive/2011/06/23/building-java-applications-on-windows-azure-gets-easier-with-the-new-version-of-the-eclipse-plugin.aspx

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

Keep tuned!

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

November 18, 2011

AjGenesis: Basis of its Implementation

Filed under: AjGenesis, Code Generation, Ruby — ajlopez @ 12:07 pm

I dedicated a lot of time to the development of AjGenesis, my open source code generation engine (from a free model). It’s time to write down what I consider the key points of its implementation, the parts that makes AjGenesis what it is.

First: the use of a free model on memory, that it’s managed like a common object in a programming language. You don’t need to traverse XML path or something else. You can visit and manipulated one or mode models  like any other dynamic object. I didn’t adopt a type model or a model with a schema: the model is free, you can put on each model what you want to have in it. The model is deserialized from XML or from text files, or it could be injected for your program: AjGenesis can be hosted as a library in your own application.

Second: the use of a dynamic, simple language, to execute simple or complex task, with access to rich class library. In AjGenesis, I use AjBasic, a interpreter that can access .NET. It can use, create and change dynamic objects, like the models.

Third: the use of templates, with expressions and commands (i.e. loops) written using the dynamic language.

(Some early alternatives were: use XML with schemas for models, and XSLT for transformations. I rejected them because I felt they had shortcomings that could affect the clear development of the system).

See:
Building an Application with AjGenesis
Code Generation with AjGenesis in a Real Project
Models for Code Generation in AjGenesis
AjBasic: An Open Source Basic-alike Interpreter
Generating Code Hello World with AjGenesis

Having these three pillars, I used AjGenesis for years, in different technologies, languages and framework (from Java to .NET, from JSP to ASP.NET to ASP.NET MVC, from PHP4 to PHP5 to .NET4 to .NET5, DDL for MySql, MS SQL Server database, and one user is generating code for Ruby and Rails!). Notably, I’m generating text artifacts for technologies that didn’t exist at the beginning of the project, with minimal changes to AjGenesis itself. And it can run in Linux and Mac OSX thanks to the Mono project (see Running AjGenesis Using Mono and Ubuntu).

Ideas to implement: the ability of inject the source of the model (you could write your own serializer); you could choose the dynamic language to use (I plan to add AjSharp as dynamic language for tasks and templates).

But if I have the three key points I enumerated above, I could implement AjGenesis. Then, as a proof of concept, I started to implement the same ideas under Ruby: dynamic objects, that can be loaded from YAML (or XML, or other formats), the use of ruby for task programming, and its template using ERB (or, maybe, other template engines).

You can check my progress at: https://github.com/ajlopez/AjGenesisRb

Keep tuned!

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

November 17, 2011

Git: Links, News and Resources (2)

Filed under: Git, Links — ajlopez @ 9:55 am

Previous Post
Next Post

More links about Git, the distributed revision control system:

Creating a documentation system – Part 1
http://www.code972.com/blog/2011/10/creating-a-documentation-system-part-1/

Git ready: pushing and pulling
http://gitready.com/beginner/2009/01/21/pushing-and-pulling.html

Git Immersion
http://gitimmersion.com/
Git Immersion is a guided tour that walks through the fundamentals of Git, inspired by the premise that to know a thing is to do it.

WebMatrix, Git, and AppHarbor
http://jeffhandley.com/archive/2011/10/08/WebMatrix-Git-AppHarbor.aspx

Merge recursive strategy
http://codicesoftware.blogspot.com/2011/09/merge-recursive-strategy.html

Git Magic
http://www-cs-students.stanford.edu/~blynn/gitmagic/index.html

git-new-workdir
http://nuclearsquid.com/writings/git-new-workdir/

Git Is Simpler Than You Think
http://nfarina.com/post/9868516270/git-is-simpler

Got Git? HOWTO git and github
http://b.lesseverything.com/2008/3/25/got-git-howto-git-and-github

Git pull certain branch from github
http://stackoverflow.com/questions/1709177/git-pull-certain-branch-from-github

Push and Pull Branches In Git
http://stackoverflow.com/questions/1072261/push-and-pull-branches-in-git

GitJungle (beta)
http://www.plasticscm.com/labs/gitjungle.aspx

Git Internals
http://peepcode.com/products/git-internals-pdf

Introduction to Git with Scott Chacon of GitHub
http://www.youtube.com/watch?v=ZDR433b0HJY

Topic Branches
https://github.com/dchelimsky/rspec/wiki/Topic-Branches
A “topic” branch is a separate branch that you use when working on a single “topic” (a bug fix, a new feature, or an experimental idea). Working on a topic branch instead of directly on top of “master” is recommended because…

Fork A Repo
http://help.github.com/fork-a-repo/

Send pull requests
http://help.github.com/send-pull-requests/

How GitHub Works: Be Asynchronous
http://zachholman.com/posts/how-github-works-asynchronous/

Git.js: A Git Implementation in Pure JavaScript
http://www.readwriteweb.com/hack/2011/08/gitjs-a-git-implementation-in.php

Martin Fowler: SemanticConflict
http://martinfowler.com/bliki/SemanticConflict.html

Announcing Git Support for Google Code Project Hosting
http://google-opensource.blogspot.com/2011/07/announcing-git-support-for-google-code.html

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

Keep tuned!

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

November 16, 2011

Ruby: Links, News and Resources (2)

Filed under: Links, Programming Languages, Ruby — ajlopez @ 9:29 am

Previous Post
Next Post

More links about Ruby:

Why Bother With Cucumber Testing?
http://www.jackkinsella.ie/2011/09/26/why-bother-with-cucumber-testing.html
The disadvantages of using Cucumber and its widespread use as a poor man’s integration test.

Confident Code
http://avdi.org/talks/confident-code-rubymidwest-2011/confident-code.html
This is a talk about… JOY

Avdi Grimm
http://about.avdi.org/

Exceptional Ruby
http://exceptionalruby.com/
Master the art of handling failure in Ruby

seidi / Amethyst
https://github.com/rseidi/Amethyst
Amethyst is a programming language based on Ruby syntax, that transcompiles to JavaScript.

Ruby in Twenty Minutes
http://www.ruby-lang.org/en/documentation/quickstart/

True, False And Nil Objects In Ruby
http://www.skorks.com/2009/09/true-false-and-nil-objects-in-ruby/

Default Ruby accessor method?
http://stackoverflow.com/questions/636277/default-ruby-accessor-method

Mini reviews of 19 Ruby template engines
http://www.hokstad.com/mini-reviews-of-19-ruby-template-engines.html

Class and Instance Methods in Ruby
http://railstips.org/blog/archives/2009/05/11/class-and-instance-methods-in-ruby/

Ruby Method Visibility
http://blog.zerosum.org/2007/11/22/ruby-method-visibility

Using TDD to Develop a Basic Algorithm
http://schuchert.wikispaces.com/ruby.tutorials.tdd.UsingTddToDevelopABasicAlgorithm

SCREENCAST OF TEST DRIVEN DEVELOPMENT WITH RUBY: PART 1 – A SIMPLE EXAMPLE
http://kanemar.com/2006/03/04/screencast-of-test-driven-development-with-ruby-part-1-a-simple-example/

Development Kit
https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
The DevKit is a toolkit that makes it easy to build and use native C/C++ extensions such as RDiscount and RedCloth for Ruby on Windows.

Rubyconf Argentina 2011
http://nilclass.blogspot.com/2011/11/rubyconf-argentina-2011.html?spref=tw
by @dseminara

RedDot RubyConf 2011 and Github Drinkup
http://www.prateekdayal.net/2011/04/25/reddot-rubyconf-2011-and-github-drinkup/

etagwerker / c2010-scrapper
https://github.com/etagwerker/c2010-scrapper
Scraper del Censo 2010 by @etagwerker

Savon
http://savonrb.com/
Ruby SOAP Client

RubyGems Guides
http://guides.rubygems.org/

Cut & Polish: A Guide to Crafting Gems
http://speakerdeck.com/u/pat/p/cut-polish-a-guide-to-crafting-gems

The Last Programming Language
http://skillsmatter.com/podcast/agile-testing/bobs-last-language/js-2958
by @unclebob

Ruby 1.9.3: Improved Performance and Stability and BSD Licensed
http://www.infoq.com/news/2011/11/ruby-193

How to remove installed ri and rdoc?
http://stackoverflow.com/questions/2941005/how-to-remove-installed-ri-and-rdoc

Programming With Nothing
http://speakerdeck.com/u/tomstuart/p/programming-with-nothing
We love Ruby for being powerful & expressive, but how much power does Ruby have if you remove all of its datatypes except for Proc and all of its features except for Proc.new and Proc#call?
https://github.com/tomstuart/nothing

A pretty good lisp
http://www.cs.uni.edu/~wallingf/blog/archives/monthly/2011-10.html#e2011-10-31T15_47_07.htm

Contribute to RubyGems
http://contribute.rubygems.org/
Get involved and get hacking with projects using RubyGems!

Clever Algorithms
Nature-Inspired Programming Recipes
http://www.cleveralgorithms.com/

Is it Rubinius?
http://isitrubinius.com/
Community-powered gem compatibility for Rubinius

Partial application that works on all Ruby implementations
https://gist.github.com/1225596

Closures – A Simple Explanation (Using Ruby)
http://www.skorks.com/2010/05/closures-a-simple-explanation-using-ruby/

My links
http://delicious.com/ajlopez/ruby

More Ruby, Rails and other languages links, are coming.

Keep tuned!

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

November 11, 2011

Machine Learning: Links, News and Resources (1)

Filed under: Artificial Intelligence, Lambda Calculus, Links, Machine Learning — ajlopez @ 10:01 am

http://en.wikipedia.org/wiki/Machine_learning
Machine learning, a branch of artificial intelligence, is a scientific discipline concerned with the design and development of algorithms that allow computers to evolve behaviors based on empirical data, such as from sensor data or databases. Machine learning is concerned with the development of algorithms allowing the machine to learn via inductive inference based on observing data that represents incomplete information about statistical phenomenon and generalize it to rules and make predictions on missing attributes or future data. An important task of machine learning is classification, which is also referred to as pattern recognition, in which machines “learn” to automatically recognize complex patterns, to distinguish between exemplars based on their different patterns, and to make intelligent predictions on their class.

Machine Learning at Stanford
http://www.ml-class.org/course/auth/welcome
Enroll today in our online class for free!

Reinforcement Learning: An Introduction
http://webdocs.cs.ualberta.ca/~sutton/book/ebook/the-book.html

Machine Learning
Systems that Improve Their Performance
http://aaai.org/AITopics/MachineLearning

Does Machine Learning Really Work?
http://www.aaai.org/ojs/index.php/aimagazine/article/view/1303/1204

My first encounter with the topic:
Samuel’s Checkers Player
http://webdocs.cs.ualberta.ca/~sutton/book/ebook/node109.html

TD Gammon
http://webdocs.cs.ualberta.ca/~sutton/book/ebook/node108.html

University of Alberta, Department of Computing Science, Machine Learning
https://www.cs.ualberta.ca/research/research-areas/machine-learning

University of Alberta, CS, Research
https://www.cs.ualberta.ca/research
See
https://www.cs.ualberta.ca/research/research-areas/bioinformatics
https://www.cs.ualberta.ca/research/research-areas/computer-games
https://www.cs.ualberta.ca/research/research-areas/artificial-intelligence
https://www.cs.ualberta.ca/research/research-areas/advanced-man-machine-interfaces

Turing award goes to ‘machine learning’ expert
http://www.physorg.com/news/2011-03-turing-award-machine-expert.html

Stanford School of Engineering – Stanford Engineering Everywhere
http://see.stanford.edu/see/courseInfo.aspx?coll=348ca38a-3a6d-4052-937d-cb017338d7b1

InfoQ: Machine Learning: A Love Story
http://www.infoq.com/presentations/Machine-Learning

Informaniac: Machine Learning for Bug Discovery
http://www.informaniac.net/2008/06/machine-learning-for-bug-discovery.html

io9. We come from the future.
http://m.io9.com/5659503/a-computer-learns-the-hard-way-by-reading-the-internet

bradford’s infer at master – GitHub
http://github.com/bradford/infer

Pragmatic Programming Techniques: Map/Reduce to recommend people connection
http://horicky.blogspot.com/2010/08/mapreduce-to-recommend-people.html

Smarter Than You Think – I.B.M.’s Supercomputer to Challenge ‘Jeopardy!’ Champions – NYTimes.com
http://www.nytimes.com/2010/06/20/magazine/20Computer-t.html?hp

Google Prediction API: Commoditization of Large-Scale Machine Learning? – A Computer Scientist in a Business School
http://behind-the-enemy-lines.blogspot.com/2010/05/google-prediction-api-commoditization.html

Apache Mahout – Overview
http://mahout.apache.org/

Papers – Hadoop Wiki
http://wiki.apache.org/hadoop/Papers

20Q – Wikipedia, the free encyclopedia
http://en.wikipedia.org/wiki/20Q

Machine Learning in Game AI – Stack Overflow
http://stackoverflow.com/questions/970060/machine-learning-in-game-ai

Applications of Machine Learning to the Game of Go
http://videolectures.net/epsrcws08_stern_aml/
David Stern, Applied Games Group, Microsoft Research Cambridge

Deep Boltzmann Machine on MNIST
http://quotenil.com/Deep-Boltzmann-Machine-on-MNIST.html

Introduction to MGL (part 1)
http://quotenil.com/Introduction-to-MGL-(part-1).html

Measuring Measures – blog – Learning about Machine Learning, 2nd Ed.
http://measuringmeasures.com/blog/2010/3/12/learning-about-machine-learning-2nd-ed.html

IET/BCS Turing Lecture 2010 | Professor Christopher Bishop
http://tv.theiet.org/technology/infopro/turing-2010.cfm

So you think machine learning is boring?
http://www.causata.com/blog/2010/02/so-you-think-machine-learning-is-boring.html

Google AI Challenge
http://csclub.uwaterloo.ca/contest/

Common Lisp and Google AI Challenge
http://aerique.blogspot.com/2010/02/google-ai-challenge-2010.html

Infer.NET: Building Software with Intelligence :: Sessions :: Microsoft PDC09
http://microsoftpdc.com/Sessions/VTL03

Infer.NET – Now with F# support @ JustinLee.sg
http://www.justinlee.sg/2009/12/09/infer-net-now-with-f-support/

Pragmatic Programming Techniques: Machine Learning: Association Rule
http://horicky.blogspot.com/2009/10/machine-learning-association-rule.html

Pragmatic Programming Techniques: Machine Learning with Linear Model
http://horicky.blogspot.com/2009/11/machine-learning-with-linear-model.html

A New Theory of Awesomeness and Miracles, by James Bridle, concerning Charles Babbage, Heath Robinson, MENACE and MAGE
http://shorttermmemoryloss.com/menace/

A small personal project to learn Clojure by implementing some simple machine learning algorithms edit
http://github.com/mreid/injuce/

Introducing Apache Mahout
http://www.ibm.com/developerworks/java/library/j-mahout/index.html

Apache Mahout – Overview
http://lucene.apache.org/mahout/

How Flightcaster squeezed predictions from flight data
http://www.datawrangling.com/how-flightcaster-squeezes-predictions-from-flight-data

Map-Reduce for Machine Learning on Multicore
http://www.cs.stanford.edu/people/ang//papers/nips06-mapreducemulticore.pdf

Torch3: The Dream Comes True
http://www.torch.ch/introduction.php

Reinforcement Learning and Artificial Intelligence: Toolkit
http://rlai.cs.ualberta.ca/RLAI/RLtoolkit/RLtoolkit1.0.html

Machine Learning Book Code
http://seat.massey.ac.nz/personal/s.r.marsland/MLBook.html

Scientific Commons: Simon Colton
http://de.scientificcommons.org/simon_colton

A Grid-based Application of machine learning to model generation
http://www.doc.ic.ac.uk/~sgc/papers/sorge_ki04.pdf

Reinforcement Learning: An Introduction
http://webdocs.cs.ualberta.ca/~sutton/book/ebook/the-book.html

Learning Draughts/Checkers
http://www.codeproject.com/KB/game/learning_draughts.aspx

Learning Connect Four
http://www.codeproject.com/KB/game/learningconnectfour.aspx

Introduction to Machine Learning
http://robotics.stanford.edu/~nilsson/mlbook.html

The Use of Java in Machine Learning
http://www.developer.com/java/other/article.php/10936_1559871_1

Similarity Learning – IDL – EE – Washington.edu
http://idl.ee.washington.edu/similaritylearning/

Gwap
http://www.gwap.com/gwap/about/

Machine Learning
http://aima.cs.berkeley.edu/ai.html#learning

Artificial Intelligence on the Web
http://aima.cs.berkeley.edu/ai.html
This page links to 820 pages around the web with information on Artificial Intelligence.

Yu-Han Chang
http://www.yuhanchang.com/home.html
“My research centers on learning in rich multi-agent environments”

My Links
http://www.delicious.com/ajlopez/machinelearning

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

November 9, 2011

Ruby On Rails: Links, News and Resources (1)

Filed under: Links, Rails, Ruby, Ruby on Rails, Web Development — ajlopez @ 12:19 pm

http://en.wikipedia.org/wiki/Ruby_on_Rails

Ruby on Rails, often shortened to Rails or RoR, is an open source web application framework for the Ruby programming language.

Ruby on Rails was extracted by David Heinemeier Hansson from his work on Basecamp, a project management tool by 37signals (now a web application company).[9] Hansson first released Ruby on Rails as open source in July 2004, but did not share commit rights to the project until February 2005.[10] In August 2006 the framework reached a milestone when Apple announced that it would ship Ruby on Rails with Mac OS X v10.5 “Leopard”,[11] which was released in October 2007.

Ruby on Rails version 2.3 was released on March 15, 2009. Major new developments in Ruby on Rails include templates, engines, Rack and nested model forms. Templates enable the developer to generate a skeleton application with custom gems and configurations. Engines let one reuse application pieces complete with routes, view paths and models. The Rack web server interface and Metal allow one to write optimized pieces of code that route around ActionController.[12]

On December 23, 2008, Merb, another web application framework was launched, and Ruby on Rails announced a commitment to work together. The Ruby on Rails team announced they would work with the Merb project to bring “the best ideas of Merb” into Ruby on Rails 3, ending the “unnecessary duplication” across both communities.[13] Merb was merged with Rails as part of the Rails 3.0 release.[14][15]

Jumpstart your Ruby on Rails 3 applications with rails-templater

http://adventuresincoding.com/2010/07/jumpstart-your-ruby-on-rails-3-applications-with-rails-templater

Rails Wizard

http://railswizard.org/

Why DataMapper?

http://datamapper.org/why

Crafting Rails Applications: Why I wrote this book

http://blog.plataformatec.com.br/2010/12/crafting-rails-applications-why-i-wrote-this-book/

Rails Routing from the Outside In

http://guides.rubyonrails.org/routing.html

Crafting Rails Applications: Expert Practices for Everyday Rails Development

http://pragprog.com/book/jvrails/crafting-rails-applications

Why Rack should matter to .NET developers

http://www.robustsoftware.co.uk/post/2131023052/why-rack-should-matter-to-dot-net-developers

Rack is a layer of abstraction which sits between servers and frameworks. What it brings as a result is greater interoperability between HTTP server implementations and web frameworks. As the author of a HTTP server if you get your server to speak Rack you can now host applications written in several Ruby frameworks, Sinatra and Rails being two of the most well known.

VAN – Noviembre 20 de 2010 – Ruby on Rails

http://www.altnethispano.org/wiki/van-2010-11-20-ruby-on-rails.ashx

By @mario_chavez

Ruby on Rails Tutorial: Learn Rails by Example

http://ruby.railstutorial.org/

Rails for Zombies

http://railsforzombies.org/

Alberto Perdomo Presentations

http://www.slideshare.net/alberto.perdomo

Rails101 Tutorial Ruby on Rails with Relations

http://conceptspace.wikidot.com/blog:19

Nimble Method

http://blog.pluron.com/

Rails 3 Screencasts

http://allaboutruby.wordpress.com/2010/06/27/rails-3-screencasts/

Helicon Zoo — a repository of web frameworks and applications for Microsoft IIS.

http://www.helicontech.com/zoo/

It supports Rails

Rails en la nube se llama Heroku

http://recorriendootrosrumbos.blogspot.com/#!/2011/10/rails-tiene-scaffold-nosotros-usamos.html

Ubuntu 11.10 to support the Cloud Foundry Platform-as-a-Service

http://www.h-online.com/open/news/item/Ubuntu-11-10-to-support-the-Cloud-Foundry-Platform-as-a-Service-1324917.html

From .NET to Ruby: Adventure, Courage, and Joy

http://www.infoq.com/presentations/From-NET-to-Ruby

Why ruby?

http://blog.crowdint.com/2011/02/25/why-ruby.html

La complejidad de Ruby On Rails

http://blog.decisionesinteligentes.com/post/1689598042/la-complejidad-de-ruby-on-rails

A Guide To Starting Your Own Rails Engine Gem

http://coding.smashingmagazine.com/2011/06/23/a-guide-to-starting-your-own-rails-engine-gem/

Java Developers have Loads to Learn from the Rails Community

http://www.theserverside.com/video/Java-Developers-have-Loads-to-Learn-from-the-Rails-Community

Ruby Version Manager (RVM)

https://rvm.beginrescueend.com/

ALT.NET Café – Mayo 13 de 2011 – La Inmortalidad de la Medusa – Web Frameworks

http://www.altnethispano.org/wiki/cafe-2011-05-13-web-frameworks.ashx

Advanced Data Models with Rails

http://net.tutsplus.com/tutorials/ruby/advanced-data-models-with-rails/

Rails Best Practices

http://www.codeschool.com/courses/rails-best-practices

Easy Rails OAuth Integration Testing

http://blog.zerosum.org/2011/03/19/easy-rails-outh-integration-testing.html

Rails 3 Baby Steps – Part 2

http://www.codethinked.com/rails-3-baby-steps-part-2

Radiant / radiant

https://github.com/radiant/radiant/wiki/

Radiant is a no-fluff, open source content management system designed for small teams. It is similar to Textpattern or MovableType, but is a general purpose content management system (not just a blogging engine).

RESTify DayTrader

http://bitworking.org/news/201/RESTify-DayTrader

[RAILS 101] Video Tutorials Ruby On Rails

http://www.codersvenezuela.com/post/rails-101-video-tutoriales-de-ruby-on-rails/25

Rails Installer (for Windows)

http://railsinstaller.org/

Ruby and Rails for Attractive .NET Developers

http://david.ing.name/2010/12/18/ruby-and-rails-for-attractive-net-developers/

kfaustino / rails-templater

https://github.com/kfaustino/rails-templater

Template generator for Ruby on Rails 3 applications

Ruby on Rails Tutorial

http://ruby.railstutorial.org/chapters/beginning

Development Kit: How to install it

https://github.com/oneclick/rubyinstaller/wiki/Development-kit

Rails Searchable API Doc

http://railsapi.com/

Bundler

http://gembundler.com/

Bundler manages an application’s dependencies through its entire life across many machines systematically and repeatably.

Getting Started with Rails

http://guides.rubyonrails.org/getting_started.html

My links

http://delicious.com/ajlopez/rubyonrails

Keep tuned!

Angel “Java” Lopez

http://www.ajlopez.com

http://twitter.com/ajlopez

Older Posts »

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

Follow

Get every new post delivered to your Inbox.