Thursday, October 31, 2013

"enterprising" the free

Here is an idea for a business model:

  1. take a piece of open source software that everyone in consulting uses and loves
  2. dress it up some with your own shim of extensions so that you may call the new thing (the free thing with your tweaks bolted on) a commercial product
  3. put a helpdesk in front of it so that your commercial software may become enterprise software
  4. start selling support engagements

What? You don't think that is a good business model? Well, that seems to be the business model of both StrongLoop and Datical as best as I can tell! That is correct, not one but at least two Austin-based ventures are doing this. How can this possibly work? Why wouldn't an enterprise just use the free version? The answer is that enterprises hate free stuff as they fear there will be no one around to support it. They need to be able to call someone in the middle of the night when things go South. They are all about engaging with vendors for IT solutions.

Bubbling copy/paste-friendly gunk up to smartphones in HTML5 applications.

When surfacing something that needs to be copy/paste-friendly from within the bowels of your application, why not use a textarea control as suggested here and make its copy automatically selected with JavaScript like this?

textarea.focus();
textarea.selectionStart = 0;
textarea.selectionEnd = textarea.value.length;

 
 

I hope this approach will prove iPhone-friendly. I'm not certain as of yet.

 
 

Addendum 11/1/2013: It didn't work. :(

When calling a file that is not a .js file via the AMD convention...

...you need you specify the extension, such as .html.

Manipulate CSS styles in Dojo!

"Up top" we have...

define([
   "dojo/dom",
   "dojo/dom-style"
], function(dom, domStyle){

 
 

"Down below" we have...

var textarea = dom.byId("whatever");
domStyle.set(textarea, "width", "100%");
domStyle.set(textarea, "height", "300px");
textarea.innerHTML = text;

swapping dates as strings from local to UTC time with moment.js

Cast a local time date in a military-time/nothing-but-digits-and-dividers/alphabetical-order-friendly string format to a UTC time military-time/nothing-but-digits-and-dividers/alphabetical-order-friendly string format:

var localString = "1974-8-24 06:13:13";
var pointInTime = moment.utc(localString);
var formattedTime = pointInTime.format('YYYY-MM-D HH:mm:ss');

 
 

Cast a UTC time date in a military-time/nothing-but-digits-and-dividers/alphabetical-order-friendly string format to a local time military-time/nothing-but-digits-and-dividers/alphabetical-order-friendly string format:

var utcString = "1974-8-24 06:13:13 GMT";
var pointInTime = moment(utcString);
pointInTime.local();
var formattedTime = pointInTime.format('YYYY-MM-D HH:mm:ss');

 
 

Using "UTC" in place of "GMT" above seems to work just fine too.

Datical DB

I saw a Mr. Pete Pickerill of Datical speak on Datical DB which is built on top of an open source piece of software called Liquibase and felt a lot like a different, comparable open source piece of software I've used called The Tarantino Project. Datical DB is not free however, it is enterprise software. As with Tarantino, a schema gets an extra table that keeps track of what scripts have been run against a given instance of a database so that a continuous integration process may update the database with just the lacking scripts as kept in source code. Tarantino uses raw SQL while Datical has an XML abstraction. Tarantino is for MSSQL while MSSQL, Oracle, mySQL, PostgreSQL, and IBM's DB2 all jive with Datical's stuff which also has a GUI and a "Forecast" feature that warns us when we are doing something like truncating a field will which sabotage existing data. The talk was an Agile Austin special interest group thing held at Bazaarvoice. A Mr. Carey Benge of Datical also spoke and emphasized the need to keep scripts small and atomic in database change management implementations.

the objects moment.js makes are not JavaScript date objects

Cast them back to plain Jane dates like so:

var lastHalloween = moment().subtract('year', 1).toDate();