July 2007

You are currently browsing the articles from TechToolBlog written in the month of July 2007.

Vista Battery Life

So Vista was suppose to be easier on laptop batteries then XP.  I’m not convinced, my Dell D820 last ~2 hours but should be getting close to at least 4.  I do have Aero turned on and will confess I have lots of windows open at a time + background services, but still 2 hours is no good.  I’ve been manually switching off Areo for the last week or so but that is a big pain in the arsh ;) 

Today I found Windows Vista Battery Saver.  This looks very promising, it automagically turns off Aero and Sidebar when the laptop is running on battery and it’s open source so you can peek at the code that manipulates the theme on Vista.

 

image

Written by Tim on July 26th, 2007 with 4 comments.
Read more articles on tools and windows.



iPhone Development Podcast

Who knew datapoohbah could be so insightful on a iPhone Development Podcast?  Check it out, it pretty well done, and he makes some real good points.

I’ve been playing around with writing a iPhone web application, more to come on this soon.

Written by Tim on July 24th, 2007 with no comments.
Read more articles on web 2.0 ish.



e.Row.RowState

I’m building a GridView that contains edit/update capabilities.  In edit mode for certain rows I need to turn on a drop down list, and based on that row add/remove Items from the list, other rows I want to show a text input to edit, all based on Foreign Key for that row in the database (which I store in a DataKey to access).  I handle the OnRowDataBound with a custom subroutine.  This hasn?t been an issue in the past but this time I have multiple controls in the ItemTemplate and need to manipulate at databound time, which is a first. 

<EditItemTemplate>

<asp:DropDownList ID=?ddlAnswer? runat=?server? Visible=?False?>

<asp:ListItem Value=?Yes? Text=?Yes? />

<asp:ListItem Value=?No? Text=?No? />

<asp:ListItem Value=?Neutral? Text=?Neutral? />

</asp:DropDownList>

<asp:TextBox ID=?txtAnswer? runat=?server? Text=?<%# Bind(?Answer?) %>? Visible=?False?></asp:TextBox>

</EditItemTemplate>

 

Both have visible=false so I need to get at the bound event and flip one on and change the item list if it?s the DropDownList.

RowState

I find the e.Row.RowState property and assign an if conditional to DataControlRowState.Edit. 

 

If e.Row.RowState = DataControlRowState.Edit Then

 

?CHANGE UPDATE COMMAND ARGUMENT

CType(e.Row.FindControl(?lbUpdate?), LinkButton).CommandArgument = _

e.Row.RowIndex.ToString()

 

Dim iAnswerTypeID = CInt(gvEditSurveyResults.DataKeys(e.Row.RowIndex).Item(0))

?TURN ON CORRECT TYPE OF INPUT

Select Case CInt(gvEditSurveyResults.DataKeys(e.Row.RowIndex).Item(0))

Case 1

CType(e.Row.FindControl(?ddlAnswer?), DropDownList).Visible = True

CType(e.Row.FindControl(?ddlAnswer?), DropDownList).SelectedValue = _

CStr(gvEditSurveyResults.DataKeys(e.Row.RowIndex).Item(2))

 

Case 2

CType(e.Row.FindControl(?txtAnswer?), TextBox).Visible = True

 

Case 3

 

Case 4

CType(e.Row.FindControl(?txtAnswer?), TextBox).Visible = True

CType(e.Row.FindControl(?txtAnswer?), TextBox).TextMode = TextBoxMode.MultiLine

 

Case 5

CType(e.Row.FindControl(?ddlAnswer?), DropDownList).Visible = True

Dim oldListItem As ListItem = CType(e.Row.FindControl(?ddlAnswer?), DropDownList).Items.FindByValue(?Neutral?)

?REMOVE NEUTRAL

CType(e.Row.FindControl(?ddlAnswer?), DropDownList).Items.Remove(oldListItem)

?ADD NA

CType(e.Row.FindControl(?ddlAnswer?), DropDownList).Items.Add _

(New ListItem(CStr(gvEditSurveyResults.DataKeys(e.Row.RowIndex).Item(1)), CStr(gvEditSurveyResults.DataKeys(e.Row.RowIndex).Item(1))))

CType(e.Row.FindControl(?ddlAnswer?), DropDownList).SelectedValue = _

CStr(gvEditSurveyResults.DataKeys(e.Row.RowIndex).Item(2))

End Select

 

End If

 

This doesn?t work, I never get into the if block for all rows. Setting a debug point I find the state of the row is not always DataControlRowState.Edit, but sometimes Alternate with an enumeration of 5.  Looking thru Microsoft documentation I don?t see any 5 reference. 

My Assumption

I am assuming that every property of the DataControlRowState handler has an Alternate row of that plus 1.  So edit  = 4 and edit on an alternative row is 5.

Trip Report - Catalonia Riviera Maya

Overview

My wife and I visited the Riviera Maya from April 15 - 22.  7 relaxing days away from our beautiful but rambunctious kids.  This was the first time away from our youngest baby so my wife had some jitters plus it was her first time out of the country.  This was an all inclusive deal, again a first time for the both of us.

Flight

We had a 4 PM direct flight from Indianapolis.  We flew Frontier Airlines.  All Frontier jets come with a LCD with 30 different TV stations all included.  Plus they serve a nice sandwich and chips during the flight.   The plane was half full so the crew was very relaxed. They get an 9 out of 10 from me.  We arrived in Cancun at 7 pm their time.  The flight home was uneventful which is good thing for air travel.

Cancun Airport + Transportation

Cancun airport is crazy, they do get you thru customs pretty quickly, but man what a shell shock. My Spanish was rusty but I didn’t realize how rusty. An airport worker got us to our private transportation.  I sent an email to Cancun Transfers asking for a nice SUV - they delivered, a brand new white Ford Explorer.   Our ride their was awesome, our driver was great.  However our ride back (again Cancun Transfers) was a nightmare.  I swear the guy almost killed us at least 5 time, speeding like crazy.  It’s at least a  good hour trip to the Catalonia Riviera Maya from the airport.

Hotel

We stayed at the Catalonia Riviera Maya.  It’s basically two hotels together that act as 1. Check in was a breeze and we were given a room on the Riviera side, next to their newest building.  Before we left I dropped them an email explaining this was our belated honeymoon and if they could do something special for my wife.  In our room was a bottle of Champaign and chocolate covered strawberries in a nice arrangement.  The “Cat” as returning guest call it, has 5 total restaurants, 5 pools, and 2 swim up bars. The grounds of the hotel are absolutely beautiful and really kept up.  The beach was crowded but my wife and I always found a couple of chairs (people do play the chair game).  The Cat is situated in a mini cove with a small reef and has really good snorkeling - they give you snorkel equipment for an hour use per day, plus other water activity equipment.  We snorkeled everyday.  The hotel guest are mix of family’s, retirees, and couples.  It’s not a party crowd but people are drinking and having a good time.   The rooms are basic, and clean.  Our bathroom was very nice, dual shower heads, marble.  We had a king’s bed that was a little stiff.  The cat doesn’t have ocean front views (it’s right on the ocean but the hotel is turned in on angel), but our room did a have a ocean side view.  It really feels like your in the Corona commercial on the beach.

Drinks

Let’s just say I became real good friends with a couple of the bartenders at the swim up bars.  Between tequila poppers, green ice shots and strawberry banana daiquiris we drank to our hearts content and more. Nothing like a tequila sunrise at 10 am, on the Riveria Maya. They’ll make them as strong as you want, just ask.  I hit up the sports bar a few time to catch some scores, rum & cokes, and had a good time in there too.  They serve dos equis on tap.

Food 

The Cat features 2 buffets (they serve the same food, one is open air, the other is enclosed), 1 Mexican, 1 Italian, 1 Steak a la carte restaurants where you have to make reservations. The buffets are good, not great, they have a different dinner theme ever night. Breakfast was good there.  During the day the steak restaurant is a grill serving hamburger, hotdogs, chips, salsa, plus more, a real nice selection.  After a few drinks in the morning we pigged out here everyday, my wife was a huge fan of the place.  This is the place you make reservations for the a la carte’s too, so make sure you get your reservations in early.  We ate at the steak restaurant first.  I had baby back ribs, my wife had a ribeye.  My ribs were great, a different type of rib then most American ribs.  The ribs were smaller in height, same length though.  In fact I noticed everything was smaller then in America, chicken, bacon, etc… Must be the size of the livestock. The Italian was fabulous, I had plenty of house wine.  The Mexican was also good.  The secret gem of the hotel is an ice cream parlor where you can get banana splits, crepes, and more.  We made sure to hit this place every night.

Service

The service in the hotel is top notch.  From the waiters to the bartenders we could not ask for better service. We always tip a little although it’s not expected.  It’s almost a shock to come from America where most customer service lacks to a place like this.  We never got the animal towels from house keeping but they did their jobs and we did not have an issue with anything missing, although we did keep our valuables in a locked suit case just in case.

Xel-Ha

We did the all exclusive here, snorkel equipment, locker, all you can eat buffet & drinks at Xel-Ha.  I would recommend going here if your hotel doesn’t have good snorkeling.  The underwater rock formation is amazing.  We did the lazy river (which unlike the water parks in America, is a real river). It’s a cool place to go once but I don’t think we would go a second time.

Playa Del Carmen

The shopping & night life here is awesome, a must go.  You can barter some real good deals.  We got our 4 year old a soccer outfit that was originally $35.00 but ended up paying $5 for it.  I also got some fat Cuban cigars here.  We felt generally felt safe here but I wouldn’t roam alone late at night.

Puerto Aventuras

This is a gated community that Cat resides in and we used the Cat’s bikes to ride there.  It’s a cool place that has a dolphin adventure, a few shops and restaurants.  You can see what the local fisherman bring back too. We totally felt really safe here.

Weather

The entire time it was sunny, highs between 88 - 92.  It was the best weather you could ask for.

Written by Tim on July 14th, 2007 with 3 comments.
Read more articles on other.

about:cache

Thanks to the Atlassian folks for letting us know about this gem, finding cache info in firefox just got easier - type about:cache in your browser:

 

image

Written by Tim on July 12th, 2007 with no comments.
Read more articles on tools and web 2.0 ish.

SQL Formatter

Our DBA writes some mean SQL code, I can write some SQL that works :).  It’s not my strongest suit but certainly not my weakest so I handle most of my sql statements myself.  However, when I need his help I cringe at sending him my sql code because he freaks when he sees it.  To me SQL is a string variable, I use to not care how pretty the formatting is, what tab setting to use, when to carriage return a FROM and so on.  Well, he cares and makes sure I know about it.  I totally understand why but for me it was too time consuming to make sure I format something that in the end is a string variable…. Until I found SQLinForm.  I am now a religious sql formatter, because not only does SQLinForm does it for me but it also creates c#, vb.net, php, and whole slew of other string variables.  My SQL has never been prettier and I can finally ship sql to my dba.

 

image

Written by Tim on July 9th, 2007 with 1 comment.
Read more articles on database and tools.

Google vs Microsoft Search

Is there really any doubt Google has Microsoft beat by 10 folds for search results?  Here is a search I did on a Microsoft Great Plains error: “No TaxScheduleKey, but TaxAmount  was passed in” Apparently Live.com doesn’t index Microsoft’s own newsgroups. Google does. Also Live.com the suggested alternative searches are based on the word “passed” which is a giant leap to assume my entire query revolves around 1 word.  Google suggested TaxAmount as two words.  I recently listened to Adam Bosworth MySQL speech in which he said how Google comes up with their “Did you mean” algorithm.  It has nothing to do with a dictionary lookup, but instead looks at the past queries and what suggestions users ended up clicking when presented with choices for “Did you mean”.  It really means Google is becoming a better search engine without any code changes, something Microsoft should take a qu from.

image

image

Written by Tim on July 9th, 2007 with 1 comment.
Read more articles on web 2.0 ish.