Soft Reset for the Ipod

There are many ways to reset a crashed iPod.

Hold pause down until it turns off. (This is just the normal turn off procedure)

Hold center button down and menu until you get apple logo. (This worked for my 5th gen ipod)
If that doesn’t work:
Hold pause and menu until you get the apple logo.

If you need to do a hard reset, also hit the right or left key. (not sure which)

If that doesn’t work you might need to restore from disk.

If that doesn’t work ….well… I don’t know.

Enterprise Library from Patterns & Practices

What is the “Enterprise Library“? Well, look at the .NET framework.  It is big and feature rich.  But what if you want to so something the righ way, like write code with lots of trace & logging commands, lots of try/catch blocks, encrypt lots of potentially secret values, cache stuff for performance or even just retrieve data from the database in a safe, high performance manner?  Well, doing any of these the right way will take ten times as much code.

Every time I catch and error, log it and alert the user, I’m down ten lines of code.  Setting up a stored procedure with parameters is a dozen lines of code, short cutting and using string concatenation takes two lines of code, but is subject to SQL injection attacks.  Encryption, again takes a couple of lines of code each time it is used.

The solution is to use the Enteprise library, which provides a layer on top of the .NET frame work that cuts the number of lines of code it takes to log and event, call a stored procedure or encrypt a string.

Why ASP.NET Themes are important

In order of importance

1) They get cruft out of the HTML code.

2) You can read the HTML code again, especially for datagrids and gridviews

3) You can update the colors of an entire website without editing 1000′s of objects. (Isn’t that always the first response of a non-techie to a website? “I don’t like the colors”)

10000) They make the website pretty

….

500000) It allows users to dynamically change the look of the website

Personal Tech

Summary of Windows Mobile 5.0

Some of the applications are subpar, but upgradable.

Word -> Textmaker

MS Reader -> Mobibook

Media Player -> ?

Whee, recovering a crashed SQL Server

I unplugged my workstation accidentally. On reboot I got, right after the trace for ‘starting up master’:
17207 : udopen: Operating system error 3(The system cannot find the path specified.) during the creation/opening of physical device .
and

FCB::Open failed: Could not open device for virtual device number (VDN) 2.

and

Error: 5105, Severity: 16, State: 4.

Possible causes: database files being held open by virus scan, database files marked as readonly, or the master is hosed.

So I suppose master is hosed. I check for advice on restoring master. I tried the rebuild master utility, which kept failing with error -1. A BUG: report said I might need to restore from a copy of the install files from harddrive, not a copy from disk.

I publish more if I ever get the server back up without just doing a reinstall of the server.

Update: It was faster to reinstall SQL Server than to figure out how restore the master.

Thinking about Logging, Trace, Configuration, Error Handling

Today I was busy hitting my head against a wall of semantics. These are all related issues, but for some reason, we have four systems for dealing with them.
Logging is communication aimed at everyone but the end user.  It is all about the about the moment to moment activities of the application. If you log to the windows system, application or security log,the likely audience is the machine administrator. Maintenance developers may or may not be able to read the security log.  Logging to a persistent store requires the same consideration you give to any other valuable data you would put in a database.  We don’t put the companies payroll into a jumbled text file, why should we do the same with application logs?
Notification is logging aimed at the maintenance developer that need response right now. Most logging that is happening while the end user is ignored unless there is a notification. Don’t expect technicians to check system logs on a daily basis, they have lives–of a sort.
Trace is logging to a non-persistent destination, usually the screen, console or other ephemeral destination.

Error Handling is trace about an entirely unexpected event.  If you tried to open a file and the file didn’t exist, the exception means the developer needs to write code to check for the existence of the file.  The only time error handling should be used as a flow of control is the expected, but impossible to test for in advance situation, like a database connection timing out.  The rest of the time, errors should result in a trace, log entry or notification to the administrator or maintenance developer to take action.  Which leads to the exception to the rule: if none of the above can be expected to solve the problem, then the error should be handle in the flow of control with a message to the user to try again.