A Software Developer working for a large financial institution developing Java and .Net based web applications.

Product of Negative Integers...Easy as -1, -2, -3

I have been reading One, Two, Three: Absolutely Elementary Mathematics  by David Berlinski. While the topic is basic mathematics, the book's content is not elementary my dear Watson.

In a side discussion of negative numbers he presents a proof of a rule that has baffled students since the discussion of positive and negative integers began--namely if when you multiply two positive numbers the product is positive and when you multiply a positive number to a negative number you get a negative outcome, how is it that when two negative numbers are multiplied together the result is a positive number? Berlinski eloquently details the proof on over two pages with this conclusion:

[xy + x(–y)] + (–x)(–y) = xy.
[xy + x(–y)] + (–x)(–y) = –x–y.

Therefore, xy = –x–y.

Berlinski, David (2011-05-10). One, Two, Three: Absolutely Elementary Mathematics (p. 153-154). Pantheon. Kindle Edition.

I thought it would be good to do this in Ruby for fun. And sure enough, the proof stands true.


Vagueness: the path to the adjacent possible?

In his Wired article entitled In Praise of Vagueness, Jonah Lehrer writes, "According to an experiment led by Catherine Clement at Eastern Kentucky University, one way to consistently increase our problem-solving ability is to rely on vague verbs when describing the problem. That’s because domain-specific verbs–actions which we only perform in particular contexts – inhibit analogical reasoning, making us less likely to discover useful comparisons. However, when the same problem is recast with more generic verbs – when we describe someone as 'moving' instead of 'sprinting,' for instance – people are suddenly more likely to uncover unexpected parallels. In some instances, Clement found that the simple act of rewriting the problem led to impressive improvements in the performance of her subjects."

Apparently, vagueness allows one to move to the adjacent possible more easily. Therefore, when stuck back away from specificity and get general.

Why we study history

On my run today, 1-9-12, I was listening to the This Developer's Life podcast that spoke of the value of looking at older programming languages and technologies and what can be gained from looking back at the refined algorithms of older programming languages and the efficiencies of other older technologies. 

One thing that stood out to me within the discussion is the long life of the Fortran language. Fortran developer David Sokol stated that Fortran is largely supported by academic institutions and research. While software companies come and go, one thing that stays is the need to teach, study, and learn. 

This reminds me of the concept of "the root produces the fruit." In other words, information does not emerge from nothing. With continued use, refactorings, and adaption older languages can provide the context for gaining old ideas for new platforms and technologies.

Using the Posterous Bookmarklet - Posterous Help

This looks useful!

"Compliant sergeants rarely become great generals."

In Seth Godin's recent blog post Confusing obedience with self-control he spoke of the value of obedience. He also stated that, “obedience transforms into self-control. That at some point, people start obeying themselves and become leaders.”
 
In other words, to be a leader, you must think for yourself and be obedient to what you know is correct. Your creativity and ideas should be your guide as you understand and comply with others such as your employer and civil authorities for the common good.

In short, we must not confuse self-control with mindless adherence.

It is OK to not know it all.

Recently, when I upgraded from my first generation Motorola Droid to the new Droid 3, I called by the local Verizon store and asked if the chargers, cradle, and car mount that I have with my current Droid would work with the Droid 3. I was told that all the hardware that I have with my droid would work with the droid 3. Well...not so. Both the cradle and the car mount will not work. As the buyer we always need to do our homework and understand the stipulations, etc. with the purchase. However, if as the vendor or service provider, you do not know for certain an answer to a question, please do not respond as though you do.

I understand that the phone store personnel are good people. Nor do I think anyone is trying to deceive or bait and switch. With that said I do think that being clear and complete with the customer goes a long way. In other words, if you do not know then state that as far as you understand this or that is true but you really need to meet face-to-face to discuss all the details or research the question further and then you can make a determination. It is OK to not know it all.

Random Rebooting of the Droid 3-Synced WIFI Settings?

Since I updated to the new Droid 3, I am finding that the phone randomly reboots every now and then. While I love the response time of the phone and the crisp view screen, the phone deciding to restart on its own is not OK. After a quick search I found a series of messages that show the issue may be tied to how WIFI networks are restored from Google during the syncing of your previous WIFI settings.

Here is a blurb from Google:
Further testing & confirmation from other testers on forums correlates this crash strongly to the restoration of wifi settings during provision of the phone & sync to google.  Users who have factory-reset the phone and disabled google syncing have solved the problem, and users who have deleted all restored wifi networks have seen similar benefits.  The twitter account in the 'my accounts' manager was indeed a red herring and does not seem to be related to the bug, as removing it has not re-introduced the problem. Workaround:  Delete ALL wifi networks after provisioning phone, and recreate them using the Droid3 UI.

This was found at: http://code.google.com/p/android/issues/detail?id=18460. I really do not want to go back to factory settings so I am hoping a simple removal of the WIFI network settings and manually rebooting the phone will cure the random reboots. Thus far, since doing the above steps no more reboots.

Review of Programming HTML5 Applications: Building Powerful Cross-Platform Environments in JavaScript by Zachary Kessin

rc_cat.gif

With the emergence of the popularity of HTML5 many books are quickly hitting the shelves. Here is an offering that provides both a high-level overview along with example code.

The first chapter, The Web as a Platform for Applications provides an historical backdrop for the HTML5 standard by reviewing the founding of the web, JavaScript’s history, the emergence of DHTML and AJAX, and laying of the ground work for the present environment.

The second chapter, The Power of JavaScript, reviews some nice aspects of the language such as functional programming,  closure, being able to expand objects, and functions with prototypes.

Chapter three, as the chapter title implies covers the JQuery, “a JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.”

The next chapter details ExtJS. While ExtJS is another JavaScript library, this library provides more than a DOM manipulation and event handling. ExtJS has several objects that provide the developer with several tools to create rich internet applications. The chapter contains good content but still needs another “proof-reading pass” as there are several typos and even a “TODO” or two.

Chapter 5 details using QUnit and Selenium to test JavaScript. This chapter provides good code examples using these two test frame works. Chapter 6 shows the developer how to use the browser’s localStorage and sessionStorage objects as well as consider browser-based databases.

The next chapter, Take it Offline,  deals with using HTML5’s new manifest file from which a user can load multiple files. Chapter 8, Splitting Up Work Through Web Workers, takes the reader through use of web workers to do, as the chapter title suggests, a division of tasks.

The reader is then brought to the topic of Web Sockets where bidirectional data can be established over TCP. Finally the chapter Internet, 2017 takes the user through the consideration of new and future technologies, of which HTML5 is a part.

In summary, while this book does provide a good overview of the above topics, it may not provide the detail that some developers desire. Also, at least in its early release stage, as of July 2011, the text shows many signs of a draft in progress with missing punctuation and various TODO’s sprinkled in some of the chapters. However, it does provide a quick and basic overview of the concepts and parts of HTML5 and JavaScript that are necessary to move forward.

Review of An Introduction to Machine Learning with Web Data by Hilary Mason

An Introduction to Machine Learning with Web Data by Hilary Mason; O'Reilly Media. 

The video itself is presented in five sections: (1) Introduction, (2) Classifying Web Documents - The Theory, (3) Classifying Web Documents - The Code, (4) Clustering , Recommendations, and Probability, and (5) Conclusion. In short, the video Hilary uses web based data to show the audience how to work with data to solve problems you may have by using basic machine learning techniques. The video is particularly directed at programmers who do not have statistical training.  

The viewer will sit with a group of a few other students and feel the imtimate setting of a small classroom. For myself, a video where you can re-watch segments, stop the video to reference a suggested resource, or pause to experiment with a variant of the code is both helpful and handy. For example, in the introduction, Hilary references a link (http://bit.ly/9RYQEF) that explans the concept of "data science." At that point, I paused the video and browsed to the link and found it quiet informative. By the second section, Classifying Web Documents - The Theory, the audience is gently taken into statistical techniques such as naive bayes and shown a step-by-step approach in how the math is applied. In the  Classifying Web Documents - The Code, the participant utilizes python code and the New York Time API to classify words from the New York Times web site. Within the Clustering, Recommendations, and Probability video the viewer is taken through code that demonstrates how to take data with which little is known and learn from the clustering results. Finally, the conclusion section deals briefly with the concepts of probability and then reviews the entire sessions content. 

While being able to navigate around in python is beneficial and by following along with the running of the code one can learn and retain more information, the participant can just view the video content as both the code and concepts are displayed and explained. What is nice is Hilary provides the code used in the video from her Git repository at https://github.com/hmason/ml_class. If the viewer wants to participate she will need to make sure that they have the proper python modules installed. 

In conclusion, the software developer that has little more than the required stats college class would do well to purchase this video. Seeing the actual application of code to the basic statistical algorithms is extremely informative and applicable in various problem domains.

Playing my Daily Healthmonth Turn and to Posting to 750words via my Droid

For over the past three months I have been using a few sites that help me to reach my personal goals within a "gamified" process.
 
The first site, healthmonth, is according to its creator Buster Benson, "an online adaptation of a game some friends used to play every year right after New Years."
 
The second, 750words also created by Benson, is a site that encourages the daily writing of...you guessed it, 750 words. The site provides an online, private space to compose an essay, journal, or just write what is on your mind. As you type, the site saves your work, tracks and displays your word count, and lets you know when you've passed the coveted 750 word mark. The fun aspect is in the fact that 750words keeps a score card of points for the days you enteract with the site. 750words also keeps track of the consecutive number of days (or streaks that) you submit completed posts. You can also see how others are doing point and streak-wise to fuel your competitive nature.
 
My wife and I were away from home for a few days and I was not certain if we would have reliable wifi access to play my daily healthmonth turns and to post to 750words to keep my 100 day plus streak alive. So, I wanted to find away to use my Droid to utilize the sites. 
 
I was able to play my turn on the healthmonth site easily with the Droid via the native web browser. However, posting to 750words was a little more tricky. While I could type a 750 word submission with the droid keyboard, I found it more feasible to create the post on my desktop, laptop, or netbook and import them into the Droid via a text app I use, AK Notepad. Then, once in AK Notepad I could copy and paste the text into the 750words site via the web browser. Note that any text editor should work in a similar manner in your Smart Phone. Specifically, here are the steps I took:
 
First you have to import your 750word posting into the AK Notepad. To import text (.txt) files into the Andriod AK Notepad app you will need to do the following:
1) Have a folder that is created during an export. You will need to use this folder as AK Notepad will not see folders created manually. If it is not there, create a directory to use by selecting and holding down a note from the list of notes, then select the "Export to text file" menu option.
2) With the droid connected to a computer via a USB cable place the files that you desire to import into AK Notepad in the directory in step 1 above.
3) Disconnect the USB cable and opened the app on the phone.
4) Select "Menu" and then "Settings"
5) Under Import/Export section select "Import notes" and then browse to the folder in step 1 above. NOTE: each file in the selected folder will be imported.
6) Select and hold the folder and then from the popup menu select "Use this folder." This should import all the files in the folder.
Next, open the note that you want to post on the 750words site and select and hold down the text until the popup menu is displayed and select the "Copy all" option. Now that the text is copied to memory, open the web browser, browse to the 750words site, and paste the text into the site page. The site will auto-save the entry.
 
Now, if I plan to be away from reliabe internet access I can still play my daily healthmonth turn and to post to 750words to keep my streak alive.