Changes & Awesome People

Warning, if you’re looking for tech, this isn’t the article. I’m writing this up in relation to the people in the industry.

Geoloqi goes ESRI!

Geoloqi and ESRI are the same force now, if anyone was watching Geoloqi they already know this. But I just wanted to follow up since I know personally – as good friends – the team over there and a new member of their team.

Amber Case

Amber Case, CEO and brain stormer, thinker and all around great person has lead the Geoloqi crew on a great path to acquisition. She kept the VC vultures at bay, helped to maintain the integrity of building a real platform versus a quick buck “dine and dash” type of company. I commend her on a job well done! I can’t wait until I get to chat with her again about all the great things they’ve been working on and what’s in store for the team now! Follow Amber on twitter, Cyborg Anthropology and her site.

Aaron Parecki & Kyle Drake

These guys are great. The coders, hackers, architects and implementers of Geoloqi from the beginning. I wrote about Kyle before when we had a chance to have him speak at Node PDX (a few words here and here) earlier this year. Kyle & Aaron have worked diligently on building out the real time nature of the high I/O systems of Geoloqi. Follow Aaron on twitter, blog and code and flickr. Follow Kyle on twitter, and code.

Jerry Sievert

My friend and also a Node PDX Speaker, has joined to lead the development efforts of Geoloqi in the new ESRI Structure. I’m super excited for Jerry and what this will bring for hacking endeavors next time we get to hang out. He also blogs, tweets and of course codes nonstop – see Github.

Warner Media Group (WMG) gets Brian McClain

I’m jealous, another person I’d love to work with. With this change I might get to do just that in some ways. Brian has been an active contributor and instigator in the Cloud Foundry Community and is now kicking off what I can only imagine as some awesome projects at WMG! I’m on pins and needles waiting to hear about what they’re working on. Congratulations to Brian, Dave McCrory (who has a twitter & blog too) and the whole team over there. WMG just got a great new team member! Follow Brian on twitter or via his code on Github.

…and that’s it for today. I’ll have more news on some key people at key companies in the very near future. Keep on guessing, cheers!

JavaScript Libraries Spilled EVERYWHERE! Series #002

In the last blog entry I wrote up vows.js for testing JavaScript, in this I’ve tried out another testing framework called mocha. This framework is pretty extensive as you can do the things you do with vows.js as well as a lot of other techniques. In addition to mocha I’ve added a few other things to the mix. As well as a few obvious points where I need to RTFM still about how mocha works.

mocha.js

Before falling off into a conversation about reading the manual, I’ll dive into a bit about mocha. Mocha is a project, hosted on github as you might expect, that aims to provide a very feature rich test framework that can run via node or the browser. It also enables asynchronous and synchronous testing with some pretty sweet reporting.

The installation is the standard simplicity of a beautiful and elegant package from npm for node.js.

$ npm install -g mocha

Of course, depending on the way you’ve setup your machine, you may need to hit that command with sudo. The sample test on the main documentation & project page is pretty straight forward, I’ve copied it below for easy reference.

$ npm install -g mocha
$ mkdir test
$ $EDITOR test/test.js

Note that above, where “$EDITOR” is whatever editor you’re using, such as Sublime 2, Textmate, Webstorm or whatever.

var assert = require("assert")
describe('Array', function(){
  describe('#indexOf()', function(){
    it('should return -1 when the value is not present', function(){
      assert.equal(-1, [1,2,3].indexOf(5));
      assert.equal(-1, [1,2,3].indexOf(0));
    })
  })
})

Then run the test.

$  mocha

  .

  ✔ 1 test complete (1ms)

Overall, pretty sweet and simple. There are ways to setup mocha to do TDD or BDD style also. What I’ve done for my basic name generator I’m building has started of super simple. One of the other additions that I’ve added below is the should.js library. I’ll add more about this library, and the intent behind using it in the next blog article I write up.

My first tests I’ve put together I’ve entered below.

require('should');
var factory = require('./../lib/NameFactory').nameFactory;

describe('when working with names using NameFactory', function(){
  var generateThisManyNames = 3;

  describe('generating names', function(){
    it('should return a name between 3 and 20 characters', function(){
        factory.generate_names().length.should.be.approximately(3,20);
    });
    it('should return correct number of names', function(){
        factory.generate_names(generateThisManyNames).length.should.equal(generateThisManyNames);
    });
  })
});

…and then I’ve implemented the absolute basic to get those tests to pass. You JavaScripters that have been at it for a while can likely detect my massive newbism among this code. I’d love feedback btw. 🙂 So here’s my basic implementation so far.

module.exports.nameFactory = {
    generate_names: function (count) {
        if (count > 1){
            return [",","];
        }
        else{
            return 'stuff';
        }
    }
};

I’m still sketch on best practices around a number of object uses and creation in JavaScript. For instance in my code above, I’m creating a module, and setting up properties with functions, which leads to a number of questions… (maybe it is stack overflow time)

  • Is this an efficient way to create a JavaScript function for returning randomly created names?
  • What would your first tests be when creating a name generator? Any suggestions on some tests to add?
  • This shows some of my intent, such as returning a single result if no count is entered or it is less than 2, any suggestions on doing a kind of overloaded factory pattern method like that?
  • Now that I’ve gotten what I do above, I need some more tests to add to confirm that the returned content isn’t [”,”,”] <- cuz’ obviously that’s useless and not random, just returns the 3 string array that would prospectively have generated (or randomly selected) names. Ideas?
  • Is there another way to create a class or namespace that isn’t “module.export…” like I have above with “module.exports.nameFactory”? I’d love to just have a “NameFactory” or something. Not sure how or what way would be best in JavaScript land to put something like that together.

I’ve already moved past just this, but would love any feedback on the above questions and code snippets. I’ll post my results and the changes and additions from any body that posts feedback and suggestions in a subsequent post.  🙂

Cheers!

ETLs and APIs – A Thought Stream on the Matter, Are Things Really Changing That Much?

Often the tendency has been, and largely still is in Enterprises, to build things really large. Doing big design up front (BDUF) all the way to creating massive JavaScript libraries for generating JavaScript from non-JavaScript langauges, leading to a huge case of analysis paralysis and other such keywords that all point to the mythic man month or software death march. In the end, building big is building to fail – in a non-learning, non-useful, big bank, financial collapse type of failure. So mumbo jumbo aside, what am I saying?

I recently read the article by Anant Jhingran over at apigee titled “From ETL to API A Changed Landscape for Enterprise Data Integration“. In the article Anant points out a number of things around this movement to APIs versus ETL efforts in leading enterprises. I couldn’t help but notice this is a recurring theme in software development and with humans in general.

Observation

With Governments: Central planning through attempting to dictate order (i.e. Soviet Union) will eventually fail  for a less dictatorial plan around keeping things simple and organizing around communities to plan large efforts.

Translation to Tech: Having mainframe/server that dictates order will eventually fail for a less controlled Internet of systems that maintain simplicity and organize around communities of people to create large efforts.

Translation to Software: Building homogenous massive systems of record that dictate order will eventually fail for less controlled service orientation that can maintain their own system of record around departmental domains of people to create and operate large efforts, like enterprises.

Of course, the concern I have is, we humans tend to do things in a cyclic nature, as with Governments we move toward freedom and liberty, then the other direction, then back again. Big control to little control to big control again.

Summary

I see the point in the article, bringing the ETL massiveness under control of the smaller services, but in the end what we all need to do is to keep things in perspective. The extraction, transformation and loading of ETL still needs to occur along with the usage of application programmer interfaces ala the APIs. So where does this really get us, this acknowledged shift? It really just brings into focus a desire to simplify and bring things into a manageable state in the Enterprise. It makes sense that the leading enterprises are doing this, simply because they’ve reached that maturity level. Of course there will still be thousands upon thousands that haven’t reached this maturity point and will have to go through the pain of large scale centrally managed and planned ETL systems.

In the end, we’ll always have to return to the simple things to get true understanding.

Portlanders Going to Cascadia.js? Ride the “Geek Train to Cascadia”

We’ll be boarding Amtrak Cascades #508 to Seattle departing Portland at 6:15pm from Union Station. If you’re interested in doing a bulk ticket purchase let me know ASAP and I’ll work with you to organize that. Otherwise if you just want to pick up a ticket and meet us on the train let us know that too.

Logistics

Make sure to let me know if you want to join the riders & we’ll join up to be boarded together in the same car, this way we can get tables, seats and code together or at least have a good convo, a beer or three (or wine or juice or whatever you’d prefer) while sitting back, relaxing and enjoying the ride to Seattle.

So RSVP me here & we’ll get this moose LIT UP!

Coder’s Vacation : OMG! JavaScript Libraries Spilled EVERYWHERE! Series #001

NOTE: All parts of this series and my other series can be found on my series links page.

I sat down a few days ago on this trip to get a simple project setup, instead something else happened. It is my fault, entirely my fault. I could have stayed focused on a single library but instead I’ve let them explode. They’re everywhere now in my project!  😮  I’ve learned a great deal about breaking and fixing things though when working with testing frameworks and Node.js. All of this being rooted in my exceedingly simple project called NameFactory on Github. Here’s a few of the things I’ve stumbled through over the course of figuring out these testing frameworks.

vows.js (while chillin’ at Phils Coffee)

Phils Coffee, a staunch cup indeed!

Phils Coffee, a staunch cup indeed!

If you aren’t familiar with vows, here’s the brief description. Vows is a node.js testing framework that is built around the notion of BDD, Behavior Driven Development. The other important thing to note, is vows.js was built specifically to test asynchronous code. It can test others, but it is more oriented toward asynchronous code. Vows also runs tests in parallel, which thinking about that it takes the random order execution and ups the game even further by running them this way. It can really tighten up code execution and regression that things will indeed work in many different conditions. Building for web scale on the internet, that’s something we definitely need!  🙂

To install vows, it follows your standard pattern with npm:

npm install vows

When I installed it I really bit the bullet and went for a global install.

sudo npm install -g vows

From there I spun up a really simple example that is shown on the vows.js site:

var vows = require('vows'),
    assert = require('assert');

vows.describe('Division by Zero').addBatch({
    'when dividing a number by zero': {
        topic: function () { return 42 / 0 },

        'we get Infinity': function (topic) {
            assert.equal (topic, Infinity);
        }
    },
    'but when dividing zero by zero': {
        topic: function () { return 0 / 0 },

        'we get a value which': {
            'is not a number': function (topic) {
                assert.isNaN (topic);
            },
            'is not equal to itself': function (topic) {
                assert.notEqual (topic, topic);
            }
        }
    }
}).run();

From this example you run the tests by executing the code with the following command:

node division-by-zero-test.js

This is all fine, but I’d rather be using the vows test runnner. To do that you’ll need to, instead of *.run(); call the *.export(); function instead. At this point I started scratching my head a bit and looking for parallels between my understanding of BDD and testing and what vows is doing. So I read further and came up with a few observations.

In vows the convention is to have one test suite per file and have the subject match the name. This makes sense to me, that’s how I’ve generally done similar things with Ruby, C# and the like. You end up with something like this for setting the subject and adding the various test suites:

var suite = vows.describe('subject');

suite.addBatch({/* run 1st */}).addBatch({/* 2nd */}).addBatch({/* 3rd */});

suite.addBatch({
   'A context': {
        topic: function () {/* Do something async */},
        'I am a vow': function (topic) {
            /* Test the result of this topic */
        }
    },
   'Another context': {
        topic: function () {/* Do something else async */},
        'I am another vow': function (topic) {
            /* Test the result of this topic */
        },
        'I am another sub-context vow': function (topic) {
            /* Test the result of the topic */
        },
        'And another sub-context': {
            /* Executed when the tests above finish running */
        }
    }
});

Each of the topics are the thing that is being tested with the secondary element of each test being the test to verify the topic. Each of these things are run asynchronously, in parallel, so be sure to keep that in mind when using this framework. However note, in the sub-context tests above the sub-context happens in order. This can be used in various ways, but be sure to not abuse this execution model to avoid the asynchronous nature of JavaScript, I’ve only been working with vows for a few days and have already seen code snippets on the web that have done exactly that!

So this is the first part in a series where I’ll just cover all sorts of JavaScript libraries. It took a Coder’s Vacation however to get me started on this series, enjoy.