Friday, July 25, 2008

Notepad2: A light-weight ABAP external editor

(a.k.a. Look Dr. Raghavan, no SAP environment!)

OK. It has been awhile since I have posted anything. Reason: I am heavily involved in church and family, working full-time, and going to school part-time. Enough said. Anyway, I have been taking a few SAP classes this summer as part of the Business Informatics graduate program I am in at NKU. One of the classes is an ABAP programming class.

I have to admit that after being skeptical at first, I like ABAP and its development environment. However, while still in the course, I want an external editor that I could use that color codes the syntax to make it easier to read and edit. Granted I will not be able to debug the code but it is nice to have an editor to drop code into, as I do not have to login to SAP, for a quick look.

My favorite light-weight editor is Notepad2 from Florian Balmer. Since it is open source, and I saw where others have added different language-syntax highlighting capabilities, I thought I would give it a go.

First, I downloaded the Notepad2 source from Flo’s Freeware Page and opened the C++ project in Visual Studio 2005. Then, after bombing on my first build, I read the readme file which stated to include the source from the editor that inspired notepad2, Scintilla and tweak one of the source files. After another bomb on the rebuild I set the project property to NOT embed the manifest. Then, it built.

Next, I wanted to get an ABAP lexer working for Notepad2. A quick look on Google and I found another build of Scintilla, SciTE Ru-Board Edition. Now is when the fun begins. What I essentially did was to dig into the SciTE Ru-Board source code, grab what I thought was the needed to implement the Notepad2 ABAP lexer, and then attempt a rebuild. With each attempted build I find various sections that I needed to modify within the Scintilla source code. Finally after about a dozen attempts, I had the Notepad2 project building.

Then, I wanted to update the Notepad2 Styles header and program files (Styles.h and Styles.c ) so that the color coding will work for ABAP files in Notepad2. Once this was completed, I had a light-weight ABAP editor that provided syntax highlighting for files with an ".abap" or ."abp" extension.

Finally, if you pull down the Notepad2 source from Flo’s Freeware Page, do a "diff" on the /src/Styles.c and /src/Styles.h files to see the updates. Also, to see where the Scintilla source was modified diffs should be done comparing the following files: /include/PropSet.h, /include/SciLexer.h, /src/KeyWords.cxx, /src/PropSet.cxx, and /src/StyleContext.h. I also added the /src/LexABAP.cxx file to the Scintilla source (thanks to VladVro [one of the SciTE Ru-Board Edition project owners]) as that is needed by Notepad2.

NOTE: The Visual Studio 2005 Notepad2 project and binary downloads were updated 9/18/2008 with more Object Oriented ABAP keywords.
Click here to get the Visual Studio 2005 Notepad2 project.
Click here to get the binary Notepad2 files.

NOTE: By the way, I added Scott Hanselman’s Ruby lexer to this project for Ruby file edits.

Wednesday, April 23, 2008

JavaScript HashMap

Okay, this is not new nor exciting but I was looking to create something like a Java HashMap or a C# Dictionary object in JavaScript. What I did find was that you can use a JavaScript Array to function as a hashmap or dictionary object. I would then use it to iterate through to do some quick client-side validation for a web page. Here is the code:

function formFieldArray(){
var myArray = new Array(10);
myArray['myname'] = "Name";
myArray['myaddress'] = "Address";
myArray['mycity'] = "City";
myArray['mystate'] = "State";
myArray['myzip'] = "Zip Code";
myArray['myPhone'] = "Phone Number";
myArray['myEmail'] = "Email Address";
myArray['cardname'] = "Name as it appears on the Card";
myArray['cardNumber'] = "Card Number";
myArray['expDate'] = "Expiration Date";
myArray['cardCode'] = "Card Security Code";

return myArray;
}

function validateForm(){
var theFormFieldArray = formFieldArray();

//iterate thru array and clear values
for (key in theFormFieldArray) {
if(eval('document.myForm.' + key + '.value.length == 0')){
alert('Please enter the value for the ' + theFormFieldArray[key] + ' field.');
eval('document.myForm.' + key + '.focus()');
return false;
}
}

document.myForm.action = "yourNextPage.php";
document.myForm.submit();
}

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.

Saturday, February 10, 2007

OpenID - open, decentralized, free

I was listening to Scott Hanselman's podcast where he featured OpenID - an open, decentralized, free framework for user-centric digital identity.

In a previous show he discussed identity and Microsoft's CardSpace and in this podcast, mentioned that Microsoft is collaborating with OpenID.

All I can say is get your's today!! Open, decentralized, free--why not!

Sunday, February 04, 2007

NSpec: .Net's Behavior Driven Development Tool

I had stated in a previous post about the advantageous of Behavior Driven Development with Ruby and RSpec. Here I am looking at NSpec, an open source tool from Tigris.

Go here to find out more about NSpec.

Monday, November 20, 2006

Setting up menu items in Ubuntu's Edgy Eft build

Have I said lately that I really like Ubuntu!?! What a great Linux distro that makes it easy enough so that the Linux novice can now use Linux on the desktop.

Anyway, I have a brief article on how to setup a menu item in the Edgy Eft build of Ubuntu.

Wednesday, October 18, 2006

An Open Source Team

As I have moved from the .Net team (yet I still have .Net apps I am modifying in my own small business) to the J2EE team at work (day job), I have been busy learning more about the commercial financial software we sell and the inner workings of J2EE.

One thing I am thankful for is a group of co-workers who do not hold their knowledge close to themselves but are ready and willing to share and teach. When I have a question, they are helpful and provide the needed information. Moreover, they have an array of tips and tricks that they provide.

That is the core of a successful team. When members understand that by sharing information, they open themselves up to receive more knowledge. It has been my experience that the more knowledge I share the more I learn.

Wednesday, October 04, 2006

A GoDaddy Ready MySql.Data.dll for .Net 2.0

In a previous post, I discussed how to build a MySql assembly to use with .Net 2.0 hosting on GoDaddy.com.

A blog reader, Bill Clark, recently asked me if I could post the assembly that I created for others to use.

Here you go.

The file includes the compiled (specifically for GoDaddy) MySql.Data.dll assembly that you will reference. Also included in the zip is ICSharpCode.SharpZipLib.dll assembly that is referenced by the MySql.Data.dll assembly.

Thursday, August 17, 2006

Dynamic vs. Compiled Languages

I was doing my usual run this morning listening to my IPod shuffle when on came a particular podcast that I enjoy called Hanselminutes. The host of the show, Scott Hanselman typically has great discussions on all things ASP.Net and sundry other topics.

This show dealt with a discussion on Dynamic vs. Compiled Languages with a particular emphasis on the advantages of Ruby.

The show also details the values of Test-Driven Development and the next rev of C# with more potential dynamic language features.

Sunday, August 06, 2006

Is Untested Code the Dark Matter of Software?

According to Cedric Beust's blog, untested code is the dark matter of software. I like this analogy. Just what is dark matter? Wikipedia states:
In cosmology, dark matter refers to matter particles, of unknown composition, that do not emit or reflect enough electromagnetic radiation (light) to be detected directly, but whose presence may be inferred from gravitational effects on visible matter such as stars and galaxies.
I find it interesting that just like untested software, dark matter has observational evidences such as gravitational effects on galactic motion but we really do not fully know what it is. Our calculations detect its presence, but due to obvious limitations, we lack the current ability to conduct extensive empirical investigations. Similarly, in software development, (not because we can't do extensive test but because we won't) we will run limited tests on a module and observe a small scope of expected behaviors. In essence, like the observable effects of dark matter on stellar objects, we infer that the software is coded correctly because of its observable outcomes. However, if not properly tested with the array of possible circumstances the module may not function as planned.

I understand that the limitations for software programming are different than cosmological research. Shear distance and inconclusive understandings of gravitation hinder a fuller understanding of dark matter. With software development, customer expectations, unmitigated risks, and changing requirements can hinder proper developer testing and confidence. However, if we really want to, unlike the astrophysicist, we have the ability to test and empirically understand most of the potential effects of the software we write.

What do you think would become of an astronomer who had the opportunity to more closely research dark matter and did not because of time pressures at best, and laziness at worst? Now that matter is dark.

Wednesday, August 02, 2006

Microsoft's Port 25 - their Open Source Software Lab

I came across this site today. Of interest is an interview with Tim O'Reilly at OSCON 2006.

My hope is that Microsoft will support cross-platform efforts in the open source community. I am already fond of DotNetNuke, NUnit, and other open source tools that are, at least in part, supported my Microsoft for the Windows platforms. We shall see if they support Mono and the like.

Saturday, July 29, 2006

Moving from Windows XP Pro to Ubuntu

I decided to take the plunge with Ubuntu on my old laptop that had Windows XP Pro installed. First I pulled down the Desktop CD of Ubuntu 6.06 ISO and burned it to a CD. Ubuntu fits on one CD-Rom disk, nice. Then after setting the BIOS settings to boot off the CD-Rom/DVD drive I inserted the CD with the Ubuntu 6.06 ISO.

After booting from the Ubuntu CD, you can test drive it to see if you want to install it on your hard disk. If so, there is a handy install icon. Select the icon, answer a few standard questions for language, timezone, userID, and password and it will install.

Then, I inserted my Linksys WPC11 wireless NIC and Ubuntu recognized it lickety split. I added my WEP settings info via the Administrator|Network tool and I was browsing.

I have to say that this was the most trouble-free install of any linux distribution I have seen. Then, with the help of the Urban Puddle blog, I was able to get Ruby, Rails, and MySql installed.

See my messing with Interactive Ruby (IRB) below on my new Ubuntu install.

Ubuntu Screen Shot

Also of note was that Ubuntu was able to browse to my Windows server shares as Server Message Block (SMB) shares. I did not even have to mess with SAMBA. Sweet!!!

Sunday, July 23, 2006

If you are hosting ASP.Net 2.0 on GoDaddy and using the MySql .Net Connector for MySql please read

First download the Connector/NET 1.0 installer from the MySql site (do not get the source code only download as it is buggy. The installer download contains the source also.)

After installing the MySql .Net Connector, in VS 2005 Add an Existing Project to your solution by browsing to C:\Program Files\MySQL\MySQL Connector Net 1.0\src\ MySql.Data.csproj file.

After adding the project, open the MySql project and add the following to the AssemblyInfo.cs file in the perspective locations:
using System.Security; //added for GoDaddy Host
[assembly: AllowPartiallyTrustedCallers()] //added for GoDaddy Host
Build the project and then either reference the MySql project or browse to the new MySql.Data.dll assembly directly.

Special thanks to a post from Alek at GoDaddy’s Support team on Microsoft’s Asp.Net Forum site. Apparently, as of June 22, 2006 GoDaddy.com, "has updated the custom medium trust configuration to allow the MySql.Data.Dll to work in a medium trust environment for the .Net 2.0 development environment." He then goes on to instruct you to set the AllowPartiallyTrustedCallers attribute in the AssemblyInfo file. Also thanks to others for pointing out the referencing the System.Security namespace in the AssemblyInfo file.

UPDATE: By request I have posted the compiled MySql.Data.DLL Assembly. Get it here.

Saturday, July 22, 2006

The value of multiple input

I was waiting for the app I was working on to build as I was listening to an old Led Zepplin tune and started thinking, what has the great bassist/keyboard player John Paul Jones been up to? A quick Google on John Paul Jones and I found his personal site at johnpauljones.com. A quick look at the photos and I was surprised to see John in a picture with Nickel Creek band member Chris Thile, at a mandolin symposium (See the image below).

John Paul Jones with Chris Thile and others

For the unacquainted, Nickel Creek is a progressive, blue grass group that many would not even label as blue grass. Any way I always read of the various blues and other world music that was the influence of Led Zepplin. I also know John Paul Jones played mandolin at least on Led’s fourth album song, Going to California. The point of this post is to be aware of the value of various influences. One should resist the temptation to limit oneself to only what is comfortable. I then thought of the literary influences that were listed by futurist Alvin Toffler in a recent C-Span interview. He spoke of a array of topics on which he regularly reads. Moreover, he explicitly stated that one needs to expand the genre and subject matter of what one reads to get a better, holistic view.

How does this apply to technology and business in general and software development in particular? One general application is that inputs of various topics helps one to better anticipate the ebb and flow of the information technology market and adjust one’s direction accordingly. Secondly, and more specifically, a broader understanding of things makes one more able to understand the various business domains for which one will have to write software solutions. Finally, the understanding of various programming languages enables one to develop a broader knowledge base by applying the concepts, idioms, and problem-solving patterns of one language to another, potentially combining the strengths of two or more languages to a solution.

Sunday, July 16, 2006

RSpec and the Empty Executable Spec

One great side effect of utilizing the agile approach to software design is the first thinking about, at lease as well as one can given the available information, the desired end result. This is typically started a failing test in the Test Drive Development (TDD) camp. However, the more I am exposed on RSpec the more I like the idea of design that is driven by specifications that are fulfilled in short, iterative cycles. Therefore, instead of having a "failing test" one would have an "empty executable specification." (If you could not already tell, I am not attempting to coin a new phrase. The expression "empty executable specification" is neither clever nor catchy. To be honest, I really do not know what else to call it.) In fact, it is the use of existing terms in TDD that do not really communicate the great results of TDD.

Click here for more.

Wednesday, July 12, 2006

Hegel's (or rather Jim Weirich's) Ruby Dialectic: the synthesis of Design by Contract and Behavior Driven Development

At a great Extreme Programmers User’s Group meeting here in Cincinnati, Ohio, Jim Weirich gave a thought provoking presentation on the experimentation of utilizing the semantics of a Behavior Driven Design (BDD) and the more traditional Design by Contact (DbC) with the Ruby rSpec tool. Having come out of the VB/ASP/COM/.Net world and now working on the J2EE team at US Bank, I appreciate the semantic qualities that various languages possess and more importantly the "idioms" they teach. I agree with the classic Sapir-Whorf hypothesis that the language(s) you use can either aid or hinder your ability to form thoughts and even solve problems.

With that said, the potential of Jim’s experiment with BDD and DbC is rich in its bringing together two divergent methodologies into a potentially better one. The question that the experiment is attempting to answer, from my understanding of the presentation, is can the thesis of DbC and its emphasis on getting the specifications completed upfront, pre and post conditions, and assertions combined with the antithesis of BDD’s executable specifications (a.k.a unit tests in Test Driven Devlopment) and short iterations produce synthesis of the two--a clearly understood contract (or set of contracts) between customer and developer that is the requirement for a short, iterative BDD’s executable specification(s)? Moreover, are there any unanticipated results that will emerge from the experiment that can be immediately useful or spawn more questions? One might state this is similar to an "alchemist experiment to see what comes to the top of the mixture of the two elements."

In summary, after showing us his Ruby framework to support Design by Contract, Jim explicitly stated that the experiment’s result(s) are not intended to replace Test Driven Development, BDD or DbC. However, in my view, it could produce a client initiated contract that can be solved in a few iterations with BDD. Or, sticking with the previous alchemist analogy, Jim's experiment could provide some proverbial "gold from silver and copper."

Sunday, July 02, 2006

Testing .Net Properties with FIT

Just got a comment on .Net and FIT from a blog reader. This caused me to remember that I submitted a proposed patch to source forge, artifact 1255429, which deals with using properties instead of member variables. The patch was submitted to source forge in August of 2005. Nothing as of this post has been done, that I am aware of, so I thought I would put it out for public consumption and comment.

In more detail, fixtures deriving from RowFixture have instantiated classes with public variables, instead of exposing the instantiated object’s members via public properties. With these modifications you can write fixtures directly against objects under test, which are typically the actual application classes, exposing properties instead of variables to the RowFixtures. This enables the .Net developer to avoid writing additional code beyond the fixture and the actual application objects under test.

Here it is.

Thursday, June 29, 2006

Re-writing and copying HTML files with Ruby Refactoring

I submitted a previous post on re-writing and copying HTML files with Ruby. I could not let that rather large and unruly script go as is and had to refactor, a.k.a. extract, much of the script code out into a ruby class.

Here are the goodies.

Wednesday, June 28, 2006

Php 4 Quick and Dirty Model and View Separation Example

I was coding a site in Php and needed to display announcements and needed a quick and simple way to do this. Moreover, I wanted to keep the design in the good ole MVC pattern.

See how I, at least somewhat, did this here.

Monday, June 26, 2006

Re-writing and copying HTML files with Ruby

A personal goal of mine is to read through the Bible this year on a daily basis. To assist me in this I have an HTML file for each month of the year with links that call a JavaScript function passing the text-section value and then putting the value into a URL QueryString and opening a new window with the loaded URL. This worked OK but because the JavaScript opens a new window, the daily links were not showing with the visited style that I set in the CSS file. Here is where Ruby came in.

I thought about just rewriting the HTML but having to create 12 separate files, one for each month, was not what I wanted to do. Why not, as I am learning to use Ruby, use it to parse the existing HTML into a new file, a txt file in this case and then run script to rename the new into the old files, with links that use the traditional target attribute to open a new browser.

Click here to see what I did to parse the existing HTML files into TXT files.

Click here to see the copy of the TXT into HTML files.

Saturday, June 10, 2006

What are we thinking?

Okay. So now you have inherited someone else’s code. You typically review the automated tests (if any), available documentation (if any), and then the code itself. It is here that at lease one person in each development group will say, “What were they thinking? This code sucks.” It is at this point that I cringe. Yes, the code may not be the most elegant. But to just simply state, in your self-proclaimed superiority, that the previous programmers were stupid is both unprofessional and short sighted. Don’t misunderstand me. I am not saying that in the name of being nice to overlook and tolerate crappy code. My point here is that there is more than initially meets the eye.

What got me thinking about this was an article that I ran across by Dave Hunt and Andy Thomas entitled, Software Archaeology. In it the authors state:

Archaeologists generally don’t make wisecracks about how stupid a particular culture was (even if they did throw dead bodies into the only good drinking well). In our industry, we generally don’t show such restraint.


As stated above, it has been my experience that in the software development field, we are too quick to criticize. They then go on to write:

But it’s important when reading code to realize that apparently bone-headed decisions that appear to be straight out of a "Dilbert" cartoon seemed perfectly reasonable to the developers at the time. Understanding "what they were thinking" is critical to understanding how and why they wrote the code the way they did. If you discover they misunderstood something, you’ll likely find that mistake in more than one place. But rather than simply "flipping the bozo bit" on the original authors, try to evaluate their strengths as well as weaknesses. You might find lost treasure—buried domain expertise that’s been forgotten.


Therefore instead of just asking, "What were they thinking?” we need to consider “What and how are we thinking?" to get the most out of the code that we sometimes unearth and/or must excavate.

Sunday, May 21, 2006

Ego is not your friend

I was listening to Scott Hanselman's podcast called HanselMinutes and noted a statement from the host of the show Carl Franklin, "Ego is not your friend." The context was that as a developer, your ego, if too sensitive or too large, can keep you from learning from the developer community. The ego typically prohibits you from being honest and saying, "I do not understand or know what you are talking about, please explain." This prohibition is manifested in your feeling ashamed to state that you do not know what is presently being discussed or you want to appear that you know more about the topic than you actually do.

It has been my experience that my ego, if not monitored, can cause me to view my present lack of understanding in an incorrect way. The reality is not that I lack the ability to understand the information, but rather I lack exposure to the information. From that aspect, I am now informed about what I need to learn. Moreover, if I do understand a topic better than someone else, this does not mean that my level of intelligence is greater. It simply means that I have been made aware of the topic and have taken the time to learn. Otherwise, my ego could falsely cause me to think that I am more adept than I am in reality and cause me to not consider various aspects of a topic, since I think I understand more than I do in reality.

In summary, either by causing one to think they can not improve or that they have no need to better their understanding, ego is not your friend.

Thursday, April 13, 2006

msquaredweb.com now on linux

For those who care, I took the plunge and am now hosting on linux. This is in preparation to eventually move the site to Rails.

I will still have sites on asp.net just to keep my .Net skills current, but since I have moved to the J2EE team at my real job, I thought it best to make this move with msquaredweb.com.

Wednesday, March 15, 2006

Installing Ruby on Windows XP Pro

In my readings on Ruby I have yet to run across a step-by-step example of how to install it on Windows XP Pro. Anyway, since I bought a new laptop, I decided to record the steps in the installation of Ruby 1.82-15.

Here are the steps.

Tuesday, February 21, 2006

Truthiness?? Alrighty then!

In a blog from Brian Marick I saw this: The American Dialect Society voted "truthiness" the 2005 word of the year. It "refers to the quality of preferring concepts or facts one wishes to be true, rather than concepts or facts known to be true." On a private level that may be well and good. However, the older I get the more that I am aware that “no man is an island.” In other words, in some small way we affect on another.

Therefore, if you are my family doctor, don’t use that in your medical practice. If you are my employer, do not use “truthiness” when you calculate my pay. If you are a civil engineer, do not go about “preferring concepts or facts one wishes to be true” when engineering the bridges I drive over.

Brian goes on to show that in the development of code, more tests are the answer to “preferring concepts or facts one wishes to be true, rather than concepts or facts known to be true”, not ignoring the facts.

And yes, when designing software, more tests please, and less "truthiness."

Thursday, February 16, 2006

The Scandal of Prediction (a.k.a We think we're purty smart)

Just listened to an interesting program on IT Conversations dealing with the problems of predictability and why the various models and systems of predictors fail by Nassim Nicholas Taleb entitled, The Scandal of Prediction.

What I gathered from the program is that the overall problem with accuracy in predictions and forecasting is systemic arrogance. We fail to acknowledge what we do not know and inflate the little we do know. We should not stop attempting to utilize our forecast models and systems , but let us do it with an honest look at the vast amount of knowledge we are yet to discover.

An interesting note is that Taleb refers to the concept of Yesterdays Weather with which agile developers should be familiar. Simply put, this concept is based on the understanding that there is a 70% chance that today’s weather patterns will be a repeat of yesterdays. Statistically, we know this but still we employ vast machinery to "predict" what the weather will be like in the future. Admittedly, there is more value in the use of models and formulas the further out one attempts to predict. In any event, I humbly predict (without any meteorological training or know how) a 70% chance that tomorrows weather is like today’s.

Tuesday, January 10, 2006

Learning Ruby

The Cincinnati Extreme Programmer’s Group January meeting was treated to a presentation by Jim Weirich, a consultant for Compuware, about Ruby On Rails. I could not make the meeting but watched a recorded video of the presentation and reviewed Jim’s blog concerning the meeting. As I was perusing Jim's blog I came across his link on a talk that he will be giving at the upcoming Dayton-Cincinnati Code Camp entitled, "10 Things Every Java Programmer Should Know About Ruby."

I must say that Ruby looks intriguing. In fact, I have registered for the Dayton-Cincinnati Code Camp and am looking forward to Jim's talk. Moreover, I ordered the Agile Web Development with Rails: A Pragmatic Guide book. I can not wait to dig in!!

Thursday, January 05, 2006

Output Parameters from C# Method

I know that this is “old hat” to many but I am working on an application where I needed a method to return two separate values. I turned to good ole output parameters. I know I could have created two separate methods but the values within the problem domain are always associated. Therefore, it made sense to me to use output parameters with one method.

Here is an example using a NUnit test and the method returning two values via output parameters.

[Test]
public void TestParseAndReturnTwoSeperateStrings()
{
string toParse = "00050000999";
string strOne;
string strTwo;

ParseAndReturnTwoSeperateStrings (toParse, out strOne, out strTwo);

Console.WriteLine("String 1: {0}", strOne);
Console.WriteLine("String 2: {0}", strTwo);

Assert.AreEqual("000", strOne);
Assert.AreEqual("50000999", strTwo);
}

private void ParseAndReturnTwoSeperateStrings (string input,
out string strOne, out string strTwo)
{
strOne = input.Substring(0, 3);
strTwo = input.Substring(3, input.Length - 3);
}

Saturday, December 17, 2005

NUnit 2.2.4 Released!!

Just got an e-mail within the Test Driven Development Yahoo Group from Charlie Poole concerning the release of NUnit 2.2.4:
If you haven't followed the development releases, here are a few highlights of what's new, as compared to NUnit 2.2:

* NUnit 2.2.4 runs under .Net 2.0 and works with VS2005. If you work exclusively with .Net 2.0, you can download a version that is actually built with that framework version, which eliminates dealing with the config file.

* You can run tests built against older versions - 2.0 or later - of NUnit without recompiling. As a bonus, you can run tests built against CSUnit without recompiling.

* A number of new Asserts and Attributes have been added. It is now much easier to create your own custom Asserts while still taking advantage of NUnit's built-in error message formatting.

* An extensibility mechanism allows you to define your own attributes for test fixtures and cases that behave in non-standard ways. [This feature is Still a bit experimental, and will appear in final form in the 2.4 release.

* Documentation is substantially improved and is provided as a set of html files. The packaged documentation includes only version-specific details, with info that may change over time, such as contacts, kept on the web site.

You can read the full release notes at http://nunit.com/testweb/index.php?p=releaseNotes&r=2.2.4. Note that the nunit.org site has not yet been updated to reflect this release.

You can download NUnit 2.2.4 at http://sourceforge.net/project/showfiles.php?group_id=10749

Friday, November 25, 2005

A thought experiment, just for fun

I typically, for a brief dose of humor, will go to the Dilbert site some point in my day. As I browsed to the daily comic strip I noted a link to Scott Adam’s free e-book entitled God’s Debris. Here is a part of the introduction:

The central character in God’s Debris knows everything. Literally everything. This presented a challenge to me as a writer. When you consider all of the things that can be known, I don’t know much. My solution was to create smart-sounding answers using the skeptic’s creed:

The simplest explanation is usually right.

My experience tells me that in this complicated world the simplest explanation is usually dead wrong. But I’ve noticed that the simplest explanation usually sounds right and is far more convincing than any complicated explanation could hope to be. That’s good enough for my purposes here.

The simplest-explanation approach turned out to be more provocative than I expected. The simplest explanations for the Big Questions ended up connecting paths that don’t normally get connected. The description of reality in God’s Debris isn’t true, as far as I know, but it’s oddly compelling. Therein lies the thought experiment:

Try to figure out what’s wrong with the simplest explanations.

What I found interesting is that, at least, sounds very much like the "simple design principle" that is advocated, correctly in my view, by the Agile Extreme Programming methodology.

In addition to this, I also found of interest related to software development was a discussion of pattern recognition and usage. In the chapter, Science, the central character states:
Computers and rocket ships are examples of inventions, not of understanding," he said. "All that is needed to build machines is the knowledge that when one thing happens, another thing happens as a result. It’s an accumulation of simple patterns. A dog can learn patterns. There is no 'why' in those examples. We don’t understand why electricity travels. We don’t know why light travels at a constant speed forever. All we can do is observe and record patterns." (P. 22)
In any event, instead of getting my daily fix of humor I got much more, a jolt to my thinking about fundamental questions. That, in my possibly warped view of entertainment, is for more enjoyable. Moreover, perhaps the joke is on me since I do not know nearly as much as I foolishly thought.

Thursday, November 17, 2005

Agile Amigo?

Ivar Jacobson, one of the founders of UML, pledged to support Microsoft Visual Studio 2005 Team System with the goal of a more agile approach to design and modeling.

Check this potential Agile Amigo out here. This will be interesting to follow.

Tuesday, November 15, 2005

Microsoft released guidelines for converting ASP.Net 2002/2003 projects to Visual Studio.Net 2005

Microsoft released guidelines for converting ASP.Net2002/2003 projects to Visual Studio.Net 2005 at Step-By-Step Guide to Converting Web Projects fromVisual Studio .NET 2002/2003 to Visual Studio 2005.

The article states:

The primary benefit of converting a Web application project to Visual Studio 2005 is the ability to use many new features in ASP.NET 2.0 (e.g., master pages,etc.) in your existing application. If you are looking to enhance an existing Web application built using Visual Studio .NET 2003, then upgrading to Visual Studio 2005 is most likely the right decision.
As expected, simple projects will be easier to convert:
For relatively simple Web projects where a Webproject is the only project in your Visual Studio .NET 2003 solution, conversion should be a relatively automatic process requiring little time or problem resolution.

However, not all ASP.Net 2002/2003 project conversions will be easy:
If the application you are converting is of reasonable size and has several Web projects and additional projects, such as class libraries, in a single Visual Studio solution, it is possible to encounter issues during migration. Be prepared to spend the better part of a day completing the entire process. The steps and guidance provided in this article can help an informed user to migrate most applications of medium complexity.

Thank you Web Platform and Tools Team for your honest assessment. I must admit that I am very skeptical when someone says, "it’s really pretty straight forward." Yea....right. In any event, I am looking forward to moving some of my small-sized projects to VS 2005.

Monday, November 14, 2005

Webservice Account Permissions "Gotcha"

For a project, an internal customer wanted to utilize web services for file reading and writing. Both the file write and read services were utilizing a System.IO.FileStream object, invoking the object's Read and Write methods. Since the location that the web services would be reading and writing from is a network share, two domain accounts were setup and given read, and you guessed it, write permissions each respectively to the share.

The “gotcha” that we encountered was that the accounts that the web services were utilizing needed modify permissions on the server <WindowsFolder>/temp folder in order to generate serialization proxies.

Click here to see what was done to remedy the issue.

Monday, November 07, 2005

It's in the wild!!

SQL Server 2005, Visual Studio 2005 with .Net 2.0 and BizTalk Server 2006 had their official launch today.

Also, DotNetNuke, an Open Source Web Application Framework, is releasing its 3.2 framework, built on the 1.1 .Net, and its 4.0 framework, built on .Net 2.0.

I can see that I am not going to get much sleep.

Friday, November 04, 2005

New from Yahoo! and still in beta - Instant Search

New from Yahoo! and still in beta - Instant Search where results instantly appear for Yahoo! Shortcuts and common searches.

Thursday, November 03, 2005

Covariance and Delegates in .Net 2

Click here to view this little nugget in .Net 2 dealing with covariance, an object-oriented principle, and delegates.

Very nice code re-use construct!

Friday, October 14, 2005

Essential ASP.Net 2 Webcasts and Lab Exercises

Fritz Onion has been doing some great webcasts concerning ASP.Net 2.

There are also labs and demo code provided with the slides! There is nothing like actually building something with the code to learn newprogramming constructs and techniques.


Saturday, October 01, 2005

Continuous Partial Attention, please?

I typically download podcasts, audio program files in MP3 or WMA format, to listen to as I jog or mow the yard. One podcast feed that I subscribe to is IT Conversations.

A recent podcast dealt with a discussion panel of information overload and how that affects our attention to any one thing at a time.
In a world where information overload is common, attention is a very scarce resource and there is an increasing need to manage it efficiently. In this panel discussion, Steve Gillmor, Glenn Reid, Doreé Duncan Seligmann, David Sifry and Linda Stone talk about the problem of coping with more information than one can handle and the possible solutions.

In a connected world it is becoming very difficult to filter out the information that really needs our attention from that which is irrelevant to us. The panel discusses the work that they are currently involved in and tries to come up with answers to the problem of overwhelming information, only some of which deserves our attention. They talk about the tools, practices and new technology being developed to effectively use data which matters to the end user.

Part of the discussion dealt with what Linda Stone has termed continuous partial attention:

For almost two decades, continuous partial attention has been a way of life to cope and keep up with responsibilities and relationships. We've stretched our attention bandwidth to upper limits. We think that if tech has a lot of bandwidth then we do, too.

With continuous partial attention we keep the top level item in focus and scan the periphery in case something more important emerges. Continuous partial attention is motivated by a desire not to miss opportunities. We want to ensure our place as a live node on the network, we feel alive when we're connected. To be busy and to be connected is to be alive.

She then states how through the last twenty years we have come to realize that the belief that connectedness is synonymous with living is not necessarily true.

Now we long for a quality of life that comes in meaningful connections to friends, colleagues, family that we experience with full-focus attention on relationships, etc.

I for one will begin to strive to give full attention when talking and relating to not only my loved ones, but friends, neighbors, and co-workers. What higher compliment can we pay to others but attention?

It is all about people

The longer I am in the Information Technology world the more I am convinced that it is all about people. What is more important to a company than human capital? We all know that technology provides both assistance and in some forms, electronic enslavement. The latest gadgets come and go. However, when the dust settles, we the people are still here.

We are all still striving to become. Let the newest software languages and methodologies, the latest portable toys, and the most recent killer apps assist us in being, not just being wired.

Wednesday, September 21, 2005

ASP.Net 2 Cross-Page Posting - More than Server.Transfer

Cross-Page Posting provides what we had in classic ASP form posting and more. Instead of the form posting back to itself, as we currently have in ASP.Net 1.x, or using the Server.Tranfer method, also in ASP.Net 1.x, we can now post directly to other ASP.NET forms.

For those controls that implement the new (in ASP.Net 2) IButtonControl interface, such as the Button control, the PostBackUrl property (that must be implemented by the control), "Gets or sets the URL of the Web page to post to from the current page when the button control is clicked."

Too cool!!

For more on this go here.

Wednesday, September 14, 2005

The LINQ Project - Check this out!

Here is a cool announcement that came out of the PDC. According to Microsoft:
The The LINQ Project is a codename for a set of extensions to the .NET Framework that encompass language-integrated query, set, and transform operations. It extends C# and Visual Basic with native language syntax for queries and provides class libraries to take advantage of these capabilities.
See a demo from Anders Hejlsberg on Channel 9.

Friday, September 02, 2005

Factory Method or Abstract Factory

Since I provided the code examples in C# for the Head First Design Patterns book, I recently got an e-mail from a reader, James Micheals, of the Head First Design Patterns book that sent me this question.
I'm trying to understand the difference between simple factory and factory method. They are the same thing! It's just one is composed while the other is inherited. I could even argue that since we prefer composition over inheritance, simple factory is better than factory method. I don't understand why factory method is better, and I've been tearing my hair out for hours to figure out why.
While I myself am a mere student of patterns here was my reply and thoughts on his question:
James,

You have asked a good question.

The factory method is good to implement alone if you have variations of a particular object that you need to create.

The Head First book uses a pizza store as the example here. The pizza store has a limited variation of pizzas it sells. Therefore, an abstract class is implemented (extended in java) in your subclasses and you are good to go for specific pizza object creation.

The abstract factory is utilized for creating a "family of objects" and therefore often utilizes factory methods within it.

In short, which pattern is used is dependent upon your need. If a simple set of related objects is what you want, then the factory method is your pattern. If you need a more varied set of objects created, the abstract factory pattern provides this via the ability to use a set of interfaces for each desired set of objects.

You stated that composition is favored over inheritance. That is correct, but which pattern is used is dependent upon your need.

Hope this helps,

Mark


Monday, August 22, 2005

Playing with Partial Classes in C#

I was reading a Partial Class Definition on MSDN and thought it looked simple enough and decided to take Partial Classes for a C# run.

Here it is.

Tuesday, August 16, 2005

Web UI Developers, for now, use the Firefox Browser

I am primarily a Microsoft platform developer. Microsoft makes a great IDE in the form of Visual Studio.Net and has a great language in C#, which is getting better with C# 2.0.

However, I must say, at least until IE 7 becomes more visible and out of beta, that Mozilla’s Firefox browser provides better tools for web developers through Firefox’s extensions for developers.

I especially like the Web Developer extension. Sure beats the Alt+Tab dance between the browser you are viewing your changes with and your CSS editor!

Sunday, August 07, 2005

How can we be sure we are singing from the same page of music? – Fit in the key of C#

To build on an earlier posting on the use of Fit with C#, here are examples of Fit fixtures implemented in C#. The fixtures I demonstrate are the ActionFixture, ColumnFixture and RowFixture.

I also briefly discuss the desire to test properties in addition to fields and methods with Fit. I have "tweaked" the source code to provide this. My initial tests work but I would like to further test the code and submit it to other Fit developers as I am sure this has already been considered. My guess is that I may not be implementing the RowFixture subclass correctly. I will provide my source code on this later following more tests and discussion.

UPDATE 7-10-2006: After posting the above info, I submitted a proposed patch to source forge, artifact 1255429, which deals with using properties instead of member variables. The patch was submitted to source forge in August of 2005. Nothing as of this update has been done, that I am aware of, so I thought I would put it out for public consumption and comment.

In more detail, fixtures deriving from RowFixture have instantiated classes with public variables, instead of exposing the instantiated object’s members via public properties. With these modifications you can write fixtures directly against objects under test, which are typically the actual application classes, exposing properties instead of variables to the RowFixtures. This enables the .Net developer to avoid writing additional code beyond the fixture and the actual application objects under test.

The new post: Testing .Net Properties with FIT

Friday, August 05, 2005

Resharper: Sharper indeed

ReSharper provides some needed editing features for Visual Studio.Net.

For example, if you have private local variables and you want to expose those guys via public properties just Alt+Insert (ReSharper > Code > Generate... via the ReSharper menu) in Visual Studio and you get:

Resharper Generate code menu

As you can see you can also easily generate a constructor, implement interface members, or override members from base classes.

There are many more “niceties” from ReSharper such as automatic indentation within bracket blocks {}. I got real tired of typing the brackets, separating them via hard return, and then tabbing to indent the first line in the block of code.

public void SomeMethod()
{
     //indented code here
}


Instead, when you enter a set of brackets for a block of code, ReSharper will insert your cursor between the brackets. Then, when you hit the Enter key the new line is indented for you! These are just a few of the great features of ReSharper.

I did not mention the Refactoring it provides. ReSharper rocks!!

Thursday, August 04, 2005

101 Samples for Visual Studio 2005, in VB.Net and C# -- Nice!

Via a post on the ServerSide.Net site from Paul Ballard, Microsoft has released a compilation of 101 code samples in both Visual Basic.Net and C# for Visual Studio 2005 and the .NET Framework 2.0.

Samples include base class library samples, data access samples, web development samples, and windows forms samples.

Nice!

I love Virtual PC!!!!

I love Virtual PC! Now I can do something more unique with my older workstations, one with Redhat and the other with Windows 2003 Server, since I now have Virtual PC where I can have several "virtual installs" of operating systems that run on my Windows XP Pro SP2 system!

I have 2 Windows 2003 server virtual installs (one with Fitnesse, PHP5 and the Netbeans IDE running on it and the other with Visual Studio 2005 Beta 2) and am installing SUSE Linux 9.3 in a separate install next!

This is most useful when doing development R & D on various OS/platform applications. Did I already say that I love Virtual PC?

Thursday, July 28, 2005

C# FIT Basic Setup on XP Pro

As you know from a previous post, I have been reading Fit for Developing Software by Rick Mugridge. What a great tool for communication and clarification of requirements between the customer(s) and software developer(s).

I am now at the chapter introducing Fitnesse. The use of a wiki format for Fit tests is powerful to say the least. More on that going forward.

Anyway, I thought it best at least to detail the steps of the basic setup of .Net's Fit on Windows XP Pro. So here you go!

Sunday, July 24, 2005

Open exchange of ideas...NOT

Here is a great Dilbert cartoon that unfortunately describes the mentality of many, not just managers, in the exchange of ideas in the corporate environment. I think it is true that one can keep the subordinates or co-workers ignorant and powerless, but only for so long. Then, the brightest and best either dumb down, which harms the organization, or move on to other employers, which also hurts the company. In either case, the ones who win are the competitors.

I must say I am thankful this is not the case where I work! Thanks Sarah and Reed!!

Saturday, July 16, 2005

Just got my copy of Fit for Developing Sofware!

I just got my copy of Fit for Developing Software by Rick Mugridge and Ward Cunningham! Stay tuned for musings from this book. I hope to be providing some of the book's code examples (which in are java in the book) in C#.

Tuesday, July 12, 2005

IT Conversations - It’s a small world indeed

Each morning, at least on weekdays, I jog my usual neighborhood loop. To make this less tedious I usually have my Rio MP3 player piping music or a podcast into my head. The last few days here in Northern Kentucky we have felt the effects hurricane Dennis. Just days earlier I watched as the hurricane ripped through the pan handle of Florida. I find it fascinating that within our vast ecosystem one pressure or influence affects another. Anyway, on my run this morning, I noted the cloud cover from Dennis. At the same time I was listening to an MP3 that was found as the result of “googling” for technology podcasts. What I found from Google was IT Conversations. You often here in agile development circles of the emergence of "organic" applications due to environmental pressures. Here, at least in my view, is the emergence of a great service due to pressures of the need for thought provoking audio in the technology “ecosystem.”

The IT Conversations site is a free, donation based podcast site that deals with everything from software development to social trends and how technology affects these domains.

I highly recommend IT Conversations and encourage all to go there. If you agree, please donate to keep the informative and entertaining podcasts coming.

Saturday, July 02, 2005

Configuring NUnit 2.2 to use Visual Studio 2005 Beta 2

I have been playing with Visual Studio 2005 Beta 2 lately. I do not have any Team System install on my test server yet. I was thinking how nice it would be to meanwhile, at least, have NUnit 2.2 working with VS.Net Beta 2.

Click here for the steps to make that happen.

I will be getting Visual Studio 2005 Team Suite Beta 2 on my server shortly. Until then, it is nice having NUnit2.2 to use with just the plain Visual Studio 2005 Beta 2 install.

Saturday, June 25, 2005

Language Oriented Programming

I was browsing my RSS feeds and noted an update on Martin Fowler's bliki dealing with Language Workbenches for Language Oriented Programming (LOP). This entry led to an article by Sergey Dmitriev entitled, Language Oriented Programming: The Next Programming Paradigm. As I was reading through the article I came across the statment:


In mainstream programming, most of the time spent 'programming' is really just finding ways to express natural language concepts in terms of programming level abstractions, which is difficult, not very creative, and more or less a waste of time. For example, today a good deal of development time is spent on object-oriented design (OOD). This is actually a fairly creative process where the programmer expresses classes, hierarchies, relationships, and such. The purpose of this exercise is to express the program in object-oriented terms such as classes and methods. The process of OOD is necessary because these classes and methods are the only abstractions that object-oriented languages understand. It seems like it is necessary and creative, but with Language Oriented Programming, OOD is not needed at all.
Okay, now you have my undivided attention. Having just spent a week in RUP training which was about taking use cases and performing "use case realization" which is completed to translate the anticipated business line usage senarios of the application in question, I was really interested.

The article then discusses the aspects of LOP. Then following this an overview of LOP and a JetBrains' Meta Programming System overview dealing with LOP is provided. Most interesting.
Needless to say, I will be reading more on LOP.

Saturday, June 18, 2005

RUP Development Iterations and TDD together

I have spent most of this week in Rational Unified Process (RUP) training, presented by the Ivar Jacobson International company. The training was engaging in that there were several opportunities for group discussion and hands-on exercises.

During a class discussion it was stated by the teacher that within the old waterfall lifecycle approach, when the project was nearing the production release date, testing was the portion of the project that got squeezed out due to a looming deadline. The discussion then moved to the fact that within the phases of RUP, iterative style development insures that testing for that particular iteration is done and not affected by timeline pressures.

When the instructor stated that, I quickly considered past situations within development iterations where testing time still got "squeezed" because of the various pressures to move to the next iteration. Because I know the value of the Test Driven Development (TDD) methodology I thought, what if, within the RUP phase iterations, TDD was utilized?

First, the TDD methodology could ensure that the developer tests are passing and that code coverage is almost complete. In addition, TDD would make certain that the code is refactored and ready for the next development iteration. TDD could also provide a living artifact to demonstrate to the stakeholders of the project that the entire bank of developer tests is passing. (You TDDers know the warm, fuzzy feeling you get when you see the green bar of tools like JUnit or NUnit.) Finally, the tests provide a quick and automated regression testing mechanism when any changes are made to code base in future iterations.

Thursday, June 16, 2005

The Rational Unified Process and Test Driven Development

Since I have spent most of this week in RUP training, presented by the Ivar Jacobson International company, I was reading a blog from Mike Bosch concerning the Rational Unified Process (RUP) and Extreme Proramming (XP).

I agree with Mike concerning "Unless you have a LOT of authority you will find it very exhausting to try and influence a culture change without buy-in from your management." I work at a large financial institution which whole heartedly supports RUP. In addition to having one of the "three amigos" own consulting company contracted to provide detailed courses on the four phases of RUP and their various disciplines, Dr. Jacobson has often provided great lectures to the application development teams that are broadcast to the various corporate team locations within the United States. In my view that is great. However any corresponding and/or competing methodology is typically viewed with skepticism and then ignored.

I have found that within the corporate environment I have been able to introduce Test Driven Development as a programming methodology that our dev team can use internally. In fact I am finding that it is a relatively easy sale because TDD is so effective concerning both the quality of code and efficiency of the team production! Moreover, the artifact of the tests is a great source of "developer oriented documentation" for new team members that are already familiar with developer testing tools such as JUnit or NUnit.

All in all, RUP is a tried and tested methodology for an organization as large as the one that I am currently employed. Yet, it is greatly enhanced by agile processes.

Monday, June 13, 2005

My First C# DotNetNuke Module

Click here to see the ramblings of my first C# DotNetNuke custom module. In the normal tradition, its a Hello World module. What else could it be, right?

Initial DotNetNuke "gotchas" with Windows XP Pro

After reading for sometime the great reviews of the opensource portal, DotNetNuke, I decided to download it and give it a spin. Wonderful framework but a few "gotchas" when installing on a Windows XP Pro OS workstation.

Click here to find out more.

Sunday, May 08, 2005

PDF to byte array with TDD

At work, I was tasked with reviewing and prototyping a Windows Service that will monitor a file directory, and invoke a web service that utilizes FileNet to archive reports that will be FTPed to the directory in question.

From the sample API of the web service, the first task was to get the report, that is in a PDF format, to a byte array that will be passed to the web method.

Click here to see the how Test Driven Development (TDD) made this task much easier and quicker to complete.

Monday, April 18, 2005

What to do with complexity

I was pursuing the Creating Passionate Users blog and noted a link to a new, interesting product that the Head First folks are coming out with called Head First Design Meditations. This looks to be a deck of cards that is, Designed to be used as a brainstorming and inspiration tool, the card deck will contain small bits of software design wisdom, insights, idioms, inspiring quotes and perhaps even a chuckle or two.

What I quickly noted on the page was the following quote by Alan J. Perlis: Fools ignore complexity. Pragmatists suffer it. Some can avoid it. Geniuses remove it.

Wow! I must admit that when I have encountered complexity, in both code and in life in general, I have ignored it, suffered it, and avoided it. Rarely, if ever, have I removed it. What comes immediately to my mind concerning the removing of complexity is Refactoring. This I try to do regularly with code. What is Refactoring? According to the Wikipedia Refactoring is the process of rewriting written material to improve its readability or structure, with the explicit purpose of keeping its meaning or behavior. Wikipedia defines readability as, Readability is a measure of the comprehensibility or understandability of written text.

The main reason I refactor is indeed pragmatic. I find that further updates to the code is easier to do if the current code is as clear in its intent and as simplistic in its structure as possible.

Perhaps those who really are geniuses remove complexity out of altruistic reasons, for myself as a mere mortal, I remove it so I can better understand how and why.

For more quotes by Alan J. Perlis, click here.

Saturday, April 09, 2005

XHTML and CSS: a union made in....

Because I sit all day hammering out code, I have to make a real effort to get enough exercise. What I often like to do is download and listen to a great weekly podcast, that is offered in both MP3 and WMA format, that is a recording of a show called .Net Rocks while I am taking my daily jog. This week’s show featured Rory Blyth and Scott Hanselman who discussed at length a great site, csszengarden.com that demonstrates the use of XHTML and CSS for website design. To date, I have used CSS primarily for font formatting, but not much else. However, a combination of both the show and the csszengarden web site have caused me to take another look at CSS (Cascading Style Sheets) and a new look at XHTML (Extensible HyperText Markup Language).

Check out my latest learning spike about using XHTML and CSS to form a great web design toolset.

Monday, April 04, 2005

NMock 101

Recently a new member of the development team questioned me on how various dependent objects, that are part of an implementation of an app we are building, could be tested using NUnit and NUnitASP, a set of unit testing tools. I stated that the simplest way I understand would be to "mock" the objects that the view (or the UI) and controller tiers under test are dependent upon. The tool that I am most familiar with is NMock. Since it had been a while since I had utilized NMock for testing purposes, I thought it would be good to review the documentation for the tool.

Click here to see the step-by-step process I used to create a demo of NMock using a TDD methodology with NUnit.

CopySourceAsHtml

Loaded the great addin for VS.Net 2003, CopySourceAsHtml , version 1.2.3, last night. However, when I went to select some code to Copy As HTML I would get an interop exception. Unfortunately, I did not copy the exception message in the dialog box that was displayed.

Anyway, the solution was to take the source code and do a local build, creating the install file and installing from that .msi file. Then all worked swimmingly.

Saturday, April 02, 2005

Thursday, March 24, 2005

Head First Design Patterns in C# with NUnit

I recently read a great new software design patterns book entitled, Head First Design Patterns. Click here to go to the books web site.

Anyway, the book shows the code and exercises in Java. To better learn the patterns I implemented the code in C#. About halfway through the book I e-mailed the authors and let them know how much I enjoyed the teaching style of the book and informed them about the C# exercise code that I was creating. They were interested and asked me to post it to them when completed. I did and they, I say they as the book has four authors and I have been corresponding with one, suggested that I create a small web page to link too, that briefly shares my learning experience with a link to the C# code. I did and the author graciously stated that they will be linking to my page from their page (see link above) shortly. Meanwhile, click here to get to my page with the brief overview and code.