2011-06-29

Simple and quick

Another great example on a simple type being faster than a object attribute:
PowerTip of the Day > Speed Up Loops.

Another facet of KISS.

2011-06-27

Timestamp difference

I was looking into Windows Application Log and SQL Server Error Log to investigate a incident, and needed to calculate the effective duration of the incident.

This is actually quite simple using PowerShell and the CmdLet Get-Date:
(Get-Date "24-06-2011 08:00:24") - (Get-Date "23-06-2011 16:24:49")

Days              : 0
Hours             : 15
Minutes           : 35
Seconds           : 35
Milliseconds      : 0
Ticks             : 561350000000
TotalDays         : 0,649710648148148
TotalHours        : 15,5930555555556
TotalMinutes      : 935,583333333333
TotalSeconds      : 56135
TotalMilliseconds : 56135000

A more compact answer can be acquired by
((Get-Date "24-06-2011 08:00:24") - (Get-Date "23-06-2011 16:24:49")).ToString()
15:35:35

The statement converts the timestamp strings to DateTime (System.DateTime) objects, subtracts the two objects and returns a TimeSpan (System.TimeSpan) object.

2011-05-31

HP OfficeJet 8000

The last couple of weeks we have had increasing problems with our printer for the entire family. We are using a HP OfficeJet Pro 8000, that is connected to the 1 Gb switch together with the workstations and the router.
More and more documents and web pages failed on printing but remained in the queue and blocked other jobs.
We are using both Secunia and SlimDrivers and neither reported a missing update.

To fix the problem I changed both the printer and the workstations:

  • The WSD was configured for discovery only.
  • The existing printer registration was deleted from Devices and Printers.
  • The port was deleted.
  • The driver was deleted with installation image - together with other HP drivers.
The firmware was updated, so I downloaded and installed the complete package for the printer from HP Support.
Also I downloaded and installed the SLP update.
All our computers are running Windows 7 x64, and used the same installation set.

After a restart all print jobs, that failed before, runs with success.
:-)
We are now challenging the printer for the next couple of weeks with various jobs. If we can avoid a purchase of a new printer, we think we have a success.

The conslusion for the moment must be something like: Do not trust central driver updates.
I know I have said something like this before (ati-driver-on-windows-7), but it is still relevant.

2011-05-06

Failed:(0) Alter failed for Server 'abc\\def'

A maintenance plan created with the wizard failed in a Check Database Integrity task with the message in the log file:
Failed:(0) Alter failed for Server 'abc\\def'.
The SQL Server instance is 2008 SP1 (10.0.2531).

Several writings like the Connect case 126163 is talking about Allow Updates, but setting the I/O affinity to all solved the issue.
The solution is in a discussion on SQL Developer Center.

Unfortunately is the root cause unknown.