tag:blogger.com,1999:blog-47685716515802851642024-03-05T13:20:16.542-06:00.NET ReferenceThis blog is a depository for things I have found regarding VB.NET and C#.NET development (and other things I may need to remember). This blog is primarily for my own reference, but if the information I found is useful to others, then that is great. If others want to contribute with comments or other information, then that is great too.Unknownnoreply@blogger.comBlogger168125tag:blogger.com,1999:blog-4768571651580285164.post-15411773848593725602022-02-10T09:14:00.000-06:002022-02-10T09:14:11.190-06:00Touch Input goes to Wrong Screen in Windows 10<p> I have 2 screens, one is touch and one is not. Every few months, Windows gets confused and puts the touch input on the non-touchscreen. I usually spend an hour trying to figure out how to get this back to normal because all of the "fixes" I find with Google are wrong (or no longer apply because of Windows Updates, etc.). Here is how I can get it to work:</p><p>- Use the Search on the Taskbar and type "calibrate" and you should see "Calibrate the screen for pen or touch input".</p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgHoTPo-ItySWdJPA29OeXiC2FZVY3eNngfa2jLmPzKZC0winf6raEZb8lvNwxjO1uwWV4s0zKoctjVZb1ctWzTNCa3yfte7VOAK-Rvt1sJGg4-Ja0WnT__WJrw8fOorxo8CoEzyBub1WWfR2zscQW01B0vrampG2UzhSfvWAlOwEQghhThF_3SYcQ7uw" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="1016" data-original-width="664" height="240" src="https://blogger.googleusercontent.com/img/a/AVvXsEgHoTPo-ItySWdJPA29OeXiC2FZVY3eNngfa2jLmPzKZC0winf6raEZb8lvNwxjO1uwWV4s0zKoctjVZb1ctWzTNCa3yfte7VOAK-Rvt1sJGg4-Ja0WnT__WJrw8fOorxo8CoEzyBub1WWfR2zscQW01B0vrampG2UzhSfvWAlOwEQghhThF_3SYcQ7uw" width="157" /></a></div><br /><br /><p></p><p>- Everything else I found to solve this problem said to type "Tablet" and look for "Tablet PC Settings." I can't get to this using "Tablet". I do get "Tablet Settings" but this isn't the same thing and doesn't let you change the input.</p><p>- Once you get to the "Calibrate the screen for pen or touch input", it will be the "Tablet PC Settings" dialog and there is a "Setup" button in the Configure area:</p><p><br /></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgfCsI0BacL4dQQd2Y_om_AlKg-wKs-BE5cUqhgtR4lbA8A1sRDqjjr3PCvxRPDmWhk5bhZ9yxS55-SYU_3HQXeeEgqIwQrFzMzAr2uDxLJOPyLFX9cF9dS3PrBfR_4Hc2hQictqGYSknD93kcsmMEfdzvDMgP1l1X5SkBFBhi9AKvXmY4l4tb26VBrJA" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="665" data-original-width="546" height="240" src="https://blogger.googleusercontent.com/img/a/AVvXsEgfCsI0BacL4dQQd2Y_om_AlKg-wKs-BE5cUqhgtR4lbA8A1sRDqjjr3PCvxRPDmWhk5bhZ9yxS55-SYU_3HQXeeEgqIwQrFzMzAr2uDxLJOPyLFX9cF9dS3PrBfR_4Hc2hQictqGYSknD93kcsmMEfdzvDMgP1l1X5SkBFBhi9AKvXmY4l4tb26VBrJA" width="197" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: left;">- When you press the Setup button, your screens turn white and one will have a message saying "Tap this screen with a single finger to identify it as the touchscreen". If the message is not on the correct screen (the one with touch input), then press Enter to move through the screens.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEg9P_G3n8hz7r_qZjDpfNm0q2S4g96itJOVzRXdp7jBe7KUt8SGqG6rsoW7s5N5fhOJJADHNceqF3OfhA20FbJkj3m_Vdi_uN0V_0GHxSk_oQzLPF-BhEbOaRjvAMPN5EfUbKOHwrUvAVcWVkbGVx6IBcBj4iv4vDaeOk06WvIUmw3Bf88HVXk9FuGIWA" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="498" data-original-width="1522" height="105" src="https://blogger.googleusercontent.com/img/a/AVvXsEg9P_G3n8hz7r_qZjDpfNm0q2S4g96itJOVzRXdp7jBe7KUt8SGqG6rsoW7s5N5fhOJJADHNceqF3OfhA20FbJkj3m_Vdi_uN0V_0GHxSk_oQzLPF-BhEbOaRjvAMPN5EfUbKOHwrUvAVcWVkbGVx6IBcBj4iv4vDaeOk06WvIUmw3Bf88HVXk9FuGIWA" width="320" /></a></div><br /><br /></div><p>- Once you get the message on the right screen and tap with one finger, it will be fixed (until the next time it gets confused).</p><br /><p></p><p><br /></p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4768571651580285164.post-55844123395068647622018-11-21T10:05:00.003-06:002018-11-26T09:23:50.400-06:00Getting other files in ASP.NET Bin Directory when Publishing<div>
<br /></div>
<div>
I needed additional files in my ASP.NET's Bin directory that were not part of the ASP.NET project itself (they were configuration files and Native .dlls). I tried various methods from different suggestions, but the solution described here is the only one that worked:</div>
<div>
<br /></div>
<div>
http://sedodream.com/2010/05/01/WebDeploymentToolMSDeployBuildPackageIncludingExtraFilesOrExcludingSpecificFiles.aspx<br />
<br />
https://stackoverflow.com/questions/35000825/copyallfilestosinglefolderforpackagedependson-and-web-deploy<br />
<br />
<br />
Some of the options that didn't work included marking the files as Content, using Post-Build events to copy your files to the Bin directory. None of that works on putting them in the Web Deploy Package.<br />
<br />
<br />
My issue was that my additional files (.dll and .ini) would not make it to the Web Deploy Package. Getting them into the Folder Profile's output was not an issue. There does not appear to be a way Visual Studio GUI or in your Project's Solution to make this happened.<br />
<br />
You must do the following:<br />
<br />
- create your Web Deploy Package.<br />
<br />
- show all of the hidden files in the Solution.<br />
<br />
- Find the PublishProfiles folder, then find the .pubxml file that corresponds with your Web Deploy Package's profile.<br />
<br />
- You must manually insert the highlighted section below into your .pubxml file:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMwYEbiPFjhvk37h7LmOiYlxQ3HQinvVKhn6l7WQYfQKBMnxFqxSn6C0Aq61sNZG3m26x1x5dzwATsAJmVe4Ix1NIiiYz0Zin2jDzluSeAWb8QE0OkUnooFnRoQxy6QTJTph8U8l4r5bKj/s1600/wd.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1054" data-original-width="1021" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMwYEbiPFjhvk37h7LmOiYlxQ3HQinvVKhn6l7WQYfQKBMnxFqxSn6C0Aq61sNZG3m26x1x5dzwATsAJmVe4Ix1NIiiYz0Zin2jDzluSeAWb8QE0OkUnooFnRoQxy6QTJTph8U8l4r5bKj/s320/wd.png" width="309" /></a></div>
<br />
<br /></div>
- the location of your extra files is important because the _CustomFiles Include entry specifies the location of those files. I used "..\extraFilesForWebDeploy\**\*" This will get all of the files and subdirectory in a directory called extraFilesForWebDeploy that is at the same directory level as the ASP.NET project's folder. <br />
<br />
- If you just put your files there, they will be put in the ASP.NET's main directory. To get them in the Bin directory, I had to create a Bin directory in my ExtraFilesForWebDeploy directory and put the files I wanted to be delivered there.<br />
<br />
- You must have the CopyAllFilesToSingleFolderForMsdeployDependsOn section to get them in the Web Deploy Package.<br />
<br />
-The only part that needs to be adjusted for your project is the location of the source files.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4768571651580285164.post-56674376777442245692018-05-11T14:54:00.000-05:002018-05-11T14:54:17.497-05:00Troubleshooting Setting up Oracle 12c R2 and using it with Older Clients<b>Here are the problems I have every time I setup up Oracle.</b><br />
<b><br /></b>
<b>Oracle 12c R2 on Windows Server added more complexity than even 12c R1.</b><br />
<br />
<br />
1) Windows user name cannot have a <b class="">space</b><b> </b>in it. The Oracle Setup will hang up before it completes (with no explanation).<br />
<br />
<br />
2) Turn off <b>Password Complexity</b> on Windows Server or Oracle Setup can't create a user for Oracle (if you are wanting it to create a user)<br />
<br />
<br />
3) In <b>listener.ora</b> and <b>tnsname.ora</b>, change "localhost" to your machine name or you will not be able to connect from other machines.<br />
<br />
<br />
4) If you need older clients to connect with Oracle 12c R2, in the <b>sqlnet.ora</b>, you will have to add: <br />
<br />
<span style="font-family: Courier New, Courier, monospace;">SQLNET.ALLOWED_LOGON_VERSION_SERVER=8</span><br />
<span style="font-family: Courier New, Courier, monospace;">SQLNET.ALLOWED_LOGON_VERSION_CLIENT=8</span><br />
<br />
You can use a different minimum (instead of 8), but this is the lowest.<br />
<br />
You will get this error on other machine if this is the case:<br />
<br />
<span style="background-color: white; color: #555555; font-family: "Lucida Grande"; font-weight: 700; text-align: center;">ORA 28040: No matching authentication protocol</span><br />
<br />
<br />
5) If you have already created users in Oracle before adding the entries to sqlnet.ora, you will have to reset the passwords if you want to connect from the older versions.<br />
<br />
<pre style="background-color: white; color: #333333; font-family: monospace, serif; font-size: 13px; white-space: pre-wrap;">ALTER USER <user> IDENTIFIED BY <password></password></user></pre>
<br />
You will get the following error until this is done (for no apparent reason):<br />
<br />
<h1 itemprop="name" style="background-color: white; border: 0px; box-sizing: inherit; color: #242729; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: 1.3; margin: 0px 0px 0.5em; padding: 0px; vertical-align: baseline;">
<span style="font-family: inherit; font-size: small;">ORA-01017 Invalid Username/Password </span></h1>
<div>
<br /></div>
----<br />
<br />
<b>Resources:</b><br />
<br />
<br />
https://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:9533918300346989898<br />
<br />
https://community.microstrategy.com/s/article/ORA-28040-No-matching-authentication-protocol-when-connecting-to-Oracle-12c-or-higher-database<br />
<br />
https://stackoverflow.com/questions/37615088/unable-to-connect-to-oracle-12c-from-client-machine<br />
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4768571651580285164.post-67472440772533605192017-01-06T09:38:00.000-06:002017-01-06T09:38:13.471-06:00Welcome to the world of Pluggable Databases in Oracle 12cI'm new to pluggable databases in Oracle 12c, so I thought I would put my most common problems here in hopes that the solutions might help someone else.<br />
<br />
<br />
Everything worked fine in my database until I rebooted the machine, and then I got:<br />
<br />
<br />
<span style="color: blue; font-family: Courier New, Courier, monospace; font-size: x-small;">ORA-01033: ORACLE initialization or shutdown in progress</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace; font-size: x-small;">01033. 00000 - "ORACLE initialization or shutdown in progress"</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace; font-size: x-small;">*Cause: An attempt was made to log on while Oracle is being started up</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace; font-size: x-small;"> or shutdown.</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace; font-size: x-small;">*Action: Wait a few minutes. Then retry the operation.</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace; font-size: x-small;">Vendor code 1033</span><br />
<br />
<br />
The problem was that the pluggable databases do not automatically open by default, not that the initialization or shutdown is in progress. It doesn't matter how long you wait (as directed by the message).<br />
<br />
First, you must open the pluggable database to get it running again:<br />
<br />
<span style="color: blue; font-family: Courier New, Courier, monospace; font-size: x-small;">alter pluggable database all open;</span><br />
<br />
I said "all" but you could specify a specific pluggable database.<br />
<br />
This will get the database running until you reboot. If you want it to automatically open, you must save the state:<br />
<br />
<span style="color: blue; font-family: Courier New, Courier, monospace; font-size: x-small;">alter pluggable database all save state;</span><br />
<br />
Again I said "all" instead of the pluggable database name.<br />
<br />
The following Ask Tom post goes into more detail on this topic, but it doesn't mention the misleading message you get from Oracle.<br />
<br />
https://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:9531671900346425939<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4768571651580285164.post-51107251682069370242015-04-23T15:53:00.000-05:002015-04-23T15:54:15.609-05:00Get Schema/DDL from Oracle Data Pump ExportReposting this from the linked Stack Overflow article because this solutions works well and I want to be able to easily find it again:<br />
<br />
<pre class="lang-sql prettyprint prettyprinted" style="background-color: #eeeeee; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;"><code style="border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;"><span class="pln" style="border: 0px; color: black; margin: 0px; padding: 0px;">impdp </span><span class="str" style="border: 0px; color: maroon; margin: 0px; padding: 0px;">'/ as sysdba'</span><span class="pln" style="border: 0px; color: black; margin: 0px; padding: 0px;"> dumpfile</span><span class="pun" style="border: 0px; color: black; margin: 0px; padding: 0px;">=<</span><span class="kwd" style="border: 0px; color: darkblue; margin: 0px; padding: 0px;">file</span><span class="pun" style="border: 0px; color: black; margin: 0px; padding: 0px;">></span><span class="pln" style="border: 0px; color: black; margin: 0px; padding: 0px;"> logfile</span><span class="pun" style="border: 0px; color: black; margin: 0px; padding: 0px;">=</span><span class="pln" style="border: 0px; color: black; margin: 0px; padding: 0px;">import_log</span><span class="pun" style="border: 0px; color: black; margin: 0px; padding: 0px;">.</span><span class="pln" style="border: 0px; color: black; margin: 0px; padding: 0px;">txt sqlfile</span><span class="pun" style="border: 0px; color: black; margin: 0px; padding: 0px;">=</span><span class="pln" style="border: 0px; color: black; margin: 0px; padding: 0px;">ddl_dump</span><span class="pun" style="border: 0px; color: black; margin: 0px; padding: 0px;">.</span><span class="pln" style="border: 0px; color: black; margin: 0px; padding: 0px;">txt</span></code></pre>
<br />
http://stackoverflow.com/questions/95578/how-to-determine-the-schemas-inside-an-oracle-data-pump-export-file<br />
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4768571651580285164.post-25710561248155709752015-03-26T10:15:00.001-05:002015-03-26T10:15:28.195-05:00Adding more than one Datafile to an Oracle TablespaceIf you need to add an additional data file to an Oracle Tablespace:<br />
<br />
<span style="color: blue; font-family: Courier New, Courier, monospace;">ALTER TABLESPACE </span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"> users </span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;">ADD DATAFILE </span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;"> 'AdditionalUsersTablespace.dbf' </span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;">size 100m</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;">AUTOEXTEND ON</span><br />
<span style="color: blue; font-family: Courier New, Courier, monospace;">NEXT 10M</span><br />
<br />
<br />
More info from these posts:<br />
<br />
http://www.dba-oracle.com/t_alter_tablespace_add_datafile.htm<br />
<br />
http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_3002.htm<br />
<br />
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4768571651580285164.post-35693852333968073672015-01-27T17:31:00.003-06:002015-01-27T17:32:19.574-06:00Problems registering a Windows Phone 8.1 for DevelopmentWhy is it that things that should be simple are not. Connecting my Window Phone to a Windows 8.1 machine to deploy my apps. So, I installed Zune (???) and the Windows Phone SDK 8.1 (it took hours) and still had errors. I ran the Windows Phone Registration tool and it consistently fails. Reboots (phone and computer) do nothing to help, nor do new/different USB cables help. There are many items out there to help.<br />
<br />
This link:<br />
<br />
http://stackoverflow.com/questions/24153897/getting-error-unable-to-connect-to-a-phone-make-sure-the-windows-phone-ip-over<br />
<br />
<br />
And it leads to this link:<br />
<br />
http://irisclasson.com/2013/10/28/problems-and-fixes-when-registering-a-windows-phone-8-device-to-deploydebug-applications/<br />
<br />
<br />
The solution (for me) turned out that I had to manually restart the Windows Phone IP Over USB Service. It doesn't matter that you just rebooted, and it says it is running. I got "<span style="background-color: white; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 19.5px;">Unable to connect to a phone. Make sure the Windows Phone IP over USB transport service is running" ever time until I manually restarted it.</span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4768571651580285164.post-53130822577940456912014-06-30T13:15:00.002-05:002014-07-02T14:58:02.788-05:00How To Adjust Environment Variables<div class="MsoNormal">
<b><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; line-height: 115%;">How
To Adjust Environment Variables<o:p></o:p></span></b></div>
<div class="MsoNormal">
<b><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; line-height: 115%;">by Charlie Marlin</span></b></div>
<div class="MsoNormal">
<b><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; line-height: 115%;"><br /></span></b></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; line-height: 115%;">This post is similar to a post by Joey Rogers on
Friday, <a href="http://dotnetref.blogspot.com/2011/02/how-solve-problem-of-loading-native-dll.html" target="_blank">February 11, 2011</a>. It has slight
differences in language and syntax, but I thought I should share it just the
same. <o:p></o:p></span><span style="font-family: Verdana, sans-serif; font-size: 10pt; line-height: 115%;">Windows 7 installations should also see the “Fly in
Ointment” note at the end.</span><br />
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; line-height: 115%;"><o:p></o:p></span></div>
</div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; line-height: 115%;"><br /></span>
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; line-height: 115%;">Sometimes you need to change a system variable for a
section of code. Where I work, we have
some Oracle databases on the 11g version and some on version 8. They reside on different servers. When we want to use one, it often works
fine. If we need to use the other, we
have to edit the PATH variable on our machines to move the reference to the
unwanted Oracle version further down the path than the desired version. I have lived with this limitation for years,
hoping the old database would get upgraded, but last week I was placed in a
situation of telling a user who does not have admin credentials that will allow
him to edit the environment variables to use one laptop for one thing and another
laptop for the other. Embarrassing. So I groped around and found this, tested it,
delivered it to the user, and to my astonishment it worked.<o:p></o:p></span><br />
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; line-height: 115%;">(Let’s name the old Oracle 8 server “Aristophanes”
and the more modern Oracle 11g server “Moliere”. In the code before I need
“C:\ORANT\BIN:” not to come before the home for Oracle 11g I place this code:)<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"><span style="color: green;">' First, we
need to change the PATH environment variable in order to reach Moliere...<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"><span style="color: blue;">Dim</span>
oraclePathAristophanes <span style="color: blue;">As</span> <span style="color: blue;">String</span> = Environment.GetEnvironmentVariable(<span style="color: #a31515;">"path"</span>)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"><span style="color: blue;">Dim</span>
oraclePathMoliere <span style="color: blue;">As</span> <span style="color: blue;">String</span>
= oraclePathAristophanes<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">oraclePathMoliere =
oraclePathAristophanes.Replace(<span style="color: #a31515;">"C:\ORANT\BIN;"</span>,
<span style="color: #a31515;">""</span>)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"><span style="color: green;">'MessageBox.Show("Oracle
PATH edited: " & vbCrLf & oraclePathMoliere)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">Environment.SetEnvironmentVariable(<span style="color: #a31515;">"path"</span>, oraclePathMoliere)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"><span style="color: green;">' restore
oraclePathAristophanes further down once we are done with Moliere...<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-no-proof: yes;"><span style="color: green;">'MessageBox.Show("Oracle PATH set: " & vbCrLf
& Environment.GetEnvironmentVariable("path"))</span></span><o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; line-height: 115%;">(then later in the sub I restore the old path
variable)<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"><span style="color: green;">' restore
oraclePathAristophanes once we are done with Moliere...<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">Environment.SetEnvironmentVariable(<span style="color: #a31515;">"path"</span>, oraclePathAristophanes)<o:p></o:p></span></div>
<br />
<div class="MsoNormal">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-no-proof: yes;"><span style="color: green;">'MessageBox.Show("Oracle PATH restored: " &
vbCrLf & Environment.GetEnvironmentVariable("path"))</span></span><o:p></o:p><br />
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-no-proof: yes;"><span style="color: green;"><br /></span></span>
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-no-proof: yes;"><span style="color: green;"><br /></span></span>
<br />
<div class="MsoNormal">
<b><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; line-height: 115%;">Fly
in Ointment<o:p></o:p></span></b></div>
<br />
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; line-height: 115%;">This approach fails on Windows 7 for non-admin users,
but the following article lets you step over that obstacle: </span><a href="http://williamfaulkner.co.uk/2009/04/vbnet-run-as-administrator-impersonate-a-user-2008/"><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; line-height: 115%;">http://williamfaulkner.co.uk/2009/04/vbnet-run-as-administrator-impersonate-a-user-2008/</span></a><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; line-height: 115%;"><o:p></o:p></span></div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4768571651580285164.post-476859567871415022014-04-08T12:45:00.003-05:002014-04-08T12:52:24.470-05:00Turning On/Off/Flipping specific Bits in a Value<h1 style="background-color: white; margin: 0px; padding: 0px; text-align: justify; text-shadow: rgb(255, 255, 255) 0px 1px 0px;">
<span style="font-family: MuseoSlabTumblr, Helvetica, sans-serif; font-size: small;"><span style="font-weight: normal;">Here is a nice set of functions to do your bit manipulation in C#:</span></span></h1>
<h1 style="background-color: white; margin: 0px; padding: 0px; text-align: justify; text-shadow: rgb(255, 255, 255) 0px 1px 0px;">
<span style="font-family: MuseoSlabTumblr, Helvetica, sans-serif; font-size: small;"><span style="font-weight: normal;"><br /></span></span></h1>
<h1 style="background-color: white; margin: 0px; padding: 0px; text-align: justify; text-shadow: rgb(255, 255, 255) 0px 1px 0px;">
<span style="font-family: MuseoSlabTumblr, Helvetica, sans-serif; font-size: small;"><span style="font-weight: normal;"><a href="http://codeidol.com/community/dotnet/turning-bits-on-or-off/8901/">http://codeidol.com/community/dotnet/turning-bits-on-or-off/8901/</a></span></span></h1>
<div>
<span style="font-family: MuseoSlabTumblr, Helvetica, sans-serif; font-size: small;"><br /></span></div>
<div>
<span style="font-family: MuseoSlabTumblr, Helvetica, sans-serif; font-size: small;"><br /></span></div>
<div>
<span style="font-family: MuseoSlabTumblr, Helvetica, sans-serif; font-size: small;">Here they are in VB.NET:</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span></div>
<div>
<div style="padding: 0px;">
<span style="font-size: x-small;"><span style="font-family: Courier New, Courier, monospace;">Public Function TurnBitOn(value As Integer, bitToTurnOn As Integer) As Integer</span><span style="font-family: Courier New, Courier, monospace;"> Return (value Or bitToTurnOn)</span></span><br />
<span style="font-size: x-small;"><span style="font-family: Courier New, Courier, monospace;">End Function</span></span></div>
<div style="padding: 0px;">
<span style="font-size: x-small;"><span style="font-family: Courier New, Courier, monospace;"><br /></span></span></div>
<div style="padding: 0px;">
<span style="font-size: x-small;"><span style="font-family: Courier New, Courier, monospace;"><br /></span><span style="font-family: Courier New, Courier, monospace;">Public Function TurnBitOff(value As Integer, bitToTurnOff As Integer) As Integer</span><span style="font-family: Courier New, Courier, monospace;"> Return (value And Not bitToTurnOff)</span></span><br />
<span style="font-size: x-small;"><span style="font-family: Courier New, Courier, monospace;">End Function</span></span></div>
<div style="padding: 0px;">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span></div>
<div style="padding: 0px;">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span><span style="font-size: x-small;"><span style="font-family: Courier New, Courier, monospace;">
</span></span></div>
<pre class="brush:vbnet" id="code-result" style="padding: 0px;"></pre>
<span style="font-size: x-small;"><span style="font-family: Courier New, Courier, monospace;">
</span><span style="font-family: Courier New, Courier, monospace;">Public Function FlipBit(value As Integer, bitToFlip As Integer) As Integer</span><span style="font-family: Courier New, Courier, monospace;"> Return (value Xor bitToFlip)</span></span><br />
<span style="font-size: x-small;"><span style="font-family: Courier New, Courier, monospace;">End Function</span></span><br />
<div style="padding: 0px;">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span></div>
<div style="padding: 0px;">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span><span style="font-size: x-small;"><span style="font-family: Courier New, Courier, monospace;">
</span></span></div>
<pre class="brush:vbnet" id="code-result" style="padding: 0px;"></pre>
<span style="font-size: x-small;"><span style="font-family: Courier New, Courier, monospace;">
</span><span style="font-family: Courier New, Courier, monospace;">Public Function TurnBitPositionOn(value As Integer, bitPosition As Integer) As Integer</span><span style="font-family: Courier New, Courier, monospace;"> Return (value Or (1 << bitPosition))</span></span><br />
<span style="font-size: x-small;"><span style="font-family: Courier New, Courier, monospace;">End Function</span></span><br />
<div style="padding: 0px;">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span></div>
<div style="padding: 0px;">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span><span style="font-size: x-small;"><span style="font-family: Courier New, Courier, monospace;">
</span></span></div>
<pre class="brush:vbnet" id="code-result" style="padding: 0px;"></pre>
<span style="font-size: x-small;"><span style="font-family: Courier New, Courier, monospace;">
</span><span style="font-family: Courier New, Courier, monospace;">Public Function TurnBitPositionOff(value As Integer, bitPosition As Integer) As Integer</span><span style="font-family: Courier New, Courier, monospace;"> Return (value And Not (1 << bitPosition))</span></span><br />
<span style="font-size: x-small;"><span style="font-family: Courier New, Courier, monospace;">End Function</span></span><br />
<div style="padding: 0px;">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span></div>
<div style="padding: 0px;">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span><span style="font-size: x-small;"><span style="font-family: Courier New, Courier, monospace;">
</span></span></div>
<pre class="brush:vbnet" id="code-result" style="padding: 0px;"></pre>
<span style="font-size: x-small;"><span style="font-family: Courier New, Courier, monospace;">
</span><span style="font-family: Courier New, Courier, monospace;">Public Function FlipBitPosition(value As Integer, bitPosition As Integer) As Integer</span><span style="font-family: Courier New, Courier, monospace;"> Return (value Xor (1 << bitPosition))</span></span><br />
<span style="font-size: x-small;"><span style="font-family: Courier New, Courier, monospace;">End Function</span></span><br />
<pre class="brush:vbnet" id="code-result" style="color: #2e2e2e; font-size: 12px; padding: 0px;"></pre>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4768571651580285164.post-24765988694405854342014-01-15T10:12:00.001-06:002014-01-15T10:17:44.006-06:001,000 Features Per Second for Node-to-Node Trace!<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><a href="http://www.blogger.com/blogger.g?blogID=4768571651580285164" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a><a href="http://www.blogger.com/blogger.g?blogID=4768571651580285164" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a><br />
<!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:TargetScreenSize>800x600</o:TargetScreenSize>
</o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Calibri","sans-serif";}
</style>
<![endif]-->
<br />
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 20.0pt; line-height: 115%;">1,000
Features Per Second for Node-to-Node Trace!</span></b></div>
<div class="MsoNormal">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 14.0pt; line-height: 115%;">Description
of an Electric Trace for GTViewer using Bentley Utility Designer Data </span></b></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br />
<a href="http://www.blogger.com/blogger.g?blogID=4768571651580285164" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"> </a><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Charlie
Marlin</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Huntsville
Utilities</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Begun
April 3, 2013</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Revised
January 14, 2014</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Summary</span></b></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Network
traces have historically been slow – 1 feature per second, maybe 10, maybe 100.<span style="mso-spacerun: yes;"> </span>This paper shows how to achieve 1,000
features per second using standard data structures. The primary innovation is
to pre-process certain portions of the data into text files which are loaded
into memory (into hash tables) when the trace application is first
started.<span style="mso-spacerun: yes;"> </span>Most of the data access during
the trace uses these hash tables (which are one of the fastest data structures
available) instead of disk reads, so the trace runs faster than most.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Audience</span></b></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">The
paper is intended for anyone writing a network trace, whether with GTViewer or
not, whether with data from Bentley or not.<span style="mso-spacerun: yes;">
</span>The trace is implemented using GTViewer on data that has been converted
from Bentley to the format used by GTViewer, so I will necessarily get down
into the details of GTViewer and Bentley in order to explain what’s going
on.<span style="mso-spacerun: yes;"> </span>But an interested reader should be
able to understand how to implement the same concepts in his own environment.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Network
tracing is one of many practical applications of Graph Theory.<span style="mso-spacerun: yes;"> </span>Here is the definition from Wikipedia:<span style="mso-spacerun: yes;"> </span>(http://en.wikipedia.org/wiki/Graph_theory)</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
“In <a href="http://en.wikipedia.org/wiki/Mathematics" title="Mathematics">mathematics</a> and <a href="http://en.wikipedia.org/wiki/Computer_science" title="Computer science">computer
science</a>, <b>graph theory</b> is the study of <i><a href="http://en.wikipedia.org/wiki/Graph_%28mathematics%29" title="Graph (mathematics)">graphs</a></i>, which are mathematical structures
used to model pairwise relations between objects. A "graph" in this
context is made up of "<a href="http://en.wikipedia.org/wiki/Vertex_%28graph_theory%29" title="Vertex (graph theory)">vertices</a>" or "nodes" and lines
called <i>edges</i> that connect them. A graph may be <i>undirected</i>, meaning
that there is no distinction between the two vertices associated with each
edge, or its edges may be <i>directed</i> from one vertex to another; see <a href="http://en.wikipedia.org/wiki/Graph_%28mathematics%29" title="Graph (mathematics)">graph (mathematics)</a> for more detailed
definitions and for other variations in the types of graph that are commonly
considered. Graphs are one of the prime objects of study in <a href="http://en.wikipedia.org/wiki/Discrete_mathematics" title="Discrete mathematics">discrete mathematics</a>.”</div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
Why is Graph Theory important to GIS?<span style="mso-spacerun: yes;">
</span>Because our electric, gas, telephone, water, sewer, and storm drain
networks<span style="mso-spacerun: yes;"> </span>are easily modeled as graphs,
thereby allowing all of the many tools from graph theory to be used to analyze
GIS data.</div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">A Note on .NET’s NameValueCollection</span></b></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Before
we get very far, I should share some things about a data structure that .NET
calls a “NameValueCollection”.<span style="mso-spacerun: yes;"> </span>It is
implemented as a hash table (actually .NET will determine how big the thing is
going to be and implement either a hash table or a simpler structure, whichever
will be faster, or so I’ve read in Rod Stevens, <u>Visual Basic 2005</u>.)<span style="mso-spacerun: yes;"> </span>The programmer adds keys and values.<span style="mso-spacerun: yes;"> </span>Then when he has a key, he can retrieve the
value quickly.<span style="mso-spacerun: yes;"> </span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">I
should note here one very cool thing that .NET does with the
NameValueCollection.<span style="mso-spacerun: yes;"> </span>You don’t need to
know at run time how many values you may wind up with for a given key.<span style="mso-spacerun: yes;"> </span>In most cases, you have a single value for a
key.<span style="mso-spacerun: yes;"> </span>But the value returned by
GetValues(key) in .NET is a List(Of String).<span style="mso-spacerun: yes;">
</span>So in case there is only one value, it’s value(0).<span style="mso-spacerun: yes;"> </span>But you could add several values over the
course of processing and parse them when you retrieve them. <span style="mso-spacerun: yes;"> </span>I use this capability during the trace to find
nodes for electric primaries.<span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 20.0pt; mso-ansi-language: EN-US; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US;"><br clear="all" style="page-break-before: always;" />
</span></b>
<br />
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 20.0pt;">Pre-Processing</span></b></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Let
me describe the pre-processing first.<span style="mso-spacerun: yes;">
</span>During development, of course, this came last.<span style="mso-spacerun: yes;"> </span>I got the trace working and then looked for
ways to speed it up and wrote the pre-processing stuff then.<span style="mso-spacerun: yes;"> </span>But the interesting aspect of the trace depends
on the results of pre-processing.<span style="mso-spacerun: yes;"> </span>The
reader will need to be patient because the reasons for generating various text
files during pre-processing may be poorly motivated if you don’t know what the
trace logic is going to do with them.<span style="mso-spacerun: yes;">
</span>There is a flow chart below on page 8, and I hope it’s helpful.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">A
word on “keys”.<span style="mso-spacerun: yes;"> </span>GTViewer uses a one- or
two-key system to link graphic elements to tabular data.<span style="mso-spacerun: yes;"> </span>Older readers are welcome to think DMRS,
MSLINK, FRAMME, etc.<span style="mso-spacerun: yes;"> </span>In most of what
follows, I will only be concerned with the second key because the first key for
Bentley data as converted to GTViewer is always zero (or some other arbitrary
value set at conversion time).</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">The VB.NET Project:<span style="mso-spacerun: yes;"> </span>HU_BuildConnectivityTable</span></b></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">HU_BuildConnectivityTable
builds six text files:</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .75in; margin-right: 0in; margin-top: 0in; mso-list: l1 level1 lfo1; text-indent: -.25in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-bidi-font-family: Verdana; mso-fareast-font-family: Verdana;"><span style="mso-list: Ignore;">1.<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Connectivity.txt</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .75in; margin-right: 0in; margin-top: 0in; mso-list: l1 level1 lfo1; text-indent: -.25in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-bidi-font-family: Verdana; mso-fareast-font-family: Verdana;"><span style="mso-list: Ignore;">2.<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">ConductorTable.txt</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .75in; margin-right: 0in; margin-top: 0in; mso-list: l1 level1 lfo1; text-indent: -.25in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-bidi-font-family: Verdana; mso-fareast-font-family: Verdana;"><span style="mso-list: Ignore;">3.<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">StopFeature.txt</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .75in; margin-right: 0in; margin-top: 0in; mso-list: l1 level1 lfo1; text-indent: -.25in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-bidi-font-family: Verdana; mso-fareast-font-family: Verdana;"><span style="mso-list: Ignore;">4.<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">StopNode.txt</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .75in; margin-right: 0in; margin-top: 0in; mso-list: l1 level1 lfo1; text-indent: -.25in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-bidi-font-family: Verdana; mso-fareast-font-family: Verdana;"><span style="mso-list: Ignore;">5.<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">UnitTransformerTable.txt</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .75in; margin-right: 0in; margin-top: 0in; mso-list: l1 level1 lfo1; text-indent: -.25in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-bidi-font-family: Verdana; mso-fareast-font-family: Verdana;"><span style="mso-list: Ignore;">6.<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">TransformerThick.txt</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .25in; margin-right: 0in; margin-top: 0in; mso-list: l0 level1 lfo2; text-indent: -.25in;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-bidi-font-family: Verdana; mso-fareast-font-family: Verdana;"><span style="mso-list: Ignore;">1.<span style="font: 7.0pt "Times New Roman";">
</span></span></span></b><b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Building
Connectivity.txt</span></b></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">We begin
by opening a stream reader for GTViewer’s “data.txt” file, the record of
tabular data for all features.<span style="mso-spacerun: yes;"> </span>It reads
line-by-line until it finds the table for “E_OHPRIMARY”.<span style="mso-spacerun: yes;"> </span>Then it establishes offsets for the
attributes "PRIMARY_STARTID_Remap" and </span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">"PRIMARY_ENDID_Remap".<span style="mso-spacerun: yes;"> </span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">(Why?<span style="mso-spacerun: yes;"> </span>And what do I mean by this?<span style="mso-spacerun: yes;"> </span>In data.txt, GTViewer has a line for the tabular
data for each element.<span style="mso-spacerun: yes;"> </span>Attribute values
are delimited by pipe characters.<span style="mso-spacerun: yes;"> </span>Each
table section begins with a description of its structure, which includes a list
of the attributes in the order they appear in the pipe-delimited list.<span style="mso-spacerun: yes;"> </span>So it is a trivial programming activity in
.NET to “Split” each line of attributes into an array where I know the index of
the PRIMARY_STARTID_Remap and PRIMARY_ENDID_Remap attributes.<span style="mso-spacerun: yes;"> </span>Why “_Remap”?<span style="mso-spacerun: yes;">
</span>The conversion from Bentley to GTViewer retains the PRIMARY_STARTID and
PRIMARY_ENDID attribute values as they exist in Bentley, but it also remaps
these somewhat cumbersome GUID-style values to unique integer values that are
easier to work with.)</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Back
to data.txt.<span style="mso-spacerun: yes;"> </span>We read each line and write
the GTViewer key2 and the start node (PRIMARY_STARTID_Remap) and end node (PRIMARY_ENDID_Remap),
pipe delimited, to the text file Connectivity.txt.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Later
on, when the user starts the trace application, this text file will be read and
loaded into a NameValueCollection called “"nvcNodes” with key2 as the key.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">So
what?<span style="mso-spacerun: yes;"> </span>“So what” is that at run time, I
will be able to retrieve the start and end nodes of a primary if I know the
graphic-tabular link of the primary.<span style="mso-spacerun: yes;">
</span>Specific motivation for that will need to wait for the description of
the recursive subroutine at the heart of the trace code.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Electricity
travels over more features than OHPRIMARY, so the code also reads the
“E_UGPRIMARY” and “E_SWCABBUSBAR” tables and appends the pipe-delimited key2|start_node|end_node
string to the file Connectivity.txt.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">(Looking ahead to a
future version, the code also has provision for E_OHSECONDARY, E_UGSECONDARY,
E_OHSERVICE, and E_UGSERVICE, but our data at Huntsville Utilities does not
have these values sufficiently populated with accurate values so that a
secondary trace can run.)</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .25in; margin-right: 0in; margin-top: 0in; mso-list: l0 level1 lfo2; text-indent: -.25in;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-bidi-font-family: Verdana; mso-fareast-font-family: Verdana;"><span style="mso-list: Ignore;">2.<span style="font: 7.0pt "Times New Roman";">
</span></span></span></b><b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Building
ConductorTable.txt</span></b></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Slightly
different in implementation, but with similar results.<span style="mso-spacerun: yes;"> </span>We run a GTViewer query for E_OHPRIMARY and
add key2 and ”|” and<span style="mso-spacerun: yes;"> </span>“E_OHPRIMARY” to a
List(Of String).<span style="mso-spacerun: yes;"> </span>We then run another
query for E_UGPRIMARY, and another for E_SWCABBUSBAR.<span style="mso-spacerun: yes;"> </span>Then we walk through that List and write
ConductorTable.txt.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">How
can I motivate such a simple-minded activity?<span style="mso-spacerun: yes;">
</span>At times during the trace, the code will have key2 for a primary, and it
will need to now what table that primary is in.<span style="mso-spacerun: yes;">
</span>In early versions of the trace, I found this table in a clunky way that
took a lot of time.<span style="mso-spacerun: yes;"> </span>Currently, I load up
another NameValueCollection (hash table) called “nvcConductorTable” when the
user starts the trace, so the look-up is brisk.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .25in; margin-right: 0in; margin-top: 0in; mso-list: l0 level1 lfo2; text-indent: -.25in;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-bidi-font-family: Verdana; mso-fareast-font-family: Verdana;"><span style="mso-list: Ignore;">3.<span style="font: 7.0pt "Times New Roman";">
</span></span></span></b><b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Building
StopFeature.txt</span></b></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Similar
to building ConductorTable.txt except that it takes two steps.<span style="mso-spacerun: yes;"> </span>First, we build a StopFeatureList by running a
query to find every switch.<span style="mso-spacerun: yes;"> </span>That
sentence hides some complexity.<span style="mso-spacerun: yes;"> </span>I
compile a GTViewer query that returns the PRIMARY_ATTACHEDEDGEID for each
E_OHSWITCH.<span style="mso-spacerun: yes;"> </span>Then I compile similar
queries for each type of stop feature.<span style="mso-spacerun: yes;">
</span>Because each of these queries only asks for PRIMARY_ATTACHEDEDGEID, I
can append them into a single query.<span style="mso-spacerun: yes;">
</span>GTViewer queries (when run in code) return the attribute(s) you ask for,
and they also return the category and offset of each element they find.<span style="mso-spacerun: yes;"> </span>The category for all primary features is 304,
so we know that without the query.<span style="mso-spacerun: yes;"> </span>But
the offset is golden.<span style="mso-spacerun: yes;"> </span>We write the
PRIMARY_ATTACHEDEDGEID and “|” and the offset of the switch to a list. In .NET
speak: a List(Of String) called “StopFeatureList”.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Then
we walk through StopFeatureList and use the PRIMARY_ATTACHEDEDGEID value to run
another query to find primaries by PRIMARY_NETID.<span style="mso-spacerun: yes;"> </span>The PRIMARY_NETID for a primary is, of
course, the same number as the PRIMARY_ATTACHEDEDGEID for a stop feature that
is attached to this primary.<span style="mso-spacerun: yes;"> </span>So as the
query returns primaries which we know have stop features attached, we note the
key2 of the primary and write it to a temporary list with a pipe symbol and the
PRIMARY_NETID.<span style="mso-spacerun: yes;"> </span>Then we write this list
to the file StopFeature.txt.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Again,
so what?<span style="mso-spacerun: yes;"> </span>Well, after loading StopFeature.txt
into a NameValueCollection called “nvcStopFeature” when the user starts the
trace application, we can quickly test whether a primary has a stop feature
attached.<span style="mso-spacerun: yes;"> </span>We use the key2 of the primary
as a key to nvcStopFeatures.<span style="mso-spacerun: yes;"> </span>If we get any
values, then the primary has a stop feature attached.<span style="mso-spacerun: yes;"> </span>If not, it doesn’t.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .25in; margin-right: 0in; margin-top: 0in; mso-list: l0 level1 lfo2; text-indent: -.25in;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-bidi-font-family: Verdana; mso-fareast-font-family: Verdana;"><span style="mso-list: Ignore;">4.<span style="font: 7.0pt "Times New Roman";">
</span></span></span></b><b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Building StopNode.txt</span></b></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">We
use StopFeatureList built during the previous step.<span style="mso-spacerun: yes;"> </span>We walk through it, pulling out the
PRIMARY_ATTACHEDEDGEID (which, of course, is the PRIMARY_NETID of the primary
that has a Switch or other stop feature) and and the offset of the stop
feature.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">First we build a
short list called “shortList”, a 2-element array (Of String), that holds the
nodes (PRIMARY_STARTID_Remap and PRIMARY_ENDID_Remap) for this primary.<span style="mso-spacerun: yes;"> </span>The stop node will be one of these.<span style="mso-spacerun: yes;"> </span>Perhaps both.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Then we use the
offset to do a GTViewer proximity search (within 50 feet of the origin of the
stop feature) to build a list of nodes called “nodeList” from nearby
primaries.<span style="mso-spacerun: yes;"> </span>(PRIMARY_STARTID_Remap and
PRIMARY_ENDID_Remap)<span style="mso-spacerun: yes;"> </span>We omit the primary
that has the stop feature attached, because we already have those nodes in
shortList.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Then, if nodeList
contains shortList(0), then we add it to StopNodeList along with “|” and the
offset of the stop feature.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Also, if nodeList
contains shortList(1), then we add it to StopNodeList along with “|” and the offset
of the stop feature.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Then
we process the next item in StopFeatureList.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Then
we write StopNodeList to the file StopNode.txt.<span style="mso-spacerun: yes;">
</span>When the trace initializes, we load StopNode.txt into the
NameValueCollection “nvcNodeOffsets”.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">So
now, while we search from node to node, we can quickly tell if we have reached
a node where the trace should stop.<span style="mso-spacerun: yes;"> </span>To
appreciate why I take the two steps of building both StopNode.txt and
StopFeature.txt, see “Special Bentley Considerations” below.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .25in; margin-right: 0in; margin-top: 0in; mso-list: l0 level1 lfo2; text-indent: -.25in;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-bidi-font-family: Verdana; mso-fareast-font-family: Verdana;"><span style="mso-list: Ignore;">5.<span style="font: 7.0pt "Times New Roman";">
</span></span></span></b><b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Building
UnitTransformerTable.txt and TransformerThick.txt</span></b></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">We
can skip these.<span style="mso-spacerun: yes;"> </span>They are not used for
the trace proper, but are used to sum transformer load by phase for a
circuit.<span style="mso-spacerun: yes;"> </span>I build the file
UnitTransformerTable.txt first and use it to help build the file
TransformerThick.txt.<span style="mso-spacerun: yes;"> </span>I do it that way
because some transformers have a KVA for a phase, and some have child records
with different KVA ratings for each of the children.<span style="mso-spacerun: yes;"> </span>The point is that, as is becoming boring to
you by now, I load this file into a NameValueCollection when the user starts
the trace application, and then I can use the node number (on currently
processing primary, which is equal to the PRIMARY_NETID of the attached
transformer) to get the KVA load for each phase.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-ansi-language: EN-US; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US;"><br clear="all" style="mso-special-character: line-break; page-break-before: always;" />
</span>
<br />
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Summary of Pre-processing</span></b></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: none; mso-border-alt: solid black .5pt; mso-border-insideh: .5pt solid black; mso-border-insidev: .5pt solid black; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184; width: 625px;">
<tbody>
<tr style="height: 15.0pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0;">
<td nowrap="" style="background: #D9D9D9; border: solid black 1.0pt; height: 15.0pt; mso-border-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 108.75pt;" valign="top" width="145"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">File name</span></div>
</td>
<td nowrap="" style="background: #D9D9D9; border-left: none; border: solid black 1.0pt; height: 15.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 85.5pt;" valign="top" width="114"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">Contents</span></div>
</td>
<td nowrap="" style="background: #D9D9D9; border-left: none; border: solid black 1.0pt; height: 15.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 140.15pt;" valign="top" width="187"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">Meaning</span></div>
</td>
<td nowrap="" style="background: #D9D9D9; border-left: none; border: solid black 1.0pt; height: 15.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 134.35pt;" valign="top" width="179"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">Comment</span></div>
</td>
</tr>
<tr style="height: 30.0pt; mso-yfti-irow: 1;">
<td nowrap="" style="border-top: none; border: solid black 1.0pt; height: 30.0pt; mso-border-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 108.75pt;" valign="top" width="145"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">ConnectivityTable.txt (used to build nvcNodes)</span></div>
</td>
<td nowrap="" style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; height: 30.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 85.5pt;" valign="top" width="114"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">key2</span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; height: 30.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 140.15pt;" valign="top" width="187"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">linkage for E_ OHPRIMARY, E_UGPRIMARY, or E_SWCABBUSBAR</span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; height: 30.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 134.35pt;" valign="top" width="179"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">Written on graphic element; points to its tabular data.</span></div>
</td>
</tr>
<tr style="height: 15.0pt; mso-yfti-irow: 2;">
<td nowrap="" style="border-top: none; border: solid black 1.0pt; height: 15.0pt; mso-border-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 108.75pt;" valign="top" width="145"><br /></td>
<td nowrap="" style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; height: 15.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 85.5pt;" valign="top" width="114"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">node1</span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; height: 15.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 140.15pt;" valign="top" width="187"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">PRIMARY_STARTID_Remap</span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; height: 15.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 134.35pt;" valign="top" width="179"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">PRIMARY_STARTID mapped to an integer.</span></div>
</td>
</tr>
<tr style="height: 15.0pt; mso-yfti-irow: 3;">
<td nowrap="" style="border-top: none; border: solid black 1.0pt; height: 15.0pt; mso-border-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 108.75pt;" valign="top" width="145"><br /></td>
<td nowrap="" style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; height: 15.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 85.5pt;" valign="top" width="114"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">node2</span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; height: 15.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 140.15pt;" valign="top" width="187"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">PRIMARY_ENDID_Remap</span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; height: 15.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 134.35pt;" valign="top" width="179"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">PRIMARY_ENDID mapped to an integer.</span></div>
</td>
</tr>
<tr style="height: 30.0pt; mso-yfti-irow: 4;">
<td nowrap="" style="border-top: none; border: solid black 1.0pt; height: 30.0pt; mso-border-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 108.75pt;" valign="top" width="145"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">ConductorTable.txt (used to build nvcConductorTable)</span></div>
</td>
<td nowrap="" style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; height: 30.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 85.5pt;" valign="top" width="114"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">key2</span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; height: 30.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 140.15pt;" valign="top" width="187"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">linkage for E_ OHPRIMARY, E_UGPRIMARY, or E_SWCABBUSBAR</span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; height: 30.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 134.35pt;" valign="top" width="179"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">Written on graphic element; points to its tabular data.</span></div>
</td>
</tr>
<tr style="height: 30.0pt; mso-yfti-irow: 5;">
<td nowrap="" style="border-top: none; border: solid black 1.0pt; height: 30.0pt; mso-border-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 108.75pt;" valign="top" width="145"><br /></td>
<td nowrap="" style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; height: 30.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 85.5pt;" valign="top" width="114"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";"><table_name></table_name></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; height: 30.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 140.15pt;" valign="top" width="187"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">table name: E_ OHPRIMARY, E_UGPRIMARY, or E_SWCABBUSBAR</span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; height: 30.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 134.35pt;" valign="top" width="179"><br /></td>
</tr>
<tr style="height: 48.0pt; mso-yfti-irow: 6;">
<td nowrap="" style="border-top: none; border: solid black 1.0pt; height: 48.0pt; mso-border-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 108.75pt;" valign="top" width="145"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">StopFeature.txt </span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">(used to build nvcStopFeature)</span></div>
</td>
<td nowrap="" style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; height: 48.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 85.5pt;" valign="top" width="114"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">key2</span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; height: 48.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 140.15pt;" valign="top" width="187"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">linkage for E_ OHPRIMARY, E_UGPRIMARY, or E_SWCABBUSBAR
that has a stop feature attached to it.</span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; height: 48.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 134.35pt;" valign="top" width="179"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">Written on graphic element; points to its tabular data.</span></div>
</td>
</tr>
<tr style="height: 30.0pt; mso-yfti-irow: 7;">
<td nowrap="" style="border-top: none; border: solid black 1.0pt; height: 30.0pt; mso-border-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 108.75pt;" valign="top" width="145"><br /></td>
<td nowrap="" style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; height: 30.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 85.5pt;" valign="top" width="114"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">PRIMARY_NETID</span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; height: 30.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 140.15pt;" valign="top" width="187"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">Link to PRIMARY_ATTACHEDEDGEID for the stop feature</span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; height: 30.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 134.35pt;" valign="top" width="179"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">All I really need is for key2 to have a value in the
NameValueCollection.</span></div>
</td>
</tr>
<tr style="height: 30.0pt; mso-yfti-irow: 8;">
<td nowrap="" style="border-top: none; border: solid black 1.0pt; height: 30.0pt; mso-border-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 108.75pt;" valign="top" width="145"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">StopNode.txt </span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">(used to build nvcNodeOffsets)</span></div>
</td>
<td nowrap="" style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; height: 30.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 85.5pt;" valign="top" width="114"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">node</span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; height: 30.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 140.15pt;" valign="top" width="187"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">PRIMARY_STARTID_Remap or PRIMARY_ENDID_Remap</span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; height: 30.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 134.35pt;" valign="top" width="179"><br /></td>
</tr>
<tr style="height: 60.0pt; mso-yfti-irow: 9; mso-yfti-lastrow: yes;">
<td nowrap="" style="border-top: none; border: solid black 1.0pt; height: 60.0pt; mso-border-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 108.75pt;" valign="top" width="145"><br /></td>
<td nowrap="" style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; height: 60.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 85.5pt;" valign="top" width="114"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">offset</span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; height: 60.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 140.15pt;" valign="top" width="187"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">Position of the stop feature in the Primary category</span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; height: 60.0pt; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 134.35pt;" valign="top" width="179"><div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: black; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman";">Allows the trace to find the origin of the stop feature
in order to circle it.<span style="mso-spacerun: yes;"> </span>Other than the
circle, all I need is a value in the NameValueCollection.</span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; line-height: 115%;">Looking over the summary table above, it may seem that
I’m force fitting the stop feature and stop node into a NameValueCollection
when all I need is a list, array, or stack.<span style="mso-spacerun: yes;">
</span>I tried these data structures, and they were not as fast as the
NameValueCollection.<span style="mso-spacerun: yes;"> </span>My guess is that a
list, array, or stack is searched in sequential order, so the seek time is N/2,
whereas the seek time for a NameValueCollection (a hash table) is going to be
more like a fixed value between 1 and 2.<span style="mso-spacerun: yes;">
</span></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; line-height: 115%;">On
my four year old Dell laptop, HU_BuildConnectivityTable runs in 121 seconds (call
it 2 minutes) on a data set with 89,297 primaries, including overhead
primaries, underground primaries, and bus bars.<span style="mso-spacerun: yes;">
</span>This run time includes building the Transformer text files.<span style="mso-spacerun: yes;"> </span>HU_TraceElectric takes about 2 or 3 seconds
to initialize, which includes loading the text files into
NameValueCollections.<span style="mso-spacerun: yes;"> </span>I consider these
to be acceptable times when they enable a node-to-node trace to run at about
1,000 features per second.</span><b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 20.0pt; line-height: 115%;"><br clear="all" style="page-break-before: always;" /> </span></b><br />
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 20.0pt; line-height: 115%;"> The Trace Logic</span></b></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">The
VB.NET project is called HU_ElectricTrace.<span style="mso-spacerun: yes;">
</span>It is run as an external application in GTViewer.<span style="mso-spacerun: yes;"> </span>Here is the essential section of the form
shown to the user:</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0wXXxPacCeZ5wydEDskWXrfwHHl-7jK9Zec-euHpuGpekDcbXrPQVkrzyEVj2Qtvv37ooi4f3e3_4M28e4ZfQKVZBGwS9EzErNrbQrfZqQKTdCkj70o0mgX-10-1kPP6qzKDjNHbQbEPO/s1600/charlie1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0wXXxPacCeZ5wydEDskWXrfwHHl-7jK9Zec-euHpuGpekDcbXrPQVkrzyEVj2Qtvv37ooi4f3e3_4M28e4ZfQKVZBGwS9EzErNrbQrfZqQKTdCkj70o0mgX-10-1kPP6qzKDjNHbQbEPO/s1600/charlie1.png" /></a></div>
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">A
simplified flowchart is presented on the next page.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-ansi-language: EN-US; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US;"><br clear="all" style="page-break-before: always;" />
</span></b>
<br />
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Simplified Flow Chart</span></b></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglDH92Tkm06Xa0A8q1uHmO6Oju8Z2IE5oiGQaZny9oN1KW90yd5jnMby5CrybFkcYw1g0afesSP9nDgMzqg2vwv7ITVnIvsxI7gjUyKkHoQCeL4nYjxlb7u51J2doO6oi2uiu0rAWOO0Yx/s1600/charlie2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglDH92Tkm06Xa0A8q1uHmO6Oju8Z2IE5oiGQaZny9oN1KW90yd5jnMby5CrybFkcYw1g0afesSP9nDgMzqg2vwv7ITVnIvsxI7gjUyKkHoQCeL4nYjxlb7u51J2doO6oi2uiu0rAWOO0Yx/s320/charlie2.png" width="238" /></a></div>
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;"></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-ansi-language: EN-US; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US;"><br clear="all" style="page-break-before: always;" />
</span></b>
<br />
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Sequence of Actions</span></b></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">The
user clicks the “Trace Primary” button on the form and then clicks on a breaker
at a substation (E_PRIMARYCIRCUIT).<span style="mso-spacerun: yes;"> </span>A
current limitation is that the trace can only start with a substation
breaker.<span style="mso-spacerun: yes;"> </span>Future versions will allow the
user to start on any conducting feature.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Then
we determine the name of the circuit from that feature and write it to the
Listbox on the form.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Then
we get keys for the breaker and determine its node number (PRIMARY_NETID_Remap).<span style="mso-spacerun: yes;"> </span>This is the initialStartNode. We push that
node on the node stack, push that node on the nodes visited stack, and pass it
to the Node Iterator.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Node Iterator</span></b></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">The
sub “Node Iterator” is the recursive subroutine at the heart of the trace.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">It
runs a special GTViewer query called a “connectivity query”, that returns 2
arrays when fed a node number.<span style="mso-spacerun: yes;"> </span>One array
is a list of key1 values.<span style="mso-spacerun: yes;"> </span>The other is a
list of key2 values.<span style="mso-spacerun: yes;"> </span>It also returns a
count of the number of values returned, so the programmer writes a For…Next
loop that processes each set of key1-key2 pairs in turn.<span style="mso-spacerun: yes;"> </span>The keys are the links to every primary that
is connected to the node.<span style="mso-spacerun: yes;"> </span>In our case,
we need only use key2.<span style="mso-spacerun: yes;"> </span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">(Now
that I have learned a few things by working on this trace, I realize I could
write an equivalent to the connectivity query.<span style="mso-spacerun: yes;">
</span>It would be a NameValueCollection with the node as the key and a list of
key2’s as the values.<span style="mso-spacerun: yes;"> </span>When you define
the connectivity query, you have to provide the sorts of features that can have
nodes you want to consider, as well as the table and attribute names for the
nodes.<span style="mso-spacerun: yes;"> </span>For example, E_OHPRIMARY,
PRIMARY_STARTID, PRIMARY_ENDID.<span style="mso-spacerun: yes;"> </span>My code
works fine using the special GTViewer query; but developers outside the
GTViewer product can just as well use a NameValueCollection with the node
number as key and the list of links to primaries as the values.)</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Joey
Rogers, designer and developer of GTViewer, has provided a note on the
connectivity query:</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">The connectivity
query in GTViewer is performing a Binary Search over records that are
pre-sorted.<span style="mso-spacerun: yes;"> </span>There is a lot of debate
over using Binary Search vs. Hash Tables to look up values.<span style="mso-spacerun: yes;"> </span>Binary Searches generally work better if you
don’t have unique keys;<span style="mso-spacerun: yes;"> </span>Hash Tables
usually work better if you have unique keys.<span style="mso-spacerun: yes;">
</span>Since there are many records with the same keys in typical GIS data, and
since the connectivity query uses the same keys for each node of a feature, the
Binary Search was used in GTViewer.<span style="mso-spacerun: yes;">
</span>However, Hash tables should work better for this trace application
because you can use unique keys for most/all of the different pre-processed
data in the hash tables.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">For
each key2, we check whether it is already in a stack that contains key2 values
for primaries that have already been processed.<span style="mso-spacerun: yes;">
</span>(Since the connectivity query returns all the primaries that share that
node, once you are downstream on the trace, it will return the primary you came
from, which you want to disregard.<span style="mso-spacerun: yes;"> </span>By
historical accident, this stack is called “ufidStack”.<span style="mso-spacerun: yes;"> </span>I will refer to it later.)</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">(At the risk of
starting too many side trails, I will note here that if key2 is already in
ufidStack, the code tests whether the count of connected primaries is 1.<span style="mso-spacerun: yes;"> </span>If so, then we have a leaf node, and we add
its keys to a List(Of Integer) called “leafNodes”.<span style="mso-spacerun: yes;"> </span>I don’t use this in the current version of
the trace, but in previous versions I did something with all these leaf
nodes.<span style="mso-spacerun: yes;"> </span>So I kept the ability to keep
track of them, and here is where.<span style="mso-spacerun: yes;"> </span>After
this leaf node test the code skips to the …Next part of the For…Next loop.)</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">If
key2 has not already been processed, we use it to get the table for that
feature from the NameValueCollection “nvcConductorTable”.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Now we
test whether the current node is a stop node <i style="mso-bidi-font-style: normal;"><u>and</u></i> whether the primary for which we have key2 is a stop
feature, using simple functions that use nvcStopNode and nvcStopFeature.<span style="mso-spacerun: yes;"> </span>If both tests pass, we have found a stop node
on a stop feature; so we add the stop feature to a highlight list for stop
features and skip to the next set of keys in the For…Next loop.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">If
not, then we keep going.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">We
push the key2 of the primary onto the ufidStack.<span style="mso-spacerun: yes;"> </span>We increment the primary counter.<span style="mso-spacerun: yes;"> </span>We add the primary to the highlight list.<span style="mso-spacerun: yes;"> </span>(In GTViewer, there is a concept of adding
something to the highlight list and separately displaying the highlight.<span style="mso-spacerun: yes;"> </span>This separation allows you to add lots of
features to the highlight list without slowing down by updating the
display.)<span style="mso-spacerun: yes;"> </span>Based on a user setting on the
trace form, we update the display after processing every nth primary or we wait
until the whole circuit is complete.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Now
we determine the next node to feed Node Iterator.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">We
look at the NameValueCollection “nvcNodes”, which was built during
initialization from Connectivity.txt.<span style="mso-spacerun: yes;">
</span>The key is the key2 for the primary; the value is the pipe-delimited
list of two nodes.<span style="mso-spacerun: yes;"> </span>The GetNextNode
function merely parses out the nodes and returns the one that is not already in
the nodesVisited stack.<span style="mso-spacerun: yes;"> </span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: .5in; margin-right: 0in; margin-top: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">(Performance
note:<span style="mso-spacerun: yes;"> </span>It seems that .NET does a (slow)
sequential search to find out if an item is in a List, but does a fast search
to find if an item is in a Stack.<span style="mso-spacerun: yes;"> </span>I
could be wrong.<span style="mso-spacerun: yes;"> </span>It may be that the stack
of visited nodes is always relatively small (<2 and="" because="" composed="" each="" fast.="" feeder="" for="" integers="" is="" it="" of="" reinitialized="" s="" so="" span="" style="mso-spacerun: yes;" that="" why=""> <!--2--></2></span>Or it may be that even a
sequential search of the stack from the top down will generally find the
previous node soon in its path.)</div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Not
quite done.<span style="mso-spacerun: yes;"> </span>This new node may be a stop
node.<span style="mso-spacerun: yes;"> </span>We add it to the nodesVisited
stack and test whether it is a stop node and whether the feature for which we
have key2 is a stop feature.<span style="mso-spacerun: yes;"> </span>We may have
just turned up the other end of a feature that is a stop node and need to stop
there.<span style="mso-spacerun: yes;"> </span>If we do not find both stop node
and feature, we push the new node onto the nodeStack and pass it to Node Iterator,
which feeds the recursion.<span style="mso-spacerun: yes;"> </span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">The
very next line in the code is “nodeStack.Pop”.<span style="mso-spacerun: yes;">
</span>It’s really magical to me.<span style="mso-spacerun: yes;"> </span>The
recursion can go down a long path, but as it unpeels, the nodeStack pops off
the nodes, and can resume at a node it bypassed earlier.<span style="mso-spacerun: yes;"> </span>When the last node on the stack is popped,
it’s done.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-ansi-language: EN-US; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US;"><br clear="all" style="page-break-before: always;" />
</span></b>
<br />
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">When the Node Iterator is Done</span></b></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">We
update the view.<span style="mso-spacerun: yes;"> </span>In case the ShowAsYouGo
box has not been checked, this is the first time the user sees the traced
primaries on the screen.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">We
use the primary counter to show how many primaries have been processed.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;"><span style="mso-spacerun: yes;"> </span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Then
we call the subroutine PostProcess.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Not
too much of interest for the purposes of this paper, but I will note that if
the box ShowTransformerKvaByPhase has been checked, we show a summary of load
by phase.<span style="mso-spacerun: yes;"> </span>This may have some interest
for Bentley people.<span style="mso-spacerun: yes;"> </span>For some types of
transformers, it is necessary to drill down to the child records of a
Transformer Bank to get the phases of the units.<span style="mso-spacerun: yes;"> </span>The hard work is done in HU_BuildConnectivityTable
where we create another text file that makes it easy (and brisk) at run time.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<b style="mso-bidi-font-weight: normal;"><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Special Bentley Considerations</span></b></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">Bentley
models stop features (E_OHSWITCHBANK, E_SWCABFUSEDSWITCH, E_SWCABGROUPSWITCH)
as edge devices.<span style="mso-spacerun: yes;"> </span>Their attribute PRIMARY_ATTACHEDEDGEID
maps to the PRIMARY_NETID of a conducting feature.<span style="mso-spacerun: yes;"> </span>Therefore, stop features cannot be placed in
a NODE1-NODE2 pattern.<span style="mso-spacerun: yes;"> </span>It would simplify
processing tremendously if Switches and other potential stop features had a
node that matched where they connected to the primaries.<span style="mso-spacerun: yes;"> </span>But it would require a potentially major rework
of the Bentley feature model.</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">What
the trace code has to do is test whether a node is a stop node and whether the
primary it is currently processing is attached to a stop feature.<span style="mso-spacerun: yes;"> </span>Only if both conditions are satisfied should
the trace stop.<span style="mso-spacerun: yes;"> </span>If stop features had a
shared node with the primaries they connect to, this check would be simpler.</span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt;">For a
Bentley developer, the task of writing all these queries transforms into the
task of writing a series of SQL statements.<span style="mso-spacerun: yes;">
</span>I don’t mean to minimize the task, but it should be approachable for an
SQL guy.</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-4768571651580285164.post-74441424401022437742013-11-05T12:48:00.001-06:002013-11-05T12:48:41.147-06:00Getting Web Services to Work on IIS 7After switching to a new server, my Web Services did not work. It did not recognize the .svc extension.<br />
<br />
This page has a log of info on fixing the problem:<br />
<br />
http://msdn.microsoft.com/en-us/library/ms752252%28v=vs.90%29.aspx<br />
<br />
<br />
Running this command from a command prompt fixed my problem:<br />
<br />
<pre>"%WINDIR%\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -r</pre>
<pre> </pre>
<pre> </pre>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4768571651580285164.post-12745115135161168812013-01-24T14:41:00.000-06:002013-01-24T14:41:16.004-06:00Capitalize the First Letter of each Word in a StringThere is a built in .NET method to capitalize the first letter of each word in a string:<br />
<br />
<span style="color: blue;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-size: x-small;">newStr = Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(str)</span></span></span><br />
<br />
This is easier than writing the function to do it.<br />
<br />
I found this at:<br />
<br />
<a href="http://www.vbforums.com/showthread.php?557905-Uppercase-first-letter-in-each-word-of-a-string.">http://www.vbforums.com/showthread.php?557905-Uppercase-first-letter-in-each-word-of-a-string.</a><br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4768571651580285164.post-74070815347435206802012-12-12T16:36:00.000-06:002012-12-12T16:36:02.901-06:00Automatically Increment Version number for Assembly I have to look this up every time I do it, so I am posting this link to make it easier to find.<br />
<br />
<br />
<a href="http://www.csharpcity.com/2012/visual-studio-automatic-version-numbering/">http://www.csharpcity.com/2012/visual-studio-automatic-version-numbering/</a><br />
<br />
<br />
<br />To summarize, you have to change the C# <b>assemblyinfo.cs</b> file from:<br />
<br />
<pre><span style="color: blue;"><code>[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]</code></span></pre>
<br />
<br />
to just:<br />
<br />
<pre><span style="color: blue;"><code>[assembly: AssemblyVersion("1.0.*")]</code></span></pre>
<pre><code> </code></pre>
<pre><code> </code></pre>
<pre><code><span style="font-family: Georgia,"Times New Roman",serif;">The AssemblyFileVersion entry must not be present.</span> </code></pre>
<pre><code> </code></pre>
<pre><code><span style="font-family: Georgia,"Times New Roman",serif;">The version only increments when the project is opened, so it may appear that the version does not increment.</span></code></pre>
<pre><code><span style="font-family: Georgia,"Times New Roman",serif;"> </span></code></pre>
<pre><code><span style="font-family: Georgia,"Times New Roman",serif;"> </span></code></pre>
<pre><code><span style="font-family: Georgia,"Times New Roman",serif;">For VB.NET it is similar. Edit the<b> assemblyInfo.vb</b> file and change:</span></code></pre>
<pre><code><span style="font-family: Georgia,"Times New Roman",serif;"> </span></code></pre>
<pre><code><span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: blue;"><span style="font-family: "Courier New",Courier,monospace;"><assembly: assemblyversion="assemblyversion">
<assembly: assemblyfileversion="assemblyfileversion"> </assembly:></assembly:></span></span></span></code></pre>
<pre><code><span style="font-family: Georgia,"Times New Roman",serif;"> </span></code></pre>
<pre><code><span style="font-family: Georgia,"Times New Roman",serif;"> </span></code></pre>
<pre><code><span style="font-family: Georgia,"Times New Roman",serif;">to:</span></code></pre>
<pre><code><span style="font-family: Georgia,"Times New Roman",serif;"> </span></code></pre>
<pre><code><span style="color: blue;"><span style="font-family: "Courier New",Courier,monospace;"> <assembly: assemblyversion="assemblyversion"> </assembly:></span></span></code></pre>
<br />
<br />
The GUI for Assembly Version does not let you make this change.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4768571651580285164.post-85138991695265865542012-11-27T08:57:00.003-06:002012-11-27T08:58:09.752-06:00Closing Parent Form from Child Form in VB.NETThe Application.Exit() call can be made in the child form's FormClosed event to exist the app when the child form is closed. <br />
<br />
<br />
<span style="font-family: "Courier New",Courier,monospace;"> Private Sub Form_Child_FormClosed(sender As Object, e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed<br /><br /> Application.Exit()<br /><br /> End Sub</span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4768571651580285164.post-24030247876099068652012-11-27T08:56:00.001-06:002012-11-27T08:58:00.858-06:00Unload Event equivalent in VB.NET<br />
<br />
For VB.NET, you can use the <b>FormClosed </b>or <b>FormClosing </b>in place of the VB6 Unload event.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4768571651580285164.post-21717126085449182012-04-03T14:52:00.003-05:002012-04-03T14:57:43.662-05:00Can't find Mime Types in IIS 7.5I was installing a Web Application on IIS 7.5. Everything seems to work until I try to visit some of my pages and they just didn't do anything, no error messages or anything. Strangely, all of the .aspx files worked, it was just simple files like .htm and .jpb that didn't work. <br /><br />I thought maybe the Mime types were not setup correctly, so I went to see what was defined. I couldn't find the Mime Types option in the IIS Managment Console.<br /><br />It turns out that the <span style="font-weight: bold;">Static Content</span> option under the Http Features (under Server Managers, Web Server roles) was not installed. Installed the Static Content option in Server Manager and everything started working.Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-4768571651580285164.post-26956942073851233262011-11-16T15:32:00.001-06:002011-11-16T15:35:30.781-06:00My.Resources in C#The equivalent of:<br /><br /><span style="font-family: courier new;"> My.Resources </span><br /><br />in VB.NET is:<br /><br /> <span style="font-family: courier new;">Properties.Resources </span><br /><br />in C#.<br /><br />So,<br /><br /><span style="font-family: courier new;"> Me.Icon = My.Resources.AppIcon</span><br /><br />in VB.NET is equivalent to:<br /><br /> <span style="font-family: courier new;">this.Icon = Properties.Resources.App_Icon;</span><br /><br />in C#.Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-4768571651580285164.post-79667762837270250452011-10-21T14:48:00.000-05:002018-03-21T14:28:08.034-05:00Computing RGB composite Color Value in C#If you still have to deal with the Win32Api in C#, you may need to get the old-style RGB composite color values from a .NET Color value. The ToArgb method doesn't work like you want, so it has to be computed:<br />
<br />
<pre class="CSharp" name="code"> private int ConvertColorToRGB(Color col)
{
return (col.R) | (col.G << 8) | (col.B << 16);
}
</pre>
If you are using VB.NET, it still has an RGB function to call or:<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> Public Function ConvertColorToRGB(col As Color) As Integer</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> Return CInt(col.R) Or (CInt(col.G) << 8) Or (CInt(col.B) << 16)</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> End Function</span>Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-4768571651580285164.post-8421214372241396392011-08-25T10:10:00.000-05:002011-08-25T10:20:50.950-05:00Updating the NUM_ROWS in USER_TABLES in OracleGood or bad, I use the NUM_ROWS values in the USER_TABLES table to help filter lists of tables when presenting them to the user. If I have a database and only about 25% of tables have records (and there are thousands of tables), then it is a lot nicer to only sift through the tables that do have records, and knowing how many records is even better (even if it is only an estimate). My problem is that these values don't just get updated automatically for you. You might find that they are all 0 even when there is data present. You can update all of the values with something like this:
<br />
<br /><span style="color: rgb(51, 51, 255); font-family: courier new;">exec dbms_stats.gather_schema_stats('mySchema', cascade=>TRUE)</span>
<br />
<br />A lot more info on this topic can be found at:
<br />
<br /><a href="http://www.dba-oracle.com/concepts/tables_optimizer_statistics.htm">http://www.dba-oracle.com/concepts/tables_optimizer_statistics.htm</a>
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4768571651580285164.post-525023750662909532011-07-18T12:13:00.000-05:002011-07-18T12:20:44.448-05:00Creating a .CSV file in ASP.NETI wanting to create a .CSV file from a query to SQL Server in ASP.NET. The link below has an excellent description of creating the .CSV file without having to create a temp file like I was originally planning to do. This post doesn't show how to wrap the query results up, but that is pretty simple to figure out:<br /><br /><a href="http://wiki.asp.net/page.aspx/401/export-to-csv-file/">http://wiki.asp.net/page.aspx/401/export-to-csv-file/</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4768571651580285164.post-91736863919183962322011-07-14T12:20:00.000-05:002011-07-14T12:35:52.797-05:00Selecting a Folder in VB.NETTo go along with my previous <a href="http://dotnetref.blogspot.com/2011/07/selecting-files-to-open-or-save-in.html">post</a> on the Open File and Save File dialogs in VB.NET, I am providing this post using <span style="font-weight: bold;">FolderBrowserDialog </span>to select a specific Directory.<br /><br />Browsing to Select a Directory in VB.NET<br /><pre name="code" class="Vb"> Dim dirDlg As New FolderBrowserDialog<br /><br /> dirDlg.RootFolder = Environment.SpecialFolder.MyComputer<br /><br /> If dirDlg.ShowDialog() = DialogResult.OK Then<br /><br /> ' do something with the selected path<br /> Debug.Print("Directory: " + dirDlg.SelectedPath)<br /><br /> Else<br /><br /> ' the dialog was cancelled<br /><br /> End If<br /></pre><br /><br />The <span style="font-weight: bold;">FolderBrowsingDialog </span>object has many options, but I have only shown the most commonly used one in the example. The <span style="font-weight: bold;">RootFolder </span>property lets you specify the directory to start browsing from. You can set this property to an explicit path (like "c:\MyData") or you can use the special directories that are defined for you:<br /><pre name="code" class="Vb">Environment.SpecialFolder.MyDocument<br />Environment.SpecialFolder.MyComputer<br />Environment.SpecialFolder.MyPictures<br />Environment.SpecialFolder.Desktop<br /><br /></pre>The default is Environment.SpecialFolder.MyComputer.<br /><br />After the <span style="font-weight: bold;">ShowDialog </span>call returns OK, use the <span style="font-weight: bold;">SelectedPath</span> property to get the selected directory.Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-4768571651580285164.post-8196395543181817632011-07-14T09:24:00.000-05:002011-07-19T11:54:09.600-05:00Selecting Files to Open or Save in VB.NETVB.NET has come a long way from the clunky Common Dialog control of VB6 for implementing a standard dialog that will let you browse to find a file to <span style="font-weight: bold;">Open </span>or <span style="font-weight: bold;">Save</span>. Here is an example of each:<br /><br />Browsing to Open a File in VB.NET<br /><pre name="code" class="Vb"> Dim fileDlg As New OpenFileDialog<br /><br /> fileDlg.Filter = "CSV File (*.csv)|*.csv|txt files (*.txt)|*.txt|All files (*.*)|*.*"<br /> fileDlg.DefaultExt = "csv"<br /><br />' could be omitted to use default, or a specific dir can be given<br /> fileDlg.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)<br /><br /> If fileDlg.ShowDialog() = DialogResult.OK Then<br /><br /> ' Do something with the selected filename<br /> Debug.Print(fileDlg.FileName)<br /><br /> Else<br /><br /> ' the dialog was cancelled<br /><br /> End If<br /></pre><br />The <span style="font-weight: bold;">OpenFileDialog </span>object is used here, and I have only shown the most commonly used options. The <span style="font-weight: bold;">Filter </span>property lets you specify the which File Types will be selectable form the Open File Dialog (in a dropdown list). The value is set to a string that is a pipe (|) delimited list composed to a File Type Description and Filter Pattern. If you have more than one File Type, you can add another pipe, then another Description|Filter Pattern, and so on. If you leave the Filter property empty, then then Open File Dialog will just not have a drop down to select the File Type filter. Here are some examples:<br /><br />"CSV File (*.csv)|*.csv"<br />"CSV File (*.csv)|*.csv|txt files (*.txt)|*.txt"<br />"CSV File (*.csv)|*.csv|txt files (*.txt)|*.txt|All files (*.*)|*.*"<br /><br />If you are using <span style="font-weight: bold;">Filter </span>with more than one File Type specified, you can also use <span style="font-weight: bold;">DefaultExt</span> to specify which File Type to use as the default. Just specify the extension as a string (with no dot). This property also will set the default file extension to use if you don't specify it in the filename (if typed in), so this property can also be used without the Filter property being set.<br /><br />The <span style="font-weight: bold;">InitialDirectory </span>property will let you define which directory to open up in. You can set this property to an explicit path (like "c:\MyData") or you can use the special directories that are defined for you, like:<br /><pre name="code" class="Vb">Environment.SpecialFolder.MyDocument<br />Environment.SpecialFolder.MyComputer<br />Environment.SpecialFolder.MyPictures<br />Environment.SpecialFolder.Desktop<br /></pre><br />There is also a <span style="font-weight: bold;">Title </span>property that can be used to change the name of the Open File Dialog. In this example, it is not used and defaults to "Open File".<br /><br />After the <span style="font-weight: bold;">ShowDialog </span>call returns OK, use the <span style="font-weight: bold;">FileName </span>property to get the selected filename.<br /><br />Browsing to Save a File in VB.NET<br /><pre name="code" class="Vb"> Dim fileDlg As New SaveFileDialog<br /><br /> fileDlg.Filter = "CSV File (*.csv)|*.csv|txt files (*.txt)|*.txt|All files (*.*)|*.*"<br /> fileDlg.DefaultExt = "csv"<br /><br /> ' InitialDirectory can be omitted to use default, or used to specify an explicit directory<br /> fileDlg.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)<br /><br /> fileDlg.OverwritePrompt = True<br /><br /> If fileDlg.ShowDialog() = DialogResult.OK Then<br /><br /> ' Do something with the selected filename<br /> Debug.Print(fileDlg.FileName)<br /><br /> Else<br /><br /> ' the dialog was cancelled<br /><br /> End If<br /></pre><br />Saving a file is similar to opening a file. You use a <span style="font-weight: bold;">SaveFileDialog </span>object instead of a <span style="font-weight: bold;">OpenFileDialog </span>object. Many of the properties work the same way as with the OpenFileDialog such as Filter, DefaultExt, and InitialDirectory. I also show OverwritePrompt set to True (which is the default). This setting will cause the dialog to prompt you when you try to save over an existing file.<br /><br />After the <span style="font-weight: bold;">ShowDialog </span>call returns OK, use the <span style="font-weight: bold;">FileName </span>property to get the filename.<br /><br />If you want to select a Directory instead of a file, look at this <a href="http://dotnetref.blogspot.com/2011/07/to-go-along-with-my-previous-post-on.html">post</a>.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4768571651580285164.post-85838779722618214412011-07-13T15:11:00.000-05:002011-07-13T15:16:25.859-05:00Setting all elements of an Array to Null in C# (like with memset in C++)I sometime find it strange that things we take for granted in C++ are hard in C#. Probably I should say hard to find the equivalent for rather than hard to do. I routinely clear out my arrays in C++ with memset (setting each item to 0). To get the equivalent in C#, you can use the Array.Clear(...) method like this:<br /><pre name="code" class="CSharp">Array.Clear(MyArray,0,MyArray.Length);<br /></pre>Here is a more detailed example:<br /><br /><a href="http://www.dotnetperls.com/array-clear">http://www.dotnetperls.com/array-clear</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4768571651580285164.post-50323879955906125032011-07-12T13:43:00.000-05:002011-07-12T14:56:14.402-05:00Preventing Flicker with GDI+ drawing in C#In C#, the <span style="font-weight:bold;">OnPaintBackground </span>method is called before the <span style="font-weight: bold;">OnPaint </span>event and it draws the background color for the entire view. If you are already drawing the background in the OnPaint event, then this process will cause flicker. You can override the <span style="font-weight: bold;">OnPaintBackground </span>and just do nothing in it to prevent the flicker:<br /><pre name="code" class="CSharp">protected override void OnPaintBackground(PaintEventArgs pevent)<br />{<br />// do nothing<br />}<br /></pre>Unknownnoreply@blogger.com8tag:blogger.com,1999:blog-4768571651580285164.post-27986938957047593942011-06-29T10:13:00.000-05:002011-06-29T11:59:16.504-05:00Script to Purge All Objects for a User in OracleI have to purge and reload an Oracle Database dump on a monthly basis. I have been manually deleting all of the Objects with Toad before loading the new dump. I searched for a script that would delete all of the objects. Many people suggested that you should just drop the user, but if I do this I have to add back in grants that don't get picked up by the export. <br /><br />This <a href="http://forums.oracle.com/forums/thread.jspa?threadID=614090">thread</a> on the Oracle Discussion Forum has several solutions. I am pasting the script that worked the best for me below from Massimo. There is some criticism in the thread about why he did not just use the object name in one case instead of all the If/Else conditions; however, I like this approach better, because I can easily take out something if I need to:<br /><pre name="code" class="Sql"><br />declare<br />stringa varchar2(100);<br /><br />cursor cur is<br /> select *<br /> from user_objects;<br /><br />begin<br /> for c in cur loop<br /> begin<br /> stringa := '';<br /> if c.object_type = 'VIEW' then<br /> stringa := 'drop view ' || c.object_name;<br /> EXECUTE immediate stringa;<br /> elsif c.object_type = 'TABLE' then<br /> stringa := 'drop table ' || c.object_name || ' cascade constraints';<br /> EXECUTE immediate stringa;<br /> elsif c.object_type = 'SEQUENCE' then<br /> stringa := 'drop sequence ' || c.object_name;<br /> EXECUTE immediate stringa;<br /> elsif c.object_type = 'PACKAGE' then<br /> stringa := 'drop package ' || c.object_name;<br /> EXECUTE immediate stringa; <br /> elsif c.object_type = 'TRIGGER' then<br /> stringa := 'drop trigger ' || c.object_name;<br /> EXECUTE immediate stringa; <br /> elsif c.object_type = 'PROCEDURE' then<br /> stringa := 'drop procedure ' || c.object_name;<br /> EXECUTE immediate stringa;<br /> elsif c.object_type = 'FUNCTION' then<br /> stringa := 'drop function ' || c.object_name;<br /> EXECUTE immediate stringa; <br /> elsif c.object_type = 'SYNONYM' then<br /> stringa := 'drop synonym ' || c.object_name;<br /> EXECUTE immediate stringa;<br /> elsif c.object_type = 'INDEX' then<br /> stringa := 'drop index ' || c.object_name;<br /> EXECUTE immediate stringa;<br /> elsif c.object_type = 'PACKAGE BODY' then<br /> stringa := 'drop PACKAGE BODY ' || c.object_name;<br /> EXECUTE immediate stringa; <br /> elsif c.object_type = 'DATABASE LINK' then<br /> stringa := 'drop database link ' || c.object_name;<br /> EXECUTE immediate stringa; <br /> end if;<br /> exception<br /> when others then<br /> null;<br /> end; <br /> end loop;<br /> -- PURGE recyclebin<br /><br />end;<br />/<br /></pre>Unknownnoreply@blogger.com0