Monday, December 15, 2008

TimeWarner Tuning Adapter hits Austin Texas

Last Friday I got the call from Time Warner that the Tivo Tuning Adapters (TA) had finally arrived. After work, I rushed to the TW office to get mine. After waiting an hour or so, I took it home, hooked it up, and nothing happened.
Searching the forums, I learned that the tuning adapter's green light should be solid, mine was blinking - a sign that all was not well. After rebooting the TA and my TiVo in various combinations, I gave up and called tech support. After sending two ill-fated reset signals to the TA, the rep scheduled a truck roll in the morning.
Not content, I tried various reboot combinations. Maddeningly after a while the TA would get a solid green light, but my TiVo did not know that the TA was ready. So I'd reboot the TA, the TiVo would see the TA there, try to test channels and fail since the green light was still flashing. When the green light stopped flashing, the TiVo didn't know it was there.
This combination finally worked:
1. Reboot the Tuning Adapter. Wait for the green light to stop flashing. 10 minutes?
2. Reboot the TiVo. The Tivo does not know that the TA is ready. (This step may be optional).
3. Unplug the USB connector from the TA to the TiVo, wait a few seconds and plug back in. This sends a signal to the TiVo that the TA is ready.
4. TiVo can now test the TA signal.
Worked for me.

Wednesday, December 10, 2008

Major Version Upgrade with No User Downtime Using Virtuals Machines

shadow
This last week we upgraded our web-based software to a new major version without any downtime for our users. It was a great success. This only works if the databases backing the site are upwardly compatible. Here's the steps:
1. It all started last year when we hosted our application in a virtual machine (who doesn't these days anyway) even though our application was the only one running on the server.
2. On each of the production boxes we recently installed a parallel shadow virtual machine and loaded the new version of the software. We created test copies of the databases on our database server farm.
3. We created a shadow farm address (www.siteB.OurFarm.com instead of www.siteA.OurFarm.com) in our local router/load balancer and pointed the siteB domain to our shadow virtuals. Since all the nunit and functional tests were all done in our internal test farm, this round of testing was for configuration issues (can all the machines see all the databases? Can the farm machines see each other? Can outside users hit all the shadow boxes?).
4. We upgraded the databases on the live system by adding our new tables. The old system ran on the upgraded databases, but did not use all the tables. We incrementally pointed our shadow virtuals to the three live databases and tested them.
5. On the big transition day, we simply switched our domain address "SiteA" to point to our new shadow virtuals and all was golden.

PostScript: If any errors had occurred with the new version, we could back out by pointing "SiteA" back to the original servers (assuming no damage to the databases). We had made copies of the databases before had so we could switch back to them if something had corrupted the databases.

Tuesday, December 09, 2008

Austin .Net User's Group Meeting

Aaron Erickson talked about optimizing LINQ seach through customizing the "Where" clause with the Expression Tree feature of C#3.0. The talk on how i4o worked interesting, but as usual some of the more enlightening bits are revealed through side comments and questions. The audience agreed that LINQ-to-SQL is in it's death throes, to be replaced by, perhaps one day, the Entity Framework. For today, use NHibernate.
Out of sixty people, only two admitted to be VB programmers, everyone else was C#.

Wednesday, December 03, 2008

Let's Buy GM and Give It To the UAW

From our friend Michael Moore about the woes of the big three auto makers:
"Let me just state the obvious: Every single dollar Congress gives these three companies will be flushed right down the toilet."
I'd agree with Michael for once, but he recommends that the government buy all the outstanding shares of GM - currently at a bargain of $3 billion dollars and take over the company. Bad Idea. The government is really bad at running any business.
Instead of the $36 billion dollars bailout, let's spend $3 billion to buy the company and give it to the UAW. That way we don't have to hear the UAW whine about how all the problems of GM are the result of bad management. The UAW could show the world how it could build quality cars just like the Japanese.

Tuesday, November 25, 2008

Oceans Ten Times More Acidic Than Thought

http://www.morguefile.com/archive/?display=98154
National Geographic has a curious article entitled, Oceans Ten Times More Acidic Than Thought" that contains so many errors it's difficult to know where to begin. For starters, the title implies that the ocean is ten times more acidic that previously thought, like it slipped from 6.5 to 5.5pH, catching researchers off guard. In reality, it's the increase in acidity that is ten times higher than some climate model predicted. Perhaps a better title would have been, "Global Warming Model Incorrect By an Order of Magnitude".

The word "Oceans" in the title implies many of our oceans have increased acidity, but the article cleanly states the research applies to the ocean around one island (or perhaps "Oceans" in the title needs a possessive apostrophe).

A whale of a contradiction in the article is "...carbon dioxide dissolves in the oceans it forms carbonic acid, which in turn has a negative impact on marine life.", but later the article claims, "Larger mussels and barnacles suffered, leaving smaller barnacles and some calcium-based seaweeds better off."
Increased acidity doesn't have a negative impact on all marine life. Under almost any change in environment, some species will do better and other will flounder.

The article ends with a stinging quote: "This is typical of so many climate studies—almost without exception things are turning out to be worse than we originally thought." This clearly is a call to the readers to do something about the tsunami of impending climate change. Although it could be argued from the article that there's something fishy with these climate models which can't make accurate predictions.

The whole article should be taken with a grain of salt.

Friday, November 21, 2008

C# OutOfMemoryException and StringBuilder

We had an interesting OutOfMemoryException this week. When creating really long strings and adding them to a StringBuilder, we get the OutOfMemoryException way before we really run out of memory. Come to find out, StringBuilder is searching for contiguous memory and may not find that long before you run out of real memory.

To help find your upper limit of memory use, .Net provides the friendly MemoryFailPoint as shown below:


using System;
using System.Runtime;
using System.Text;
namespace PlayingAround {
class Memory {
private static void Main() {
MemoryFailPoint memFailPoint;
StringBuilder sb = new StringBuilder("1234567890");

for (int i = 0; i < 100; i++) {
Console.Out.WriteLine("");
try
{
int aboutToGetMemoryInBytes = sb.Length*5;
Console.Out.WriteLine("aboutToGetMemoryInBytes = " + aboutToGetMemoryInBytes.ToString("#,##0"));
int aboutToGetMemoryInMegaBytes = (int)(1 + (aboutToGetMemoryInBytes >> 20)); //round up to the next megabyte
Console.Out.WriteLine("aboutToGetMemoryInMegaBytes = " + aboutToGetMemoryInMegaBytes.ToString("#,##0"));
using (memFailPoint = new MemoryFailPoint(aboutToGetMemoryInMegaBytes)) {
Console.Out.WriteLine("GC.GetTotalMemory(true) = " + GC.GetTotalMemory(true).ToString("#,##0"));
Console.Out.WriteLine("sb.Length = " + sb.Length.ToString("#,##0"));
//Console.Out.WriteLine(System.Environment.WorkingSet.ToString());
sb.Append(sb.ToString());
}
}
catch (InsufficientMemoryException) {
Console.Out.WriteLine("InsufficientMemoryException.");
var maxMem = GC.GetTotalMemory(true);
Console.Out.WriteLine("maxMem = " + maxMem);
break;
} catch (OutOfMemoryException) {
Console.Out.WriteLine("OutOfMemoryException.");
break;
}
}
Console.Out.Write("press return to exit.");
Console.In.ReadLine();
}
}
}

Wednesday, November 12, 2008

DataTable.Compute considered harmful

Our team has been investigating a particularly obscure bug in our .Net 3.5 application. During load and performance testing we crashed the application on our Windows Server 2003 test farm. IE7 would not render the page, Firefox crashed the application pool. We got three basic errors:
1. application pool had been abandoned.
2. "aspnet_wp.exe (PID: 2536) stopped unexpectedly."
3. a stack overflow error.
Oddly the application ran fine on our Windows XP boxes used for development. After much searching and testing the problem was with
DataTable.Compute(string expression, string filter) 

We had a large filter string which exhausted the memory on the machine since the filter was used in a recursive manner. It did not help that the stack size in IIS for Server 2003 was reduced to 256K from 1MB in 2000. (In retrospect this was a good thing since it exposed an error earlier in testing and not later in production).
We will rewrite the code calling Compute() and do it iteratively in our C# code. Not all uses of Compute() are bad, but be careful about using large filters.

Monday, October 20, 2008

Syntax Highlighting via Javascript with SHJS




After doing my own code syntax highlighting for the web by injecting span tags into code snippets using lisp functions inside emacs, I realized it's not the way to go. The right way to do this would be a javascript function that would decorate the code after it's been sent to the browser. I ran across SHJS, Syntax Highlighting in JavaScript on sourceforge. SHJS is very easy to set up and gives great results in many languages.
I've attached two graphics, one using Watir in Ruby and the other a little C#.
If you publish code on the internet you should use SHJS or something like it. It's just too easy not to use and it leaves your HTML very clean.
You can see my results for Ruby, C#, Java, Perl, JavaScript.


Monday, October 13, 2008

TV shows now on Youtube




Youtube has just announced a major deal to start showing full-length TV shows like StarTrek with commercials. This puts Youtube in direct competition with Hulu, Joost, imdb, and a host of others showing tv shows over the web. Although Youtube's initial lineup is paltry, it shows a lot of promise.
The most exciting angle is the Tivo one. TiVo can access Youtube videos right now if the TiVo is connected to the internet. Since TiVo sits right next to my TV I don't have that PC-to-TV 10-yard gap. So, instead of taking up space on my TiVo, I can use Youtube's storage to host my old tv shows. But since I don't really watch old tv series, it doesn't mean a lot to me at the moment, but I can foresee in the not too distant future that first run shows are on Youtube which makes it interesting. It would help if TiVo could also access Hulu.com content.
What if all first run shows were available on Youtube?
1. I won't need a terabyte TiVo. In fact, I wouldn't need any disk space at all. Tivo will just get the shows on demand.
2. What is a TV network then? Independent producers could just make shows to go directly on Youtube without a network exec saying, "That will never work.". With production costs dropping, it's easier than ever to make your own tv shows and sell them on youtube.
3. Google, the owner of Youtube, would shake up the tv advertising market. Google would disintermediate a lot of advertising firms that specialize in buying/selling tv ad time. Companies could just bid for slots on tv shows just like they do for adwords. Also Google could target specific audiences on the fly with just-in-time advertising. Google can estimate your age (from your gmail account, past searches, etc) which would help, but they would be able to deduce your zip code, which tells a lot about you.
With a TiVo, Youtube tv on demand, and a fast internet connection, the world will be an interesting place. I can just envision Dr. McCoy leaning over the prone body of network tv, turning to Kirk and saying, "He's dead Jim.".

Friday, October 10, 2008

Time Warner Tuning Adapters now available for preorder in Austin TX!!


Oh happy day!
I've been waiting for 6 months for the Tuning Adapters from TimeWarner Austin so my Tivo can pick up all the Switched Digital Video (SDV) signals. Many of the high-def stations on TimeWarner are delivered via SDV which one-way cable cards, like the one in my TiVo, can't see. SDV channels are only sent to your home when requested, unlike regular channels which are always being broadcast to everyone. When a viewer requests an SDV channel the set-top box sends a message to a TimeWarner computer saying, "Send me History International", and the computer will say, "OK, I sending that to you on channel 3423". The set-top box then tunes to channel 3423, which just seconds ago was empty. In theory, this frees bandwidth for more channels.
You can now pre-order your free Tuning Adapter at http://www.timewarnercable.com/centraltx/Products/Cable/sdv/default.html.
It's a happy thing - trust me.

Wednesday, October 08, 2008

Agile Austin's Meeting Tuesday Night


book

The Agile Austin user group had sixty-seven people attend a great talk given by John Heinz of gistlabs.com entitled "Test Automation: The Big Picture". John started with a slide saying, "Testing is hard, coding is fun." which was a good start to talk about testing automation.
He reiterated some of the Toyota Production System mantras: Eliminate waste, only work on valuable products for your customer; optimize the whole, not the parts; build quality in, don't test for quality.

He also made it a point to say you shouldn't test everything, because testing is expensive. Testing does have a point of diminishing returns.
John recommended Implementing Lean Software Development by Mary Poppendieck and Tom Poppendieck.

John also recommended the Simian project to detect duplicate code.

Thursday, October 02, 2008

How to Protect Against Credit Card Fraud


1. If you're like me, you get zillions of unrequested offers for credit cards. I thought these just wasted my time (I've got to open them, sort generic parts from those with my name, and then shred the parts with my name). But they are a big credit fraud risk. If the applications are stolen from your mail box, or delivered to the wrong address (never happens right?), you could be in big trouble. The best thing to do is to stop all unsolicited offers of pre-approved credit cards.
You can call 1-888-567-8688 to stop the mailing of these. (Don't take my advice on the number. A less scrupulous blogger could give you a phone number to call and get your ssn). Check out the phone number here at a .gov site, www.ftc.gov



2. The other big thing to do is check you credit report at www.annualcreditreport.com. Only try this site. A lot of sites disguise themselves as this one and only real site to get you to buy a fraud detection service and other products. Here again don't just trust me for the web address look at a good .gov site for the address, http://www.ftc.gov. You can get a copy from each credit agency once a year. So every four months you can check to make sure no one has opened a new credit card account in your name. Be care at their sites, because they will try to upsell you on various products. Be firm, only get your credit report, not your credit score, or credit monitoring.

3. It's also good to stop junk mail at www.dmachoice.org website. This reduces the times your personal details travel around the universe of companies trading/selling your data.

4. While your at it, opt out of sales calls at www.donotcall.gov/

Eternal vigilance is the price of good credit. Perhaps Congress should take note?

Wednesday, September 24, 2008

The New Penny Doesn't Make Sense

coin costs
The US Mint unveiled some pretty spiffy looking prototypes for next years new one cents pieces celebrating the life of Abraham Lincoln.penny
The only problem with the new coins is that, being shiny and all, they will start to renew interest in pennies, and some people might collect a few of them. No harm there, really, except it costs you and I money.
To produce a penny last year cost 1.67 cents, so every penny saved in a drawer somewhere is costing the US government, (i.e., you and me), 0.67 cents.
Now the new quarters with pictures of different states adorning them was pure genius. Many people bought the little blue books and started collecting all fifty of them. This is great for our country since it only costs 9.78 cents to make a quarter, we make 15.22 cents on each quarter taken out of circulation. (It's kinda like a tiny savings bond each time someone throws a quarter into the back of a drawer).
Unfortunately, with the penny, encouraging collecting just doesn't make sense.

Tuesday, September 16, 2008

Plastics - the Lead Wine Bowls of our Times


In ancient Rome the citizens enjoyed hot, spiced wine mixed in lead bowls. During preparation, the hot acidic wine would leach the toxic lead from the bowl and into the drink. No one paid the practice a second thought. With so much lead in their bodies, it's no wonder some of the emperors went crazy (see Mad Hatter).
My hunch is that plastics are the lead wine bowls of our time. Reports like this and this are coming out regularly suggesting damage from bisphenol A (BPA), an ingredient in some plastics.
The most damaging evidence so far is that people with the highest BPA levels were three times more likely to have heart disease.
Perhaps our descents will look back centuries from now and wonder in amazement, "They used plastics for drinking hot liquids?"

Tuesday, September 09, 2008

LHC Rap

I loved this new rap video by some scientists at the Large Hadron Collider. Perhaps this is the future of all science textbooks?

Tuesday, September 02, 2008

The Beauty of Sarah Palin's Underrated Experience


book

I hear a lot of concern in the blogoshere about how Sarah Palin does not have the experience for being Vice President. Well, she has a little discussed experience which is critical for the job and being ignored by the mainstream media - she was runner-up in the Miss Alaska Beauty Pageant! For an entire year she was a heartbeat away from the top spot. She had to be ready for that 3am phone call that the official Miss Alaska was somehow been disgraced (read: internet photos) and could no longer fulfill the pageant duties. Sarah had to be on top of her game and be ready for the press conference the next morning. Sarah is ready for the same type of challenge.
I get tired of all this Sarah bashing. Leave Sarah Alone.

Wednesday, August 27, 2008

SqlServer Timeout Expired Exception

One of our users emailed and said he got the following exception with a reporting query:
System.Data.SqlClient.SqlException: Timeout expired.  
The timeout period elapsed prior to completion of the operation or the server is not responding.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)

The exception just started happening because the database has slowly been increasing to where the report query fails to finish in a timely manner. The timely manner is 30 seconds, the default for .Net database connections.

You can increase the default time of 30 seconds by using the "CommandTimeout" field on the "Command" object as shown below:

using (connection) {
SqlCommand sqlcommand = connection.CreateCommand();
sqlcommand.CommandTimeout = 60; //default is 30 seconds
sqlcommand.CommandText = sqlText;
...

Don't be misled by the database connection string option, "Connection Timeout", e.g., "Data Source=myMachine; Integrated Security=SSPI; database=Northwind;Connection Timeout=60". That timeout is for getting the connection, not for how long it queries the database.

Monday, August 25, 2008

Car Buying Tips


I just bought a new car this weekend and wanted to share some tips:
1. Go to Edmunds.com to price your dream vehicle.
2. Get a small notebook (a physical paper-thingy, oddly enough, they still make them) and keep all your notes in one place. Staple business cards into the notebook. I had scraps of paper everywhere and it was a mess.
3. When you first visit a dealership, ask for someone from the internet department - they can get you the best deals. Better yet, phone ahead and make an appointment.
4. When you've got your car model, trim number, and options set, use Edmunds.com to send an email to all the dealers near you asking for a quote on a car. Ask for the Vin# of the auto. I had a car swapped out from under a deal at a dealership. It was suppose to have a certain option for the price, but oddly enough didn't.
5. Ask for the car price and the final "drive-out" price.
6. After getting the best deal, email all the losers and ask if they can meet the price.
7. After getting the best price, take a copy of the email with you to the dealership, just in case, like in my situation, the dealership forgot the low price quoted.

Tuesday, August 19, 2008

Find Duplicates of Your Images on the Web with TinEye




I like a new startup named, TinEye. It searches its archives of the web for the original or altered versions of your photos. I asked it to track down one of my photos and it found five unauthorized copies floating around on various sites. (Not that it matters to me, any publicity is good, but I could at least ask for a link back).

Computer Generated Actors

The following clip is very impressive. Estimates are that digital actors could replace carbon-based ones in 2020. With the right software we could place ourselves or family members into future mainstream movies, not by photoshopping, but by swapping out the digital actor component in a "film". Software would play the film, but access your new character instead of the original component. How about swapping out the characters in "Aliens" with the cast of "Friends"? Weirder things will happen.

Thursday, August 14, 2008

Jeffrey Palermo at Austin .Net Users Group - TDD, DI, and SoC with ASP.NET MVC




This last Monday Jeffrey 'Party With' Palermo gave an excellent talk to the Austin .Net Users Group on Separation of Concerns. He gave a brief overview of Dependency Injection and Test Driven Development/Design while introducing Microsoft's ModelViewController framework, which is all about separating concerns so components can be better designed, freely replaced in the future, and tested.
Jeffrey said something that made sense about SoC and GUI testing: "Any decision can have bugs. Don't put decisions in the GUI which is hard to test. Views should only create HTML."
The first official release of MVC is guessed to be late October, 2008, although prereleases are coming out every six weeks or so.

Wednesday, August 13, 2008

PeopleWare by DeMarco and Lister


Click to read reviews or buy Peopleware

I've just finished reading Peopleware by DeMarco and Lister and have put it on my Recommended Reading list. Buy one and read it.

This is a great book, it's 20 years old, but still relevant. I thought the highlights were these:


  1. Projects fail not for technical reasons, but for sociological reasons.
  2. Our successes stem from good human interactions, not from incremental technical improvements.
  3. Making errors should be encouraged - everyone should have a few mistakes during the project when we tried something and it didn't work. When the answer to "How many mistakes did you make?" is "none"; that's a bad sign people aren't trying enough new things.
  4. We need people who make the team "jell" - they are worth more than coders.
  5. We spend too much time trying to get things done, and not enough time asking if the thing is worth doing.
  6. People really like to make very high quality stuff, but the market wants high quantity.
  7. Parkinson's law, "work expands to fill the alloted time", doesn't apply well to software developers.
  8. Beware of claims to increase software productivity by 100% because most time is not spent programming.
  9. When testing productivity of programmers, some were 10 times more productive than others. This is not quite what it sounds like since not all a person's time is taken with programming.
  10. During "programming games", language did not affect the outcome (except assembly language) and experience didn't matter (if they had more than six months experience).
  11. Quiet places for work are extremely important to allow programmers to get in the "flow" of their work. (This agrees with Joel Spolsky, but not the Agile wing of development).
  12. Corporations have entropy. Differences, and creativity, in departments are slowly ground out of them to create a flat, bleak landscape of sameness.
  13. Big Methodologies don't work; better to use training, tools, and peer reviews.
  14. Fujitsu encourages all projects to do some aspect in a nonstandard way.
  15. Letting teams strive for less than perfect quality is the "death knell" for the team. Teams really want to do high quality work.
  16. "Sociology matters more than technology or even money."
  17. Overtime is destructive and counter-productive.
  18. People hate change. We are agents of change.
  19. Try to keep people on one project at a time, not spread over several at one time. They are less efficient and more frustrated.
  20. Don't waste your peoples time in meetings and overstaffing projects early.
  21. Create a fun, creative, productive team environment - somehow.


Their recommendation for having quiet offices struck me. As a result we got the loud cell phone in the office turned down and I bought one of my people, who is affected by the noise, some noise-canceling headphones to see if that would help with the noise. It didn't.

Saturday, August 02, 2008

Salman Rushdie threatens to sue ex-guard over book

Is it just me or does it seem ironic that Salman Rushdie the champion of "free speech" for books is threatening to sue the author of a book that implies Salman is "cheap, nasty and arrogant"?

Wednesday, July 30, 2008

EEstor passing Independent Tests

electric meter
EEStor, the Cedar Park Texas based designer of supercapacitors, passed a milestone independent test by Texas Research International which certified that the purity of EEStor's powder averaged 99.92% purity. The purity of the chemicals is crucial for creating their economy-changing energy storage product.
If EEStor can create their supercapacitor at a decent price and having sufficient safety, the whole peak oil crisis will change.
Their energy storage device, not technically a battery but a capacitor, will make total electric cars feasible. They pack nine times the power of lead-acid batteries and can be recharged in minutes, although using special high voltage chargers, home recharging will take longer. As soon as some of these cars hit the market, our need for oil will start to lessen.
With the need and demand dropping, the price of oil should start declining. (Yes, yes, I know China and India - blah, blah, blah. But China and India aren't going to be buying a lot of oil at $130 a barrel once their governments stop subsidizing. They will be shifting to electric as well. China has a lot of coal and doesn't seem to be shy about burning it.
So, it's a happy thing that Eestor's product passed the test. Hopefully we'll see a real product demonstration from them soon.

Tuesday, July 15, 2008

GrandCentral - Another Layer of Indirection for Your Phone

I'm very impressed with GrandCentral, a service that provides a phone proxy. You get a "virtual phone number" that you can redirect to other phones based on the caller. You can block certain numbers and have other numbers ring you directly or go to voicemail directly.

Reminds me of Butler Lampson's quote:
"All problems in computer science can be solved by another level of indirection"

Another great idea from our friends at Google.

Wednesday, July 09, 2008

Google's New Virtual Enviornment Promo

Google's new lively.com site provides avatar environment as shown in the following youtube video. The interesting thing to me is that the video has no voice over - it's all visual with a driving rock beat.

Tuesday, July 01, 2008

MR. BURN-A-KEY IS STEALING MY MONEY?


book


I didn't mean to overhear the conversation, but it's funny how baby monitors and older cordless phones interact over the 900Mz range. Just after breakfast I heard this through the baby monitor.

[Baby breathing and twisting in crib...]

"OFFICER, THIS IS CLARENCE JOHNSON AND I'VE BEEN ROBBED!"
"This is officer James O'Malley, and you need not shout Mr. Johnson."
"WHAT? YOU NEED TO TALK LOUDER. SEE I WAS IN THE WAR AND LOST MY HEARING. WORKED ON JETS IN KOREA. ONE OF THEM BLEW UP RIGHT BESIDE ME."
"All right Mr. Johnson, I'll speak up."
"THANKS SONNY - SOMEBODY DONE AND GONE STOLE MY MONEY."
"Are you alright?"
"YEAH, YEAH, I'M FINE BUT MY MONEY'S GONE."
Ok, when did this robbery take place."
"IT STARTED A FEW YEARS AGO AND THEY'VE BEEN STEALING A THOUSAND DOLLARS A MONTH."
"Well, that's a lot of money Mr. Johnson."
"AND I NEED IT. I'M 87 YEARS OLD AND LIVE ON MY SAVINGS."
"So did the thieves break into your house?"
"NO, NO, THEY BEEN TAKING IT STRAIGHT FROM MY BANK ACCOUNT."
"Well, I'll need to transfer you to our fraud division."
"NO, NO, I ALREADY TALKED WITH THEM AND THEY SAID IT AIN'T NO FRAUD - THEY'S AS WORTHLESS AS LIPSTICK ON A DUCK."
"I'm sure they are doing the best they can. I'll see if I can help you. Now how did these crooks steal your money?"
"WELL, DON'T TELL THE NEIGHBORS, BUT MY WIFE, God rest her soul, AND ME SAVED FOUR HUNDRED THOUSAND DOLLARS IN OUR YEARS FROM ME WORKING, AND MAYBE A LITTLE FROM BESSIE'S DADDY WHO HAD THIS LITTLE FARM OUTSIDE OF DALLAS."
"That's a lot of money."
"I'D BEEN GETTING LIKE 16 HUNDRED DOLLARS A MONTH FROM MY SAVINGS ACCOUNT. A MAN CAN LIVE LIKE A KING ON 16 HUNDRED A MONTH."
"Ok, keep going."
"LATELY IT STARTED GETTIN SMALLER EACH MONTH. 16 HUNDRED, 14 HUNDRED, AND NOW ONLY 600 DOLLARS! THEY'RE STEALING MY MONEY!"
"Ok, calm down Mr. Johnston, and you really don't have to shout. I'm not the one with the hearing problem."
"WHAT?"
"Mr. Johnson, what's happening is that your interest rate is just going down. It was 5 percent or so a few years ago and a good bank savings rate these days is 2 percent. That's all that's happening. No one is stealing your money."
"WHO IN TARNATION MADE MY RATES GO DOWN?"
"Well, the Federal Reserve Board sets interest rates and they had to lower them recently to help out some bankers who were in trouble."
"BANKERS? ARE THEM D*** BANKERS HAVING TROUBLE PAYING THEIR LIGHT BILLS? ARE THEY SWEATIN LIKE PIGS IN THE TEXAS SUMMER?"
"You don't have to shout Mr. Johnson. Ben Bernanke and the Fed have to save the banks or everyone will panic. They are doing all of us a favor by lowering interest rates."
"SO THIS MR. BURN-A-KEY IS STEALING MY MONEY?"
"No it's not him, he's just helping the banks and everyone else to not panic."
"IS HE CAUSING THE GAS PRICES TO GO UP? I WENT TO FILL UP..."
[My baby starts crying and needs a few minutes of comforting...]
"...no, no Mr. Johnson, the price of gas is also due to inflation which is about three percent."
"THREE PERCENT EH? MY SON SAYS THE INFLATION RATE IS SEVEN OR EIGHT PERCENT - I THOUGHT THAT BOY WAS FIBBIN."
"Well, no Mr. Johnson, if you calculate inflation like it was done a few decades ago your son's right - it's about seven percent, but since then all the presidents have fiddled with the numbers to make inflation look smaller so they wouldn't have to pay all that social security cost of living adjustment."
"SO INFLATIONS AT SEVEN PERCENT AND I'M EARNING 2 PERCENT? I'M LOSING LIKE ... FIVE PERCENT A YEAR ON MY SAVINGS? WHERE'S MY MONEY GOIN? WHO'S STEALING MY MONEY?"
"Just a minute Mr. Johnson I've got some police work to do."
[Whispering:] "Marge, I'll take a raspberry filled and an eclair...oh... grande please."
"Ok, I'm back. Now Mr. Johnson, no one's stealing your money and fortunately for you , you have four hundred thousand in the bank you can just withdrawal some of that for your light bill."
"SONNY, ITS KINDA EMBARASSIN BUT THE MONEY'S IN A THING AT THE BANK. BESSIE'S DADDY WASN'T THE TRUSTING KIND AND HE'D GONE AND PUT IT SO I CAN'T GET AT IT - JUST GET THE INTEREST MONEY."
"Mr. Johnson, I've got to go now. Sorry I can't help you. Maybe you could buy a fan and turn the lights down in the evening and go to bed earlier."
"WHAT DID YOU SAY SONNY, SEE I WAS IN KOREA WITH THESE JETS..."
[Our baby started really crying over the monitor and that was it for the phone call.]

.Net Web.config attributes case-sensitive

One little tidbit I learned this morning:
In the Web.config file for web applications the attribute values are case sensitive.
To aid remote debugging I turned "off" the friendly messages to get meaningful error messages from remote machines. I tried the following line, but it didn't work:

<customErrors mode="off"/>

It turns out the attribute values are case-sensitive. The line should be:

<customErrors mode="Off"/>

Saturday, June 28, 2008

Why the CAFE Fuel Standards Don't Matter Anymore

By Phi Guy, Flickr

The US government passed the "Energy Policy Conservation Act" in 1975 which mandated a Corporate Average Fuel Economy (CAFE) for all a car makers products. The intent was to raise the fuel efficiency of cars.
Many electrons have been spilled in the blogosphere about how to reduce our dependency on foreign oil. The Republicans typically say, "Let's drill off-shore and in that big cold state up North." The Democrats say, "Let's just raise the CAFE standards." The current energy bill proposes a target of 35 mpg by 2020.
Well, the CAFE standards don't matter anymore. Here's two reasons why:
1. With gasoline at $4.00 a gallon, SUV sales are tanking already - down 50% this year. It doesn't matter what the CAFE standards are, people are buying more fuel efficient cars. In the last year the fuel efficiency of US cars has gone from 20.2 mpg to 24.4 mpg.
2. The plugin electric cars are coming. By 2020 the concept of miles per gallon will be moot. We will have gone electric. The pace of battery technology is accelerating and will provide a huge economic advantage to electrical cars. With new Lithium-Ion batteries and EEStor's super-capacitor, the trend will be towards electric cars. Chevy's over-hyped Volt and the Japanese plugins will get here in 2010. They will probably have the bugs worked out of them and be practical by 2015. By 2020 most passenger cars will be electric, trucks may take another decade.
So congress should quit wasting time about whether the CAFE standards should be 35 or 37 mpg in 2020, it won't matter.
What's the mpg of an all electric plugin car anyway?

Wednesday, June 25, 2008

Where does the US get foreign oil?

chart
You may not know this but according to the US government figures we import more oil from our friends up north, Canada, than from any other country.
Some other tidbits of petroleum stats:
The United States produces 10% of the world’s oil and consumes 24%.
In 2006 the United States consumed 20.7 million barrels a day (MMdb) of crude oil and produced 5.1 MMdb of that leaving 13.7 MMdb to be imported.

Tuesday, June 24, 2008

Falling

planets in orbit NASA/JPL
As a programmer do you feel like you are falling behind in the current technology? If you don't, you aren't paying attention.
Isaac Newton came to the revelation that gravity held the heavenly bodies in orbit by theorizing a cannon ball being shot fast enough that it was always just falling over the horizon thereby putting it in orbit. That's what software development is today - we are always falling over a body of knowledge but never quite resting on it.

Creating software is changing rapidly:
  • new Agile techniques for organizing and managing projects
  • new Model-View-Controller frameworks for Java, C#, and python
  • new language features, especially C# 3.0 has some wonderful new toys
  • new rebirth of functional programming
  • new ActiveRecord type object-relational mapping tools
  • new AJAX toolkits
  • oh, yeah, that new handset stuff for the iPhone and Android.

How do you keep up? Here are a few thoughts:
  • Read technical blogs. My list is here.
  • Do code reviews or paired programming. At our company we do biweekly code reviews for 30 minutes. I've learned so much from seeing how my compatriots code. Do the new CodingDojo thing with friends.
  • Be involved with your local user groups. Austin is fortunate in having many fine groups such as a great Java User's Group, Dot Net User's Group and an Agile group. See a more complete listing at my del.icio.us austin+tech bookmarks.
  • Get together with friends from companies you used to work at and see what their company is doing. How do they do builds? Unit and integration testing? What are the problems they have?
  • Buy a domain name and play around.
  • Learn a new language every two years.
  • Read good classic books. Some of my favorites are here.

If you aren't learning everyday, you're falling behind.

Thursday, May 22, 2008

Public Domain Classical MP3s and Sheetmusic at www.musopen.com




I stumbled into a wonderful site, MusOpen.com, that is gathering recordings of classical music and associated sheet music to put in the public domain. What a great idea.
We can now have classy background music for those wacky YouTube videos we make.
An interesting twist on the site is that you can "bid" to have your favorite pieces performed by a professional musician. When enough bids have been collected, MusOpen hires the musicians and adds the music.
To speed up the process I would like to see is the ability for any assemble to upload their version of a classical piece. Any local high school or civic orchestra could upload their version. This would lead to a lot of mediocre music, but if we added voting, the cream would rise to the top. Check them out at MusOpen.com.

Monday, May 19, 2008

Austin Code Camp 2008

Austin Code Camp was very informative.
I went to the afternoon sessions (Swim meet in the morning).



Chad Myers led an interesting "Fishbowl" session on adapting TDD in your team.

Jimmy Bogard gave a good presentation on mocks and stubbing. I really liked the new testing syntax made possible by extension methods:

bool result = foo(a,b,c)
result.shouldBeTrue();

This seems more natural than using the "Assert.IsTrue(result);"


Ben Scheirman showed all the cool features of ReSharper that he uses. I liked one of his side comments about keyboard shortcuts: "If I'm using the mouse, I've failed."

Other miscellaneous items:

  • Recommended Books: Lean Thinking / The Machine That Changed the World / Toyota Way
  • Rhino Commons is a helper class for NHibernate
  • Demo tools: Jedi show keyboard strokes, Zoomit magnifies areas on screen
  • C# has new ReadOnlyCollection




Austin Code Camp was well attended. Join us next year.
(Going to the camp reminded me as software developers we have to be constantly learning - reminds me of the urban myth about sharks having to swim or they die.)

Friday, May 02, 2008

Scrap H-1B Visa Lottery - Use Ebay

163,000 applications were filed for 85,000 H-1B Visas. With our current lottery system for allocating the coveted visas, employers have a 50-50 chance of getting an employee into the country.
Many workers in the US don't like the system because many think the guest workers depress wages. Employers don't like it because they cannot be guaranteed the desperately needed talent for hot projects.
Here's an idea - let's put the visas up on Ebay. Employers can almost be guaranteed a visa is they really, really need someone. Downward pressure on wages would be slowed since the cost of the visas would be higher. The extra income to the US treasury could be put to some good use. It's a win-win-win situation.

Thursday, May 01, 2008

Alistair Cockburn at Austin IEEE

Last night 120 people came out to hear Alistair Cockburn at the ieee meeting.
pic
Some items that struck me:
1. Shu, Ha, Ri meaning, "Learn a technique", "Learn many techniques", "Blend Techniques". These are the levels people go through as they learn. We need to understand how people in each level of craftsmanship will act.
2. The bottlenecks in your organization will determine your strategy of software development. If the bottleneck is a database designer, then everything must be arranged to maximize her time. It doesn't much matter what everyone else does - unless they become the bottleneck.
3. There's always a bottleneck.
4. Do the riskiest stories first to make sure no surprises lurk in the corners of your project. This is contrary to the "do the highest business value first" philosophy.
5. Whether you use Agile or Lean processes don't matter much; you'll end up in the same place.
6. As you increase communication in a group you increase productivity.
7. Alistair told a story about a group interviewing Indian programmers. The interviewer made a mistake (on purpose) during the interview. If the interviewee didn't not mention the mistake, they were not considered for the job. Message: you need people who will communicate.
pic

Tuesday, April 22, 2008

.Net Application Restarts Frequently on Windows Server 2003

While stress testing a .Net 2.0 application, we noticed the application was restarting about every minute. This restart did not occur under normal loading, but when we really pounded the app it did this weird restart every minute thing.

The application ShutdownReason was "Configuration change", a more detailed message:

_shutDownMessage=Overwhelming Change Notification in c:\inetpub\wwwroot
Overwhelming Change Notification in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config
CONFIG change

This happened on Windows Server 2003, but not on XP.
The solution was to install the Microsoft .NET Framework 2.0 Service Pack 1. Now it is happy.

Saturday, April 19, 2008

Encyclopedia Britannica Offers Free One Year Subscription to Bloggers

Yep, I took the bait. I was impressed with the simple, but elegant design of the site.
While reading some articles, my inner being was refreshed; I didn't realize how, when surfing the net, I'm constantly asking myself the question, "Is this really true?".
I could turn down my skepticism and enjoy reading the articles.

To signup visit britannicanet.com/ and click on the green "registration" button on the right side.

Watching TV on Your PC via Hulu.com



I spent a few minutes with Hulu this Saturday. Hulu is easy to use and has a wealth of old and new TV shows. I appreciate the Firefly and Babylon5 reruns there. Commercials adorn the front of the show, which isn't bad, but clickable banner ads appear at the bottom of the running show which is annoying.
Now if I could just pipe the hulu stream to my Tivos.

Free Web Filtering with OpenDNS

Since I have young kids at home I've used web filtering software, but it's been very slow to load. When a browser opened for the first time, the nanny software would load a bunch of restricted sites and this would take a long time.
I've been using OpenDNS for a few months at home and it's very zippy. OpenDNS works on a different principle. You set the DNS server for your machine (the computer which converts urls like "www.fincher.org" to "208.97.191.221") to be the OpenDNS server. OpenDNS then does filtering based on the categories you have set.

The URLs in the blocked categories are from a public project that votes on how sites should be categorized.
Other niceties:
1. OpenDNS is advertised as being faster than your ISPs domain name server
2. It corrects typos in urls ("cnn.co" is mapped to "cnn.com")
3. You can create your own shortcuts ("go" is "google.com")
4. Reports are available on DNS usage

Check it out at OpenDNS.com

Tuesday, April 08, 2008

Biogasoline Breakthrough Using Cellulose Feedstock

Researchers have made a breakthrough in creating biogasoline from renewable cellulose like switchgrass and trees. The final product is almost indistinguishable from gasoline made from crude oil. Most energy research has been focused on converting corn and cellulose to ethanol, but ethanol has several problems:
1. By volume ethanol only has 70% of gasoline's energy, so cars will only go 70% as far on a tank
2. Ethanol cannot be transported by pipelines since it collects water in the pipelines so this makes distribution more expensive
3. Pure ethanol cannot be used in cold climates
4. Cars must be modified to use ethanol
Using biogasoline gets around all these problems.

We don't need to produce all our gasoline this way, but even if we could make 10-15% it would take pressure off the price of gasoline.
This new biogasoline could tide us over until eestor's "batteries" are available in the Chevy Volt and we go all electric.

Monday, April 07, 2008

Using IntelliSense with Nant Files in Visual Studio 2005

I've been hacking at some build files to integrate with CruiseControl.Net lately. I finally took the time to research how to have intellisense with the build files in Visual Studio 2005. It's easy - really.

1. Copy the Nant.xsd file into Visual Studio's Schema directory:

copy C:\opt\nant\nant-0.85\schema\nant.xsd "C:\Program Files\Microsoft Visual Studio 8\Xml\Schemas"


2. Look at the Nant.xsd to copy the namespace into your build files.
Inside my version of Nant.xsd the second line was:

<xs:schema xmlns:nant="http://nant.sf.net/release/0.85/nant.xsd" elementFormDefault="qualified" targetNamespace="http://nant.sf.net/release/0.85/nant.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema">

So I added the namespace to the "project" element of my build file.

<project name="Scythe" basedir="." xmlns="http://nant.sf.net/release/0.85/nant.xsd">

If you haven't already set your build file to be XML you need to right-click on the build file, select "Open With...", and use "XML Editor".
Now intellisense gives me hints on what I can put in the nant file.
Enjoy.

Tuesday, March 25, 2008

A Complaint is a Gift



One of the great faults of software groups is that we assume if we don't hear from our customers, they are happy. This is a lie from hell.

How happy are you with Windows? Have you ever called Bill Gates? I rest my case.

We need to strive to improve feedback with our software customers. I uninstalled Skype from my work machine today (something about corporate policy and security). I was pleasantly surprised to see in my firefox browser a page from Skype entitled, "We're really sorry to see you go. Did you have problems? We can help." This shows a great attitude that Skype really cares about its customers and improving their product.
A complaint really is a gift, and we need to accept these gifts graciously and learn from them.
One of the new things in our application I put in this release is a link to a wiki for suggestions and feedback. Now instead of steaming that a page didn't remember previous settings a user can go to the wiki and document their needs while fresh in their mind. It's an easy thing to do and a great way to get feedback, although actually talking with your customers is the best idea.

Tuesday, March 11, 2008

Creating Favicons Online

http://www.MayanPeriodic.com
I recently found a wonderful site for creating favicons, you know, those cute itsy-bitsy images that appear to the left of your tab uhm, you are using tabs?.
It's www.favicon.cc. I uploaded a graphic like this one to the site and it converted it to a tiny little favicon. Check it out at http://www.MayanPeriodic.com.

Friday, March 07, 2008

Butterflies and Stored Procedures

butterfly
The Monarch caterpillar eats the poisonous milkweed plant so as an adult the butterfly is quite toxic to birds. A young bird will eat the butterfly and be so repulsed by the taste will not try to eat another in its lifetime. Some other species of butterflys mimic the color of the Monarch even though they are not poisonous, but quite tasty to birds. But a young bird after tasting the dreadful Monarch will not eat its counterfeit.
I'm like that with stored procedures. In one of my early projects stored procedures left a bad taste in my mouth. Stored procedures were cumbersome to code, difficult to synchronize across multiple databases and they always seemed to be out of sync with version control. Looking back all those issues could have be averted with better build management, but stored procedures left a bad taste in my mouth.
Today, one of my programmers came up with a good case for a stored procedure. He is working on one program that interfaces with a database, but many other programs are constantly changing the database. Currently they all issue a series of sql commands to affect a change in the database, but if one of the programs fails to get all the sql commands for a change correct, the database will be in an unsteady state.
Better to use a stored procedure to ensure consistency across the applications.
Maybe that first butterfly was a fluke.

Thursday, February 28, 2008

Whinning about Microsoft's Inept Naming Schemes

While searching on O'Reilly's code search site this morning, I was reminded how Microsoft chooses unfortunate names for products. My initial problem was searching for code in C# relating to the ICollection interface. I entered the category as "C#":

cat:c# icollection

and got returned a bunch of code snippets on C, C++, and C#. What I needed to say was,

cat:csharp icollection


The problem with "C#" is that it doesn't really play well with search. I can see the cute progression of C, C++, and the the musical incrementation with C#, but it's a pain in search. I can understand a non-technical marketing person (with a degree in music) selecting the name, but a technical company? Sun did a nice job selecting "java" as the final name for the language - it's a real word, but a little obscure. Why couldn't Microsoft select something like "jasper" or some obscure tea name?

And selecting ".Net" as the name of a framework? Isn't ".net" a top level domain? And how do you search for something with a dot in front of it? Don't search engines strip out obscure characters?

And while I'm at it, what sense does it make to name your operating systems, Windows 3.1, Windows 95, Windows 98, Windows 2000, NT, XP, then Vista?
Please, use version numbers, or years, or code names, but don't mix them - it gives a sense of purposeless wandering.

Ok, I feel better now - back to ICollection.

Wednesday, February 20, 2008

China to Open Coal-To-Liquid Plants


According to the Guardian China is about to open the first of many Coal-To-Liquid plants. The technology is well understood and was used by Germany and Japan in WWII. The process will allow China to import less oil and save money. The estimated cost is 25-40 dollars in equivalent barrel terms.
A bad thing about the process is that it produces more CO2 than conventional oil.
This is why I thing the EnvironmentalGraffiti.com smears the technology calling it "Nazi Fuel" (we don't call the F-22 a Nazi-Jet, or the Saturn V a Nazi-Rocket).
Although it does increase CO2, a way to help supplement our energy is a good thing until we can get renewables online.

Calculating with Google.com

I was trying to determine how many times all the DNA in our bodies, if stretched out and laid end to end, would go back and forth to the sun. Don't ask why. I just think about these things so you don't have to. Each cell contains six feet of DNA, our bodies contain 100 trillion cells, the sun is 93 million miles away... the numbers were too big for my calculators, so I thought I'd try Google. I entered:

((6 ft * 100 trillion) / 93,000,000 miles)/2

and out popped my answer, 611. Google calculator does all the unit conversions for us. Very cool.

Tuesday, February 19, 2008

"using" in C#

C# provides an interesting feature with "using". The target of "using" must implement the IDisposable interface which contains one member, Dispose(). After the block is executed, the Dispose() method is called on the target object.

using System;
namespace Doodle {
class DisposableExample : IDisposable {
public void Dispose() {
Console.Out.WriteLine("I'm being disposed!");
}
public static void Main() {
DisposableExample de = new DisposableExample();
using (de) {
Console.Out.WriteLine("Inside using.");
}
Console.Out.WriteLine("after using.");
Console.In.ReadLine();
}
}
}

This produces:

Inside using.
I'm being disposed!
after using.


This can be used to good effect with database connections. Instead of using the finally block to close connections, a "using" block can be more succinct.

using System;
using System.Data.SqlClient;

class Test {
private static readonly string connectionString = "Data Source=myMachine; Integrated Security=SSPI; database=Northwind";
private static readonly string commandString = "SELECT count(*) FROM Customers";

private static void Main() {
using (SqlConnection sqlConnection = new SqlConnection(connectionString)) {
using (SqlCommand sqlCommand = new SqlCommand(commandString, sqlConnection)) {
sqlConnection.Open();
int count = (int)sqlCommand.ExecuteScalar();
Console.Out.WriteLine("count of customers is " + count);
}
}
Console.In.ReadLine();
}
}


"using" can also be helpful with files as this example shows:

using System;
using System.IO;

class Test {
///
/// Example of "using" with files.
/// This repeated creates files and closes them subtly by the "using" statement.
///

private static void Main() {
for (int i = 0; i < 5000; i++) {
using (TextWriter w = File.CreateText("C:\\tmp\\test\\log" + i + ".txt")) {
string msg = DateTime.Now + ", " + i;
w.WriteLine(msg);
Console.Out.WriteLine(msg);
}
}
Console.In.ReadLine();
}
}

Monday, February 11, 2008

Solazyme Is Making Biodiesel from Algae

Solarzyme is producing biodiesel now from algae. The technology is very intriguing since the final product is something similar to oil, so it can be refined, transported, and consumed by our existing infrastructure.



Solazyme Produces Biofuel from Algae

Chevron has taken a stake in the company causing fears among the conspiracy theorists that big oil would quietly shelve to process to protect Chevron's oil interest. But Big Oil (tm) is in big trouble now. Most of the oil deposits are now out of reach of big oil companies and in the hands of state sponsored oil companies. Big oil should welcome processes like Solazyme's that will them to produce and deliver oil independent of foreign government's whims.

Another video clip here.

Monday, February 04, 2008

Skip the Biomass - Go Straight Hydrogen

In photosynthesis, plants take sunlight, wrestle hydrogen from h20 and make ATP, their power source. When we create alcohol or other synthetic fuels from plants we are really harvesting the energy from sunlight that freed the hydrogen from inside the plants. To make alcohol from corn we have to plow the fields, lay down fertilizer and insecticides, plant the seed, and harvest the corn - all of which takes a lot of energy and emits carbon.
What if we could just skip the plant and get the energy straight from the sun?
That's what Nanoptek is doing.

Nanoptek has a special catalyst to free hydrogen from water in the presence of sunlight.
Why use this process instead of photovoltaics? One of the advantages is the ability to store the energy for use later. A farm of Nanoptek's harvesters could create hydrogen all day and store it for burning in turbines at night or peak demand. This gives great flexibility to the power-grid. The hydrogen gas could through serious chemistry be used to create liquid fuels similar to diesel.
What remains to be seen is whether the economics will work, but their recent announce is exciting to see.

Abandoned by Intellisense

This morning I was already to get to work on a fun programming project in Visual Studio 2005, but I had lost intellisense which is very annoying. I toggled between ReSharper's version and Microsoft's. I quit VS2005 and reopened. I checked in the recalcitrant file, checked it back out. Nothing.
Finally I closed all open windows, quit VS again, and Intellisense returned.
Which reminds me of a haiku,

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

Wednesday, January 30, 2008

Last Night's Austin Java User's Group


book

Last night Ernest Hill gave an excellent introduction to the SCALA language. It continues the recent trend of all objects, even lowly integers, are real objects.
Eitan Suez talked about his recent work with jmatter.org. One idea was to create a "browser" environment for jmatter applications. A user would download a 25Meg file containing all the libraries for a jmatter app, and then only have to download the 100K or so for all the other jmatter applications they would run. I liked the idea.
Eitan also talked about his new open source project css4swing which allows java Swing applications to use css rules to define the look of an application.
I always enjoy hearing Eitan speak since he so often has curious, interesting, and big ideas.
I also won the very cool Google Toolkit book.

Tuesday, January 29, 2008

LifeHack: Perfect Exercise Setup

Here's my perfect exercise setup: An elliptical rider with a heart monitor set in front of a TiVo. Now when I want to watch TV I go to my rider and exercise while watching while keeping my heart rate above 125.
I can breeze through an hour workout and really enjoy it.

Friday, January 18, 2008

Austin on Rails Meeting

This last Austin on Rails meeting highlighted the latest version of Sun's NetBeans IDE. Gregg Sporar gave a good overview of all the new Ruby and Rails features in NetBeans. I am very impressed with Sun's commitment to Ruby and Rails. My favorite feature was the ability to convert javaStyleCamelCaseVariables names to their equivalent, java_style_camel_case_variables ruby style automatically.
The ability to switch easily between model,view, and controls looked very helpful.

Monday, January 14, 2008

Interesting difference between ie and firefox/opera regarding location.href

Recently here at inotech we ran into some oddities regarding javascript in different browsers. This test page shows the issue:


<body>
<h2>Test of ampersands </h2>
<script language="JavaScript" type="text/javascript" ><!--
location.href="http://www.myhost.org/cgi-bin/SimpleFormAction.pl?cat=felix&amp;dog=fido";
//--></script>
</body>

Note the the "&" in the location.href value have been escaped already to "&amp;".

In Internet Explorer the following is echoed back from the form:

cat = felix
dog = fido

But in Firefox and IE we get,

cat = felix
amp;dog = fido

IE converts the "&amp;" to just "&", although I think Firefox/Opera are doing the right thing not to escape the amp. No charge for this tip today, but be careful in how you specify the ampersand in your hrefs.