<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-28160416</id><updated>2008-05-02T06:41:37.062-07:00</updated><title type='text'>Developer Notes</title><link rel='alternate' type='text/html' href='http://developernotes.thomaspowell.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default?start-index=26&amp;max-results=25'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default'/><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://developernotes.thomaspowell.com/atom.xml'/><author><name>Thomas</name></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>37</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-28160416.post-5616992835160353563</id><published>2008-05-02T06:24:00.000-07:00</published><updated>2008-05-02T06:41:37.159-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='startup'/><category scheme='http://www.blogger.com/atom/ns#' term='registry'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><title type='text'>Microsoft Windows startup Registry Settings</title><content type='html'>INFO: Run, RunOnce, RunServices, RunServicesOnce and Startup:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;I believe this is pretty much a bulk of the information set by &lt;a href="http://www.x-setup.net/purchase/index.php"&gt;Xteq X-Setup&lt;/a&gt;.  For those who don't want to make the purchase for a very simple edit, the following is the except from the &lt;a href="http://support.microsoft.com/kb/179365"&gt;Microsoft KB article&lt;/a&gt; &lt;/i&gt; &lt;br /&gt;&lt;br /&gt;General order of loading:&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce&lt;br /&gt;&lt;li&gt;HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices&lt;br /&gt;&lt;li&gt;&amp;lt;Logon Prompt&amp;gt;&lt;br /&gt;&lt;li&gt;HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce &lt;span style="font-style:italic;"&gt;Not supported in NT 3.51 and ignored by XP and 2000 in safe mode&lt;/span&gt;&lt;br /&gt;&lt;li&gt;HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run&lt;br /&gt;&lt;li&gt;HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run&lt;br /&gt;&lt;li&gt;StartUp Folder&lt;br /&gt;&lt;li&gt;HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce  &lt;span style="font-style:italic;"&gt;Not supported in NT 3.51 and ignored by XP and 2000 in safe mode&lt;/span&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;However,&lt;br /&gt;&lt;blockquote&gt;With the exception of the HKEY_LOCAL_MACHINE\...\RunOnce key, all keys and their entries are loaded asynchronously. Therefore, all entries in the RunServices and RunServicesOnce keys can potentially run at the same time.&lt;/blockquote&gt;&lt;br /&gt;&lt;blockquote&gt;Entries in the HKEY_LOCAL_MACHINE\...\RunOnce key are loaded synchronously in an undefined order.&lt;/blockquote&gt;&lt;br /&gt;&lt;blockquote&gt;Because the HKEY_LOCAL_MACHINE\...\RunOnce key is loaded synchronously, all of its entries must finish loading before the HKEY_LOCAL_MACHINE\...\Run, HKEY_CURRENT_USER\...\Run, HKEY_CURRENT_USER\...\RunOnce, and Startup Folder entries can be loaded.&lt;/blockquote&gt;</content><link rel='alternate' type='text/html' href='http://developernotes.thomaspowell.com/2008/05/microsoft-windows-startup-registry.html' title='Microsoft Windows startup Registry Settings'/><link rel='related' href='http://support.microsoft.com/kb/179365' title='Microsoft Windows startup Registry Settings'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28160416&amp;postID=5616992835160353563' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://developernotes.thomaspowell.com/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/5616992835160353563'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/5616992835160353563'/><author><name>Thomas</name></author></entry><entry><id>tag:blogger.com,1999:blog-28160416.post-842863282681491415</id><published>2008-04-11T07:16:00.000-07:00</published><updated>2008-04-11T07:17:18.338-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wmic windows'/><title type='text'>WMIC service cheat sheet.</title><content type='html'>Microsoft's documentation is thorough, but I got a lot more out of the above link.</content><link rel='alternate' type='text/html' href='http://developernotes.thomaspowell.com/2008/04/wmic-service-cheat-sheet.html' title='WMIC service cheat sheet.'/><link rel='related' href='http://www.ss64.com/nt/wmic.html' title='WMIC service cheat sheet.'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28160416&amp;postID=842863282681491415' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://developernotes.thomaspowell.com/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/842863282681491415'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/842863282681491415'/><author><name>Thomas</name></author></entry><entry><id>tag:blogger.com,1999:blog-28160416.post-4572596064590452360</id><published>2008-04-10T13:43:00.001-07:00</published><updated>2008-04-10T13:53:13.719-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VBScript'/><title type='text'>Time since last boot (Windows, VBScript)</title><content type='html'>I don't remember where I found this, I was just happy to find code that did this.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt; strComputer &lt;font color="#ffa0ff"&gt;=&lt;/font&gt; &lt;font color="#90d0ff"&gt;&amp;quot;.&amp;quot;&lt;/font&gt; &lt;font color="#c0c0d0"&gt;' Local computer&lt;/font&gt; &lt;br /&gt;&lt;font color="#40f0a0"&gt;set&lt;/font&gt; objWMIDateTime &lt;font color="#ffa0ff"&gt;=&lt;/font&gt; &lt;font color="#40f0f0"&gt;CreateObject&lt;/font&gt;&lt;font color="#ffa0ff"&gt;(&lt;/font&gt;&lt;font color="#90d0ff"&gt;&amp;quot;WbemScripting.SWbemDateTime&amp;quot;&lt;/font&gt;&lt;font color="#ffa0ff"&gt;)&lt;/font&gt;&lt;br /&gt;&lt;font color="#40f0a0"&gt;set&lt;/font&gt; objWMI &lt;font color="#ffa0ff"&gt;=&lt;/font&gt; &lt;font color="#40f0f0"&gt;GetObject&lt;/font&gt;&lt;font color="#ffa0ff"&gt;(&lt;/font&gt;&lt;font color="#90d0ff"&gt;&amp;quot;winmgmts:\\&amp;quot;&lt;/font&gt; &lt;font color="#ffa0ff"&gt;&amp;amp;&lt;/font&gt; strComputer &lt;font color="#ffa0ff"&gt;&amp;amp;&lt;/font&gt; &lt;font color="#90d0ff"&gt;&amp;quot;\root\cimv2&amp;quot;&lt;/font&gt;&lt;font color="#ffa0ff"&gt;)&lt;/font&gt;&lt;br /&gt;&lt;font color="#40f0a0"&gt;set&lt;/font&gt; colOS &lt;font color="#ffa0ff"&gt;=&lt;/font&gt; objWMI&lt;font color="#ffa0ff"&gt;.&lt;/font&gt;InstancesOf&lt;font color="#ffa0ff"&gt;(&lt;/font&gt;&lt;font color="#90d0ff"&gt;&amp;quot;Win32_OperatingSystem&amp;quot;&lt;/font&gt;&lt;font color="#ffa0ff"&gt;)&lt;/font&gt;&lt;br /&gt;&lt;font color="#ffa0ff"&gt;for&lt;/font&gt; &lt;font color="#ffa0ff"&gt;each&lt;/font&gt; objOS &lt;font color="#ffa0ff"&gt;in&lt;/font&gt; colOS&lt;br /&gt;    objWMIDateTime&lt;font color="#ffa0ff"&gt;.&lt;/font&gt;Value &lt;font color="#ffa0ff"&gt;=&lt;/font&gt; objOS&lt;font color="#ffa0ff"&gt;.&lt;/font&gt;LastBootUpTime&lt;br /&gt;    Wscript&lt;font color="#ffa0ff"&gt;.&lt;/font&gt;Echo &lt;font color="#90d0ff"&gt;&amp;quot;Last Boot Up Time: &amp;quot;&lt;/font&gt; &lt;font color="#ffa0ff"&gt;&amp;amp;&lt;/font&gt; objWMIDateTime&lt;font color="#ffa0ff"&gt;.&lt;/font&gt;GetVarDate &lt;font color="#ffa0ff"&gt;&amp;amp;&lt;/font&gt; vbcrlf &lt;font color="#ffa0ff"&gt;&amp;amp; _&lt;/font&gt;&lt;br /&gt;        &lt;font color="#90d0ff"&gt;&amp;quot;Time Since Last Boot: &amp;quot;&lt;/font&gt; &lt;font color="#ffa0ff"&gt;&amp;amp;&lt;/font&gt;  TimeSpan&lt;font color="#ffa0ff"&gt;(&lt;/font&gt;objWMIDateTime&lt;font color="#ffa0ff"&gt;.&lt;/font&gt;GetVarDate&lt;font color="#ffa0ff"&gt;,&lt;/font&gt;&lt;font color="#40f0f0"&gt;Now&lt;/font&gt;&lt;font color="#ffa0ff"&gt;)&lt;/font&gt; &lt;font color="#ffa0ff"&gt;&amp;amp; _&lt;/font&gt;&lt;br /&gt;        &lt;font color="#90d0ff"&gt;&amp;quot; (hh:mm:ss)&amp;quot;&lt;/font&gt;&lt;br /&gt;&lt;font color="#ffa0ff"&gt;next&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font color="#ffa0ff"&gt;Function&lt;/font&gt; TimeSpan&lt;font color="#ffa0ff"&gt;(&lt;/font&gt;dt1&lt;font color="#ffa0ff"&gt;,&lt;/font&gt; dt2&lt;font color="#ffa0ff"&gt;)&lt;/font&gt;&lt;br /&gt;    &lt;font color="#c0c0d0"&gt;' Function to display the difference between&lt;/font&gt;&lt;br /&gt;    &lt;font color="#c0c0d0"&gt;' 2 dates in hh:mm:ss format&lt;/font&gt;&lt;br /&gt;    &lt;font color="#ffa0ff"&gt;If&lt;/font&gt; &lt;font color="#ffa0ff"&gt;(&lt;/font&gt;&lt;font color="#40f0f0"&gt;isDate&lt;/font&gt;&lt;font color="#ffa0ff"&gt;(&lt;/font&gt;dt1&lt;font color="#ffa0ff"&gt;)&lt;/font&gt; &lt;font color="#ffa0ff"&gt;And&lt;/font&gt; &lt;font color="#40f0f0"&gt;IsDate&lt;/font&gt;&lt;font color="#ffa0ff"&gt;(&lt;/font&gt;dt2&lt;font color="#ffa0ff"&gt;))&lt;/font&gt; &lt;font color="#ffa0ff"&gt;=&lt;/font&gt; &lt;font color="#90d0ff"&gt;false&lt;/font&gt; &lt;font color="#ffa0ff"&gt;Then&lt;/font&gt;&lt;br /&gt;        TimeSpan &lt;font color="#ffa0ff"&gt;=&lt;/font&gt; &lt;font color="#90d0ff"&gt;&amp;quot;00:00:00&amp;quot;&lt;/font&gt;&lt;br /&gt;        &lt;font color="#ffa0ff"&gt;Exit&lt;/font&gt; &lt;font color="#ffa0ff"&gt;Function&lt;/font&gt;&lt;br /&gt;        &lt;font color="#ffa0ff"&gt;End&lt;/font&gt; &lt;font color="#ffa0ff"&gt;If&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;        seconds &lt;font color="#ffa0ff"&gt;=&lt;/font&gt; &lt;font color="#40f0f0"&gt;Abs&lt;/font&gt;&lt;font color="#ffa0ff"&gt;(&lt;/font&gt;&lt;font color="#40f0f0"&gt;DateDiff&lt;/font&gt;&lt;font color="#ffa0ff"&gt;(&lt;/font&gt;&lt;font color="#90d0ff"&gt;&amp;quot;S&amp;quot;&lt;/font&gt;&lt;font color="#ffa0ff"&gt;,&lt;/font&gt; dt1&lt;font color="#ffa0ff"&gt;,&lt;/font&gt; dt2&lt;font color="#ffa0ff"&gt;))&lt;/font&gt;&lt;br /&gt;        minutes &lt;font color="#ffa0ff"&gt;=&lt;/font&gt; seconds \ &lt;font color="#90d0ff"&gt;60&lt;/font&gt;&lt;br /&gt;        hours &lt;font color="#ffa0ff"&gt;=&lt;/font&gt; minutes \ &lt;font color="#90d0ff"&gt;60&lt;/font&gt;&lt;br /&gt;        minutes &lt;font color="#ffa0ff"&gt;=&lt;/font&gt; minutes &lt;font color="#ffa0ff"&gt;mod&lt;/font&gt; &lt;font color="#90d0ff"&gt;60&lt;/font&gt;&lt;br /&gt;        seconds &lt;font color="#ffa0ff"&gt;=&lt;/font&gt; seconds &lt;font color="#ffa0ff"&gt;mod&lt;/font&gt; &lt;font color="#90d0ff"&gt;60&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;        &lt;font color="#ffa0ff"&gt;if&lt;/font&gt; &lt;font color="#40f0f0"&gt;len&lt;/font&gt;&lt;font color="#ffa0ff"&gt;(&lt;/font&gt;hours&lt;font color="#ffa0ff"&gt;)&lt;/font&gt; &lt;font color="#ffa0ff"&gt;=&lt;/font&gt; &lt;font color="#90d0ff"&gt;1&lt;/font&gt; &lt;font color="#ffa0ff"&gt;then&lt;/font&gt; hours &lt;font color="#ffa0ff"&gt;=&lt;/font&gt; &lt;font color="#90d0ff"&gt;&amp;quot;0&amp;quot;&lt;/font&gt; &lt;font color="#ffa0ff"&gt;&amp;amp;&lt;/font&gt; hours&lt;br /&gt;&lt;br /&gt;        TimeSpan &lt;font color="#ffa0ff"&gt;=&lt;/font&gt; hours &lt;font color="#ffa0ff"&gt;&amp;amp;&lt;/font&gt; &lt;font color="#90d0ff"&gt;&amp;quot;:&amp;quot;&lt;/font&gt; &lt;font color="#ffa0ff"&gt;&amp;amp;&lt;/font&gt; _&lt;br /&gt;            &lt;font color="#40f0f0"&gt;RIGHT&lt;/font&gt;&lt;font color="#ffa0ff"&gt;(&lt;/font&gt;&lt;font color="#90d0ff"&gt;&amp;quot;00&amp;quot;&lt;/font&gt; &lt;font color="#ffa0ff"&gt;&amp;amp;&lt;/font&gt; minutes&lt;font color="#ffa0ff"&gt;,&lt;/font&gt; &lt;font color="#90d0ff"&gt;2&lt;/font&gt;&lt;font color="#ffa0ff"&gt;)&lt;/font&gt; &lt;font color="#ffa0ff"&gt;&amp;amp;&lt;/font&gt; &lt;font color="#90d0ff"&gt;&amp;quot;:&amp;quot;&lt;/font&gt; &lt;font color="#ffa0ff"&gt;&amp;amp;&lt;/font&gt; _&lt;br /&gt;            &lt;font color="#40f0f0"&gt;RIGHT&lt;/font&gt;&lt;font color="#ffa0ff"&gt;(&lt;/font&gt;&lt;font color="#90d0ff"&gt;&amp;quot;00&amp;quot;&lt;/font&gt; &lt;font color="#ffa0ff"&gt;&amp;amp;&lt;/font&gt; seconds&lt;font color="#ffa0ff"&gt;,&lt;/font&gt; &lt;font color="#90d0ff"&gt;2&lt;/font&gt;&lt;font color="#ffa0ff"&gt;)&lt;/font&gt;&lt;br /&gt;&lt;font color="#ffa0ff"&gt;End&lt;/font&gt; &lt;font color="#ffa0ff"&gt;Function&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;</content><link rel='alternate' type='text/html' href='http://developernotes.thomaspowell.com/2008/04/time-since-last-boot.html' title='Time since last boot (Windows, VBScript)'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28160416&amp;postID=4572596064590452360' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://developernotes.thomaspowell.com/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/4572596064590452360'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/4572596064590452360'/><author><name>Thomas</name></author></entry><entry><id>tag:blogger.com,1999:blog-28160416.post-7270640002610929360</id><published>2008-03-27T14:03:00.001-07:00</published><updated>2008-03-27T14:05:30.152-07:00</updated><title type='text'>Getting size estimates for tables  in SQL SERVER 2000</title><content type='html'>&lt;pre&gt;&lt;br /&gt;&lt;font color="#9933cc"&gt;&lt;i&gt;-- &lt;a href="http://sqlserver2000.databases.aspfaq.com/how-do-i-get-a-list-of-sql-server-tables-and-their-row-counts.html"&gt;SQL Server tables and row counts&lt;/a&gt;&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;declare tables_cursor &lt;font color="#33aa00"&gt;cursor&lt;/font&gt; &lt;font color="#33aa00"&gt;for&lt;/font&gt; &lt;br /&gt;&lt;font color="#ff6600"&gt;select&lt;/font&gt; name &lt;font color="#33aa00"&gt;from&lt;/font&gt; sysobjects &lt;font color="#33aa00"&gt;where&lt;/font&gt; xtype=&lt;font color="#66ff00"&gt;'U'&lt;/font&gt;&lt;br /&gt;declare @table_name sysname&lt;br /&gt;&lt;br /&gt;open tables_cursor&lt;br /&gt;fetch next &lt;font color="#33aa00"&gt;from&lt;/font&gt; tables_cursor &lt;font color="#33aa00"&gt;INTO&lt;/font&gt; @table_name&lt;br /&gt;&lt;br /&gt;while @@fetch_status = &lt;font color="#339999"&gt;0&lt;/font&gt;&lt;br /&gt;&lt;font color="#33aa00"&gt;begin&lt;/font&gt;&lt;br /&gt;    exec sp_spaceused @table_name&lt;br /&gt;    fetch next &lt;font color="#33aa00"&gt;from&lt;/font&gt; tables_cursor &lt;font color="#33aa00"&gt;INTO&lt;/font&gt; @table_name&lt;br /&gt;&lt;font color="#33aa00"&gt;end&lt;/font&gt;&lt;br /&gt;close tables_cursor&lt;br /&gt;deallocate tables_cursor&lt;br /&gt;&lt;/pre&gt;</content><link rel='alternate' type='text/html' href='http://developernotes.thomaspowell.com/2008/03/getting-size-estimates-for-tables-in.html' title='Getting size estimates for tables  in SQL SERVER 2000'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28160416&amp;postID=7270640002610929360' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://developernotes.thomaspowell.com/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/7270640002610929360'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/7270640002610929360'/><author><name>Thomas</name></author></entry><entry><id>tag:blogger.com,1999:blog-28160416.post-2497476883646684161</id><published>2008-03-25T07:56:00.000-07:00</published><updated>2008-03-25T07:58:56.607-07:00</updated><title type='text'>Restoredb.bat</title><content type='html'>Using osql and trusted connection for SQL Server 2000.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;@&lt;font color="#ffcc00"&gt;echo&lt;/font&gt;&lt;font color="#ff6600"&gt; off&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font color="#ff6600"&gt;if&lt;/font&gt;&lt;font color="#ff6600"&gt; &lt;/font&gt;{&lt;font color="#ffcc00"&gt;%2&lt;/font&gt;}&lt;font color="#ff6600"&gt;==&lt;/font&gt;{} (&lt;br /&gt;    &lt;font color="#ff6600"&gt;call&lt;/font&gt;&lt;font color="#ff6600"&gt; :Usage&lt;/font&gt;&lt;br /&gt;    &lt;font color="#ff6600"&gt;goto&lt;/font&gt;&lt;font color="#ff6600"&gt; :EOF&lt;/font&gt;&lt;br /&gt;)&lt;br /&gt;net stop mssqlserver&lt;br /&gt;net &lt;font color="#ffcc00"&gt;start&lt;/font&gt; mssqlserver&lt;br /&gt;osql -E -d master -Q &lt;font color="#66ff00"&gt;&amp;quot;restore database &lt;/font&gt;&lt;br /&gt;&lt;font color="#ffcc00"&gt;%1&lt;/font&gt;&lt;font color="#66ff00"&gt; from disk='&lt;/font&gt;&lt;font color="#ffcc00"&gt;%2&lt;/font&gt;&lt;font color="#66ff00"&gt;' with replace&amp;quot;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font color="#ff6600"&gt;goto&lt;/font&gt;&lt;font color="#ff6600"&gt; :EOF&lt;/font&gt;&lt;br /&gt;&lt;font color="#9933cc"&gt;&lt;i&gt;::Subroutine area &lt;/i&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font color="#ff6600"&gt;:Usage&lt;/font&gt;&lt;br /&gt;    @&lt;font color="#ffcc00"&gt;echo&lt;/font&gt;&lt;font color="#66ff00"&gt; Syntax: call restoredb.bat DatabaseName &lt;br /&gt;FullDatabaseBackupPath&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font color="#ff6600"&gt;goto&lt;/font&gt;&lt;font color="#ff6600"&gt; :EOF&lt;/font&gt;&lt;br /&gt;&lt;/pre&gt;</content><link rel='alternate' type='text/html' href='http://developernotes.thomaspowell.com/2008/03/restoredbbat.html' title='Restoredb.bat'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28160416&amp;postID=2497476883646684161' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://developernotes.thomaspowell.com/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/2497476883646684161'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/2497476883646684161'/><author><name>Thomas</name></author></entry><entry><id>tag:blogger.com,1999:blog-28160416.post-3639761065047883056</id><published>2008-03-07T17:41:00.000-08:00</published><updated>2008-03-07T18:08:16.044-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web server'/><category scheme='http://www.blogger.com/atom/ns#' term='didiwiki'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>"Playtime" project:  Porting Didiwiki to C#.NET</title><content type='html'>I'm hoping to find time to throw at least a quick port of DidiWiki to C#.NET together.&lt;br /&gt;&lt;br /&gt;Reference 1:  &lt;a href="http://www.c-sharpcorner.com/UploadFile/ialam/CreatingWebServerInCS12022005042042AM/CreatingWebServerInCS.aspx"&gt;Creating your own Web Server using C#&lt;/a&gt; - This article is from 2001, so there might be a significantly better way of doing things.&lt;br /&gt;&lt;br /&gt;Update:  &lt;a href="http://www.codeguru.com/Csharp/.NET/net_general/article.php/c4603#more"&gt;This CodeGuru page&lt;/a&gt; looks like a more original version of the same page.&lt;br /&gt;&lt;br /&gt;Reference 2:  &lt;a href="http://linux-notes.thomaspowell.com/2008/01/didiwiki-05-source-code.html"&gt;Didiwiki Source Code&lt;/a&gt; that I've saved off.  Original maintainer is no longer maintaining.</content><link rel='alternate' type='text/html' href='http://developernotes.thomaspowell.com/2008/03/playtime-project-porting-didiwiki-to.html' title='&quot;Playtime&quot; project:  Porting Didiwiki to C#.NET'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28160416&amp;postID=3639761065047883056' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://developernotes.thomaspowell.com/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/3639761065047883056'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/3639761065047883056'/><author><name>Thomas</name></author></entry><entry><id>tag:blogger.com,1999:blog-28160416.post-635427790530747539</id><published>2008-03-01T08:56:00.000-08:00</published><updated>2008-03-02T10:18:48.894-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql server'/><category scheme='http://www.blogger.com/atom/ns#' term='2005'/><title type='text'>Importing a runningahead log.xml into SQL Server 2005 using OPENXML</title><content type='html'>I don't currently have a work-based use for 2005, so I thought I'd use the only readily available collection of data that I have at my disposal...  my running log.  This is an export file from &lt;a href="http://www.runningahead.com/"&gt;RunningAhead.com&lt;/a&gt;.  I don't think I'm completely loading the XML data yet, and I don't have database tables to load to yet, either.  However, this is my implementation of some OPENXML examples.&lt;br /&gt;&lt;br /&gt;&lt;font face="monospace"&gt;&lt;br /&gt;DECLARE @hdoc int&lt;br&gt;DECLARE @xmlDoc XML&lt;br&gt;&lt;font color="#804040"&gt;&lt;b&gt;SET&lt;/b&gt;&lt;/font&gt;&amp;nbsp;@xmlDoc = (&lt;br&gt;&amp;nbsp;&amp;nbsp;&lt;font color="#804040"&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/font&gt;&amp;nbsp;* &lt;font color="#6a5acd"&gt;FROM&lt;/font&gt;&amp;nbsp;OPENROWSET (&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;BULK &lt;font color="#ff00ff"&gt;'C:\projects\runningahead\log.1.321C02\log.xml'&lt;/font&gt;, SINGLE_CLOB&lt;br&gt;&amp;nbsp;&amp;nbsp;) &lt;font color="#6a5acd"&gt;AS&lt;/font&gt;&amp;nbsp;xmlData&lt;br&gt;)&lt;br&gt;&lt;font color="#804040"&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/font&gt;&amp;nbsp;@xmlDoc&lt;br&gt;&lt;br&gt;EXEC sp_xml_preparedocument @hdoc OUTPUT, @xmlDoc&lt;br&gt;&lt;br&gt;&lt;font color="#804040"&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/font&gt;&amp;nbsp;* &lt;font color="#6a5acd"&gt;FROM&lt;/font&gt;&lt;br&gt;OPENXML(@hdoc, &lt;font color="#ff00ff"&gt;'/RunningAHEADLog/CourseCollection/Course'&lt;/font&gt;, &lt;font color="#ff00ff"&gt;2&lt;/font&gt;)&lt;br&gt;&lt;font color="#6a5acd"&gt;WITH&lt;/font&gt;&lt;br&gt;(&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ID &lt;font color="#2e8b57"&gt;&lt;b&gt;varchar&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;32&lt;/font&gt;),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Name &lt;font color="#2e8b57"&gt;&lt;b&gt;varchar&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;255&lt;/font&gt;) ,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Surface &lt;font color="#2e8b57"&gt;&lt;b&gt;varchar&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;255&lt;/font&gt;),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;City &lt;font color="#2e8b57"&gt;&lt;b&gt;varchar&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;255&lt;/font&gt;),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;State &lt;font color="#2e8b57"&gt;&lt;b&gt;char&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;3&lt;/font&gt;),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Notes &lt;font color="#2e8b57"&gt;&lt;b&gt;varchar&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;255&lt;/font&gt;)&lt;br&gt;)&lt;br&gt;&lt;br&gt;&lt;font color="#804040"&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/font&gt;&amp;nbsp;* &lt;font color="#6a5acd"&gt;FROM&lt;/font&gt;&lt;br&gt;OPENXML(@hdoc, &lt;font color="#ff00ff"&gt;'/RunningAHEADLog/EquipmentCollection/Shoe'&lt;/font&gt;, &lt;font color="#ff00ff"&gt;2&lt;/font&gt;)&lt;br&gt;&lt;font color="#6a5acd"&gt;WITH&lt;/font&gt;&lt;br&gt;(&lt;br&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ID &lt;font color="#2e8b57"&gt;&lt;b&gt;varchar&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;32&lt;/font&gt;),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Make &lt;font color="#2e8b57"&gt;&lt;b&gt;varchar&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;255&lt;/font&gt;) ,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Model &lt;font color="#2e8b57"&gt;&lt;b&gt;varchar&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;255&lt;/font&gt;),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Serial &lt;font color="#2e8b57"&gt;&lt;b&gt;char&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;20&lt;/font&gt;),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;InitDistance &lt;font color="#6a5acd"&gt;decimal&lt;/font&gt;(&lt;font color="#ff00ff"&gt;7&lt;/font&gt;,&lt;font color="#ff00ff"&gt;2&lt;/font&gt;),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PurchaseDate datetime,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Retired &lt;font color="#2e8b57"&gt;&lt;b&gt;char&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;3&lt;/font&gt;),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#6a5acd"&gt;Size&lt;/font&gt;&amp;nbsp;&lt;font color="#2e8b57"&gt;&lt;b&gt;char&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;10&lt;/font&gt;),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SizeSystem &lt;font color="#2e8b57"&gt;&lt;b&gt;char&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;40&lt;/font&gt;)&lt;br&gt;)&lt;br&gt;&lt;br&gt;&lt;font color="#804040"&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/font&gt;&amp;nbsp;* &lt;font color="#6a5acd"&gt;FROM&lt;/font&gt;&lt;br&gt;OPENXML(@hdoc, &lt;font color="#ff00ff"&gt;'/RunningAHEADLog/EventCollection/Run'&lt;/font&gt;, &lt;font color="#ff00ff"&gt;2&lt;/font&gt;)&lt;br&gt;&lt;font color="#6a5acd"&gt;WITH&lt;/font&gt;&lt;br&gt;(&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ID &lt;font color="#2e8b57"&gt;&lt;b&gt;char&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;32&lt;/font&gt;),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#2e8b57"&gt;&lt;b&gt;Date&lt;/b&gt;&lt;/font&gt;&amp;nbsp;datetime,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Time datetime,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#6a5acd"&gt;Type&lt;/font&gt;&amp;nbsp;&lt;font color="#2e8b57"&gt;&lt;b&gt;char&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;15&lt;/font&gt;),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Weight &lt;font color="#6a5acd"&gt;decimal&lt;/font&gt;(&lt;font color="#ff00ff"&gt;4&lt;/font&gt;,&lt;font color="#ff00ff"&gt;1&lt;/font&gt;),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;WeightUnit &lt;font color="#2e8b57"&gt;&lt;b&gt;char&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;12&lt;/font&gt;),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AvgHR tinyint,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MaxHR tinyint,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Quality tinyint,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Effort tinyint,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CourseID &lt;font color="#2e8b57"&gt;&lt;b&gt;char&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;32&lt;/font&gt;),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Distance &lt;font color="#6a5acd"&gt;decimal&lt;/font&gt;(&lt;font color="#ff00ff"&gt;8&lt;/font&gt;,&lt;font color="#ff00ff"&gt;2&lt;/font&gt;),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DistanceUnit &lt;font color="#2e8b57"&gt;&lt;b&gt;char&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;12&lt;/font&gt;),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Duration &lt;font color="#2e8b57"&gt;&lt;b&gt;char&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;20&lt;/font&gt;)&lt;br&gt;)&lt;br&gt;&lt;br&gt;&lt;br&gt;EXEC sp_xml_removedocument @hdoc&lt;br&gt;&lt;/font&gt;</content><link rel='alternate' type='text/html' href='http://developernotes.thomaspowell.com/2008/03/importing-runningahead-logxml-into-sql.html' title='Importing a runningahead log.xml into SQL Server 2005 using OPENXML'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28160416&amp;postID=635427790530747539' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://developernotes.thomaspowell.com/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/635427790530747539'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/635427790530747539'/><author><name>Thomas</name></author></entry><entry><id>tag:blogger.com,1999:blog-28160416.post-2157311769558314196</id><published>2008-02-22T10:31:00.000-08:00</published><updated>2008-02-22T10:51:21.367-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql server'/><title type='text'>Sql Date Time formats.</title><content type='html'>From&lt;a href="http://lists.evolt.org/archive/Week-of-Mon-20020617/115646.html"&gt;http://lists.evolt.org/archive/Week-of-Mon-20020617/115646.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;table border="1" valign="top"&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;without&lt;br&gt;century (yy)&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;with&lt;br&gt;century&lt;br&gt;(yyyy)&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;standard&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;outputformat&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;0 or 100 (*)&lt;/td&gt;&lt;td&gt;default&lt;/td&gt;&lt;td&gt;mon dd yyyy hh:miAM (or PM)&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;101&lt;/td&gt;&lt;td&gt;USA&lt;/td&gt;&lt;td&gt;mm/dd/yy&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;102&lt;/td&gt;&lt;td&gt;ANSI&lt;/td&gt;&lt;td&gt;yy.mm.dd&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;103&lt;/td&gt;&lt;td&gt;British/French&lt;/td&gt;&lt;td&gt;dd/mm/yy&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;104&lt;/td&gt;&lt;td&gt;German&lt;/td&gt;&lt;td&gt;dd.mm.yy&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;5&lt;/td&gt;&lt;td&gt;105&lt;/td&gt;&lt;td&gt;Italian&lt;/td&gt;&lt;td&gt;dd-mm-yy&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;6&lt;/td&gt;&lt;td&gt;106&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;dd mon yy&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;7&lt;/td&gt;&lt;td&gt;107&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;mon dd, yy&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;8&lt;/td&gt;&lt;td&gt;108&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;hh:mm:ss&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;9 or 109 (*)&lt;/td&gt;&lt;td&gt;default &lt;br&gt;milliseconds&lt;/td&gt;&lt;td&gt;mon dd yyyy hh:mi:ss:mmmAM (or PM)&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;10&lt;/td&gt;&lt;td&gt;110&lt;/td&gt;&lt;td&gt;USA&lt;/td&gt;&lt;td&gt;mm-dd-yy&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;11&lt;/td&gt;&lt;td&gt;111&lt;/td&gt;&lt;td&gt;Japan&lt;/td&gt;&lt;td&gt;yy/mm/dd&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;12&lt;/td&gt;&lt;td&gt;112&lt;/td&gt;&lt;td&gt;ISO&lt;/td&gt;&lt;td&gt;yymmdd&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;13 or 113 (*)&lt;/td&gt;&lt;td&gt;Europe default &lt;br&gt;milliseconds&lt;/td&gt;&lt;td&gt;dd mon yyyy hh:mm:ss:mmm(24h)&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;14&lt;/td&gt;&lt;td&gt;114&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;hh:mi:ss:mmm(24h)&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;20&lt;/td&gt;&lt;td&gt;120&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;yyyy-mm-dd hh:mi:ss(24h)&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;21&lt;/td&gt;&lt;td&gt;121&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;yyyy-mm-dd hh:mi:ss.mmm(24h)&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;126&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;yyyy-mm-dd Thh:mm:ss.mmm(no spaces)&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;130&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;dd mon yyyy hh:mi:ss:mmmAM&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;131&lt;/td&gt;&lt;td&gt;-&lt;/td&gt;&lt;td&gt;dd/mm/yy hh:mi:ss:mmmAM&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;   (*) the default values (style 0 or 100, 9 or 109, and&lt;br /&gt;       13 or 113) always return the century (yyyy)</content><link rel='alternate' type='text/html' href='http://developernotes.thomaspowell.com/2008/02/sql-date-time-formats.html' title='Sql Date Time formats.'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28160416&amp;postID=2157311769558314196' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://developernotes.thomaspowell.com/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/2157311769558314196'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/2157311769558314196'/><author><name>Thomas</name></author></entry><entry><id>tag:blogger.com,1999:blog-28160416.post-1889509359492249920</id><published>2008-02-15T06:22:00.000-08:00</published><updated>2008-02-15T06:28:10.394-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows xp'/><category scheme='http://www.blogger.com/atom/ns#' term='registry'/><title type='text'>Run Command Most Recently Used List Storage</title><content type='html'>At least for Windows XP, this list is stored in the registry:&lt;br /&gt;&lt;br /&gt;My Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU&lt;br /&gt;&lt;br /&gt;It looks like there are values \a through \z off of RunMRU, plus \(Default) and \MRUList.  There is string value in MRUList:  e.g., "nkvlsawbhczeyoijfugrtdxpmq", which determines the ordering of MRUList entries.</content><link rel='alternate' type='text/html' href='http://developernotes.thomaspowell.com/2008/02/run-command-most-recently-used-list.html' title='Run Command Most Recently Used List Storage'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28160416&amp;postID=1889509359492249920' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://developernotes.thomaspowell.com/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/1889509359492249920'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/1889509359492249920'/><author><name>Thomas</name></author></entry><entry><id>tag:blogger.com,1999:blog-28160416.post-8872307039453849316</id><published>2008-02-11T10:29:00.000-08:00</published><updated>2008-02-11T10:49:14.651-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Excel'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><category scheme='http://www.blogger.com/atom/ns#' term='Office'/><title type='text'>Miscellaneous Excel tricks that I needed today.</title><content type='html'>How to &lt;a href="http://office.microsoft.com/en-us/excel/HP052346811033.aspx"&gt;hide gridlines&lt;/a&gt; on an Excel Worksheet.&lt;br /&gt;&lt;br /&gt;Select a Worksheet.&lt;br /&gt;Select &lt;u&gt;T&lt;/u&gt;ools-&gt;&lt;u&gt;O&lt;/u&gt;ptions...&lt;br /&gt;On the [View] tab, un-check &lt;u&gt;G&lt;/u&gt;ridlines under the Window Options section.&lt;br /&gt;&lt;br /&gt;Row and column headers, scroll bars, and sheet tabs are also hideable through this tab.&lt;br /&gt;&lt;br /&gt;How to &lt;a href="http://forums.cnet.com/5208-6130_102-0.html?forumID=7&amp;threadID=32038&amp;messageID=367551"&gt;Split and Freeze Panes&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Freeze panes makes very nice title rows (the bottom pane does not scroll into the title row).</content><link rel='alternate' type='text/html' href='http://developernotes.thomaspowell.com/2008/02/miscellaneous-excel-tricks-that-i.html' title='Miscellaneous Excel tricks that I needed today.'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28160416&amp;postID=8872307039453849316' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://developernotes.thomaspowell.com/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/8872307039453849316'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/8872307039453849316'/><author><name>Thomas</name></author></entry><entry><id>tag:blogger.com,1999:blog-28160416.post-2030508148753722324</id><published>2008-02-04T12:29:00.000-08:00</published><updated>2008-02-04T12:33:32.759-08:00</updated><title type='text'>ILASM and ILDASM (.NET "Assembler")</title><content type='html'>&lt;a href="http://www.blong.com/Conferences/DCon2003/ReverseEngineering/ReverseEngineering.htm"&gt;Reverse Engineering To Learn .NET Better&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Accessible via command line using:&lt;br /&gt;Start-&gt;Microsoft Visual Studio 2005-&gt;Visual Studio Tools-&gt;Visual Studio 2005 Command Prompt</content><link rel='alternate' type='text/html' href='http://developernotes.thomaspowell.com/2008/02/ilasm-and-ildasm-net-assembler.html' title='ILASM and ILDASM (.NET &quot;Assembler&quot;)'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28160416&amp;postID=2030508148753722324' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://developernotes.thomaspowell.com/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/2030508148753722324'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/2030508148753722324'/><author><name>Thomas</name></author></entry><entry><id>tag:blogger.com,1999:blog-28160416.post-7198551841408167052</id><published>2008-01-31T12:11:00.000-08:00</published><updated>2008-01-31T12:13:32.020-08:00</updated><title type='text'>C vs C# formatting.</title><content type='html'>&lt;pre&gt;&lt;br /&gt;printf("%05d\n",123);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Console.WriteLine(String.Format("{0:00000}", 123))&lt;br /&gt;&lt;/pre&gt;</content><link rel='alternate' type='text/html' href='http://developernotes.thomaspowell.com/2008/01/c-vs-c-formatting.html' title='C vs C# formatting.'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28160416&amp;postID=7198551841408167052' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://developernotes.thomaspowell.com/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/7198551841408167052'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/7198551841408167052'/><author><name>Thomas</name></author></entry><entry><id>tag:blogger.com,1999:blog-28160416.post-1203853757434981846</id><published>2007-09-11T08:23:00.000-07:00</published><updated>2007-09-11T08:28:12.671-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql server'/><title type='text'>Calculate average daily mileage required to make yearly goal</title><content type='html'>This might be useful if you're programming a running site.  For me, however, I wanted to write this calculation in SQL Server to expand my knowledge some.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;font color="#0000ff"&gt;--Calculates the average daily mileage needed to meet a target yearly mileage goal, based on current mileage.&lt;/font&gt;&lt;br /&gt;&lt;font color="#804040"&gt;&lt;b&gt;CREATE&lt;/b&gt;&lt;/font&gt; &lt;font color="#6a5acd"&gt;FUNCTION&lt;/font&gt; averageDistanceNeeded (@targetMileage &lt;font color="#6a5acd"&gt;decimal&lt;/font&gt;(&lt;font color="#ff00ff"&gt;10&lt;/font&gt;,&lt;font color="#ff00ff"&gt;4&lt;/font&gt;), @currentMileage &lt;font color="#6a5acd"&gt;decimal&lt;/font&gt;(&lt;font color="#ff00ff"&gt;10&lt;/font&gt;,&lt;font color="#ff00ff"&gt;4&lt;/font&gt;))&lt;br /&gt;RETURNS &lt;font color="#6a5acd"&gt;decimal&lt;/font&gt;(&lt;font color="#ff00ff"&gt;10&lt;/font&gt;,&lt;font color="#ff00ff"&gt;4&lt;/font&gt;)&lt;br /&gt;&lt;font color="#6a5acd"&gt;AS&lt;/font&gt;&lt;br /&gt;&lt;font color="#6a5acd"&gt;BEGIN&lt;/font&gt;&lt;br /&gt;    Declare @daysLeft &lt;font color="#6a5acd"&gt;decimal&lt;/font&gt;(&lt;font color="#ff00ff"&gt;10&lt;/font&gt;,&lt;font color="#ff00ff"&gt;4&lt;/font&gt;)&lt;br /&gt;    Declare @dt datetime&lt;br /&gt;&lt;br /&gt;    &lt;font color="#804040"&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/font&gt; @dt = dt &lt;font color="#6a5acd"&gt;from&lt;/font&gt; openquery&lt;br /&gt;    (&lt;br /&gt;        &lt;font color="#ff00ff"&gt;&amp;quot;my-server&amp;quot;&lt;/font&gt;,&lt;br /&gt;        &lt;font color="#ff00ff"&gt;'select dt = getdate()'&lt;/font&gt;&lt;br /&gt;    )&lt;br /&gt;    &lt;font color="#804040"&gt;&lt;b&gt;select&lt;/b&gt;&lt;/font&gt; @daysLeft = datediff(day, @dt, CAST (CAST (YEAR(@dt) &lt;font color="#6a5acd"&gt;AS&lt;/font&gt; &lt;font color="#2e8b57"&gt;&lt;b&gt;VARCHAR&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;4&lt;/font&gt;)) + &lt;font color="#ff00ff"&gt;'-12-31'&lt;/font&gt; &lt;font color="#6a5acd"&gt;AS&lt;/font&gt; DATETIME))&lt;br /&gt;    &lt;font color="#6a5acd"&gt;return&lt;/font&gt; CONVERT(&lt;font color="#6a5acd"&gt;decimal&lt;/font&gt;(&lt;font color="#ff00ff"&gt;10&lt;/font&gt;,&lt;font color="#ff00ff"&gt;4&lt;/font&gt;), (@targetMileage - @currentMileage) / @daysLeft)&lt;br /&gt;&lt;font color="#6a5acd"&gt;END&lt;/font&gt;&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;font color="#0000ff"&gt;--Get average daily mileage needed to reach 2000 miles, based on a current mileage&lt;/font&gt;&lt;br /&gt;&lt;font color="#0000ff"&gt;-- of 960.2&lt;/font&gt;&lt;br /&gt;&lt;font color="#804040"&gt;&lt;b&gt;select&lt;/b&gt;&lt;/font&gt; dbo.averageDistanceNeeded(&lt;font color="#ff00ff"&gt;2000.0&lt;/font&gt;, &lt;font color="#ff00ff"&gt;960.2&lt;/font&gt;)&lt;br /&gt;&lt;/pre&gt;</content><link rel='alternate' type='text/html' href='http://developernotes.thomaspowell.com/2007/09/calculate-average-daily-mileage.html' title='Calculate average daily mileage required to make yearly goal'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28160416&amp;postID=1203853757434981846' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://developernotes.thomaspowell.com/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/1203853757434981846'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/1203853757434981846'/><author><name>Thomas</name></author></entry><entry><id>tag:blogger.com,1999:blog-28160416.post-4771597395703268863</id><published>2007-09-06T07:53:00.001-07:00</published><updated>2007-09-06T08:00:04.696-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql server'/><title type='text'>Further refined version of code searching</title><content type='html'>I have now included views in the search code version.  Both functions now return the object type the result was found in.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;font color="#0000ff"&gt;--Searches stored procedures, functions and views for code&lt;/font&gt;&lt;br /&gt;&lt;font color="#0000ff"&gt;-- containing the stringtosearch&lt;/font&gt;&lt;br /&gt;&lt;font color="#804040"&gt;&lt;b&gt;CREATE&lt;/b&gt;&lt;/font&gt; &lt;font color="#6a5acd"&gt;FUNCTION&lt;/font&gt; findTextInCode (@StringToSearch &lt;font color="#2e8b57"&gt;&lt;b&gt;varchar&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;100&lt;/font&gt;))&lt;br /&gt;RETURNS @fNames &lt;font color="#6a5acd"&gt;TABLE&lt;/font&gt; (search &lt;font color="#2e8b57"&gt;&lt;b&gt;varchar&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;100&lt;/font&gt;), name sysname, &lt;font color="#6a5acd"&gt;type&lt;/font&gt; &lt;font color="#2e8b57"&gt;&lt;b&gt;char&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;2&lt;/font&gt;))&lt;br /&gt;&lt;font color="#6a5acd"&gt;AS&lt;/font&gt;&lt;br /&gt;&lt;font color="#6a5acd"&gt;BEGIN&lt;/font&gt;&lt;br /&gt;   &lt;font color="#804040"&gt;&lt;b&gt;SET&lt;/b&gt;&lt;/font&gt; @StringToSearch = &lt;font color="#ff00ff"&gt;'%'&lt;/font&gt; + @StringToSearch +&lt;font color="#ff00ff"&gt;'%'&lt;/font&gt;&lt;br /&gt;   &lt;font color="#804040"&gt;&lt;b&gt;INSERT&lt;/b&gt;&lt;/font&gt; @fNames&lt;br /&gt;   &lt;font color="#804040"&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/font&gt; &lt;font color="#804040"&gt;&lt;b&gt;DISTINCT&lt;/b&gt;&lt;/font&gt; @stringtosearch, SO.Name, SO.&lt;font color="#6a5acd"&gt;Type&lt;/font&gt;&lt;br /&gt;   &lt;font color="#6a5acd"&gt;FROM&lt;/font&gt; sysobjects SO (NOLOCK)&lt;br /&gt;   INNER JOIN syscomments SC (NOLOCK) &lt;font color="#6a5acd"&gt;on&lt;/font&gt; SO.ID = SC.ID&lt;br /&gt;   &lt;font color="#804040"&gt;&lt;b&gt;AND&lt;/b&gt;&lt;/font&gt; (SO.&lt;font color="#6a5acd"&gt;Type&lt;/font&gt; = &lt;font color="#ff00ff"&gt;'P'&lt;/font&gt; &lt;font color="#804040"&gt;&lt;b&gt;OR&lt;/b&gt;&lt;/font&gt; SO.&lt;font color="#6a5acd"&gt;Type&lt;/font&gt; &lt;font color="#804040"&gt;&lt;b&gt;LIKE&lt;/b&gt;&lt;/font&gt; &lt;font color="#ff00ff"&gt;'%F%'&lt;/font&gt; &lt;font color="#804040"&gt;&lt;b&gt;OR&lt;/b&gt;&lt;/font&gt; SO.&lt;font color="#6a5acd"&gt;Type&lt;/font&gt; = &lt;font color="#ff00ff"&gt;'V'&lt;/font&gt;)&lt;br /&gt;   &lt;font color="#804040"&gt;&lt;b&gt;AND&lt;/b&gt;&lt;/font&gt; SC.Text &lt;font color="#804040"&gt;&lt;b&gt;LIKE&lt;/b&gt;&lt;/font&gt; @stringtosearch&lt;br /&gt;   &lt;font color="#6a5acd"&gt;ORDER&lt;/font&gt; &lt;font color="#6a5acd"&gt;BY&lt;/font&gt; SO.Name&lt;br /&gt;   &lt;font color="#6a5acd"&gt;RETURN&lt;/font&gt;&lt;br /&gt;&lt;font color="#6a5acd"&gt;END&lt;/font&gt;&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;font color="#0000ff"&gt;--Searches column names from stored procedure parameters and function,&lt;/font&gt;&lt;br /&gt;&lt;font color="#0000ff"&gt;-- user tables, and view columns&lt;/font&gt;&lt;br /&gt;&lt;font color="#804040"&gt;&lt;b&gt;CREATE&lt;/b&gt;&lt;/font&gt; &lt;font color="#6a5acd"&gt;FUNCTION&lt;/font&gt; findTextInColumnName (@StringToSearch &lt;font color="#2e8b57"&gt;&lt;b&gt;varchar&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;100&lt;/font&gt;))&lt;br /&gt;RETURNS @fColumnNames &lt;font color="#6a5acd"&gt;TABLE&lt;/font&gt; (tablename sysname, colname sysname, &lt;font color="#6a5acd"&gt;type&lt;/font&gt; &lt;font color="#2e8b57"&gt;&lt;b&gt;char&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;2&lt;/font&gt;))&lt;br /&gt;&lt;font color="#6a5acd"&gt;AS&lt;/font&gt;&lt;br /&gt;&lt;font color="#6a5acd"&gt;BEGIN&lt;/font&gt;&lt;br /&gt;   &lt;font color="#804040"&gt;&lt;b&gt;SET&lt;/b&gt;&lt;/font&gt; @StringToSEarch = &lt;font color="#ff00ff"&gt;'%'&lt;/font&gt; + @StringToSearch + &lt;font color="#ff00ff"&gt;'%'&lt;/font&gt;&lt;br /&gt;   &lt;font color="#804040"&gt;&lt;b&gt;INSERT&lt;/b&gt;&lt;/font&gt; @fColumnNames&lt;br /&gt;   &lt;font color="#804040"&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/font&gt; &lt;font color="#804040"&gt;&lt;b&gt;DISTINCT&lt;/b&gt;&lt;/font&gt; SO.NAME, SC.NAME, SO.&lt;font color="#6a5acd"&gt;TYPE&lt;/font&gt;&lt;br /&gt;   &lt;font color="#6a5acd"&gt;FROM&lt;/font&gt; syscolumns SC (NOLOCK)&lt;br /&gt;INNER JOIN&lt;br /&gt;   sysobjects SO (NOLOCK)&lt;br /&gt;   &lt;font color="#6a5acd"&gt;ON&lt;/font&gt; SC.id = SO.id&lt;br /&gt;   &lt;font color="#6a5acd"&gt;WHERE&lt;/font&gt; SC.NAME &lt;font color="#804040"&gt;&lt;b&gt;LIKE&lt;/b&gt;&lt;/font&gt; @StringToSearch&lt;br /&gt;   &lt;font color="#6a5acd"&gt;ORDER&lt;/font&gt; &lt;font color="#6a5acd"&gt;BY&lt;/font&gt; SC.Name&lt;br /&gt;   &lt;font color="#6a5acd"&gt;RETURN&lt;/font&gt;&lt;br /&gt;&lt;font color="#6a5acd"&gt;END&lt;/font&gt;&lt;br /&gt;&lt;/pre&gt;</content><link rel='alternate' type='text/html' href='http://developernotes.thomaspowell.com/2007/09/further-refined-version-of-code.html' title='Further refined version of code searching'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28160416&amp;postID=4771597395703268863' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://developernotes.thomaspowell.com/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/4771597395703268863'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/4771597395703268863'/><author><name>Thomas</name></author></entry><entry><id>tag:blogger.com,1999:blog-28160416.post-8076872783834191603</id><published>2007-08-16T11:06:00.000-07:00</published><updated>2007-08-16T11:11:35.159-07:00</updated><title type='text'>Further refined Find Text in Column Name</title><content type='html'>Now returns table (or function which returns a table) and column name.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;font color="#804040"&gt;&lt;b&gt;CREATE&lt;/b&gt;&lt;/font&gt; &lt;font color="#6a5acd"&gt;FUNCTION&lt;/font&gt; Find_Text_In_Column_Name (@StringToSearch &lt;font color="#2e8b57"&gt;&lt;b&gt;varchar&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;100&lt;/font&gt;))&lt;br /&gt;RETURNS @fColumnNames &lt;font color="#6a5acd"&gt;TABLE&lt;/font&gt; (tablename sysname, colname sysname)&lt;br /&gt;&lt;font color="#6a5acd"&gt;AS&lt;/font&gt;&lt;br /&gt;&lt;font color="#6a5acd"&gt;BEGIN&lt;/font&gt;&lt;br /&gt;   &lt;font color="#804040"&gt;&lt;b&gt;SET&lt;/b&gt;&lt;/font&gt; @StringToSEarch = &lt;font color="#ff00ff"&gt;'%'&lt;/font&gt; + @StringToSearch + &lt;font color="#ff00ff"&gt;'%'&lt;/font&gt;&lt;br /&gt;   &lt;font color="#804040"&gt;&lt;b&gt;INSERT&lt;/b&gt;&lt;/font&gt; @fColumnNames&lt;br /&gt;   &lt;font color="#804040"&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/font&gt; &lt;font color="#804040"&gt;&lt;b&gt;DISTINCT&lt;/b&gt;&lt;/font&gt; SO.NAME, SC.NAME&lt;br /&gt;   &lt;font color="#6a5acd"&gt;FROM&lt;/font&gt; syscolumns SC (NOLOCK)&lt;br /&gt;INNER JOIN&lt;br /&gt;   sysobjects SO (NOLOCK)&lt;br /&gt;   &lt;font color="#6a5acd"&gt;ON&lt;/font&gt; SC.id = SO.id&lt;br /&gt;   &lt;font color="#6a5acd"&gt;WHERE&lt;/font&gt; SC.NAME &lt;font color="#804040"&gt;&lt;b&gt;LIKE&lt;/b&gt;&lt;/font&gt; @StringToSearch&lt;br /&gt;   &lt;font color="#6a5acd"&gt;ORDER&lt;/font&gt; &lt;font color="#6a5acd"&gt;BY&lt;/font&gt; SC.Name&lt;br /&gt;   &lt;font color="#6a5acd"&gt;RETURN&lt;/font&gt;&lt;br /&gt;&lt;font color="#6a5acd"&gt;END&lt;/font&gt;&lt;br /&gt;&lt;/pre&gt;</content><link rel='alternate' type='text/html' href='http://developernotes.thomaspowell.com/2007/08/further-refined-find-text-in-column.html' title='Further refined Find Text in Column Name'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28160416&amp;postID=8076872783834191603' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://developernotes.thomaspowell.com/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/8076872783834191603'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/8076872783834191603'/><author><name>Thomas</name></author></entry><entry><id>tag:blogger.com,1999:blog-28160416.post-7209558142275750289</id><published>2007-08-16T07:49:00.000-07:00</published><updated>2007-08-16T07:53:21.663-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql server'/><title type='text'>Functions to find text in column names and in stored procedures and function definitions</title><content type='html'>Implemented in SQL Server:&lt;br /&gt;This function finds a text string in a stored procedure or function definition:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;font color="#804040"&gt;&lt;b&gt;CREATE&lt;/b&gt;&lt;/font&gt; &lt;font color="#6a5acd"&gt;FUNCTION&lt;/font&gt; Find_Text_In_SP_or_FN (@StringToSearch &lt;font color="#2e8b57"&gt;&lt;b&gt;varchar&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;100&lt;/font&gt;))&lt;br /&gt;RETURNS @fNames &lt;font color="#6a5acd"&gt;TABLE&lt;/font&gt; (name sysname)&lt;br /&gt;&lt;font color="#6a5acd"&gt;AS&lt;/font&gt;&lt;br /&gt;&lt;font color="#6a5acd"&gt;BEGIN&lt;/font&gt;&lt;br /&gt;   &lt;font color="#804040"&gt;&lt;b&gt;SET&lt;/b&gt;&lt;/font&gt; @StringToSearch = &lt;font color="#ff00ff"&gt;'%'&lt;/font&gt; + @StringToSearch +&lt;font color="#ff00ff"&gt;'%'&lt;/font&gt;&lt;br /&gt;   &lt;font color="#804040"&gt;&lt;b&gt;INSERT&lt;/b&gt;&lt;/font&gt; @fNames&lt;br /&gt;   &lt;font color="#804040"&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/font&gt; &lt;font color="#804040"&gt;&lt;b&gt;DISTINCT&lt;/b&gt;&lt;/font&gt; SO.Name&lt;br /&gt;   &lt;font color="#6a5acd"&gt;FROM&lt;/font&gt; sysobjects SO (NOLOCK)&lt;br /&gt;   INNER JOIN syscomments SC (NOLOCK) &lt;font color="#6a5acd"&gt;on&lt;/font&gt; SO.ID = SC.ID&lt;br /&gt;   &lt;font color="#804040"&gt;&lt;b&gt;AND&lt;/b&gt;&lt;/font&gt; (SO.&lt;font color="#6a5acd"&gt;Type&lt;/font&gt; = &lt;font color="#ff00ff"&gt;'P'&lt;/font&gt; &lt;font color="#804040"&gt;&lt;b&gt;OR&lt;/b&gt;&lt;/font&gt; SO.&lt;font color="#6a5acd"&gt;Type&lt;/font&gt; &lt;font color="#804040"&gt;&lt;b&gt;LIKE&lt;/b&gt;&lt;/font&gt; &lt;font color="#ff00ff"&gt;'%F%'&lt;/font&gt;)&lt;br /&gt;   &lt;font color="#804040"&gt;&lt;b&gt;AND&lt;/b&gt;&lt;/font&gt; SC.Text &lt;font color="#804040"&gt;&lt;b&gt;LIKE&lt;/b&gt;&lt;/font&gt; @stringtosearch&lt;br /&gt;   &lt;font color="#6a5acd"&gt;ORDER&lt;/font&gt; &lt;font color="#6a5acd"&gt;BY&lt;/font&gt; SO.Name&lt;br /&gt;   &lt;font color="#6a5acd"&gt;RETURN&lt;/font&gt;&lt;br /&gt;&lt;font color="#6a5acd"&gt;END&lt;/font&gt;&lt;br /&gt;GO&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This function finds a text string in a column name:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;font color="#804040"&gt;&lt;b&gt;CREATE&lt;/b&gt;&lt;/font&gt; &lt;font color="#6a5acd"&gt;FUNCTION&lt;/font&gt; Find_Text_In_Column_Name (@StringToSearch &lt;font color="#2e8b57"&gt;&lt;b&gt;varchar&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;100&lt;/font&gt;))&lt;br /&gt;RETURNS @fColumnNames &lt;font color="#6a5acd"&gt;TABLE&lt;/font&gt; (colname sysname)&lt;br /&gt;&lt;font color="#6a5acd"&gt;AS&lt;/font&gt;&lt;br /&gt;&lt;font color="#6a5acd"&gt;BEGIN&lt;/font&gt;&lt;br /&gt;   &lt;font color="#804040"&gt;&lt;b&gt;SET&lt;/b&gt;&lt;/font&gt; @StringToSEarch = &lt;font color="#ff00ff"&gt;'%'&lt;/font&gt; + @StringToSearch + &lt;font color="#ff00ff"&gt;'%'&lt;/font&gt;&lt;br /&gt;   &lt;font color="#804040"&gt;&lt;b&gt;INSERT&lt;/b&gt;&lt;/font&gt; @fColumnNames&lt;br /&gt;   &lt;font color="#804040"&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/font&gt; &lt;font color="#804040"&gt;&lt;b&gt;DISTINCT&lt;/b&gt;&lt;/font&gt; SC.NAME&lt;br /&gt;   &lt;font color="#6a5acd"&gt;FROM&lt;/font&gt; syscolumns SC (NOLOCK)&lt;br /&gt;   &lt;font color="#6a5acd"&gt;WHERE&lt;/font&gt; SC.NAME &lt;font color="#804040"&gt;&lt;b&gt;LIKE&lt;/b&gt;&lt;/font&gt; @StringToSearch&lt;br /&gt;   &lt;font color="#6a5acd"&gt;ORDER&lt;/font&gt; &lt;font color="#6a5acd"&gt;BY&lt;/font&gt; SC.Name&lt;br /&gt;   &lt;font color="#6a5acd"&gt;RETURN&lt;/font&gt;&lt;br /&gt;&lt;font color="#6a5acd"&gt;END&lt;/font&gt;&lt;br /&gt;GO&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Some example usage for the novices:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;font color="#804040"&gt;&lt;b&gt;select&lt;/b&gt;&lt;/font&gt; * &lt;font color="#6a5acd"&gt;from&lt;/font&gt; Find_Text_In_SP_or_FN(&lt;font color="#ff00ff"&gt;'addr'&lt;/font&gt;)&lt;br /&gt;GO&lt;br /&gt;&lt;font color="#804040"&gt;&lt;b&gt;Select&lt;/b&gt;&lt;/font&gt; * &lt;font color="#6a5acd"&gt;from&lt;/font&gt; Find_Text_In_Column_Name(&lt;font color="#ff00ff"&gt;'city'&lt;/font&gt;)&lt;br /&gt;GO&lt;br /&gt;&lt;font color="#804040"&gt;&lt;b&gt;Select&lt;/b&gt;&lt;/font&gt; * &lt;font color="#6a5acd"&gt;from&lt;/font&gt; Find_Text_In_Column_Name(&lt;font color="#ff00ff"&gt;'state'&lt;/font&gt;)&lt;br /&gt;GO&lt;br /&gt;&lt;/pre&gt;</content><link rel='alternate' type='text/html' href='http://developernotes.thomaspowell.com/2007/08/functions-to-find-text-in-column-names.html' title='Functions to find text in column names and in stored procedures and function definitions'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28160416&amp;postID=7209558142275750289' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://developernotes.thomaspowell.com/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/7209558142275750289'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/7209558142275750289'/><author><name>Thomas</name></author></entry><entry><id>tag:blogger.com,1999:blog-28160416.post-23152554472837253</id><published>2007-08-15T13:00:00.000-07:00</published><updated>2007-08-15T13:12:44.047-07:00</updated><title type='text'>Google code search for "I'm an idiot"</title><content type='html'>My new favorite toy:  Google code search&lt;br /&gt;&lt;br /&gt;Some interesting comments and such left in code:  &lt;a href="http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=file%3A%5C.c%24+%22I%27m+an+idiot%22&amp;btnG=Search"&gt;I'm an idiot&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=file%3A%5C.c%24+%22Why+the+hell%22&amp;btnG=Search"&gt;Why the hell&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=file%3A%5C.c%24+wtf&amp;btnG=Search"&gt;wtf&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=%22some+idiot%22&amp;btnG=Search"&gt;Some idiot&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=file%3A%5C.c%24+%22what+an+idiot%22&amp;btnG=Search"&gt;What an idiot&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Google code search even does regex.  How about a &lt;a href="http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=file%3A%5C.c%24+%22%21%3F%22+%7C+%22%3F%21%22+%5B%3F%21%5D%7B7%7D&amp;btnG=Search"&gt;string of random ? and !&lt;/a&gt;?</content><link rel='alternate' type='text/html' href='http://developernotes.thomaspowell.com/2007/08/google-code-search-for-im-idiot.html' title='Google code search for &quot;I&apos;m an idiot&quot;'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28160416&amp;postID=23152554472837253' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://developernotes.thomaspowell.com/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/23152554472837253'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/23152554472837253'/><author><name>Thomas</name></author></entry><entry><id>tag:blogger.com,1999:blog-28160416.post-8537226626163688165</id><published>2007-07-19T11:26:00.000-07:00</published><updated>2007-07-19T11:34:23.019-07:00</updated><title type='text'>Windows XP Keyboard Navigation</title><content type='html'>&lt;h2&gt;In Explorer:&lt;/h2&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&amp;quot;&amp;lt;ALT&amp;gt;VOU&amp;quot; - Go up one level (&lt;u&gt;V&lt;/u&gt;iew, G&lt;u&gt;o&lt;/u&gt; To, &lt;u&gt;U&lt;/u&gt;p one level&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;</content><link rel='alternate' type='text/html' href='http://developernotes.thomaspowell.com/2007/07/windows-xp-keyboard-navigation.html' title='Windows XP Keyboard Navigation'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28160416&amp;postID=8537226626163688165' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://developernotes.thomaspowell.com/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/8537226626163688165'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/8537226626163688165'/><author><name>Thomas</name></author></entry><entry><id>tag:blogger.com,1999:blog-28160416.post-6839609535198602189</id><published>2007-07-12T07:09:00.000-07:00</published><updated>2007-07-12T11:25:57.507-07:00</updated><title type='text'>Stored procedure to search functions and stored procedures.</title><content type='html'>&lt;pre&gt;&lt;br /&gt;&lt;font color="#0000ff"&gt;-- Altered slightly from &lt;a href="http://www.knowdotnet.com/articles/storedprocfinds.html"&gt;http://www.knowdotnet.com/articles/storedprocfinds.html&lt;/a&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color="#804040"&gt;&lt;b&gt;CREATE&lt;/b&gt;&lt;/font&gt; &lt;font color="#6a5acd"&gt;PROCEDURE&lt;/font&gt; Find_Text_In_SP_or_FN (@StringToSearch &lt;font color="#2e8b57"&gt;&lt;b&gt;varchar&lt;/b&gt;&lt;/font&gt;(&lt;font color="#ff00ff"&gt;100&lt;/font&gt;))&lt;br /&gt;&lt;font color="#6a5acd"&gt;AS&lt;/font&gt;&lt;br /&gt;   &lt;font color="#804040"&gt;&lt;b&gt;SET&lt;/b&gt;&lt;/font&gt; @StringToSearch = &lt;font color="#ff00ff"&gt;'%'&lt;/font&gt; + @StringToSearch +&lt;font color="#ff00ff"&gt;'%'&lt;/font&gt;&lt;br /&gt;   &lt;font color="#804040"&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/font&gt; &lt;font color="#804040"&gt;&lt;b&gt;DISTINCT&lt;/b&gt;&lt;/font&gt; SO.Name&lt;br /&gt;   &lt;font color="#6a5acd"&gt;FROM&lt;/font&gt; sysobjects SO (NOLOCK)&lt;br /&gt;   INNER JOIN syscomments SC (NOLOCK) &lt;font color="#6a5acd"&gt;on&lt;/font&gt; SO.ID = SC.ID&lt;br /&gt;   &lt;font color="#804040"&gt;&lt;b&gt;AND&lt;/b&gt;&lt;/font&gt; (SO.&lt;font color="#6a5acd"&gt;Type&lt;/font&gt; = &lt;font color="#ff00ff"&gt;'P'&lt;/font&gt; &lt;font color="#804040"&gt;&lt;b&gt;OR&lt;/b&gt;&lt;/font&gt; SO.&lt;font color="#6a5acd"&gt;Type&lt;/font&gt; LIKE &lt;font color="#ff00ff"&gt;'%F%'&lt;/font&gt;)&lt;br /&gt;   &lt;font color="#804040"&gt;&lt;b&gt;AND&lt;/b&gt;&lt;/font&gt; SC.Text &lt;font color="#804040"&gt;&lt;b&gt;LIKE&lt;/b&gt;&lt;/font&gt; @stringtosearch&lt;br /&gt;   &lt;font color="#6a5acd"&gt;ORDER&lt;/font&gt; &lt;font color="#6a5acd"&gt;BY&lt;/font&gt; SO.Name&lt;br /&gt;GO&lt;br /&gt;&lt;/pre&gt;</content><link rel='alternate' type='text/html' href='http://developernotes.thomaspowell.com/2007/07/stored-procedure-to-search-functions.html' title='Stored procedure to search functions and stored procedures.'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28160416&amp;postID=6839609535198602189' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://developernotes.thomaspowell.com/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/6839609535198602189'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/6839609535198602189'/><author><name>Thomas</name></author></entry><entry><id>tag:blogger.com,1999:blog-28160416.post-5505502948624893499</id><published>2007-06-10T21:29:00.000-07:00</published><updated>2007-06-10T21:34:55.524-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='awk'/><title type='text'>Turn pseudo-enums expressed as #defines into strings.</title><content type='html'>I have an include file that has 50+ #defines with constants (0,1,2,3,...,etc).  I have a dump program to dump the data structure that these #defines are used in into a .csv file.  I used this little script to dump case statements out for the #defines, with readable strings instead of arbitrary constant values.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;cat &lt;span style="color:#6a5acd;"&gt;$1&lt;/span&gt; | awk '&lt;span style="color:#ff00ff;"&gt;/#define/&lt;/span&gt;{&lt;br /&gt;   &lt;span style="color:#804040;"&gt;&lt;b&gt;print&lt;/b&gt;&lt;/span&gt; &lt;span style="color:#ff00ff;"&gt;"&lt;/span&gt;&lt;span style="color:#6a5acd;"&gt;\t\t&lt;/span&gt;&lt;span style="color:#ff00ff;"&gt;case "&lt;/span&gt; &lt;span style="color:#6a5acd;"&gt;$2&lt;/span&gt; &lt;span style="color:#ff00ff;"&gt;":"&lt;/span&gt;&lt;span style="color:#6a5acd;"&gt;;&lt;/span&gt;&lt;br /&gt;   &lt;span style="color:#804040;"&gt;&lt;b&gt;print&lt;/b&gt;&lt;/span&gt; &lt;span style="color:#ff00ff;"&gt;"&lt;/span&gt;&lt;span style="color:#6a5acd;"&gt;\t\t\t&lt;/span&gt;&lt;span style="color:#ff00ff;"&gt;fprintf(out_csv_fp,&lt;/span&gt;&lt;span style="color:#6a5acd;"&gt;\"&lt;/span&gt;&lt;span style="color:#ff00ff;"&gt;,"&lt;/span&gt; &lt;span style="color:#6a5acd;"&gt;$2&lt;/span&gt; &lt;span style="color:#ff00ff;"&gt;"&lt;/span&gt;&lt;span style="color:#6a5acd;"&gt;\"&lt;/span&gt;&lt;span style="color:#ff00ff;"&gt;);"&lt;/span&gt;&lt;span style="color:#6a5acd;"&gt;;&lt;/span&gt;&lt;br /&gt;   &lt;span style="color:#804040;"&gt;&lt;b&gt;print&lt;/b&gt;&lt;/span&gt; &lt;span style="color:#ff00ff;"&gt;"&lt;/span&gt;&lt;span style="color:#6a5acd;"&gt;\t\t\t&lt;/span&gt;&lt;span style="color:#ff00ff;"&gt;break;"&lt;/span&gt;&lt;span style="color:#6a5acd;"&gt;;&lt;/span&gt;&lt;br /&gt;}' &amp;gt; out.txt&lt;br /&gt;&lt;/pre&gt;</content><link rel='alternate' type='text/html' href='http://developernotes.thomaspowell.com/2007/06/turn-pseudo-enums-expressed-as-defines.html' title='Turn pseudo-enums expressed as #defines into strings.'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28160416&amp;postID=5505502948624893499' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://developernotes.thomaspowell.com/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/5505502948624893499'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/5505502948624893499'/><author><name>Thomas</name></author></entry><entry><id>tag:blogger.com,1999:blog-28160416.post-9141820950018209263</id><published>2007-06-10T21:14:00.000-07:00</published><updated>2007-06-10T21:35:14.645-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='awk'/><title type='text'>Awk script to quote all parameters for a given function name.</title><content type='html'>I was trying to maintain a program that wrote 200+ lines to a single file, using a single repeated function call--many of which had all NULL parameters.  There were also occasional loops involved.  The data was position based, so NULL writes counted.&lt;br /&gt;&lt;br /&gt;I was just trying to figure out:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;How many times a given function was called.&lt;/li&gt;&lt;li&gt;At what position actual data occurred.&lt;/li&gt;&lt;/ol&gt;I created a stub function of the original offending function that logged to a file what # call this was and the data passed.  Then I copied the offending functions' caller and substituted offending function calls using this script, which quotes all passed parameters (note: already quoted parameters would need a little more work):&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(106, 90, 205);"&gt;BEGIN&lt;/span&gt; {&lt;br /&gt;  &lt;span style="color: rgb(106, 90, 205);"&gt;OFS&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;","&lt;/span&gt;&lt;br /&gt;}&lt;br /&gt;&lt;span style="color: rgb(255, 0, 255);"&gt;/repeated_function_name/&lt;/span&gt;{&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(128, 64, 64);"&gt;&lt;b&gt;for&lt;/b&gt;&lt;/span&gt;(i=&lt;span style="color: rgb(255, 0, 255);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(106, 90, 205);"&gt;;&lt;/span&gt; i&amp;lt;=&lt;span style="color: rgb(106, 90, 205);"&gt;NF&lt;/span&gt;&lt;span style="color: rgb(106, 90, 205);"&gt;;&lt;/span&gt; i++)&lt;br /&gt;  {&lt;br /&gt;      &lt;span style="color: rgb(128, 64, 64);"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/span&gt;(i==&lt;span style="color: rgb(255, 0, 255);"&gt;1&lt;/span&gt;)&lt;br /&gt;      {&lt;br /&gt;          &lt;span style="color: rgb(0, 128, 128);"&gt;sub&lt;/span&gt;(&lt;span style="color: rgb(255, 0, 255);"&gt;"[(]"&lt;/span&gt;&lt;span style="color: rgb(106, 90, 205);"&gt;,&lt;/span&gt; &lt;span style="color: rgb(255, 0, 255);"&gt;"(&lt;/span&gt;&lt;span style="color: rgb(106, 90, 205);"&gt;\"&lt;/span&gt;&lt;span style="color: rgb(255, 0, 255);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(106, 90, 205);"&gt;,&lt;/span&gt; $i)&lt;span style="color: rgb(106, 90, 205);"&gt;;&lt;/span&gt;&lt;br /&gt;      }&lt;br /&gt;      &lt;span style="color: rgb(128, 64, 64);"&gt;&lt;b&gt;else&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;      {&lt;br /&gt;          &lt;span style="color: rgb(0, 128, 128);"&gt;sub&lt;/span&gt;(&lt;span style="color: rgb(255, 0, 255);"&gt;"^[ ]*"&lt;/span&gt;&lt;span style="color: rgb(106, 90, 205);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(255, 0, 255);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(106, 90, 205);"&gt;\"&lt;/span&gt;&lt;span style="color: rgb(255, 0, 255);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(106, 90, 205);"&gt;,&lt;/span&gt; $i)&lt;span style="color: rgb(106, 90, 205);"&gt;;&lt;/span&gt;&lt;br /&gt;      }&lt;br /&gt;      &lt;span style="color: rgb(128, 64, 64);"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/span&gt;(i==&lt;span style="color: rgb(106, 90, 205);"&gt;NF&lt;/span&gt;)&lt;br /&gt;      {&lt;br /&gt;          &lt;span style="color: rgb(0, 128, 128);"&gt;sub&lt;/span&gt;(&lt;span style="color: rgb(255, 0, 255);"&gt;"[)]"&lt;/span&gt;&lt;span style="color: rgb(106, 90, 205);"&gt;,&lt;/span&gt; &lt;span style="color: rgb(255, 0, 255);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(106, 90, 205);"&gt;\"&lt;/span&gt;&lt;span style="color: rgb(255, 0, 255);"&gt;)"&lt;/span&gt;&lt;span style="color: rgb(106, 90, 205);"&gt;,&lt;/span&gt; $i)&lt;span style="color: rgb(106, 90, 205);"&gt;;&lt;/span&gt;&lt;br /&gt;      }&lt;br /&gt;      &lt;span style="color: rgb(128, 64, 64);"&gt;&lt;b&gt;else&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;      {&lt;br /&gt;          &lt;span style="color: rgb(0, 128, 128);"&gt;sub&lt;/span&gt;(&lt;span style="color: rgb(255, 0, 255);"&gt;"[ ]*$"&lt;/span&gt;&lt;span style="color: rgb(106, 90, 205);"&gt;,&lt;/span&gt; &lt;span style="color: rgb(255, 0, 255);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(106, 90, 205);"&gt;\"&lt;/span&gt;&lt;span style="color: rgb(255, 0, 255);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(106, 90, 205);"&gt;,&lt;/span&gt; $i)&lt;span style="color: rgb(106, 90, 205);"&gt;;&lt;/span&gt;&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(128, 64, 64);"&gt;&lt;b&gt;print&lt;/b&gt;&lt;/span&gt; &lt;span style="color: rgb(106, 90, 205);"&gt;$0&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: rgb(128, 64, 64);"&gt;&lt;b&gt;next&lt;/b&gt;&lt;/span&gt;&lt;span style="color: rgb(106, 90, 205);"&gt;;&lt;/span&gt;&lt;br /&gt;}&lt;br /&gt;{ &lt;span style="color: rgb(128, 64, 64);"&gt;&lt;b&gt;print&lt;/b&gt;&lt;/span&gt; &lt;span style="color: rgb(106, 90, 205);"&gt;$0&lt;/span&gt;&lt;span style="color: rgb(106, 90, 205);"&gt;;&lt;/span&gt; }&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;</content><link rel='alternate' type='text/html' href='http://developernotes.thomaspowell.com/2007/06/awk-script-to-quote-all-parameters-for.html' title='Awk script to quote all parameters for a given function name.'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28160416&amp;postID=9141820950018209263' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://developernotes.thomaspowell.com/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/9141820950018209263'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/9141820950018209263'/><author><name>Thomas</name></author></entry><entry><id>tag:blogger.com,1999:blog-28160416.post-6524163389390946000</id><published>2007-05-29T13:19:00.000-07:00</published><updated>2007-05-29T13:23:25.469-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='awk'/><title type='text'>Awk to split c functions into multiple files.</title><content type='html'>This, at present, is overly simplistic and makes many stupid assumptions:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;That the return type is short.&lt;/li&gt;&lt;li&gt;That there are no short global variables declared.&lt;/li&gt;&lt;li&gt;That everything is well-formatted so that the return type is always first column, and that there is a space between both function name and return type (as in, only spaces--no comments)  and function name and open parenthesis of the arg list.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;cat &lt;font color="#6a5acd"&gt;$1&lt;/font&gt; | awk '&lt;br /&gt;&lt;font color="#6a5acd"&gt;BEGIN&lt;/font&gt; {&lt;br /&gt;    functionNameFile=&lt;font color="#ff00ff"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;font color="#6a5acd"&gt;;&lt;/font&gt;&lt;br /&gt;}&lt;br /&gt;&lt;font color="#ff00ff"&gt;/&lt;/font&gt;&lt;font color="#6a5acd"&gt;^&lt;/font&gt;&lt;font color="#ff00ff"&gt;short/&lt;/font&gt; {&lt;br /&gt;    &lt;font color="#ff00ff"&gt;/&lt;/font&gt;&lt;font color="#6a5acd"&gt;*&lt;/font&gt;&lt;font color="#ff00ff"&gt; assumes return type of short &lt;/font&gt;&lt;font color="#6a5acd"&gt;*&lt;/font&gt;&lt;font color="#ff00ff"&gt;/&lt;/font&gt;&lt;br /&gt;    &lt;font color="#ff00ff"&gt;/&lt;/font&gt;&lt;font color="#6a5acd"&gt;*&lt;/font&gt;&lt;font color="#ff00ff"&gt; assumes space between return type, function name, and parm list &lt;/font&gt;&lt;font color="#6a5acd"&gt;*&lt;/font&gt;&lt;font color="#ff00ff"&gt;/&lt;/font&gt;&lt;br /&gt;    functionNameFile=&lt;font color="#6a5acd"&gt;$2&lt;/font&gt;.&lt;font color="#ff00ff"&gt;&amp;quot;.c&amp;quot;&lt;/font&gt;&lt;font color="#6a5acd"&gt;;&lt;/font&gt;&lt;br /&gt;    &lt;font color="#804040"&gt;&lt;b&gt;print&lt;/b&gt;&lt;/font&gt; &lt;font color="#6a5acd"&gt;$0&lt;/font&gt; &amp;gt; functionNameFile&lt;font color="#6a5acd"&gt;;&lt;/font&gt;&lt;br /&gt;}&lt;br /&gt;&lt;font color="#ff00ff"&gt;/&lt;/font&gt;&lt;font color="#6a5acd"&gt;^&lt;/font&gt;&lt;font color="#6a5acd"&gt;\}&lt;/font&gt;&lt;font color="#ff00ff"&gt;/&lt;/font&gt; {&lt;br /&gt;    &lt;font color="#804040"&gt;&lt;b&gt;print&lt;/b&gt;&lt;/font&gt; &lt;font color="#6a5acd"&gt;$0&lt;/font&gt; &amp;gt;&amp;gt; functionNameFile&lt;font color="#6a5acd"&gt;;&lt;/font&gt;&lt;br /&gt;    functionNameFile=&lt;font color="#ff00ff"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;font color="#6a5acd"&gt;;&lt;/font&gt;&lt;br /&gt;    &lt;font color="#804040"&gt;&lt;b&gt;next&lt;/b&gt;&lt;/font&gt;&lt;font color="#6a5acd"&gt;;&lt;/font&gt;&lt;br /&gt;}&lt;br /&gt;{&lt;br /&gt;    &lt;font color="#804040"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt;(functionNameFile    != &lt;font color="#ff00ff"&gt;&amp;quot;&amp;quot;&lt;/font&gt;) {&lt;br /&gt;        &lt;font color="#804040"&gt;&lt;b&gt;print&lt;/b&gt;&lt;/font&gt; &lt;font color="#6a5acd"&gt;$0&lt;/font&gt; &amp;gt;&amp;gt; functionNameFile&lt;font color="#6a5acd"&gt;;&lt;/font&gt;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;'&lt;br /&gt;&lt;/pre&gt;</content><link rel='alternate' type='text/html' href='http://developernotes.thomaspowell.com/2007/05/awk-to-split-c-functions-into-multiple.html' title='Awk to split c functions into multiple files.'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28160416&amp;postID=6524163389390946000' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://developernotes.thomaspowell.com/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/6524163389390946000'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/6524163389390946000'/><author><name>Thomas</name></author></entry><entry><id>tag:blogger.com,1999:blog-28160416.post-3468812514750452747</id><published>2007-05-29T09:52:00.000-07:00</published><updated>2007-05-29T09:55:27.486-07:00</updated><title type='text'>Windows Vista problems resticting GNU GCC apps to 32MB</title><content type='html'>Disturbing to see this come about:&lt;br /&gt;&lt;a href="http://www.trnicely.net/misc/vista.html"&gt;Windows Vista problems resticting GNU GCC apps to 32MB&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Buried in the footnotes is a note about a response supposedly coming from a Microsoft representative saying, "now that people are asking for this, we are planning to fix..."</content><link rel='alternate' type='text/html' href='http://developernotes.thomaspowell.com/2007/05/windows-vista-problems-resticting-gnu.html' title='Windows Vista problems resticting GNU GCC apps to 32MB'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28160416&amp;postID=3468812514750452747' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://developernotes.thomaspowell.com/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/3468812514750452747'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/3468812514750452747'/><author><name>Thomas</name></author></entry><entry><id>tag:blogger.com,1999:blog-28160416.post-4231333832579242266</id><published>2007-04-26T06:15:00.000-07:00</published><updated>2007-04-26T06:18:33.285-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='awk'/><title type='text'>(g)awk script to remove last dir from PATH</title><content type='html'>This script chops off the last dir off of the PATH (still need to assign back to PATH)&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;font color="#a52a2a"&gt;&lt;b&gt;echo&lt;/b&gt;&lt;/font&gt;&lt;font color="#ff00ff"&gt; &lt;/font&gt;&lt;font color="#a020f0"&gt;$PATH&lt;/font&gt;&lt;font color="#ff00ff"&gt; &lt;/font&gt;&lt;font color="#a52a2a"&gt;&lt;b&gt;|&lt;/b&gt;&lt;/font&gt; gawk &lt;font color="#6a5acd"&gt;-F&lt;/font&gt;&lt;font color="#a52a2a"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#ff00ff"&gt;:&lt;/font&gt;&lt;font color="#a52a2a"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt; &lt;font color="#a52a2a"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;font color="#ff00ff"&gt;{&lt;/font&gt;&lt;br /&gt;&lt;font color="#6a5acd"&gt;    &lt;/font&gt;&lt;font color="#ff00ff"&gt;for(i=1; i&amp;lt;NF; i++) {&lt;/font&gt;&lt;br /&gt;&lt;font color="#6a5acd"&gt;        &lt;/font&gt;&lt;font color="#ff00ff"&gt;if(i) {&lt;/font&gt;&lt;br /&gt;&lt;font color="#6a5acd"&gt;            &lt;/font&gt;&lt;font color="#ff00ff"&gt;printf (&amp;quot;:&amp;quot;);&lt;/font&gt;&lt;br /&gt;&lt;font color="#6a5acd"&gt;        &lt;/font&gt;&lt;font color="#ff00ff"&gt;}&lt;/font&gt;&lt;font color="#6a5acd"&gt; &lt;/font&gt;&lt;br /&gt;&lt;font color="#6a5acd"&gt;        &lt;/font&gt;&lt;font color="#ff00ff"&gt;printf(&amp;quot;%s&amp;quot;, $i);&lt;/font&gt;&lt;br /&gt;&lt;font color="#6a5acd"&gt;    &lt;/font&gt;&lt;font color="#ff00ff"&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color="#ff00ff"&gt;}&lt;/font&gt;&lt;font color="#a52a2a"&gt;&lt;b&gt;'&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;&lt;/pre&gt;</content><link rel='alternate' type='text/html' href='http://developernotes.thomaspowell.com/2007/04/gawk-script-to-remove-last-dir-from.html' title='(g)awk script to remove last dir from PATH'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28160416&amp;postID=4231333832579242266' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://developernotes.thomaspowell.com/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/4231333832579242266'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/4231333832579242266'/><author><name>Thomas</name></author></entry><entry><id>tag:blogger.com,1999:blog-28160416.post-8579043276524823298</id><published>2007-04-17T06:59:00.000-07:00</published><updated>2007-04-17T07:02:45.483-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>Writing an onLoad function that includes a delay.</title><content type='html'>This code was written out of desperation when I could not use an embedded APPLET's isActive() function to check if the APPLET was loaded.  Instead, I waited for 500 milliseconds.  Hopefully, there are better uses for this code.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style='color: #000000'&gt;&lt;b&gt;&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;&lt;br /&gt;function&lt;/b&gt; OnLoadFunction(milliseconds_time)&lt;br /&gt;{&lt;br /&gt; &lt;/span&gt;&lt;span style='color: #800000'&gt;setTimeout&lt;/span&gt;&lt;span style='color: #000000'&gt;(&lt;/span&gt;&lt;span style='color: #ff0000'&gt;"delayedOnLoadFunction()"&lt;/span&gt;&lt;span style='color: #000000'&gt;, milliseconds_time);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;b&gt;function&lt;/b&gt; delayedOnLoadFunction()&lt;br /&gt;{&lt;br /&gt; &lt;/span&gt;&lt;span style='color: #808080'&gt;&lt;i&gt;/* Function body */&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style='color: #000000'&gt;}&lt;br /&gt;&lt;b&gt;&amp;lt;/SCRIPT&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;body&lt;/b&gt;&lt;/span&gt;&lt;span style='color: #008000'&gt; onLoad&lt;/span&gt;&lt;span style='color: #000000'&gt;=&lt;/span&gt;&lt;span style='color: #800000'&gt;"OnLoadFunction(500)"&lt;/span&gt;&lt;span style='color: #000000'&gt;&lt;b&gt;&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;</content><link rel='alternate' type='text/html' href='http://developernotes.thomaspowell.com/2007/04/writing-onload-function-that-includes.html' title='Writing an onLoad function that includes a delay.'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28160416&amp;postID=8579043276524823298' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://developernotes.thomaspowell.com/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/8579043276524823298'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28160416/posts/default/8579043276524823298'/><author><name>Thomas</name></author></entry></feed>