Monday, January 13, 2014

5 Applications in 5 Months - Introduction

For a long time there have been many technologies out there that I wanted to try out many different "new" technologies and just haven't had the time to dedicate to it.  Well that isn't true, it isn't that I didn't have the time as much as I didn't make the time.  Well that is about to change.  I recently saw a this post 30 Technologies in 30 days a developers challenge and decided that if this person can do 30 new technologies in a month, that I should be able to build a simple application in a month, and then, lather rinse and repeat.  So I started thinking what are some things I want to learn, what kind of application can I build.  So here is what I came up with.  I want to build a Modern Web Application.  This would have a rich web client, use noSql for the database, openId and OAuth for login, and a Rest based api.  That starts to frame up the application, but beyond some of these overarching things, what should I narrow them down to.

Backend Technologies:

Frameworks
Spring/Grails - Baseline application
NodeJS
Play
Vert.X
WebMachine (or Clojure based Framework)

Authentication
OpenId (google, facebook, github)
Oauth 2.0

DB
MongoDB
Postgres or MySql

Front End Frameworks:

Polymer/JQuery/BaconJS
EmberJS
AngularJS
BackBone/Marionette


The application that I will be building is a basic project management application.  The basics will be:
User Logs in using Google, FaceBook, Github
CRUD Operations on Projects for User
CRUD Operations on Stories for Project
CRUD Operations on Tasks for Stories

In a future post I will put together the UI wireframes for the application.

I will be creating a list of tests against the Rest endpoints to verify functionality for all backends.  For the front ends I will be trying to create both unit tests and front end tests also.

The first steps I will be putting together will be to create a set of tests for the API, create a relational and noSql data model for the application.  After that I can start my first backend.

Benefits of learning the Shell from a reformed windows user

A while back I thought I knew quite a bit, coding Java on my Windows XP laptop.  I read the Pragmatic Programmer and it talked about learning a shell and all the things it could help you with.  Of course at the time, I knew better, what would I need a shell to do, a DOS prompt was just fine.  Then in my consulting travels I was lucky enough to work with Victor Gonzales.  He had spent a lot of time working on Unix environments and felt so constrained on Windows that he installed Cygwin.  As I watched him work, I was amazed at what he could do in emacs as well as what he would do from the command prompt.  This prompted me, pun intended to install Cygwin also and start learning this amazing tool.  Over time I migrated to a Mac so I could use terminal, and now like Victor  I think I would be lost if I couldn't have this tool in my arsenal.

Now that I have given all this background on how I started using the Shell, here is the specific case.  I was working on a Grails project and we found an error that was being created in all files that were doing a specific thing.  Rather then look through all the files manually I was able to come up with these scripts to help me identify the affected files and also to then replace the affected lines.

This first script is what I came up with to find all the files with the issue.  I did a grep of all files in the views directory that contained actionSubmit.  I pipe those files to show the line that has action=  I then use sed to remove the action= from the line, sort it, uniq it, then use awk to display the information
grep -R "actionSubmit" views/* | grep -o 'action=\"[a-zA-Z]*' | sed 's/action="//' | sort | uniq | awk '{print "    def " $1 " = { \n        error()\n    }\n";}'
This is similar to the above but I use find to return all the files under views then grep each one for the actionSubmit to get the items and the counts this is then piped through grep for the line and displayed.

find views/ -type f -exec sh -c "grep -l actionSubmit {};  grep -c actionSubmit {}; grep actionSubmit {} | grep -o 'action=\"[a-zA-Z]*' | sed 's/action=\"//'"  \;