April 2007 Entries

Scripting Excel with Javascript

I vastly prefer Javascript over VBScript for many of the reasons describe by Joel On Software and by this MSDN article. Many projects that I work on use Excel for simple data relationships. Most of the data is so simple that it does not warrant a full SQL database, but a single table (spreadsheet) will suffice. I use the spreadsheets to generate files for multiple systems in some cases. For example, in an embedded turbine governor project I used a spreadsheet to map the tagnames to the communication details (rSpeed1 = 32025). The spreadsheet generated a C source file for the...

posted @ Wednesday, April 25, 2007 9:56 AM | Feedback (0)

Command Line Clipboard

I just needed to copy the output of the DOS command dir to another file. The usual mechanism is to send the output to a file, open the file, then copy the contents to the actual destination file. I was sure there must be an utility that would copy output in the command line to the clipboard and indeed I found such an utility. Kudos to Steve Kemp and his clipboard utility. I was able to do what I needed very easily:C:\>dir /s /b *.txt | clipboard - Then just paste into Notepad++ or other application!

posted @ Wednesday, April 04, 2007 4:41 PM | Feedback (0)

Altering SQL Server

I was working on a project last week where I needed to update the columns and data types in tables in SQL Server. It is pretty quick to do this manually such as:ALTER TABLE orders ALTER COLUMN orderid varchar(36) NOT NULL I prefer this compared to the code SQL Server generates in the change script which typically renames the existing table, creates a new table, copies the data from the previous table to the new table, and then restores indices and keys. While that is appropriate for dramatic changes, it is overkill for something of this nature. Since I love...

posted @ Wednesday, April 04, 2007 4:17 PM | Feedback (0)