Tuesday, December 22, 2009

Embedding date and time into a file in windows - "But it worked last night"

I'm patching a tiny project at work with duct tape until we can get an enterprise solution. A small batch job runs on the windows scheduler doing something like this:

MyCommand.exe  --output=Saturday1201amUS_%date:~10,4%-%date:~4,2%-%date:~7,2%-%time:~0,2%-%time:~3,2%-%time:~6,5%.txt


I ran it yesterday afternoon and it worked great. It created a file named
Saturday1201amUS_2009-12-21-15-46-00.21.log. This morning I did another test with my client and it failed miserably after creating a file named 'Saturday1201amUS_2009-12-22-'. A little investigation turned up that windows does not prepend a zero in front of the hours before noon so my executable file was getting a space in front of 9 oclock:

MyCommand.exe  --output=Saturday1201amUS_Saturday1201amUS_2009-12-22- 9-47-20.31.log

It worked great after putting quotes around the file name.
MyCommand.exe  --output="Saturday1201amUS_%date:~10,4%-%date:~4,2%-%date:~7,2%-%time:~0,2%-%time:~3,2%-%time:~6,5%.txt"

Monday, December 21, 2009

One Stock Trading Company Claims Compute Power of Lawrence Livermore

Interesting article from Technology Review about the computing power of the high-speed stock traders:
The explosion in high-speed automated trading has engendered a massive buildup in technology; Renaissance Technologies, a hedge fund based in East Setauket, NY, boasts that its computing power is equal to that of the Lawrence Livermore National Laboratory.

Wednesday, December 02, 2009

NHibernate Intellisense for Visual Studio 2008

From the NHibernate distribution, I renamed nhibernate-mapping.xsd to nhibernate-mapping-2.2.xsd and nhibernate-configuration.xsd to nhibernate-configuration-2.2.xsd. Then I copied those two files to C:\Program Files\Microsoft Visual Studio 9.0\Xml\Schemas and immediately intellisense started working for me in Visual Studio 2008.

Tuesday, November 24, 2009

Bitter Refactoring


Kimberley Bitter
Originally uploaded by kamoda
After reading Martin Fowler's book on Refactoring I've been a big fan of the practice. We all know that adding in tests to insure the refactoring doesn't change the results is essential.
But this last week the real world crept into our world of programming paradigms. We refactored a complicated section of code to make it simpler, more readable, and faster - a big win; except that after the code was fielding, one of our customers reported a problem.
Their use of our product actually depended on a bug in the old version. Refactoring the code fixed the bug and caused our customers grief.
I'm still a big fan of refactoring and continue to do it, but now I'm a little wiser that refactoring carries more risk than I'd thought before.

Friday, November 13, 2009

Simian - a code duplication finder


Today I downloaded simian, a code duplication detector. It's very easy to download and run. Simian detected a few chunks of duplicated code, which need to be refactored into a single method, or pushed up into a parent object. Simian is worth a quick download to test your code. Eval copy is available for free.

C:\opt\simian\bin\simian-2.2.24.exe -reportDuplicateText -threshold=5 *.cs > simian.txt

Wednesday, November 04, 2009

Agile Austin - Domain Driven Design and the Naked Objects Pattern


Last night at Agile Austin Eitan Suez explored the relationship of Domain Driven Design and the Naked Objects Architectural pattern to a packed house of 60 people.
The thing that struck me the most was how using the Naked Objects concept of having the objects themselves create the GUI forces a Ubiquitous Language on the developer since the user will see the object and method names on the screen.
Eitan gave a great example by having the jMatter framework autogenerates a permissions table with objects and their actions on the vertical axis and the types of users on the horizontal axis by reflecting the code and dynamically discovering the objects, their methods, and the types of users.

Thursday, October 29, 2009

When Will We Have Enough Computing Power?


DNA rendering
Originally uploaded by ynse
At the last Java User's Group meeting here in Austin, Gary Frost mentioned that if he took his $300 Gateway computer with its $300 graphics card back in time 6 years, his computer would be in the top ten fastest super computers in the world. Which got me thinking, "How fast do computers need to get?".
Well obviously a lot faster. I'll be happy when computers can do either of the following (I'm not picky):
1. Store every person's DNA and their medical history. That's 3 billion base pairs per person times almost 7 billion people gives 2.1 × 10^19 base pairs or about a Zettabyte. Then compare and contrast every person's DNA with their illnesses with everyone else and produce a report showing which diseases are related to which DNA differences. For example, asthma could be related to any of 307 combinations of 24 genes being different. Then we should be able to design drugs to compensate for the "defective" genes, or perhaps tweak those genes with a small bit of DNA from a friendly virus.
Storing a Zettabyte seems reasonably straightforward, diff'ing all the genes will take enormous computing power- but that's the power we need.
2. Predict the future health issues of a fertilized human egg based on its DNA. We would need the power to replicate division of all the cells grow the egg into an adult and simulate the running of the biology in each cell and predict the health issues.

Tuesday, October 27, 2009

Austin Java Users Group


Random Notes from the meeting (entered via my shiny new IPhone):
Big Mike is starting a Certification group.
Gary Frost from Amd talked about OpenCL, the Open Computing Language. This provides binding to Java via C for running parallel operations on Graphics Processing Units. Gary's demo showed the n-body problem being accelerated by using the GPU to do calculations, while the GPU was also updating the screen.
The demo was very impressive, but the OpenCL seemed a bit clunky. I think the masses of programmers will need a much smarter compiler to inspect the java code and imply what the GPU can do in paralle.

The second part of the meeting Deb Ayers talked about Oracle's Enterprise Service Bus (ESB). She said ESB is a natural progression from client Server. Many of her clients don't use soap, just Plain Old XML (POX) over http.
For a dozen services you don't need an ESB, but some Telcos have hundreds of services and need an ESB.

Monday, October 26, 2009

Xeno's Paradox and Software Delivery


Achilles
Originally uploaded by Jennifurr-Jinx
The ancient Greek philosopher Zeno of Elea composed a paradox to support his teacher, Parmenides's view of motion and change in the universe. His story is about a race between Achilles and a turtle. The turtle gets a small head start, but before Achilles can overtake the turtle, he must catchup with the turtle. Once Achilles has caught up, the turtle has moved forward, so Achilles must move a little further to where the turtle is now. But by now the turtle is ahead and Achilles must again catchup etc... so Achilles never really reaches the turtle.

I've noticed this same phenomenon in software development with regard to last minute features being requested to be thrown into the release. With three days to go before release, we get a small 4-hour feature request to be added. Then two days before the release another smaller item - really tiny, wouldn't take much effort at all - just two hours. One day to go, and another almost infinitesimally small item to be added - it will just delay the release by one hour and it's really needed.
In Zeno's world, the software will never get released.

Wednesday, October 07, 2009

Messa_e to L_ke Sky__lker


Messa_e to L_ke Sky__lker
Originally uploaded by Stéfan
OK, I couldn't resist one more.

Dough you mind?


Dough you mind?
Originally uploaded by Stéfan
I just ran into this photo set of miniature storm troppers and thought they were the funniest thing since Chad Vader sang 'Chocolate Rain'.

Tuesday, October 06, 2009

Excel: sumif - using a SQL where clause in Excel

While doing testing today I needed to add all the values in column F by "Male" and "Female". I learned the amazing "sumif" function.
The syntax is


SumIf( range to filter by, criteria to filter, sum_range to be filtered)


excel
In my case the first argument was a range in column B, my filter was "Male", and the range to actual sum was in column F.

=SUMIF($B$2:$B$641,"Male",F$2:F$461)


excel
Since I was summing based on multiple items like "Male", I told Excel to use the column to the left to be my filter value.

=SUMIF($B$2:$B$641,$E649,F$2:F$461)


The criteria can be things like ">10".

Tuesday, September 22, 2009

Last Night's Lean Software Group Meeting

Not knowing a "Value Stream Mapping" from an old tire (don't think too much about the analogy), I drove down to last night's Lean Software Group meeting at the Overwatch offices to join 27 other people and to try an tease some meaning out of all this Lean hype.
Scott Bellware gave a welcome message.
Andrew Cahoon gave an introduction of VSM and then Gary ? gave a compelling real world example of a Value Stream Mapping.
pic
My notes:
* Value Stream Mapping is more an analysis and planning tool than a prescriptive activity.
* Don't make a perfect model, it's not worth the effort - just get a good enough model to do your work.
* Customers care about Quality, Cost, and Delivery.
* Kaizen is about continuous improvement and Value Stream Mapping is a tool to get to the next level.
pic
pic

Monday, September 14, 2009

William Wallace, Stirling Bridge, and the Long Shadow of Rome

William "BraveHeart" Wallace fought for Scottish Independence at Stirling Bridge. Interestingly, the bridge, which has since been replaced, was originally built by the Romans. Let's see, the fall of Rome is around 410AD, Battle of Stirling bridge was in 1297,..., the Roman bridge had been used for 887 years. Not too bad - the Romans knew how to build things.
Will any of our structures be around for 900 years?

Friday, September 04, 2009

New Variegated Species of Cactus Discovered in Austin TX

cactus
While taking a walk outside our office building Frank and I discovered a new variegated species of cactus. Says I, "Frank, it just shows how rare mutations can give advantages to plants. Since this cactus will not be uprooted by the grounds people since it blends in so well, its genes will be passed on to the next generation. Soon all the cacti in the parking lot will be variegated."

Saturday, August 29, 2009

How to select the program to "launch for this action" for cameras in windows xp

In the past I've always copied pictures from my cannon S5 IS, by opening up Windows Explorer, navigating to the camera, copying the pics to my editing directory after opening it in explorer, then deleting the pictures from the camera. Today I just got sick of all the mindless clicking.
An automated way to do all that exists with just a few clicks in windows xp. Plug in your camera, select "start/Settings/" then left click on "Control Panel" and select "Explore". Click on "Scanners and Cameras".
A window like this pops up.
graphic
Right-click on your camera and select "Properties", then the "Events" tab.
graphic
Select the directory to copy the pictures and check "Delete Pictures From Camera after saving them" and you are good to go.

Tuesday, August 04, 2009

A Dream for the Kindle in Education




We have all heard about textbooks being converted to be shown on the Kindle or other devices. They would have many benefits.
Students will not longer have to carry sagging backpacks of textbooks (and thereby enriching future generations of chiropractors).
Textbooks could be bought for only a year. I've heard teachers say, "The textbooks we use are really bad, the textbook committee made a bad recommendation, the district bought them, and we are stuck with the books until they wear out."
In electronic form, the textbooks can be swapped out yearly.

But the real opportunity with digital textbooks is something deeper - a chance to make textbooks better, really better.
eTextbooks have the advantage that different versions of the same chapter could be written and then tested objectively with test scores. A revised chapter detailing how to do factoring of polynomials could be written and then pushed to selected classroom's eTextbooks and tested. If it proves more effective than the previous version, the new one would make it into all the eTextbooks. Repeat the process over the nation and slowly a textbook could evolve into more effective way to transfer knowledge.
I know, I know, it's a pipe dream that in public education we would actually have scientific comparisons of teaching materials and methods, but won't you dream with me for a moment?

Wednesday, July 29, 2009

Austin Java User Group Meeting July 28, 2009


Since my daughter has been playing volleyball on Tuesday nights, I've missed the JUG this summer so it was fun to get to go back and see my friends at the JUG.
As is sometimes the case, the most important things happen outside the regular meeting talks. Rob asked how many people were looking for jobs and about half of the 36 people attending raised their hands. Usually it's only a handful of people looking for work.
Steve Romohr gave a good overview of several talks at the recent NFJS conference. Kevin Graham talked about SCALA and Clojure.
During his talk, Cheng mentioned the space station, shuttle, and Russian supply ship were doing to pass overhead at 9:15, so we all went outside and watched the amazing spectacle. Below is a picture of the shuttle speeding its way across the sky.
(If you look carefully you can see the slight damage to one of the tiles on the left side about 2/3 of the way down in the middle).


Thanks to Rob for organizing the meeting!

Wednesday, July 15, 2009

Excel: Counting The Occurance Of Values in a Range

Today I had an interesting Excel challenge. I needed to know for a column of numbers how many fall into a particular range. For example, how many numbers in column A are between 0.1 and 0.2? This is the formula I used from info at contextures.com:

=COUNTIF($A2:$A642,">" & L1) - COUNTIF($A2:$A642,">" & L2)

Where A2:A642 is my range of numbers and L1 is the lower bound of the range and L2 is the upper range.

Wednesday, July 01, 2009

Launchy - The Path to a Clean Desktop in Windows XP

My new best friend is Launchy, a program launcher. After installing, you type "Alt-Spacebar" and Launchy pops up.
Launchy
You start typing the first letters of the app you want to start and it starts guessing which binaries in its path you want to start. Launchy learns quickly what you usually want. With Launchy you don't need all those icons on your desktop to launch programs. You can add directories to search and all the options you'd expect.
I've been able to clean my entire desktop of all those cluttering icons and reduce it down to just two icons, "My Computer" and "Recycle Bin".
Ahh.... the zen-like experience of having a clean desktop:
Launchy
(Ok, it doesn't take much to make me happy.)

Tuesday, June 30, 2009

Using Ruby Gems Behind Windows Proxy

I've been trying to get ruby gems installing on a Windows XP from behind our company proxy and finally got it to work using the HTTP_PROXY environment variable. (Why does configuration seem more like alchemy than science?) Although I usually have to supply a domain name, for some reason it was OK without it. YMMV.


SET HTTP_PROXY=http://myusername:mypassword@proxyname:80
gem install amazon-ecs
Successfully installed amazon-ecs-0.5.4
1 gem installed
Installing ri documentation for amazon-ecs-0.5.4...
Installing RDoc documentation for amazon-ecs-0.5.4...

Friday, June 26, 2009

Firefox Environment Backup Extension

My new favorite Firefox extension is "Firefox Environment Backup Extension" or FEBE. My work machine, still a desktop, is my most finely tuned box. My home machine is always lagging behind in Firefox (and Emacs) updates. I have often wished for something like FEBE and now its here. FEBE allows you to export all your Firefox extensions and settings and import them into another computer. A nice addition to the thousands of Firefox extensions.
I'm sure Internet Explorer 8 has something similar since the latest Microsoft sponsored browser "Get The Facts" report gives IE8 and Firefox both a check for customizability. (Can somebody tell me why the delicious tags on Microsoft's "Get The Facts For Browsers" page are "funny" and "humor"?)

Wednesday, June 24, 2009

Keep Swimming or You Die

shark
Some shark species must keep swimming to create a flow of water through its gills, or they will suffocate. Our aquatic friends of the deep can teach us something about software development.
Last night I stuck up a conversation with someone at my daughter's athletic event. Come to find out, he was an underemployed software developer. He was ruing the fact that for eight years he kept his head down and simply created java applications for his employer. He didn't investigate developing apps for this wacky internet web-thingy which is quite popular with the younger crowd. When he was laid-off, he found his excellent java application skills not much in demand in a sparse job market. Admirably he is going back to school and getting the skills needed for today's web-connected world.
The lesson from the fishies: Keep learning or your career will die.

Saturday, June 20, 2009

Roxio Creator 2009 not starting

I am rebuilding my home windows xp system after a disk crash. While reinstalling Roxio Creator 2009 I encountered an interesting problem. Roxio would not start. I looked in the event viewer ("Start/Programs/Administrator Tools/Event Viewer") and found the following error message:

EventType clr20r3, P1 roxiocentralfx.exe, P2 4.12.0.0, P3 48a05348, P4 roxiocentralfx,
P5 0.0.0.0, P6 48a05348, P7 17e, P8 12, P9 system.dllnotfoundexception, P10 NIL.

(The event log messages are really more like a Greek Oracles, something you only really understand, at your peril, afterwards).

I tried to install .Net 3.5 because another error hinted that a .Net library was missing. During the .Net 3.5 install I got the following less helpful error which did not have an event clue.


error

So I was stuck. Roxio won't start because of a missing .Net library and I can't install .Net because of a "Setup Error".

Realizing that Roxio Creator 2009 is only a shell over all these other programs, I tried to launch a sub-program, "Creator Classic", directly (Start/Programs/Roxio Creator 2009/Applications/Creator Classic". It did run and immediately asked to download patches from the mother ship. After those patches were installed I tried lauching the main Roxio Creator again - and it worked.
No rhyme or reason or understanding here, just trying random things, but that's what often works with Windows.

Friday, June 12, 2009

How to Slim Down a Word Document

For some bizarre reason, one of our important Word documents ballooned from 600K to 80 Megabytes. The document would compress nicely to an 8Meg zip file, but was taking up way too much space. I opened the document, selected all with Ctl-a, and pasted it into a new document. The new document was back to 600K. Go figure.

The Toyota Way

bookI just finished listening to "The Toyota Way" while commuting in my Camry as a way to get an introduction to Lean Software Methodology. A few things that struck me in the book (in no particular order):
  1. Counter Intuitive. Many of the ideas just don't sound right like stopping production if a problem is spotted on the line, or not using machines to their capacity. Although the ideas sound crazy at times, you can't argue with the success of Toyota.
  2. Set Based Solutions. Don't just create one solution to a problem, create several solutions and discuss the merits of each with many people. Implement swiftly.
  3. Continuous Improvement - "Kaizen". The production process should always be improving. People need to be committed to adapting to change and initiating change.
  4. Commitment to Training. Employees should be trained well. I was amazed at the amount of training that Toyota offers its people.
  5. Flow. Don't just optimize parts of the process - optimize the total system.
  6. Fix the Process, "Pokayoke". When something does not perform as expected, don't just fix it, find out why it failed. Pokayoke means to find the root problem and take action so the problem does not occur again.
  7. Easy to Copy Badly. The Toyota Production System is easy to copy badly with disastrous results. The example given was the magic chord that any employee can pull to stop the entire line when she discovers a defect in the process. Some plants tried to copy this method, but found it not to work well. In the Toyota plants pulling the chord doesn't immediately stop the line, but gives the team leaders some time to resolve the situation before stopping the complete line.
  8. Focus on "Standard Work". Each step of production has written steps on how to do the work. The employees should be doing the process exactly as written. When defects in the line occur, the line managers focus on how the defect occured. Was the standard work followed? If not, why not? If it was followed, the standard work needs to be changed. Standard Work is the first step to continuous improvement. You cannot effectively improve an ad hoc process.
  9. Eliminate Waste, "Muda". "anything other than the minimum amount of equipment, materials, parts, and workers (working time) which are absolutely essential to production" is waste. Seven classes of waste: overproduction, delay, transportation, processing, inventory, wasted motion, and defective parts. In software development I see a lot of inventory - written and tested software which has not been released because it's hard to install mission critical software.
  10. Visual Displays, "Andon". It's important for everyone to see progress, so Toyota emphasizes big signs where everyone can see problems and production.
  11. Hands-On Approach, Genchi Gengustu "Go see the problem". Management must visit the factory floor and see for themselves the problems.

Thursday, June 11, 2009

Using HTTPS in the Microsoft World

Using https on the server is fairly easy for internal testing in the Microsoft world. Since this is a self-signed certificate the users will get a warning that the certificate is untrusted. Using a self-signed certificate is not appropriate for sites used by the general public, but is good enough for internal sites and testing.

Here's some tips on how to do it:

*How to create a self-signed certificate. Change "mydomain.com" below, but everything else is OK.
makecert -r -pe -n "CN=mydomain.com" -b 01/01/2000 -e 01/01/2036 -eku 1.3.6.1.5.5.7.3.1 -ss my -sr localMachine -sky exchange -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12


*How to install the newly created certificate
Open "Internet Information Services", right click on "Default Web Site", select the "Directory Security" tab, select the "Server Certificate..." button.

*How to apply it to a virtual directory
Open IIS, right-click on the virtual directory, select the "Directory Security" tab. Under "Secure communications", select "Edit..." then check "Require secure channel (SSL)".

Saturday, May 30, 2009

Unit Test Presentation

[This is the outline of a presentation I gave recently at our company on unit testing. Permanent link is here.]

What is Unit Testing?


Take the smallest reasonable piece of code, isolate it from the rest of the application, and programatically query it to ensure the results are what is expected.


  1. Bad Things about Unit Testing:
    1. Unit Tests are expensive to write and very expensive to maintain.
    2. You can test too much.


      Bell Curve


      (Vertical axis is return on investment)
    3. You can test the wrong things.
    4. You can easily develop a false sense of security when all your unit tests pass.
    5. Having 100% code coverage doesn't mean your application is error-free.


      graphics.
    6. When all your unit tests pass, it doesn't mean your application is error-free.


      graphics.
    7. When all your unit tests pass, it doesn't mean your application is error-free. [sic]

  2. Why Do Unit Testing?

    1. Encourages better software design - less coupling, smaller, simpler methods

      Instead of tightly interlocked code like this:




      Tangled Web


      Unit testing encourages code more like this, easy little blocks that can be replaced easily:


      Tangled Web

    2. Allows you to make deep changes in the software later with confidence
    3. Produces better quality software
    4. Gives you a framework for performance testing
    5. Finds errors in single components early, instead of finding multiple errors in multiple components which is exponentially more difficult.
    6. Easier to catch threading issues in unit tests
    7. The tests themselves are documentation
    8. It's more fun - really.


  3. The Process of Unit Testing

    1. Write the test before creating any logic in your target method
    2. The first run of the test should prove it fails

      Red Test
    3. Write the simplest code in the target method to pass the test

      Green Test
    4. Refactor as needed.
    5. Repeat
    6. Red, Green, Refactor


  4. Notes Unit Testing

    1. Don't confuse Unit Tests with integration tests or system tests.
    2. Unit tests should be independent of each other.
    3. Unit tests should not typically hit external entities like a database. The test should use a mock instead. This requires external object access to be done through an interface, not a concrete class. This improves your design.
    4. Unit tests do not obviate the need for human testing of the system
    5. Unit tests allow you to throw exceptions easily in code. It's hard to simulate some network faults, but with a mock object it's easy.
    6. Many Unit test frameworks are available. We use NUnit.
    7. Unit Testing is critical to Agile software development.
    8. Where to put unit tests? In the object itself? In same assemble? In other assemble?
    9. Unit tests should be fast, less than a minute. To make them faster, move integration tests to separate suite, don't talk to the database, skip some on your local test box my using categories, and only run those on the build server, e.g., CruiseControl.Net.
    10. Each unit test should create it's own data, and delete it when it's finished. Integration tests should start with a clean database, add needed schema and data, then end with a clean database.
    11. When you find a bug, write a test that exposes that bug, and make sure it fails. Fix the bug, then run the test.


  5. Interesting Attributes in NUnit:

    1. [TestFixture]
    2. [Test]
    3. [ExpectedException]
    4. [Ignore]
    5. [Explicit]


  6. Our Dojo exercise:

    Build a case-insensitive ordered string set class. We will implement, Add(string), Count(), Contains(string), Remove(string), and GetEnumerator()



    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Reflection;
    using System.Text;
    using NUnit.Framework;

    namespace Utilities {
    // Case Insensitive Ordered String Set class
    public class CiosSet {
    public CiosSet()
    {
    }

    public void Add(string mystring)
    {

    }

    public int Count()
    {
    return 0;
    }
    }
    [TestFixture]
    public class CiosSetTest
    {
    [Test]
    public void Should_add_a_string_and_get_count_of_one() {
    Console.WriteLine(MethodBase.GetCurrentMethod());
    //Arrange
    var set = new CiosSet();
    //Act
    set.Add("abc");
    //Assert
    Assert.IsTrue(set.Count() == 1);
    }
    }

    }

Thursday, May 28, 2009

Lifehack: Water Alarms

Every home should have water alarms where water is used. They are very cheap. I changed the batteries in ours today. We have benefited from them once, when water came pouring out of our washer machine connections. We heard the alarm go off and it saved us from a lot of water damage. You can get them from Amazon.

Saturday, May 23, 2009

How to Uninstall TurboTax 2008 When Not Appearing in Add/Remove Programs

Helped my Dad tonight to repair his installation of TurboTax 2008. TurboTax couldn't update since it was missing "intuit.spc.esd.winclient.application.update" dll. We couldn't uninstall TurboTax because it was not listed in Add/Remove programs. Finally put the CD in the E drive and entered the manual flush mode to reinstall:

"E:\setup.exe" /f

worked like a champ after that.

Monday, April 27, 2009

Chatting with friends is so passe. Let's talk to strangers!

I was tickled to see the new site omegle.com that let's you chat with strangers. What a concept. Omegle was started by an 18-year old high school student from Vermont. That's the great thing about the web these days - anybody can be a player. Although my first use was not all that intriguing:

Connecting to server...
You're now chatting with a random stranger. Say hi!
Stranger: hi
You: hi
Stranger: asl?
You: i don't know what that means.
Stranger: age
Stranger: sexe
Stranger: language
You: oh
You: 50/male/english
You: u?
Your conversational partner has disconnected.

Thursday, April 23, 2009

Using Viruses to Treat Bacterial Infections


New Scientist has a great article on an old technique of using viruses to treat bacterial infections. Instead of using a broad-spectrum antibiotic that indiscriminately kills good and bad bacteria, infections can be treated with a bacteriophage that only attacks a specific species of bacteria.

Monday, April 20, 2009

AgileATX April Meeting - Scott Bellware on "5 Things I Learned from Lean "


Before Scott's presentation to the 100 people assembled for AgileATX started, I talked with a recruiter (it's a good sign for recruiters to be at an Agile group) who said two interesting things:
1. Demand for Java and .Net programmers is about equal, but java has been growing because the proportion of government jobs is increasing and our government is often open source friendly.
2. Many large corporations are looking for developers with an Agile edge.

I always enjoy hearing Scott "Force of Nature" Bellware talk. He's original and not afraid to challenge current software dogma. This week Scrum was skewered. The point of his that struck me most has to do with Scrum teams being democratic. "Don't trap your best people into a democracy where good people are outvoted." You need a disciplinary to drive the process.


book


On another point, in reference to the lean principle of a continuous learning community he said, "A learning organization cannot happen when people feel entitled not to learn."

Wednesday, April 15, 2009

Keeping Software Developers in the Flow By Combing Meetings

Click to read reviews or buy Peopleware
In their book Peopleware, Demarco and Lister talk about the importance of giving developers large blocks of time to get let them get "in the flow" and wrap their heads around a problem. Continual distractions like meetings, phone calls, and reading emails break the train of thought and it may take tens of minutes to get concentration back on the deep technical issues. Today I took action on their concept.
On my team we have a weekly book discussion time, where each of us gives a summary of their current technical book. (Our current books are jQuery in Action, Code Complete, Hibernate in Action, and Domain Driven Design Quickly). We meet on Wednesday at 2:30pm, but this breaks the concentration of my developers - we have to stop our work, check which conference room it's in, so we are combining our book discussion time with our weekly team meeting to remove one interruption of our time. I'll post later how this works.

Tuesday, March 31, 2009

15 Helpful Tips from Scott Bellware's Behavior Driven Class

On March 24th, last Tuesday, I attended Scott Bellware's helpful seminar on "Test-Driven Development and Behavior-Driven Development". A few of my take-aways:

  1. One bug takes a unit of time to fix, but with multiple bugs the time goes up exponentially since the bugs can interact. Moral: Code in steps and only introduce one bug at a time.
  2. Ask if the test you are about to write is a valuable test.
  3. Code-DB impendence mismatch example: If orders have links to customer in the db, in code the customer has links to the orders.
  4. Using "static" methods between layers is bad, it's like welding the objects together.
  5. Inheritance is strong coupling, to be used as a last resort.
  6. Scott and his team removed an entire layer of testing when they realized it provided less value than it took to maintain.
  7. Databases are places for dead objects, not logic.
  8. Someone at the meeting said Microsoft doesn't really do domain applications like we do, so they cannot really offer much advice on how to code.
  9. "Reuse" is not a good goal.
  10. You can overwrite tests, simple things are tested in more complicated tests.
  11. Don't use prepopulated databases with test data. Start with an empty database, and end with an empty database.
  12. When Scott asked the participants "Who does unit testing?" 80% of the 25 people raised their hands. "Who uses MSTest?", one hand.
  13. Regression tests are a side effect of Test Driven Development, not the primary goal.
  14. Doing traditional OO analysis (nouns, verbs,...) creates more objects than needed.
  15. Don't directly expose an object's collections; use helper functions on the object. (Use Customer.Add(obj) instead of do Customer.list.add(obj))

Monday, March 09, 2009

Sunlight turns carbon dioxide to methane

sunlight
Craig A. Grimes and friends at Penn State have produced 20 times the previous amounts of methane from sunlight and water with the aid of a catalyst of titanium dioxide nanotubes. This is important for many reasons:
1. The solar energy is storable as methane. The methane can be compressed into tanks and burned late at night when the sun does not shine.
2. Methane can be processed to produce liquid fuels for our cars so we don't need to import as much foreign oil.
3. To create energy this way just requires panels of the catalyst and water facing the sun. Unlike with many biomass energy crops which need arable land, water, warm temperatures, plowing, fertilizing, pesticides, and post-processing, this method is simple and direct.
4. The resulting fuel is carbon neutral.

The story is illustrative of how early on this science is. To get maximum yields they are trying different combinations of catalysts like copper and platinum. I look forward to the day when researchers don't have to randomly try different materials to achieve maximum efficiency, but that we will have a sufficiently advanced knowledge of materials we can calculate the exact proportions of elements to create methane from sunlight.

Our governments should be dumping money from helicopters on projects like this.

Friday, February 20, 2009

Yesterday's Model View Controller Training in Austin

MVC
Yesterday Eric Hexter and Jimmy Bogard from Headspring gave an excellent free four hour overview class on the ModelViewController framework from Microsoft(see previous post). The framework is currently available in preview form, but the 1.0 version is rumored to be out this month. The MVC framework is Microsoft's answer to Ruby on Rails. (Why did Microsoft call it the MVC framework, the same name as it's concept? I guess to be consistent with their bad naming of other technologies. I guess "C# on Rails" would have been too obvious. Why not name F# "The Functional Language"?)
Anyway, I'm very excited about the new framework.
MVC

Tuesday, February 17, 2009

NUnit + Extension Methods + NBehave.Spec.NUnit = Smile

I used a tiny bit of NBehave today and it made me smile. I used the extension methods in NBehave.Spec.NUnit so my NUnit tests can be a little more Englishy.
Instead of

Assert.IsTrue(sum.Equals(13));

I can write

sum.ShouldEqual(13);

which just gives me a warm, almost Rubyisque feeling, deep inside.

Wednesday, February 11, 2009

Windows is like that

Right before our last scheduled upgrade, one of the staging servers in the UK started acting badly. It was confused between the US date format, MM/DD/YYYY and the UK format, DD/MM/YYYY. All during testing on both sides of the Atlantic everything was fine. The server's identical twin in the farm had no such confusion. We double checked the windows regional settings, the config files, the C# code, and found no problems.
Out of desperation we restarted the web server, IIS. The sun broke through the clouds, birds were singing, and all was right with the world. The box was no longer confused about transatlantic dates. We did nothing but restart IIS. It was very scary.
After additional testing we did the upgrade and everything is fine. Which reminds me of a Haiku:

Yesterday it worked.
Today it is not working.
Windows is like that.

Monday, February 09, 2009

Austin .Net User's Group Meeting

2009/2009-02-09-DotNetUsersGroup.jpg
Matt Hinze presented a good introduction to "Practical Dependency Injection" to about 100 people at the Austin .Net Users group.
2009/2009-02-09-DotNetUsersGroupMattHinze.jpg
Two important announcements:
1. Headspring Systems will give a free class on the new Model View Controller on Thursday Feb 19th from 1-4:30.
2. Austin Code Camp is Saturday May 30th.
Lots of pizza consumed:
2009/2009-02-09-DotNetUsersGroupPizza.jpg

Wednesday, February 04, 2009

Great Video on Finding our Energy Future

I was very impressed with the enthusiasm of Bill Gross about energy and his careful research to design something for our future. Maybe he could start work on our 404 flying cars?

Thursday, January 29, 2009

Which Foreign Countries Own the US Debt?

pie chart of debt
After a dinner conversation, I was interested to know exactly which countries own the US foreign debt. I went the the treasury's website and created the above chart. China is now the largest [foreign] owner of US debt with 682 billion, followed closely by Japan with 577 and the United Kingdom good for 360 billion. Interesting that Japan owns almost as much as China, but we hear so little about Japan.
The total US Debt in November of 2008 was about 10.6 Trillion, so the foreign ownership is 28%. Is this a good thing?

Friday, January 23, 2009

Fun things to do with Google - Track UPS Packages

A little known feature of Google is that you can enter a tracking number for UPS packages and it will take you to the UPS site and show the package status. Google recognizes many forms of tracking numbers and tries to do the right thing.

Wednesday, January 21, 2009

Agile Boot Camp with Headspring Systems

picture

Last week I attended Headsprings' Agile Boot Camp class taught by Matt Hinze.
Before the class I'd hear "Blah, Blah, Blah, Dependency Injection, Blah, Blah, Blah, Program to Abstractions, Blah, Blah, Blah, RhinoMocks, Blah, Blah, Blah, StructureMap, Blah, Blah, Blah, Inversion of Control. I had a vague idea of the concepts, but not how they fit together.
picture

I struggled through the beginning of the course and then in the afternoon of the third day, the clouds parted, music swelled, and the pure sunshine of agile testing shone through and slapped my face.

I'll post another entry to give an overview of the concepts that struck me most. The labs were the perfect length, not too long as to be too time consuming, but technical enough to show the concept succinctly. I highly recommend the course if you are interested in bringing your skills to the next level.

picture