Tuesday, April 08, 2014

My Meteor App Upgrade from 0.7.2 to 0.8

As a matter of hoping to help someone who is also doing the upgrade of their Meteor app from .72 to .8 I have recorded my experience. After starting my app and getting the notification that 0.8 is available I updated Meteor. After restarting the app, I got the following error:
=> Errors prevented startup:
While building the application:client/views/stuff/stuff_submit.html:6: Only certain elements like BR, HR, IMG, etc. (and foreign elements like SVG) are allowed to self-close...Your request here."/>         </div>     ...                        ^
While building package `accounts-ui-bootstrap-dropdown`:error: no such package: 'spark'login_buttons.html:89: Only certain elements like BR, HR, IMG, etc. (and foreign elements like SVG) are allowed to self-close...n-buttons-padding" />   {{/unless}}                        ^
While building package `iron-router`:error: no such package: 'universal-events'
A quick look around stackoverflow my thinking was to brute force the update concerning iron-router with .8. While this is likely not the preferred method of many, here is what I did:
meteor remove iron-router
rm -rf packages/iron-router
mrt update
mrt add iron-router


After doing that I attempted a restart of the app and got the following error:
While building the application:client/views/stuff/stuff_submit.html:6: Only certain elements like BR, HR, IMG, etc. (and foreign elements like SVG) are allowed to self-close...Your request here."/>         </div>     ...
I changed <textarea name="request" type="text" value="" style="width:50%;" placeholder="Your stuff here.">
to
<textarea name="request" type="text" value="" style="width:50%;" placeholder="Your stuff here."></textarea>


Then, in the router.js file I changed:
var routeName = this.context.route.name;
to
var routeName = this.route.name;


In the main.html file I changed:
{{layout}} to {{> layout}}


I then got the following error:
Uncaught Error: Couldn't find a Layout component in the rendered component tree
After looking around and found this at Stackoverflow
and removed the  {{> yield}} from the layout.html file which holds the layout template.


Now, the page will render with the header but where the layout template that used to render correctly, the rest of the page was not rendering.


When adding the {{> yield}} back in the layout.html file, there is an error in /packages/blaze-layout/layout.js file on line 373. This is where the "Couldn't find a Layout component in the rendered component tree" error is thrown. After looking on the updated Discover Meteor book in the Router chapter. The Router.configure has changed from  layout: 'layout' to  layoutTemplate: 'layout'. I also changed the before: function() in the Router.configure to onBeforeAction: function(). Moreover, I changed after:function() to onAfterAction: function as well as commenting out the this.render(page) call. Then, I removed the body tag altogether from the client/main.html file as stated in the router chapter. Now, the layout template was at least rendering correctly but links in the page using the Handlebars pathFor was not forming links properly. Looking at the browser console I noted that I was getting a number of errors:
Exception in Meteor UI: TypeError: Cannot read property 'params' of undefined    at Object.processPathArgs (http://localhost:3000/packages/iron-router.js?a4167ac4d12a73891d8a9b8c57419a347da0ee12:2200:22)    at Object._.extend.pathFor (http://localhost:3000/packages/iron-router.js?a4167ac4d12a73891d8a9b8c57419a347da0ee12:2227:34)    at http://localhost:3000/packages/ui.js?b523ef986d3d39671bcb40319d0df8982acacfe8:2838:23    at Spacebars.call (http://localhost:3000/packages/spacebars.js?5d478ab1c940b6f5a88f78b8adc81a47f022da77:173:18)    at Spacebars.mustacheImpl (http://localhost:3000/packages/spacebars.js?5d478ab1c940b6f5a88f78b8adc81a47f022da77:110:25)    at Object.Spacebars.mustache (http://localhost:3000/packages/spacebars.js?5d478ab1c940b6f5a88f78b8adc81a47f022da77:114:39)    at HTML.A.href (http://localhost:3000/client/views/stuff/template.stuff_item.js?e15ce9378850d2ce553c8c60647642a543534557:58:30)    at http://localhost:3000/packages/htmljs.js?697b0dd0fbdd1f8984dffa3225121a9b7d0b8609:254:14    at callWithNoYieldsAllowed (http://localhost:3000/packages/deps.js?7afb832ce6e6c89421fa70dc066201f16f9b9105:74:5)    at _.extend._compute (http://localhost:3000/packages/deps.js?7afb832ce6e6c89421fa70dc066201f16f9b9105:212:7)


The fix was to do the following in the stuff_item.html and encouragement.html file: I changed {{pathFor 'encouragementSubmit' this}} to {{pathFor 'encouragementSubmit' params=this}}.

Now all appears to be functioning. I hope that this will be of some help to others!  :-)


Saturday, March 15, 2014

The Moral of this Story: Post Working Code to Your Repo ASAP (a.k.a. I love github)

Last night, lying in bed and ready to go to sleep, I did something that I do not like to start late in the evening. I decided to open my Meteor app and check for any updates that I would need to make. Following that initial move, I just spent the following hour messing with an update to Meteor 0.7.1.2 and authentication with facebook. What was happening was that after I updated the app I attempted to start it up and was getting the following error:


W20140315-08:39:31.394(-4)? (STDERR) TypeError: Cannot call method 'remove' of undefined
W20140315-08:39:31.394(-4)? (STDERR)     at app/server/facebook_login.js:1:71
W20140315-08:39:31.394(-4)? (STDERR)     at app/server/facebook_login.js:11:3
W20140315-08:39:31.395(-4)? (STDERR)     at /home/mark/meteor/m2smgrpdaily/.meteor/local/build/programs/server/boot.js:155:10
W20140315-08:39:31.395(-4)? (STDERR)     at Array.forEach (native)
W20140315-08:39:31.395(-4)? (STDERR)     at Function._.each._.forEach (/home/mark/.meteor/tools/8d9edffd4f/lib/node_modules/underscore/underscore.js:79:11)
W20140315-08:39:31.395(-4)? (STDERR)     at /home/mark/meteor/m2smgrpdaily/.meteor/local/build/programs/server/boot.js:82:5
=> Exited with code: 8



To fix you need to add a smart-package manually:
$meteor add service-configuration
Then change any code with: Accounts.loginServiceConfiguration.remove({}) to ServiceConfiguration.configurations.remove({}). This I did in  /home/mark/meteor/m2smgrpdaily/server/facebook_login.js and was good to go. Without hesitating, I pushed the fix to my github repo.

This Meteor update issue, that was found last night, was found while using my netbook. This morning I opened the app on my desktop and of course found the same thing. To correct it I simply pulled from my github repo, that I updated last night after fixing the code on the netbook, restarted the app, and I was good to go. 

Therefore, push working code to your repo ASAP!

Saturday, December 14, 2013

Move it on down the line...i.e. learn the new.

I have noted that the postal mail delivery has been later than normal. No doubt that is due to the business and the volume of the season. What came to mind, and for whatever reason my memory had this ready for recall, was the old song by the the country band Alabama entitled Forty Hour Week (For A Livin') Here are the lyrics;

There are people in this country
Who work hard every day
Not for fame or fortune do they strive
But the fruits of their labor
Are worth more than their pay
And it's time a few of them were recognized.
...
The one who brings the mail
...
With a spirit you can't replace with no machine
Hello America, let me thank you for your time...

While I like what the song is trying to share, I really do think that just because the sentiment is there, does not mean that the current method of how a service or product is delivered should stay that way, frozen in time? Imagine the Pony Express rider lobbying for solidarity and the right to continue his trade when the telegraph machine comes into town? While the rider may be a great and honorable person, does that mean they should continue in their profession when it is made obsolete? Would not a better reaction to the new development be that the pony express rider seek to be trained in the use of Morris Code?

Monday, November 25, 2013

jQuery Sortable Table Rows Example

On the current project that I am working on the customer was wanting to be able to reorder table rows by dragging and dropping them in the desired order. Also the records' text would need update itself displaying the new order of the records. Here is the proof of concept code.

Here is the JSFiddle result. And, here is the JSFiddle code. Enjoy!


Thursday, September 19, 2013

Rrrrr! talkPirate Function

I found out via an advertisement that today is International Talk Like a Pirate Day. "Avast, Ye Mateys! Hoist Yer Colors for Talk Like a Pirate Day! Start savin' on a pirate's favorite language: R"

So, here is my brief talkPirate R function:


Monday, August 19, 2013

Do we want other humans?

At work I was listening to one of NPR’s TED Radio Hour Podcast entitled “Do we need humans?” This talk was a presentation by Sherry Turkle, a professor of the “social studies of science” at M.I.T. and was based on her book Alone Together
 
A quick search on Google turned up a statement from the book in a New York Times Book Review:
“Dependence on a robot presents itself as risk free. But when one becomes accustomed to ‘companionship’ without demands, life with people may seem overwhelming.” Then the author of the book review states, “A blind date can be a fraught proposition when there’s a robot at home that knows exactly what we need. And all she needs is a power outlet.” 
 
Do we prefer technology to one another since human relationships take work, can be messy, and cannot be controlled?

Wednesday, August 14, 2013

R for Your Foursquare History

I was looking through twitter posts and came across one dealing with a presentation at the Quatified Self Bay Area Meetup by John Schrom. Watching the video Mr. Schrom described how he acquired his personal checkin data from Foursquare via an R program. Looking further I noted that the information about the presentation included a link to his personal site included a link to his Github repository of the code that he used to gather his personal Foursquare history. With this information in hand I figured that I would attempt to data mine my own checkin data.

The repo's readme file contained the steps that he took to get a Foursquare app setup and obtain his access code to his checkin history. After following the steps I was ready for the next step.

Then, I installed R and proceeded to add the packages that John's code required. First you will need RCurl. I issued the following command in R:
install.packages("RCurl", dependencies = TRUE)

However, I found that I needed to install libcurl due to the following error: ERROR: configuration failed for package 'RCurl'
So here is what I did to remedy the problem:
sudo apt-get install libcurl4-openssl-dev

Next, I installed the rjson package via:
install.packages("rjson", dependencies = TRUE)

Then I pulled down the rpi.R and secrets.R files and per the Github readme I ran:
source('rpi.R');
checkins <- getFoursquare('YOUR_ACCESS_TOKEN_HERE');

After this I wrote the function output to a CSV file:
out <- file("output.csv", "wt")
write.table(checkins, file=out)

Looking at the rpi.R code, I noted the getFoursquare function includes the createdAt attribute of the checkin object (of the Foursquare API which states the createdAt attribute is "Seconds since epoch when this checkin was created"). Since this element is in the form of the number of seconds, for example 1376335108, and it is a data item that I want, I will need to convert it into a human, readalbe format.
 
This was simple enough for me since I use Open Office to view CSV files in that I found this handy formula to convert the data to a human readable date/time: 
=(CellIdHere/86400)+25569+(-4/24)

From the CSV file I can inspect the checkin history for correlations with other data or look for patterns that before the review I was unaware existed. 

Finally, next steps could also include learning more R to visualize the data via plotting the data into charts and graphs.

Monday, July 08, 2013

JavaScript replaceAll Example

I needed a JavaScript "replaceAll" function on a string. Note the global flag /g The output is:
John.Jacob.Jingleheimer.Smith
John Jacob Jingleheimer Smith

Thursday, July 04, 2013

Example of Meteor using Facebook's Login API

Earlier today I finished up the Meteor Login sample app using Github's API and decided to attempt the same with Facebook's LoginAPI. Meteor makes it so easy that I was able to replicate the same results in two hours. The reason that it even took that long was because I was not accessing the Meteor.user JSON correctly.

For the code go my github repo at: https://github.com/m2web/facebooklogin.

One thing to note is the setup of the Facebook Login App for testing at Meteor's default location of http://localhost:3000.



Of course, once you deploy the app, you will need to update the above settings to the correct domain and URL.


Enjoy!

Repo Integrating User Logins with Github and Meteor

Messing with Meteor, an ultra-simple environment for building modern web applications, has been fun thus far. Here is a repo based on Chris Mather's video Customizing Login.

Thursday, June 27, 2013

Jasmine: A JavaScript Testing Framework

I have been experimenting more with JavaScript frameworks lately. Being fond of the Test Driven Development methodology, I came across Jasmine. Here is how the site defines it: Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend on any other JavaScript frameworks. It does not require a DOM. And it has a clean, obvious syntax so that you can easily write tests.
If you have not already, download Jasmine from http://pivotal.github.io/jasmine/
After you decompress the downloaded file you see this directory structure.

As you can see, the SpecRunner.html file is your user interface that is simply run from a web browser. The spec folder will hold, as you guessed, your specification code—what you want your implementation to do. The src folder will contain the code you are testing.
The JavaScript includes in the SpecRunner.html file need to be set as such:

What I wanted to do was to test how to sort a JavaScript array based on a date element in the array. So let’s start with the spec file. I named my spec DateSortSpec.js and placed it in the spec directory. Here is the DateSortSpec.js:

Next, the source code file,DateSort.js, goes in the scr directory:

OK, with basic structure in place let's do a sanity check and make sure we get a failing test result:

Now let’s get the “should show Health for a Friend title with ascending sort” spec to pass. First, create a function that will sort ascending by date. What I did was to utilize the JavaScript array.sort method passing in a compare function.

Now reload the browser and the spec passes.

Next we will add the spec to sort descending.

Reload the browser and we see the spec fail as we have not implemented any code for the spec.

So, the next step is clear. Implement enough code to pass the spec. Here I again use the JavaScript array.sort method passing in a function for a descending comparator.

Refresh the browser again and bang!

As you can see using Jasmine is pretty straight forward. Setup is a matter of expanding the compressed file. Moreover, if one has a web browser and text editor you a ready to code the specs and source code.

Wednesday, June 26, 2013

Configuring SciTE for JavaScript on Ubuntu 12.04

At work I use the SciTE editor quite a bit. With that stated, at work we use Microsoft Windows XP, soon to move to Windows 7, as the standard operating system. In any event, during a break I created a JavaScript test file to determine the best way to sort via a JavaScript Date.

All well and good at this point. Then I brought the JavaScript file home where my entire house has nothing but Ubuntu as the choice of operating systems for both desktops as well as laptops and netbooks. I quickly realized that I did not have my SciTE editor configured to execute JavaScript files on my Ubuntu desktop. Doing some quick poking around I found that I could use my installation of Node.js for the JavaScript engine. So, here is what I did.

First, I opened the /usr/local/scite/cpp.properties file. I then noted that at line 436 it was looking for the GTK cross platform tookit in the for of: if PLAT_GTK
I added the following config setting below that line:
command.go.*.js=node $(FileNameExt)

I then closed the /usr/local/scite/cpp.properties, open the SciTE editor, opened the JavaScript file, hit the F5 key to run the file and I was good.



Monday, June 24, 2013

What daily apps and devices do you use to help you daily?

For me, my day consists of a daily run, a time of scripture reading and prayer, eating breakfast, getting out the door and to work, and then the normal work day events, and then head back home.


For various steps in the events of the day, I use my Garmin watch, iPod Shuffle, fitbit, desktop computer, and smartphone. With these devices I use apps for the weather, spiritual and physical health, basic communications, and traffic for my daily commute. Here are the day’s events with the devices and the apps that are used.


Wake up:
  • Digital clock for the alarm and my smartphone in bedside mode for the time.


Morning Run:
  • Garmin watch to track time and pace
  • fitbit pedometer to track number of steps
  • Desktop computer, with Ubuntu 12.04 as the operating system, looking at weather.com and runkeeper.com to map and store the day’s run stats
  • Ipod Shuffle with iTunes to download and organize the theology based podcasts and music that I listen too


Reading of scripture and prayer time
  • Desktop computer, smartphone, or Kindle Fire looking my personal prayer app built with Ruby on Rails and housed on heroku.com


Morning communications
  • Desktop computer, smartphone, or Kindle Fire using gmail, Google calendar, facebook, and twitter


Breakfast
  • Record nutrition intake with fitbit.com that has already uploaded the calories burned from the earlier run.


Morning commute to work
  • Desktop computer, smartphone, or Kindle Fire using ohgo.com to see the current status of the traffic on I75 and I471 North bound. From there I determine which is the best route.


Work
  • Desktop PC for software development
  • Smartphone for personal communications
  • Fitbit in which I note time to time the number of steps taken during the day


Lunch
  • Record nutrition intake with fitbit.com.


Evening commute to work
  • Desktop computer or smartphone using ohgo.com to see the current status of the traffic on I75 and I471 South bound. From there I determine which is the best route.


Evening
  • Desktop computer, smartphone, or Kindle Fire using weather.com to note the evening and next morning’s forecast.
  • Fitbit from which the day’s step count is uploaded and the amount of calories burned is compared to the day’s nutrition intake.
  • Desktop computer, smartphone, or Kindle Fire using gmail, Google calendar, facebook, and twitter
  • Roku streaming player, a cloud based video streaming device that interfaces with content providers such as Netflix and/or Amazon Prime, to watch great TV series and movies such as Dr. Who, Star Trek, The Goonies, Shaun the Sheep, etc.

Of course this list does not include other devices and personal tools such as the automobile or other home based appliances that rely on silicon-based technology to function. The pattern that I see is that my day is better organized and runs smoother as the result of the use of these devices/apps. Moreover, I am better informed off my health as well as keeping better track of appointments and obligations.

Wednesday, April 24, 2013

Poetry via Python

I was attending a weekend event and heard of a website that had some lofty poetry. Having the book of that poetry, I wanted the content for my own personal use.

I had played with Python before to scrape data from the web and thought I would give it a go again. Here is what I used to get the desired content and create HTML files that I could use on my own website:


Thursday, January 24, 2013

Create PostgreSQL Sequence for Ruby on Rails Apps on Heroku

I was attempting to add a record via my rails app on Heroku and got the following:
ERROR: null value in column "id" violates not-null constraint

Since as the date of this writing Heroku uses PostgreSQL, here are the steps I took.

My Postgres server version is PostgreSQL 9.1.7 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, 64-bit. I also am using an Ubuntu Linux desktop running Rails 3.2.11.

Now to the steps I took to solve the problem.

In your rails app db/migrate folder create the following class and name it 201301081552_create_table_name_sequence.rb. Substitute the time signature in the name with your date and time and “table_name” with the name of the table you to which you are adding the sequence:

Then in your rails app db/migrate folder create the following class and name it 201301081552_add_sequence_to_table_name.rb. Again, substitute the time signature in the name with your date and time and “table_name” with your name:

Next, commit and push them to your github repository. After that push them to Heroku. If you have the Heroku toolbelt installed you can issue the following:
sudo heroku run rake db:migrate

This should run the database migration that will create the sequence as well as add it to the id column.

Friday, September 14, 2012

My First Adventure with the Raspberry Pi

My adventure with the Raspberry Pi begins by finding and purchasing it from Newark Element14.

Box

Looking at the system you can see that it is a credit card, sized unit.

Card_size
I purchased a pre-loaded 4 GB SD card but I also had a spare 4 GB SD card so I downloaded the distro from adafruit and used it.

I then hooked up a USB keyboard and an HDMI cable to my TV and booted the Raspi up.

Gui

After doing that I wanted to start messing with the General Purpose Input/Output (GPIO) pin set on the Raspi so I purchased the Raspi Cobbler from adafruit.

Cobbler
Upon investigation, I realized that I needed to solder the pins on the cobbler before using it. Moreover, I realized that I needed a breadboard as well. Adafruit's site had a tutorial that provided the steps in what to solder and where. That was a great help so I printed that tutorial. Based on the tutorial I also purchased a solder gun, solder and breadboard from Amazon and was then ready to get busy.

Soldering

After soldering the pins and connecting the data ribbon I knew that I needed to find tutorials on what to hook up to what pins, etc. and then purchase those items. What I wanted to do was to conduct the easiest experiment that I could as a first step. I thought, why not get an LED to light up. Perhaps I would find a tutorial on adafruit that was get me there. And yes, the Raspberry Pi E-mail Notifier Using LEDs tutorial was the answer.
Gleaning from the instructions of the tutorial I knew that I needed to setup Remote SSH and install python on the pi. After doing that I read further and noted that I would need to purchase two resistors from 100 ohm up to 1000 ohm as well as a green LED and red LED as well as breadboard wiring. I found that I could get the wires off Amazon for a cheaper price and so made that purchase. The resistors and LEDs I purchased at the local Radio Shack for a good price.
Below is the result thus far.
Setup

Now that I had what I need to physically test the next step of the tutorial was to create a python script to interact with the GPIO pins. I was not wanting to take the additional steps of using an IMAP feed parser as detailed in the tutorial I created enough to be able to light the LEDs in a flashing fashion. Here is the code:

I ran the script and here is the output to the screen from the pi:
Screen_output

However, I did not see the LEDs lighting up. Then I realized that I did not have the ground wires connected to the breadboard ground rail. After making the correction I had flashing lights.
Now, what is the next step?











Thursday, August 09, 2012

There is No Defect.

I am in agile training for my employer. Someone from software testing asked how we deal with defects in our implementation of agile. One of our development managers made the statement that thinking about the agile process in similar ways to our past waterfall methodology no longer applies. He said, "Do not think of defects, there is no defect, only a working system that needs a change."

This reminded me of the first Matrix movie where Neo, when within the Matrix, was at the home of the Oracle watching a boy bend a spoon telekinetically:
Spoon boy: Do not try and bend the spoon. That's impossible. Instead... only try to realize the truth.
Neo: What truth?
Spoon boy: There is no spoon.
Neo: There is no spoon?
Spoon boy: Then you'll see, that it is not the spoon that bends, it is only yourself.

Sunday, June 24, 2012

My Review of Running Lean, 2nd Edition

Originally submitted at O'Reilly

Iterate from Plan A to a Plan That Works

Running Lean, 2nd Edition Review
By m2web from Erlanger, KY on 6/24/2012
4out of 5
Pros: Easy to understand, Concise, Accurate, Helpful examples
Best Uses: Novice, Expert, Intermediate
Describe Yourself: Developer
This book is a practical work that enables you to take immediate steps to a lean start-up . In a nutshell the subtitle states the content of the book: "Iterate from Plan A to a Plan That Works."

One of the more helpful aspects of the book is its emphasis on learning the market fit of your proposed product by working face-to-face with potential and actual customers. Moreover, you are given examples of how to test your hypotheses, determine product pricing, define your Minimum Viable Product (MVP), and learn and improve from each step in the start-up process.

Finally, the book provides links to several helps such as the Lean Canvas which is "the faster, more effective way to communicate your business model with internal and external stakeholders" at leancanvas.com.

Saturday, June 23, 2012

Updating VirtualBox on Ubuntu 11.10 Oneiric Ocelot 64 bit

I went to update my install of VirtualBox on Ubuntu on my Acer Aspire Netbook. When I went to update via selecting the DEB file the Ubuntu Software Center app was not responsive to my selection to install the new VirtualBox build. A little digging and I found the next steps. From a terminal:
sudo apt-get remove --purge virtualbox-4.1
Note that the version will depend what you have installed. Then when I selected the VirtualBox.deb file the Ubuntu Software Center acted as expected by installing the upgrade. Mind you, I know that I could have issued a:
sudo apt-get install virtualbox-4.1
but I wanted the latest that I just downloaded from Oracle.

Tuesday, May 29, 2012

Amount of Serendipity = Luck Surface Area

I am currently working through the book Running Lean: Iterate from Plan A to a Plan That Works by Ash Mauryaby. In the book is a reference to a blog post entitled Increasing Your Luck Surface Area. Here are a few quotes from that blog post:
The amount of serendipity that will occur in your life, your Luck Surface Area, is directly proportional to the degree to which you do something you're passionate about combined with the total number of people to whom this is effectively communicated.
To satisfy my mathematically oriented brain I've gone one step further and formalized the concept into the equation L = D * T, where L is luck, D is doing and T is telling. This demonstrates clearly that the more you do and the more people you tell about it, the larger your Luck Surface Area will become. And while I like equations, it's the graphical representation that really brings the concept home.

Inline image 1
In other words, the larger the target, the better the opportunities of being hit by serendipity!

Saturday, April 21, 2012

Vim and help with the answer 42

Watching a presentation on Vim by Bill Odom and he mentioned a fun item in the help feature for Douglas Adams fans. In Vim issue the following
:h 42
Here is what you see:
What is the meaning of life, the universe and everything?  *42*
Douglas Adams, the only person who knew what this question really was about is
now dead, unfortunately.  So now you might wonder what the meaning of death
is...

Thursday, April 12, 2012

Turning Consumption into Production

During my morning run I was listening to This Developer's Life Podcast by Scott Hanselman is a production that deals with general areas of a typical software developer's existence. This latest show discusses the need to be a continual learner.

One of the points made in the podcast was the concept of turning the consumer of software, consider the person playing hours of video games, into a producer of software. Imagine the amount of time and brain power applied to just video gaming by the consumers of those games!

One aspect to turn consumers into producers may be the use game mechanics in the actual creation of programs. The addicting factor of video games is largely the desire to "get to the next level."

Maybe simply making the solving of problems via the writing of code the reward. "How can I 'get to the next level' in my understanding of this framework?" or "How many defects can I fix today?" or "What is the most elegant solution for meeting that business need?" Perhaps creating personal challenges out of the problems by asking, "How much can I accomplish today on this bug or issue?"

Just thinking....

 

Tuesday, March 20, 2012

Operation not allowed for reason code "7" on table "YourTableHere" in DB2

Note to self: When you make a change to a DB2 table and you see the following database error in the logs:
Operation not allowed for reason code "7" on table "YourTableHere"

It is time to issue a reorg on the table via this:
CALL sysproc.admin_cmd('REORG TABLE YourTableHere');

Tuesday, March 06, 2012

Review of JavaScript Web Applications by Alex MacCaw

Title: JavaScript Web Applications
Author: Alex MacCaw
ISBN:144930351X
ISBN-13978-1449303518
Javascriptwebapplicationscover

Pros: Extensive, Well-written, Several examples
Audience: Advanced and/or Intermediate Developers
Introduction
I started this book thinking that it would provide a basic overview of the use of JavaScript within web application development. Boy was I wrong! This text is really a manual on creating a full featured JavaScript web based app. Given that the author is the creator of Spine.js, he is qualified to create an extensive JavaScript Manual.
As a Java and .Net developer, this text is more that I require concerning the use of JavaScript. However, I am sure that as time goes on and JavaScript is more embedded in various frameworks via the likes of JQuery, etc. this book will become more practical for me. 
Review
Instead of giving a chapter by chapter review, here is the summary of the overall content of the book (as if such is easy to do for this comprehensive work). This book is not for those just starting JavaScript development. However, if you have experience in another language, this resource will serve you well as you move into further JavaScript programming. 
The initial part of the book deals with the concept of the MVC framework, models, events and event handling, controllers, application state, views, and templating. The examples are mostly in JQuery which is also my framework of choice for JavaScript development. MacCaw also covers Node.js, Socket.IO, and WebSockets. Moreover, he also provides an examples on testing, debugging your apps, as well as a look at the Backbone and Spine.js (which he created) libraries. Finally, the text provides further information on JQuery, CSS extensions, and CSS3 in the appendixes.
Conclusion
When you are ready to take take the deep dive into developing a JavaScript based we application, this is your manual.

Friday, March 02, 2012

Personal Informatics: The Weather

This past year I have been tracking various personal data key indicators. One has been the number of miles ran per calendar month. Having used Runkeeper to do this an interesting observation has emerged. 

It has been no secret how mild the winter has been here in the Greater Cincinnati/Northern Kentucky area. However, this February 2012 is about the same as February 2011 concerning being able to run outdoors. The temperatures seem to be higher in February 2012 but the conditions that allow one to run outside, no ice or snow, were no different this year than in 2011  Look at the monthly numbers from Runkeeper for this 2011-2012 winter season:

2012running

Compare this to the 2010-2011 winter season:

2011running

Running outside November 2010 through January 2011 was not safe due to ice and snow. While there is a vast difference between the months of November through January for both winters, the month of February was not different for either winter season. Interesting....

Thursday, March 01, 2012

Autotest on Ubuntu 11.10 running Rails 3.2

I’m reading and working through Ruby on Rails Tutorial from Michael Hartl. The book rightly promotes a "test first" approach. In this Hartl mentions autotest. As the text mentions, "configuring it can be a bit tricky."
Here are the steps I used to get autotest working on my Ubuntu 11.10 OS running Rails 3.2.0.rc2:
$ gem install autotest
$ gem install autotest-rails-pure
$ sudo apt-get install libnotify-bin
$ gem install autotest-notification
Next, I added the ~/.autotest file:
Then, I simply ran autotest from my rails app directory:
$ rails-apps/myapp autotest
This is nice in that I do not have to manually run the rspec tests as autotest runs each time I change a test file or the tested implementation code. 

Wednesday, February 22, 2012

Ghost in the Machine - secondary, tertiary, etc.side effects

Was listening the the This Week in Tech podcast and caught a comment by Kara Swisher. The statement dealt with the Wall Street Journal article Google's iPhone Tracking: Web Giant, Others Bypassed Apple Browser Settings for Guarding Privacy where she felt that the Google was not honest in their claim that the code applied to bypass Safari Web Browser settings was not to steal user information. Here is where someone who has not been involved in the development of software systems of any size fails to realize that when you have several coders working on a system, some pieces of code have side affects that have not nor could not be anticipated, period.

Yes Google has some brilliant software engineers. However, even the best minds cannot foresee all or most secondary and tertiary effects of a piece of code. To simply say that they knew all ramifications of the code is not to consider the complexity of their systems.

I am not saying that Google is always ethical. I have submitted previous posts that clearly state that I understand the danger of user data potentially being misused. I am not so naive to think that they are not interested in making money. But I am not sure that this case, that stemmed from code added that was designed to make different web browsers consistent which is a better experience for the user, is the result of malevolence to steal user information. It is certainly possible for it to be used in that way but again, this really could be a case of an unintended side effect or what is commonly termed, the ghost in the machine.

Tuesday, February 21, 2012

Use and Calibrate the Compass

Seth Godin makes a good point in his blog when he states:

The map keeps getting redrawn, because it's cheaper than ever to go offroad, to develop and innovate and remake what we thought was going to be next. Technology keeps changing the routes we take to get our projects from here to there. It doesn't pay to memorize the route, because it's going to change soon. The compass, on the other hand, is more important then ever. If you don't know which direction you're going, how will you know when you're off course?

The map may be easier but as Godin says it will be constantly changing. Therefore, let's get good at using a compass.

To find our direction, I must turn the compass dial until the North mark and the "Orienting Arrow" are lined up with the North end of the needle. Then, whichever direction is on the opposite side of the compass, that is the direction you are heading. Now, orient yourself to the direction you want to go with the compass dial until the North mark and the "Orienting Arrow" are lined up and you are good to go. For example, the picture below shows you pointing west.

Compass-west

Now, you can take any road that will allow you to go west and not be stopped if the road your on is closed. Just navigate to another road going west by the use of the compass.

Of course, the compass in Godin's article was a metaphor. Yet, this concrete example shows us that we need to get better at calibrating our compasses or our sense of the proper direction. We need to determine the best direction via "the compass" and stop memorizing maps to get where we are going professionally, personally, etc.as the maps will be changing faster as we move forward in our journey.

I need to remember this next time Google Maps leads me into a corn field instead of where I wanted to go!

Saturday, February 11, 2012

...fatal error: parser/kwlist.h: No such file or directory compilation terminated on Ubuntu

Yesterday I was compiling and installing the latest source code for pgAdmin3, a popular Open Source administration and development platform for the PostgreSQL database, on my netbook with the Ubuntu 11.10 operating system and ran across the following error:

...fatal error: parser/kwlist.h: No such file or directory compilation terminated. 

Earlier this month I had built and installed pgAdmin3 on two other systems and ran into the same problem. Because I had hunted this header file down and stored it on my Dropbox account, I had it handy and dropped it into the source code and went on my merry way with the build. 

Therefore, for those who run across this issue I have linked the file here.

Simply drop the file into the /theSourceCodeDir/pgadmin/include/parser directory and reissue the make command. 
Enjoy  :-)

Friday, February 10, 2012

Build an adaptive culture that will invest in process only when it is needed

I just watched a great video with Eric Ries, entrepreneur-in-residence at Harvard Business School and author of the book The Lean Startup: How Today's Entrepreneurs Use Continuous Innovation to Create Radically Successful Businesses.

Within the video he examines the technique of the "5 whys." In short, those involved in a lean startup will for each problem they must tackle (1) ask "why" at least 5 times digging further into a  problem with each "why" questions. (2) Next they are to find the human problem behind every seemingly technical issue. And finally, (3) make a proportional investment in each of the 5 "why answer" layers. This will build an adaptive culture that will invest in process only when it is needed and not expend valuable resources.

For example, let us suppose you are part of startup X and one of the startup's main partners asked a software developer, "Why didn't we get that last feature into the release to show to the investors?" That was why number 1. The software developer answers, "Because I did not have enough time." The partner then asked, "Why didn't you have enough time?" Again, why number 2. "Because I can only add features to the application on week-day nights." "Why only on weekday nights?" Why number 3. I think you are getting this by now. "Because I have a full-time developer job that I work during the week and I want to spend time with my family on the weekend." "Why did we not consider your time limitation when prioritizing features and do the more important features first?" "Not sure, I was told to add the features in this order." "Why who was it that told you those features?" "The project manager."

We see the human factor here is both the developer resource limitation as well as with the program manager on how the priorities of the software program's features were determined.

Proportional investments into the first three layers could be addressed by adding development resources. The last two layers could be remedied by the full team collaborating on what the startup's software should feature. Simple and elegant. 

Thursday, February 09, 2012

Weblining - what you'll miss

In the previous post I discussed how the use of the results of the analysis of individuals' aggregated data and what Lori Andrews termed "weblining." 

Andrews sees the limitation of chance encounters as well when considering the results of a demographic segment's data analysis in targeted advertisement. "When young people in poor neighborhoods are bombarded with advertisements for trade schools, will they be more likely than others their age to forgo college? And when women are shown articles about celebrities rather than stock market trends, will they be less likely to develop financial savvy?" 

In other words, media content tailored to the individual's preferences may lead to a lack of exposure to new products as well as ideas and view points. This area of negative impact from this use of data aggregation analysis is what I and others before me call the loss of serendipity. Dictionary.com defines serendipity as "an aptitude for making desirable discoveries by accident."

Lenny Rachitsky, in his TED Talk entitled Losing Serendipity shares that we may be denying ourselves our next favorite thing by limiting our exposure by what we like on Facebook or the narrow news feeds we select and hear.

Lennyserendipity

Could it be that with targeted advertising and by following only those viewpoints and ideas with which we already agree and are comfortable with that we are losing out on what we may discover and/or may be beneficial for us? Could it be possible that a new type of food we will love could be missed if we always went to the same restaurant? What about that next song you will not hear because your current music tastes reflected in your Facebook posts limits what music advertisements Facebook provides to you? 

Does this mean that we should not utilize data to target advertising? Of course not. Data analysis and the discoveries it provides offers too much potential to ignore. The question in my view is, how can we use technology to increase an aptitude for making desirable discoveries by accident? 

Wednesday, February 08, 2012

Weblining--what you 'search' can be used against you?

Anyone who has watched a law enforcement television show has heard the apprehending official state the Miranda warning to the person being arrested. "You have the right to remain silent. Anything you say or do can and will be held against you in a court of law...."

According to Wikipedia, "the 'Miranda rights' was enshrined in U.S. law following the 1966 Miranda v. Arizona Supreme Court decision, which found that the Fifth Amendment and Sixth Amendment rights of Ernesto Arturo Miranda had been violated during his arrest and trial for domestic violence." Within this decision the court did not provide the exact wording of the warning but did set guidelines that law enforcement must follow:
"...The person in custody must, prior to interrogation, be clearly informed that he or she has the right to remain silent, and that anything the person says will be used against that person in court...."

In her recent New York Times article Lori Andrews provides a similar warning. She defines "weblining" as using the results from analyzing aggregate data to discriminate against individuals or groups of people. The term is based on the use of "redlining." Andrews explains:
"In the 1970s, a professor of communication studies at Northwestern University named John McKnight popularized the term “redlining” to describe the failure of banks, insurers and other institutions to offer their services to inner city neighborhoods. The term came from the practice of bank officials who drew a red line on a map to indicate where they wouldn’t invest. But use of the term expanded to cover a wide array of racially discriminatory practices, such as not offering home loans to African-Americans, even those who were wealthy or middle class."

For example, "Your application for credit could be declined not on the basis of your own finances or credit history, but on the basis of aggregate data — what other people whose likes and dislikes are similar to yours have done." "What?!?" you might ask, how can that be? Andrews goes not to explain that "If guitar players or divorcing couples are more likely to renege on their credit-card bills, then the fact that you’ve looked at guitar ads or sent an e-mail to a divorce lawyer might cause a data aggregator to classify you as less credit-worthy. When an Atlanta man returned from his honeymoon, he found that his credit limit had been lowered to $3,800 from $10,800. The switch was not based on anything he had done but on aggregate data. A letter from the company told him, 'Other customers who have used their card at establishments where you recently shopped have a poor repayment history with American Express.'"

Wow! While I do think that the analysis of data can and does provide the consumer with more useful, directed advertisements, this is not a proper use of individuals' aggregated data. So, here is your warning, what you search can and may be used against you. Now you know.

Tuesday, February 07, 2012

When creating Postgresql users....

Being new to the Postgresql database server this is a note to self, in the future when creating postgresql users, remember the options precede the user name. For example, to create a user with an encrypted password issue the following from the command prompt:
$ sudo su postgres
$ createuser -e -P theUserNameHere
The first line logs you in as the postgres superuser. The next line is where the user is created. The -e option is so the password is encrypted and the -P option is so the password is requested before the user creation is complete. There, now I have it for future reference. 

Thursday, February 02, 2012

...more tangible, more linear and more contextual

In her NY Times piece, The Dilemma of Being a Cyborg, Carina Chocano defines a dilemma of depending on memory extension devices such as smart phones: "It’s that we’re collectively engaged in a mass conversion of what we used to call, variously, records, accounts, entries, archives, registers, collections, keepsakes, catalogs, testimonies and memories into, simply, data. 'Data' has become the default word used to describe the constantly generated, centrally stored evidence of our existence. I wasn’t surprised to learn that the word “data” comes from the Latin for 'to give,' and refers to something that is given or relinquished. It also feels significant that data rests at the very bottom of the so-called knowledge hierarchy — below information, knowledge and wisdom."

Her tone is one of regret. She expertly details that as we move our digitally captured memories and experiences to silicon extensions of ourselves, we lose what biological memory is good at providing--an emotional context that was a tangible part of our space/time existence. "Data is weightless and characterless and takes up very little space. The more of it we save, the more we lose the ability to differentiate it, to assign significance and meaning."

At the end of the article she discusses the small revival of the use of physical media such as vinyl records or cassette tapes. "It strikes me that the current fetishization of analog technology has less to do with nostalgia than it does with an urge to slow down the transfer of data from the internal to the external, from the individual to the collective, and to make it all less instant, less ephemeral, less interchangeable, and more tangible, more linear and more contextual."

Given that we are all cyborgs now, what can we do to recover the richness of ourselves that is more tangible, more linear and more contextual? It is not as if we will abandon those devices any time soon. Could it be that we can find a way to use them in a more tangible, linear, and contextual fashion? Is this where the Facebook timeline can help a person as they look at their own and other friend's profiles? Perhaps looking at the timeline with a significant other as they remissness over those actual events?

While I agree with Chocano that reducing our contextually created memories to bits and bytes is not the same as "remembering," can we use binary data to create meaningful memories? I hope so.

Wednesday, February 01, 2012

Highly Specific Rituals

I was perusing the Harvard Business Review blog site and came across the Why Don't We Act in Our Own Best Interest? post by Tony Schwartz. This should sound familiar to us in that we often hear the phrase that we are our own worst enemies.

Schwartz's answer to the question that he poses is "The most basic answer is that we don't make a connection between our current behavior and its future consequences."

Schwartz's remedy? "It's to rely more on our pre-frontal cortex, which allows humans alone to imagine the future consequences of our actions. Too often, instead, we use our pre-frontal cortex after the fact, to rationalize and minimize our short-term and ultimately self-defeating behaviors." While I agree, the problem here is literally easier said than done. So, what things can we do that reminds us to use our pre-frontal cortex and not the amygdala?

"Our own work at The Energy Project focuses on helping individuals and organizations institute highly specific rituals — behaviors and practices that eventually become automatic and serve sustainable well-being and effectiveness. We can learn to be far more conscious and intentional in our behavior, and less self-centered and short-term in our perspective. Doing so requires deliberate practice."

Again, I agree whole heartily. But isn't the trick here to not give in to the lizard brain and procrastinate on those "highly specific rituals?"