Sunday, March 02, 2008

Want to be influenced?

Caught this interesting post by Valdis Krebs on social networks and how ideas are spread within them. There has been much discussion about the "influential elite" and how, if they champion an idea, it is more probable that it will grow and gain acceptance. However, this post points to the thought that it is not so much the influencing elite who control what ideas gain intellectual and social traction, but rather the willingness to be influenced by those adjacent, in the social network graph, to the elite.

Saturday, February 16, 2008

Narrative Thinking

I was doing a few days coding for a client and informed them that I only had a few more free days before starting back into a new term at grad school and that I would probably not get much done given I was still learning the e-commerce package that they were using. But in order to provide them with a deliverable I decided to record my steps and thoughts in a document in narrative form for their future information and use.

There is much discussion about narrative verses symbolic code and moving computer languages more toward a natural language. Such is the discussion about Domain Specific Languages. However, when I say narrative form I am not speaking of actually writing code but rather simple prose mixed with code as needed, to record thought processes, research findings, and general steps in a discovery process.

Here is an example layout of what I did:

Saturday, January 05, 2008
Login Test
Current Steps Planned:
I would describe the steps/tasks that I planned on taking for this date. It could include a list of items, a brief description of what is planned, etc.

Actual steps:
  1. Here I would describe actual steps that I took, thoughts in the process, rationale for decisions, etc.
  2. I added a check to the Customer.Authenticate method.
if (customer.ID[0].Status != Customer.Validated){
throw new CustomerException(CustomerExceptionType.NotValidated, "Customer Not Validated");
}
  1. This resulted in an error when attempting to login with the userid and password.
  2. ......
Next Steps:
Here I would describe the steps/tasks that I planned on taking the time.

What I found was this forced me to be more precise in my thinking which naturally resulted in a more precise research and coding process. I have always known that writing makes one organize their thoughts more orderly in order to communicate more clearly. However, I must say I enjoyed the controlling aspect of thinking in a narrative format. It somewhat reminded me of the Test Driven Development in which you are controlled by getting the current test you are working on to pass with the simplest code. You do not have the opportunity to thrash around or run down this rabbit trail or that. You record your processes, organizing and analyzing your thoughts as you go, making sure you are focused and productive.

Tuesday, January 08, 2008

Dynamic and Domain Specific Languages in a Language Tiered Structure?

In a recent post I linked to a paper that I composed for a graduate class on Dynamic Languages in software development. Today, at InfoQ there was an interesting review of a post by JRuby developer Ola Bini. In a similar view to n-tier layered architecture, Bini describes language types of static, dynamic, and domain specific in a layered fashion.

For example, in an n-tiered layered architecture you would have a presentation tier on top of a business logic tier which is over a data layer. Bini states:
The first layer is what I called the stable layer. It's not a very large part of the application in terms of functionality. But it's the part that everything else builds on top off, and is as such a very important part of it. This layer is the layer where static type safety will really help. Currently, Java is really the only choice for this layer.
This layer corresponds to the data layer mentioned above.

The next tier Bini mentions is the dynamic language layer:
This is where maybe half the application code resides. The language types here are predominantly dynamic, strongly typed languages running on the JVM, like JRuby, Rhino and Jython. This is also the layer where I have spent most of my time lately, with JRuby and so on. It's a nice and productive place to be, and obviously, with my fascination for JVM languages, I believe that it's the interplay between this layer and the stable layer that is really powerful.
In my paper that I referenced above, I discussed that Groovy has great potential given it is designed for the JVM. Here I see this corresponding to the business logic layer.

The last tier mentioned is the Domain Specific Language (DSL) layer. For a discussion on that, go here. Bini states:
The third layer is the domain layer. It should be implemented in DSL's, one or many depending on the needs of the system. In most cases it's probably enough to implement it as an internal DSL within the dynamic layer, and in those cases the second and third layer are not as easily distinguishable.
Finally, in my view, this tier corresponds to the presentation layer. In a similar manner, the business logic and presentation tiers in many applications are often tightly coupled and "are not as easily distinguishable" as they should be. In any event, Bini’s post is an interesting perspective on the use and place for both dynamic and DSL languages.

Saturday, January 05, 2008

MIT’s new Open Courseware (OWC) web site

I was listening to IT Conversations earlier this week while jogging and heard the mention of MIT’s new Open Courseware (OWC) web site. After checking it out I found that OCW is a free publication of course materials used at MIT. The site provides access to course lecture notes and audio and video files, labs, and resources on a variety of subjects.

Of late, I have been diving into the business aspects of development. I must say to my shame I should have had this perspective much earlier in my career. Do not misunderstand me, I have always developed to solve a business need, but I am looking further up the value chain to explore how software applications in particular and technology in general can enhance innovation. With that said, I find OWC’s link to the Sloan School of Management providing helpful resources. For example, the reading list from the Management Information Systems: Generating Business Value from Information Technology provides a list of resources to read. One of the resources listed is an article from Harvard Business Review, October 2002, entitled Six IT Decisions Your IT People Shouldn't Make. A quote from the article states:
Our center runs a seminar called "IT for the Non-IT Executive," and the refrain among the more than 1,000 senior managers who have taken the course runs something like this: "What can I do? I don't understand IT well enough to manage it in detail. And my IT people - although they work hard - don't seem to understand the very real business problems I face."

I want to better understand real business problems and more effectively utilize software to solve them.

Finally, while this does not present an MIT education, it does provide supplemental materials for one’s academic and professional pursuits.

Friday, December 28, 2007

Dynamic Languages and Increasing the Quality of Software and Velocity in the Software Development Lifecycle

This last semester in my Systems Analysis and Design graduate class, we were assigned to present the results of a brief research project. We were to decide the topic and then provide a written paper and presentation.

My project was entitled Dynamic Languages and Increasing the Quality of Software and Velocity in the Software Development Lifecycle. Within this project I attempted to see if the current literature showed empirical evidence that dynamic languages, particularly Ruby and Groovy, shorted the development lifecycle and increased the quality of the software application.

Click here for the paper from the project.

Thursday, December 27, 2007

General Unification Theorem Proof Concerning Functional Dependencies in Relational Databases

For a problem that was to be solved in my database systems graduate class this last semester, we were asked to prove a theorem by Hugh Darwen that is known as the General Unification Theorem concerning Functional Dependencies within Relational Databases.

Click here to see the proof.

Tuesday, October 16, 2007

Selenium IDE HTML Compare Pattern

I was needing to test sorting for a web-based application UI this last week. What I needed to do was check that a listbox control’s account numbers were sorted in ascending order. What quickly emerged was a pattern of steps when using Selenium IDE HTML scripts to compare values.

First, get the string values to compare. Then, compare the values. You may need to parse the value as a float via the JavaScript parseFloat() function if working with decimals such as currency. If you use the eval() function (see below), you are good on comparing numbers such as integers. Finally, verify the expected outcome of the comparison.

As stated above the first thing is to get the values to compare:

<!-- get the first account number in the listcontrol -->
<tr>
            <td>storeEval</td>
            <td>var Account1 = ""; var
accountOptionList =
selenium.browserbot.getCurrentWindow().document.getElementsByName('accountList');Account1
= accountOptionList.item(0)[1].value</td>
            <td>Account1</td>
</tr>

<!-- get the second account number in the listcontrol -->
<tr>
            <td>storeEval</td>
            <td>var Account2 = ""; var
accountOptionList =
selenium.browserbot.getCurrentWindow().document.getElementsByName('accountList');Account1
= accountOptionList.item(0)[2].value</td>
            <td>Account2</td>
</tr>

Next, compare the values and place the comparison value into a variable:

<tr>
            <td>storeEval</td>
            <td>var isLess = false; isLess =
eval(${Account1} &lt; ${ Account2});</td>
            <td>isLess</td>
</tr>

Finally, verify that the comparison value evaluated as expected (that
the first numeric value is less than the second if sorted correctly):

<tr>
            <td>verifyExpression</td>
            <td>${isLess}</td>
            <td>true</td>
</tr>

Monday, October 15, 2007

JQuery Demos

Considering that most JavaScript development deals with Document Object Model (DOM) Element collections, JQuery provides a framework that results in cleaner and more concise code.

For the documentation go here. I have some basic demos here that cover very basic AJAX and drag and drop functionality.

Sunday, October 14, 2007

JavaScript Functions in Selenium IDE HTML Tests

I wanted to run a JavaScript function in my Selenium IDE HTML test. Specifically, I wanted to remove any currency symbols and commas from currency values. Here is the best way that I have found to do it.

First, declare the JavaScript function.

<tr>
<td>storeEval</td>
<td>
function(input) {var output =""; output = input.replace",","");
return output.replace("$","");}
</td>
<td>replaceText</td>
</tr>

To call the replaceText function do something like this:


<tr>
<td>storeEval</td>
<td>var parsedTotal = 0; parsedTotal =
parseFloat(storedVars['replaceText']('${Amount}')).toFixed(2);
</td>
<td>parsedTotal</td>
</tr>

Now I can use the parsedTotal value later in the test:

<tr>
<td>verifyExpression</td>
<td>${parsedTotal}</td>
<td>SomeValueHere</td>
</tr>

Saturday, October 13, 2007

Adobe's Integrated Runtime - Heavenly

Back in August I attended an event sponsored by Adobe that highlighted their new AIR (Adobe Integrated Runtime) product. The new runtime looks great but what was of particular interest at this event was the venue in which the event was held.

It was at the Bell Event Centre at the Verdin Bell & Clock Museum in downtown Cincinnati. The museum is an old church. What was cool was the majestic atmosphere that the building provided for Adobe’s informative outing. Moreover, as I sat there listening to the content of the presentation and looking up at the interior structure of the church, I could not resist the irony of the situation given the evangelism (of glad tidings for all developers) that was taking place.

Ryan Stewart giving the keynote

As the faithful, seekers of inspiration, and the skeptical gathered the Adobe AIR clergy (team) was prepared to deliver a message of hope. The sermons (presentations) consisted of building an AIR application with Adobe Flex, HTML and JavaScript, and utilizing JavaScript frameworks in AIR applications.

The content was inspiring (informative) and Adobe’s integrated runtime shows much promise (potential). In addition to the miraculous (cool) features such as ability for JavaScript developers to utilize ActionScript objects via script bridging, the sermons (presentations) contained the occasional rebuke (pokes) at Microsoft for their heretical ways (.Net platform), at which the congregation (those in attendance) responded with various utterances of “amen” (chuckles and head nods).

Although I left the service (event) unconverted from my agnosticism (the belief that no one technology can meet every business need), I was inspired to look to the holy city (Adobe) for more revelation (documentation) to see how AIR could potentially be the way (an answer to a business need).

Confession: You know I have to admit that I had fun with this one.

HTML ListBox Quick Item Select JavaScript

It has been awhile given that I have been busy at work and also started a graduate business informatics program. Anywho, a customer recently requested a way to select an HTML Listbox control and key in an account number and have that number be selected as they were entering the perspective number.

A coworker and I came up with the following. The referenced JavaScript file is here.

The trick here was utilizing the onkeyup event. The entered text is appended to a string that is compared to the listbox content. If there is a match, it is added to an array of matched items. On each onkeyup event, the first matched element in the array is selected in the listbox control. If the listbox loses focus, then entered string is set to an empty string.

Wednesday, August 01, 2007

Polyglot Programming?

Neal Ford argues for understanding and utilizing various languages based on business need. a.k.a. Use the right tool for the job!

When discussing using multiple languages many would say, "That's crazy talk!" However, Ford points out that we are already polyglot programming. We are using Java, XML, SQL, and JavaScript. Moreover, the learning of different languages help us think more broad about business problems.

Will have more coming on dynamic languages such as Groovy, which runs on the JVM. In a recent post I show a test drive of pre-alpha release of IronRuby (Ruby on the .Net CLR).

If we can dispel the delusion that learning about computers should be an activity of fiddling with array indexes and worrying whether X is an integer or a real number, we can begin to focus on programming as a source of ideas.
Harold Abelson

Sunday, July 29, 2007

Test Drive with IronRuby and System.Windows.Forms

Per Scott Guthrie’s blog I was inspired to take a look at IronRuby. Even though it is in pre-alpha, I could not resist given the appeal of Ruby with the rich libraries available in the .Net framework.

After building the IronRuby solution, I took the rbx.exe, along with the related assemblies, and dropped them into a new folder. Here is a look at the folder content.




I then created a file named example.ir.




Next, I ran the IronRuby exe with the new file.




This resulted in the window below.




After clicking the Click Me button:




On a side note, the shot above of the example.ir file is from Notepad2. The syntax highlighting, even with an .ir extension, is from changing the custom scheme in Notepad2. Look at a previous post to see how to change the schemes for syntax highlighting. If you want a build of Notepad2 with Ruby syntax highlighting, go to Scott Hanselman's blog for the build and source code.

Saturday, June 23, 2007

Notepad 2 for MXML and ActionScript 3

I was looking for a way to get color coding, for my favorite lightweight code editor for Windows, Notepad2, for Flex 2’s MXML files when I came upon Josh Tynjala’s blog entry on how to enable color coding support for ActionScript 3 files.

Since MXML files are XML they can use the same color coding syntax information. Here’s what you need to do to enable support for MXML files (or any other file type for that matter).

  1. Click on the View menu and choose Customize Schemes….
  2. Choose the XML Document type.
  3. In the input that contains xml;xsl;svg;xul;xsd;xslt;axl;rdf;vcproj;manifest, add ;mxml to the end. Note the semi-colon.
  4. Open an *.mxml file to see the wonderful color coding.

Friday, June 15, 2007

CAPTCHA (a.k.a Are you man or machine?) to reCAPTCHA

We have all been to sites where we have to type in a word or phrase that demonstrates that we are not a spider or spam bot but a human attempting to access a page or purchase an item. When you look at the word or phrase it looks like a warped rendering with distorted letters. The program that provides the fuzzy looking words is called CAPTCHA. According to recaptcha.net, “The term CAPTCHA (for Completely Automated Turing Test To Tell Computers and Humans Apart) was coined in 2000 by Luis von Ahn, Manuel Blum, Nicholas Hopper and John Langford of Carnegie Mellon University. At the time, they developed the first CAPTCHA to be used by Yahoo.”

I always understood the funky phrase or word was to stop Optical Character Recognition systems from deciphering them, submitting the words back, and falsely validating itself to as a human being. While it does that, recaptcha.net wants to use that few seconds of human effort of typing in the words into a textbox for noble purposes.

About 60 million CAPTCHAs are solved by humans around the world every day. In each case, roughly ten seconds of human time are being spent. Individually, that's not a lot of time, but in aggregate these little puzzles consume more than 150,000 hours of work each day. What if we could make positive use of this human effort? reCAPTCHA does exactly that by channeling the effort spent solving CAPTCHAs online into "reading" books.

reCAPTCHA improves the process of digitizing books by sending words that cannot be read by computers to the Web in the form of CAPTCHAs for humans to decipher. More specifically, each word that cannot be read correctly by OCR is placed on an image and used as a CAPTCHA. This is possible because most OCR programs alert you when a word cannot be read correctly.

To help with this go to http://recaptcha.net/learnmore.html. Moreover there is an API at http://recaptcha.net/apidocs/captcha/.

Hey, in about 30 seconds I helped digitized five words!

Wednesday, May 09, 2007

The Selenium storEval Method in Action

I was creating Selenium tests for the module on a J2EE app at work and noted that the requirements wanted the beginning and end dates in the search text boxes to be the current date. I then thought, "Hmmm, these tests will be run on various dates. How can I get the current date to validate that the current date, in a specified format, is entered into the beginning and end date textbox entries for a search query?"

A little digging on the OpenQA site in the reference for Selenium and I found the storEval method. According to the reference this method, "Gets the result of evaluating the specified JavaScript snippet. The snippet may have multiple lines, but only the result of the last line will be returned." That was just what I needed.

Here is where the method is used in the test that is stored in an HTML file:

<tr>
<td>storeEval</td>
<td>var d = new Date(); var mday = d.getDate();
var mmonth = d.getMonth() + 1; var myear; if (navigator.appName == 'Microsoft
Internet Explorer') {myear = d.getYear();} else {myear = d.getYear() + 1900;}
if (mday.toString().length == 1) { mday = '0' + mday; } if
(mmonth.toString().length == 1) { mmonth = '0' + mmonth; } todaysDate = mmonth
+ '/' + mday + '/' + myear;</td>
<td>todaysDate</td>
</tr>
<tr>

Note that the todaysDate variable above is passed the formatted current date. I then use it later in the test to assert that this is what is entered into the beginning and end date text boxes.

<tr>
<td>verifyValue</td>
<td>searchBeginDate</td>
<td>${todaysDate}</td>
</tr>
<tr>
<td>verifyValue</td>
<td>searchEndDate</td>
<td>${todaysDate}</td>
</tr>

Wednesday, April 18, 2007

Selenium IDE with an XPath Locator

We are beginning to use the Selenium IDE at work to do some UI based testing. One thing that I wanted to test is the sorting of columns in a table.

Here is how I did it.

Tuesday, April 10, 2007

Dreaming in Code Book Review

Just finished Scott Rosenberg's book entitled, Dreaming in Code. The subtitle: Two Dozen Programmers, Three Years, 4,732 Bugs, and One Quest for Transcendent Software summarizes this interesting work.

Unlike other tech related books this was composed by a journalist that kept the book moving and informative, all the while viewing software development from an entertaining, fresh perspective.

I highly recommend this book for not only software developers, but for those who work with them. Project managers, software testers, program managers and the like will benefit from the view point of a man who watched the unfolding of the Chandler open source project for a three year period.

As the book details, software is hard:
Why is good software so hard to make? Since no one seems to have a definitive answer even now, at the start of the twenty-first century, fifty years deep into the computer era, I offer, by way of exploration, the tale of the making of one piece of software -- a story about a group of people setting their shoulders once more to the boulder of code and heaving it up the hill, stymied by obstacles old and new, struggling to make something useful and rich and lasting.

Saturday, March 24, 2007

Ubuntu Desktop in Microsoft's Virtual PC 2007

I pulled down Microsoft's VPC 2007, which is free, a few weeks ago and have been using it on my Windows XP workstation and laptop. I even have a VPC machine with Vista and Office 2007.

I setup the VPC machine with Vista and then created a copy of the VPC to test drive. This enables me to play with it, and even break it with no issues. If I mess it up I just make another copy of my master VPC and go at it again. This is great for development and testing.

I even got the Ubuntu Desktop on a VPC machine thanks to a blog post from Arcane entitled Installing Ubuntu 6.10 on Virtual PC 2007 Step by Step.