App_Offline.htm and working around the “IE Friendly Errors” feature

I posted the slides+demos from my ASP.NET 2.0 Tips and Tricks talk online last week from the ASP.NET Connections Conference in Orlando. One of the new features I talked about was the "App_Offline.htm" feature in ASP.NET 2.0, which provides a super convenient way to bring down an ASP.NET application while you make changes to it (for example: updating a lot of content or making big changes to the site where you want to ensure that no users are accessing the application until all changes are done).

The way app_offline.htm works is that you place this file in the root of the application. When ASP.NET sees it, it will shut-down the app-domain for the application (and not restart it for requests) and instead send back the contents of the app_offline.htm file in response to all new dynamic requests for the application. When you are done updating the site, just delete the file and it will come back online.

One thing I pointed out in the talk that you want to keep an eye on is a feature of IE6 called "Show Friendly Http Errors". This can be configured in the Tools->Internet Options->Advanced tab within IE, and is on by default with IE6. When this is on, and a server returns a non HTTP-200 status code with less than 512 bytes of content, IE will not show the returned HTML and instead substitutes its own generic status code message (which personally I don't think is super friendly ).

So if you use the app_offline.htm feature, you should make sure you have at least 512 bytes of content within it to make sure that your HTML (instead of IE's friendly status message) shows up to your users. If you don't want to have a lot of text show-up on the page, one trick you can use is to just add an html client-side comment with some bogus content to push it over 512 bytes.

Battery Not Charging in Net Book (Aspire One)

Here's what I found a a help site that worked:

"Unplug it pop out the battery and hold the power down for a minute, put the battery and ac adapter back in and start it; the motherboard was probably still holding power when the battery died causing a "hiccup"in the system, this should resolve or at least help a little."

Making Bread

Recipe for Bread Pan with Lid (Pain de Mie Pan)

Specifically for our bread pan 300mm

Flour 375g
Rice Flour 45g
Milk 300cc (1 & 1/3 cup)
Sugar 22.5g ~6 tsp
Butter 22.5g or 1.5 tbsp
Salt 1 tsp
Dry Yeast 1 tsp

Sift flour together twice

I substituted water for milk and olive oil for the butter, the mixture was way too wet, let's try just 1 cup and 1 tbsp of water next time.

Put in bread machine and let it go until it gets punched down for the second rise. Going to try to have it kneaded an extra five minutes.

Original recipe says cover with wet towel for 15 minutes but I just let it stay in the bread machine instead, as stated above.

Spray pan with oil, and place dough in pan.

I actually pre-heated oven for a couple of minutes and then let it rise with the cover almost closed until bread almost reached top this takes approximately 45 minutes.

I turned on oven and when it reached 375F, I started the timer for 35 minutes.

So, 375F for 35 minutes and you now have bread.

Notes: The original recipe has you separate the bread into two halves and place these in the bread pan to keep it from getting too much dome shape. I actually broke it into four pieces, rolled them into ball/logs with ends pointing to narrow sides and it worked perfectly.

Struts2Action with Tomcat and Eclipse

Tomcat

You will need to add the following XML entry in order to use Tomcat Manager
/conf/tomcat-users.xml
<tomcat-users>
<role rolename="manager"/>
<user username="tomcat" password="tomcat" roles="manager"/>

You can use the XAMPP MySQL engine by making the following changes.
/WEB-INF/applicationContext.xml
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="org.gjt.mm.mysql.Driver" />
<property name="url" value="jdbc:mysql://127.0.0.1:3306/manning" />
<property name="username" value="root" />
<property name="password" value="root" />
</bean>

Point to a JDK of your choice and use the JAVA_OPTS variable to allow debugging in Eclipse.
/bin/startup.bat
SET JAVA_HOME=C:\java\jdk1.6.0_17
SET JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

Eclipse

Add jar files for build from the following:

  • C:\tomcat\lib
  • C:\tomcat\webapps\Struts2InAction\WEB-INF\lib

Picasa Database Location

Looking for a network drive solution because Picasa keeps its thumbnail database and meta data local. Does not work great with a network drive.

Here is the location of the database:
In Windows /Users/%USERNAME%/AppData/Local/Google/Picasa2/db3/

Backing up the photos within Picasa will preserver the meta data. A better solution needs to be found, but none exists at this point.