Generating Excel Reports in Binary Format

April 26th, 2010

Some years ago I wrote a .NET Class that used the Microsoft Office Interop Services (Microsoft.Office.Interop.Excel). While I wrote it nearly complete to the exact specification I found it was never quite fast enough since a) it was using COM and b) I had to deal with the .NET wrappers for that unmanaged code. Knowing I had to produce the report in binary for optimal performance I pretty much gave up on ever discovering the format of the file… until today, while researching SQL Server Reporting Services when I came across these links:

“OpenOffice.org’s documentation of the Microsoft Excel File Format”

“Microsoft Office Excel 97 – 2007 Binary File Format Specification (*.xls 97-2007 format)”

Happy coding.

Uncategorized

Best Free Image Converter (png to gif)

April 12th, 2010

If you do any web programming you will eventually need to do some image conversions. This is especially true if you download icon libraries that are in PNG and need to convert them to transparent GIFs.

My favorite and free program for this is ImageMagick. You will find the command line tool especially useful for doing batch conversions.

http://www.imagemagick.org/script/index.php

Note: If you can use PNG stick with it as you will lose opacity layers if you convert these to GIF. Unfortunately some older browsers don’t support PNG so I typically use GIF for compatibility reasons.

Uncategorized

Direct2d (hardware acceleration) FireFox

April 8th, 2010

This is amazingly fast… check it out. IE 9 is supposed to have hardware acceleration too…. (btw: this won’t work on XP)

http://www.basschouten.com/blog1.php/2010/03/02/presenting-direct2d-hardware-acceleratio

Uncategorized

JQuery Google Suggest (jquery.gsuggest.js) – update

March 30th, 2010

Make sure you download the latest release. I fixed a bug that showed up in jQuery 1.4.2 (thanks CK for bringing it to my attention)

See more at the original post, JQuery Google Suggest (jquery.gsugguest.js).

jQuery Google Suggest

SQL Server Management Studio Keyboard Shortcuts

March 26th, 2010

Key bindings for SSMS default to Visual Studio scheme… again folks I highly recommend taking the time to learn the shortcuts. Force yourself to use them and your speed will eventually be unmatched.

http://msdn.microsoft.com/en-us/library/ms174205(printer).aspx

Uncategorized

Microsoft Visual C# Default Keybindings

March 24th, 2010

Took a while to find a good printout…. but I highly recommend it if you are looking to code faster with Visual Studio.

http://www.microsoft.com/downloads/details.aspx?familyid=E5F902A8-5BB5-4CC6-907E-472809749973&displaylang=en

Uncategorized

JQuery Google Suggest (jquery.gsuggest.js) – update

February 11th, 2010

Due to a hard drive failure the sample page “SEE IT IN ACTION” for jquery.gsuggest has been down. I rewrote the sample this morning. Keep the comments coming in!

See more at the original post, JQuery Google Suggest (jquery.gsugguest.js).

jQuery Google Suggest

Adobe LiveDocs Alternative – CFQUickDocs

December 28th, 2009

Those of you who do any cf programming have undoubtedly referenced Adobe’s LiveDocs quite a lot… however I find the way the site is structured to be a little slow with the frames and directory tree view. I noticed CFQuickDocs embedded as the default ColdFusion help in Eclipse (with the cf plugin) and it is nice and speedy…. check it out if you have time:

http://www.cfquickdocs.com

Uncategorized

PowerEdge 2650, Rebuilding a Mirror Raid

December 23rd, 2009

One of the drives in the programmers.org server decided to die last night as I was running defrag. Not a big deal, figured I could hot swap it out since I have plenty machiens to pull parts from. Unfortunately I discovered since the drive, while nearly exact in size and speed, was not compatible with an automatic-rebuild for this paticular raid card (PERC something or other).

 

After beating my head against the wall looking for a rebuild utility in the controller configuration application, I eventually discovered when the auto-rebuild fails you have to perform a manual rebuild with Dell’s OpenManage Software. I didn’t have this installed, go figure.

My apologies if you experienced any noticeable outtages.

Uncategorized

Restarting Terminal Services Remotely

December 22nd, 2009

If you find yourself using terminal services a lot to manage various systems you will undoubtedly forget to logout of your sessions from time to time. Depending on the number of allowed and active sessions you could find yourself in a jam and unable to login.

I found myself in a jam and needed to restart terminal services remotely. Here is how I did it.

Yesterday evening, It occurred to me that a simple solution to this is to just restart the services from the command line. You might be wondering, since you can’t get in to run the command how this would work. You have two options:

  1. Execute a command from a web script (if you have ftp or rds access to an application server like ColdFusion or ASP .NET) *see below for more info

  2. Use PsExec (or PsService) part of the PsTools package from Microsoft. A nice collection of command line utilities for server administration I recommend you take the time to checkout.

To execute a command from a web script you will need to do two things. First create a batch file with the commands you wish to execute. Second write a script to securely execute those commands.

[remote.bat]

net stop “Terminal Services”

net start “Terminal Services”

REM echo reboot the machine

REM shutdown -r -t 0

[/remote.cfm]

<cfparam name=”url.key” default=”">

<cfif url.key eq “xya58IE9tsr”>

<cfexecute name=”#expandPath(“remote.bat”)#” variable=”foo”></cfexecute>

<cfoutput>#foo#</cfoutput>

</cfif>

—–

You will see the above script checks for a specific url.key in order to execute… you could easily limit this to a paticular IP or integrate another security method. Just remember not to leave it wide open or you just might have an unauthorized user executing your batch (probably on accident).

*Note that in this case the batch and cfm file reside in the same directory and execute permissions are given by default to each folder in CF. With ASP .NET you will need to make sure you have the ACL set correctly for IUSR or the Impersonated Account inside web.config.

—–

If you don’t have access to an application server, rember to consider PsExec as an option. It is a free tool from Sysinternals, but I recommend you download it as part of a collection of PsTools.

To stop Terminal Services remotely, run :

psexec \\servername net stop “terminal services”

To start Terminal Services remotely, run :

psexec \\servername net start “terminal services”

*don’t forget to add your user account information for this to work. its [-u] & [-p] respectively. See /? or check out the July 2004 issue of Windows IT Pro Magazine for Mark’s article that covers advanced usage of PsExec.

Uncategorized , , ,