<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-6707555</atom:id><lastBuildDate>Thu, 25 Sep 2025 06:55:43 +0000</lastBuildDate><category>DrH4x0rsVoid</category><category>Code</category><category>software</category><category>.net</category><category>vista</category><category>windows</category><category>Zybermark</category><category>music</category><category>technology</category><category>csharp</category><category>microsoft</category><category>NVidia</category><category>PuTTY</category><category>Realtek HD Audio</category><category>Windows7</category><category>security</category><category>ASP.Net</category><category>Certificates</category><category>Expression Blend</category><category>MIDI</category><category>VSTi</category><category>WebService</category><category>anime</category><category>flamebait</category><category>fun</category><category>performance</category><category>pocket pc</category><category>review</category><category>robotics</category><category>samurize</category><category>tutorial</category><category>windows ce</category><category>windows mobile</category><title>Zybermark</title><description>Adventures in the digital world of music and computer programming.</description><link>http://zybermark.blogspot.com/</link><managingEditor>noreply@blogger.com (Zybermark)</managingEditor><generator>Blogger</generator><openSearch:totalResults>30</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6707555.post-478941338413787615</guid><pubDate>Sun, 22 Jul 2012 03:08:00 +0000</pubDate><atom:updated>2012-07-21T21:14:36.884-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">.net</category><category domain="http://www.blogger.com/atom/ns#">ASP.Net</category><category domain="http://www.blogger.com/atom/ns#">Code</category><category domain="http://www.blogger.com/atom/ns#">DrH4x0rsVoid</category><title>Creating a File Relay (proxy) using ASP.Net - Part 1 - Serving files.</title><description>&lt;p&gt;In this series of posts I will walk you through implementing an ASP.Net based file relay mechanism using aspx pages. This will allow you to serve files hosted in the back-office (behind a firewall) from a frontend webserver.&lt;/p&gt;  &lt;p&gt;To implement this solution we need to build two separate webpages, one for the backend server and one for the frontend server.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;GetFile.aspx&lt;/strong&gt; – The backend page which will surface the requested file to the frontend server. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;RelayFile.aspx &lt;/strong&gt;– The frontend page which will forward (relay/proxy) the request to the backend server. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;In this first part I will show you how to send a file using an aspx page.&lt;/p&gt;  &lt;h2&gt;Implementing GetFile.aspx&lt;/h2&gt;  &lt;p&gt;The first thing we need to do is create the new aspx page and name it GetFile.aspx.&lt;/p&gt;  &lt;h3&gt;The Page Markup&lt;/h3&gt;  &lt;p&gt;Now let’s go ahead and remove all the content from the GetFile.aspx page, except for the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ydy4x04a&quot; target=&quot;_blank&quot;&gt;Page directive&lt;/a&gt;; The purpose of this page is to return to contents of another file, so all the html markup is superfluous.&lt;/p&gt;  &lt;pre class=&quot;csharpcode&quot;&gt;&amp;lt;%@ Page Language=&lt;span class=&quot;str&quot;&gt;&amp;quot;C#&amp;quot;&lt;/span&gt; AutoEventWireup=&lt;span class=&quot;str&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt; CodeBehind=&lt;span class=&quot;str&quot;&gt;&amp;quot;GetFile.aspx.cs&amp;quot;&lt;/span&gt; Inherits=&lt;span class=&quot;str&quot;&gt;&amp;quot;Backend.GetFile&amp;quot;&lt;/span&gt; %&amp;gt;&lt;/pre&gt;

&lt;h3&gt;The Code Behind&lt;/h3&gt;

&lt;p&gt;With the markup out of the way, let’s focus on the actual code behind the page. The only method we will need to implement is Page_Load.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; Ensure a clean response – We don’t want anything from the aspx processing pipeline to interfere with the result&lt;/p&gt;

&lt;pre class=&quot;csharpcode&quot;&gt;Response.ClearHeaders();
Response.ClearContent();&lt;/pre&gt;
&lt;style type=&quot;text/css&quot;&gt;




.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; Determine the target file – In this example the filepath will be passed with the querystring.&lt;/p&gt;

&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; filePath = (Request.QueryString[&lt;span class=&quot;str&quot;&gt;&amp;quot;filePath&amp;quot;&lt;/span&gt;] ?? &lt;span class=&quot;str&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;).Trim();&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; Determine and set the response type – This will allow the browser to display the file correctly. Also, make sure you only serve expected file types! This feature circumvents the basic webserver file security mechanisms, avoid leaking your secrets to the world!&lt;/p&gt;

&lt;div class=&quot;csharpcode&quot;&gt;
  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; contentType = &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; extension = Path.GetExtension(filePath).ToLowerInvariant();&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;switch&lt;/span&gt; (extension)&lt;/pre&gt;

  &lt;pre&gt;{&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;   &lt;span class=&quot;kwrd&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&amp;quot;.csv&amp;quot;&lt;/span&gt;:&lt;/pre&gt;

  &lt;pre&gt;      contentType = &lt;span class=&quot;str&quot;&gt;&amp;quot;text/csv&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;      &lt;span class=&quot;kwrd&quot;&gt;break&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;   &lt;span class=&quot;kwrd&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&amp;quot;.mp4&amp;quot;&lt;/span&gt;:&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;      contentType = &lt;span class=&quot;str&quot;&gt;&amp;quot;video/mp4&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;      &lt;span class=&quot;kwrd&quot;&gt;break&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;   &lt;span class=&quot;kwrd&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&amp;quot;.pdf&amp;quot;&lt;/span&gt;:&lt;/pre&gt;

  &lt;pre&gt;      contentType = &lt;span class=&quot;str&quot;&gt;&amp;quot;application/pdf&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;      &lt;span class=&quot;kwrd&quot;&gt;break&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;   &lt;span class=&quot;kwrd&quot;&gt;default&lt;/span&gt;:&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;      &lt;span class=&quot;rem&quot;&gt;// Unsupported filetype&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;      &lt;span class=&quot;rem&quot;&gt;// There are serious security implications with&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;      &lt;span class=&quot;rem&quot;&gt;// serving up files from a webserver. Make sure&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;      &lt;span class=&quot;rem&quot;&gt;// you do not open yourself up to an attack!&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;      &lt;span class=&quot;kwrd&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; HttpException(403, &lt;span class=&quot;str&quot;&gt;&amp;quot;Forbidden.&amp;quot;&lt;/span&gt;); &lt;/pre&gt;

  &lt;pre&gt;      &lt;span class=&quot;rem&quot;&gt;// Use an empty ContentType if the type is unknown&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;      &lt;span class=&quot;rem&quot;&gt;//contentType = &amp;quot;&amp;quot;;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;      &lt;span class=&quot;rem&quot;&gt;//break;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;}&lt;/pre&gt;

  &lt;pre&gt;   &lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;rem&quot;&gt;//Set the ContentType.&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;Response.ContentType = contentType;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;4.&lt;/strong&gt; Set the response content length so the client knows how much data to expect.&lt;/p&gt;

&lt;pre class=&quot;csharpcode&quot;&gt;var fileInfo = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; FileInfo(filePath);
Response.AddHeader(&lt;span class=&quot;str&quot;&gt;&amp;quot;Content-Length&amp;quot;&lt;/span&gt;, fileInfo.Length.ToString());&lt;/pre&gt;

&lt;p&gt;5. Write the file contents to the response stream.&lt;/p&gt;

&lt;pre class=&quot;csharpcode&quot;&gt;Response.WriteFile(filePath);&lt;/pre&gt;

&lt;p&gt;6. Flush the output buffers and end the response.&lt;/p&gt;

&lt;pre class=&quot;csharpcode&quot;&gt;Response.End();&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h2&gt;It’s a Wrap!&lt;/h2&gt;

&lt;p&gt;These 6 simple steps (7 if you count the page markup change) are all you need to implement a simple page to serve files from the filesystem. In the next part we will have a look at making this code more production ready by adding error checking and handling.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h2&gt;The Complete Page_Load Method&lt;/h2&gt;

&lt;div class=&quot;csharpcode&quot;&gt;
  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   1:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Page_Load(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, EventArgs e)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   3:  &lt;/span&gt;   &lt;span class=&quot;rem&quot;&gt;// Clear headers and content to ensure a clean response&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   4:  &lt;/span&gt;   Response.ClearHeaders();&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   5:  &lt;/span&gt;   Response.ClearContent();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   6:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   7:  &lt;/span&gt;   &lt;span class=&quot;rem&quot;&gt;// get target file path from querystring&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   8:  &lt;/span&gt;   &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; filePath = (Request.QueryString[&lt;span class=&quot;str&quot;&gt;&amp;quot;filePath&amp;quot;&lt;/span&gt;] ?? &lt;span class=&quot;str&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;).Trim();&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   9:  &lt;/span&gt;   Debug.WriteLine(&lt;span class=&quot;str&quot;&gt;&amp;quot;GetFile: filePath: &#39;&amp;quot;&lt;/span&gt; + filePath + &lt;span class=&quot;str&quot;&gt;&amp;quot;&#39;&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  10:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  11:  &lt;/span&gt;   &lt;span class=&quot;rem&quot;&gt;// determine content type&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  12:  &lt;/span&gt;   &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; contentType = &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  13:  &lt;/span&gt;   &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; extension = Path.GetExtension(filePath).ToLowerInvariant();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  14:  &lt;/span&gt;   &lt;span class=&quot;kwrd&quot;&gt;switch&lt;/span&gt; (extension)&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  15:  &lt;/span&gt;   {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  16:  &lt;/span&gt;      &lt;span class=&quot;kwrd&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&amp;quot;.csv&amp;quot;&lt;/span&gt;:&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  17:  &lt;/span&gt;         contentType = &lt;span class=&quot;str&quot;&gt;&amp;quot;text/csv&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  18:  &lt;/span&gt;         &lt;span class=&quot;kwrd&quot;&gt;break&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  19:  &lt;/span&gt;      &lt;span class=&quot;kwrd&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&amp;quot;.mp4&amp;quot;&lt;/span&gt;:&lt;/pre&gt;

  &lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  20:  &lt;/span&gt;         contentType = &lt;span class=&quot;str&quot;&gt;&amp;quot;video/mp4&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  21:  &lt;/span&gt;         &lt;span class=&quot;kwrd&quot;&gt;break&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  22:  &lt;/span&gt;      &lt;span class=&quot;kwrd&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&amp;quot;.pdf&amp;quot;&lt;/span&gt;:&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  23:  &lt;/span&gt;         contentType = &lt;span class=&quot;str&quot;&gt;&amp;quot;application/pdf&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  24:  &lt;/span&gt;         &lt;span class=&quot;kwrd&quot;&gt;break&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  25:  &lt;/span&gt;      &lt;span class=&quot;kwrd&quot;&gt;default&lt;/span&gt;:&lt;/pre&gt;

  &lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  26:  &lt;/span&gt;         &lt;span class=&quot;rem&quot;&gt;// Unsupported filetype&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  27:  &lt;/span&gt;         &lt;span class=&quot;rem&quot;&gt;// There are serious security implications with&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  28:  &lt;/span&gt;         &lt;span class=&quot;rem&quot;&gt;// serving up files from a webserver. Make sure&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  29:  &lt;/span&gt;         &lt;span class=&quot;rem&quot;&gt;// you do not open yourself up to an attack!&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  30:  &lt;/span&gt;         &lt;span class=&quot;kwrd&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; HttpException(403, &lt;span class=&quot;str&quot;&gt;&amp;quot;Forbidden.&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  31:  &lt;/span&gt;      &lt;span class=&quot;rem&quot;&gt;// Use an empty ContentType if the type is unknown&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  32:  &lt;/span&gt;      &lt;span class=&quot;rem&quot;&gt;//contentType = &amp;quot;&amp;quot;;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  33:  &lt;/span&gt;      &lt;span class=&quot;rem&quot;&gt;//break;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  34:  &lt;/span&gt;   }&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  35:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  36:  &lt;/span&gt;   &lt;span class=&quot;rem&quot;&gt;//Set the ContentType.&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  37:  &lt;/span&gt;   Response.ContentType = contentType;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  38:  &lt;/span&gt;   Debug.WriteLine(&lt;span class=&quot;str&quot;&gt;&amp;quot;Mapped extension &#39;&amp;quot;&lt;/span&gt; + extension &lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  39:  &lt;/span&gt;          + &lt;span class=&quot;str&quot;&gt;&amp;quot;&#39; to content type &#39;&amp;quot;&lt;/span&gt; + contentType + &lt;span class=&quot;str&quot;&gt;&amp;quot;&#39;.&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  40:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  41:  &lt;/span&gt;   &lt;span class=&quot;rem&quot;&gt;// determine and set file length&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  42:  &lt;/span&gt;   var fileInfo = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; FileInfo(filePath);&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  43:  &lt;/span&gt;   Response.AddHeader(&lt;span class=&quot;str&quot;&gt;&amp;quot;Content-Length&amp;quot;&lt;/span&gt;, fileInfo.Length.ToString());&lt;/pre&gt;

  &lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  44:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  45:  &lt;/span&gt;   &lt;span class=&quot;rem&quot;&gt;//Write the file directly to the HTTP content output stream.&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  46:  &lt;/span&gt;   Response.WriteFile(filePath);&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  47:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  48:  &lt;/span&gt;   &lt;span class=&quot;rem&quot;&gt;// flush and end the response&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  49:  &lt;/span&gt;   Response.End();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  50:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type=&quot;text/css&quot;&gt;





.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;  </description><link>http://zybermark.blogspot.com/2012/07/creating-file-relay-proxy-using-aspnet.html</link><author>noreply@blogger.com (Zybermark)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6707555.post-5875801917257780483</guid><pubDate>Sat, 09 Jun 2012 16:33:00 +0000</pubDate><atom:updated>2012-06-09T11:27:23.417-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Code</category><category domain="http://www.blogger.com/atom/ns#">DrH4x0rsVoid</category><category domain="http://www.blogger.com/atom/ns#">security</category><category domain="http://www.blogger.com/atom/ns#">vista</category><category domain="http://www.blogger.com/atom/ns#">windows</category><category domain="http://www.blogger.com/atom/ns#">Windows7</category><title>How To Detect If The Command Prompt Is Running Elevated</title><description>&lt;p&gt;As I was &lt;a title=&quot;Console2 - A Better Windows Command Prompt&quot; href=&quot;http://www.hanselman.com/blog/Console2ABetterWindowsCommandPrompt.aspx&quot; target=&quot;_blank&quot;&gt;setting up my Console2 shell tabs&lt;/a&gt; I was curious if running Console2 as an administrator would transfer the elevated privileges token to the tabs as well.&lt;/p&gt;  &lt;p&gt;Turns out detecting this was not as straightforward as I thought it would be!&lt;/p&gt;  &lt;h2&gt;TL;DR&lt;/h2&gt;  &lt;p&gt;If you need to know &lt;a title=&quot;How To Detect Elevation From The Commandline&quot; href=&quot;http://marksletterink.com/wiki/code.HowToDetectElevationFromTheCommandline.ashx&quot; target=&quot;_blank&quot;&gt;how to detect if the command prompt is running elevated&lt;/a&gt; (&lt;a title=&quot;Creating a Self-Elevating Script&quot; href=&quot;http://blogs.technet.com/b/elevationpowertoys/archive/2010/06/20/creating-a-self-elevating-script.aspx&quot; target=&quot;_blank&quot;&gt;or your script&lt;/a&gt;) use the following command:&lt;/p&gt;  &lt;blockquote&gt;   &lt;pre&gt;&lt;strong&gt;whoami /groups&lt;/strong&gt;&lt;/pre&gt;
&lt;/blockquote&gt;
If the output contains these lines the process is running elevated: 

&lt;blockquote&gt;
  &lt;pre&gt;&lt;strong&gt;Mandatory Label\High Mandatory Level Label            S-1-16-12288&lt;/strong&gt;
                    Mandatory group, Enabled by default, Enabled group&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;h2&gt;The Long Answer&lt;/h2&gt;

&lt;p&gt;With the addition of &lt;a title=&quot;What is User Account Control&quot; href=&quot;http://windows.microsoft.com/en-US/windows-vista/What-is-User-Account-Control&quot; target=&quot;_blank&quot;&gt;User Account Control&lt;/a&gt; to Windows Vista the platform gained integrity levels – an integrity level indicates how much an application can be trusted to perform&amp;#160; actions on the system, e.g. accessing files or the registry and interacting with other processes. By adding this additional security feature to the OS it now has another indicator to help isolate (&lt;a title=&quot;Wikipedia: Sandbox (computer security)&quot; href=&quot;http://en.wikipedia.org/wiki/Sandbox_%28computer_security%29&quot; target=&quot;_blank&quot;&gt;sandbox&lt;/a&gt;) programs and prevent them from going rogue on your system. Very cool!&lt;/p&gt;

&lt;p&gt;The following &lt;a href=&quot;http://www.symantec.com/connect/articles/introduction-windows-integrity-control&quot; target=&quot;_blank&quot;&gt;integrity levels&lt;/a&gt; are supported:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;b&gt;Untrusted&lt;/b&gt; – processes that are logged on anonymously are automatically designated as Untrusted &lt;/li&gt;

  &lt;li&gt;&lt;b&gt;Low&lt;/b&gt; – The Low integrity level is the level used by default for interaction with the Internet. As long as Internet Explorer is run in its default state, Protected Mode, all files and processes associated with it are assigned the Low integrity level. Some folders, such as the Temporary Internet Folder, are also assigned the Low integrity level by default. &lt;/li&gt;

  &lt;li&gt;&lt;b&gt;Medium&lt;/b&gt; – Medium is the context that most objects will run in. Standard users receive the Medium integrity level, and any object not explicitly designated with a lower or higher integrity level is Medium by default. &lt;/li&gt;

  &lt;li&gt;&lt;b&gt;High&lt;/b&gt; – Administrators are granted the High integrity level. This ensures that Administrators are capable of interacting with and modifying objects assigned Medium or Low integrity levels, but can also act on other objects with a High integrity level, which standard users can not do. &lt;/li&gt;

  &lt;li&gt;&lt;b&gt;System&lt;/b&gt; – As the name implies, the System integrity level is reserved for the system. The Windows kernel and core services are granted the System integrity level. Being even higher than the High integrity level of Administrators protects these core functions from being affected or compromised even by Administrators. &lt;/li&gt;

  &lt;li&gt;&lt;b&gt;Installer&lt;/b&gt; – The Installer integrity level is a special case and is the highest of all integrity levels. By virtue of being equal to or higher than all other WIC integrity levels, objects assigned the Installer integrity level are also able to uninstall all other objects. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;For more info see the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/bb625963.aspx&quot; target=&quot;_blank&quot;&gt;Windows Integrity Mechanism Design&lt;/a&gt;.&lt;/p&gt;  </description><link>http://zybermark.blogspot.com/2012/06/how-to-detect-if-command-prompt-is.html</link><author>noreply@blogger.com (Zybermark)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6707555.post-2733870525921035142</guid><pubDate>Sun, 24 Jul 2011 07:29:00 +0000</pubDate><atom:updated>2011-07-24T01:29:14.581-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">MIDI</category><category domain="http://www.blogger.com/atom/ns#">music</category><category domain="http://www.blogger.com/atom/ns#">Zybermark</category><title>Korg nanoKontrol2 MIDI Not Recognized</title><description>&lt;p&gt;I finally got my 2 new toys: &lt;a href=&quot;http://www.korg.com/Product.aspx?pd=596&quot; target=&quot;_blank&quot;&gt;a Korg nanoKONTROL2 and a nanoPAD2&lt;/a&gt;. The initial installation was quick and painless: unwrap nanoKONTROL2/nanoPAD2, hook it up to the PC with USB a cable, and Windows happily recognized the new devices and installed the default drivers for them. The following installation steps, install the KORG USB-MIDI Driver, update the system software and using Kontrol Editor , proved to be more challenging…&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Installing the KORG USB-MIDI Driver&lt;/h3&gt;  &lt;p&gt;I located the &lt;a href=&quot;http://www.korg.com/Product.aspx?pd=596&quot; target=&quot;_blank&quot;&gt;support section for the nanoSERIES2 controllers&lt;/a&gt; (click on SUPPORT below the product image), downloaded the latest USB-MIDI Driver for PC (&lt;a href=&quot;http://www.korg.com/uploads/Download/KORG_USB_MIDI_Driver_1.13_r6_PC_634396683078320000.zip&quot; target=&quot;_blank&quot;&gt;1.13-r6&lt;/a&gt; at the time of this writing) and installed the drivers for both controllers. No errors, all seemed well.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Controller software updates&lt;/h3&gt;  &lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrHCGUXXhkvBX25vMmSZk79ZsPIuJ4xrywoaXq9lPgA8AwwLuKiwDpH4dW-kzN0Y-E54w09uiqFd6l3Srw1S1WK4hJh9IWd_CoH4ViMoPFSuLLOaM4aYLc69FRi5Vm__Tx7Q6YKA/s1600-h/image%25255B22%25255D.png&quot;&gt;&lt;img style=&quot;background-image: none; border-right-width: 0px; margin: 0px 0px 0px 4px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; align=&quot;right&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYohktBioYTCjp-Y5Ro2aKQTo9M58X7WsFXwkyLmT5iJ_5hZ82MWjH1sc_L9RyIhe9jEtASMKg8aoTgXt6T002pyYkjEOz4l5P7walIlnkweeGaPCketpVyMhwC7RR7dfj7-NPgA/?imgmax=800&quot; width=&quot;240&quot; height=&quot;141&quot; /&gt;&lt;/a&gt;Next up, updating the controllers with the latest software updates: &lt;a href=&quot;http://www.korg.com/uploads/Download/nanoKONTROL2_Updater_0103_634445076375860000.zip&quot; target=&quot;_blank&quot;&gt;nanoKONTROL2_Updater_0103&lt;/a&gt; and &lt;a href=&quot;http://www.korg.com/uploads/Download/nanoPAD2_Updater_0104_634445077102950000.zip&quot; target=&quot;_blank&quot;&gt;nanoPAD2_Updater_0104&lt;/a&gt;. This is where the trouble started showing itself: Error – Update device is not found. Looking at the “Config…” menu option the only MIDI device recognized was my Yamaha Portable G-1 device. The two nano controllers were nowhere to be found, even when trying to manually select a MIDI device.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4pOn_8oEytvuytWNkb__rfb5OuJX6PV6h2uMdu-gZbL51bXtT-J03yiKe3Cb3TGcLaWTHIgkc0gBIxBsYecm1NCm0iceUrVgaDF63Hyxx_2JqVdf3_4g6Jt95GbBWifbJEBOzVw/s1600-h/image%25255B18%25255D.png&quot;&gt;&lt;img style=&quot;background-image: none; border-right-width: 0px; margin: 0px 4px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; align=&quot;left&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKnttvAUv09PWV9pXwcgFJtanARLuwjrIKVQlTRttj0lSD8YQscrD0hzXUckvymL79WbviA3Uz1huu3UpbNLJb74FYWk89TkdZFNh37hyphenhyphen81pa8TMn6pxKwUT8jL0fpNH3zccdhOw/?imgmax=800&quot; width=&quot;208&quot; height=&quot;240&quot; /&gt;&lt;/a&gt;Similarly troublesome was the Kontrol Editor device selection dialog at startup, both controllers were not recognized.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Troubleshooting&lt;/h3&gt;  &lt;p&gt;Basic troubleshooting of the issue consisted of un-/reinstalling the device drivers through device manager and un-/reinstalling the USB-MIDI Driver in various orders, with reboots in between, but after a couple of hours going through that with still no results I decided to look beyond the Korg drivers.   &lt;br /&gt; The only other thing that could possibly interfere seemed to be the Yamaha Portable G-1 USB-MIDI driver, so as a last resort I uninstalled it, rebooted and reinstalled the Korg USB-MIDI drivers. SUCCESS! The nanoKONTROL2 and nanoPAD2 finally showed up as MIDI devices, allowing me to update the controller software and use Kontrol Editor. This left me without support for my Yamaha keyboard however, so I downloaded and installed the &lt;a href=&quot;http://download.yamaha.com/usb_midi/index.html&quot; target=&quot;_blank&quot;&gt;latest Yamaha USB-MIDI Driver&lt;/a&gt;,&amp;#160; um310x86 – which was two versions up from my installed version, verified all USB-MIDI devices were still functional. Rebooted. Verified all USB-MIDI devices were STILL functional, and they still were! &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Afterthoughts&lt;/h3&gt;  &lt;p&gt;Having to uninstall the Yamaha USB-MIDI driver still seems strange to me, but apparently did the trick. If this trick worked for you, or if it didn’t, please leave me a comment!&lt;/p&gt;  </description><link>http://zybermark.blogspot.com/2011/07/korg-nanokontrol2-midi-not-recognized.html</link><author>noreply@blogger.com (Zybermark)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYohktBioYTCjp-Y5Ro2aKQTo9M58X7WsFXwkyLmT5iJ_5hZ82MWjH1sc_L9RyIhe9jEtASMKg8aoTgXt6T002pyYkjEOz4l5P7walIlnkweeGaPCketpVyMhwC7RR7dfj7-NPgA/s72-c?imgmax=800" height="72" width="72"/><thr:total>9</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6707555.post-171531507361561210</guid><pubDate>Wed, 27 Apr 2011 13:34:00 +0000</pubDate><atom:updated>2011-04-27T07:34:00.901-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">.net</category><category domain="http://www.blogger.com/atom/ns#">Code</category><category domain="http://www.blogger.com/atom/ns#">csharp</category><category domain="http://www.blogger.com/atom/ns#">DrH4x0rsVoid</category><category domain="http://www.blogger.com/atom/ns#">Zybermark</category><title>Simple, Fast and Accurate Running Average in C#</title><description>&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Moving_average&quot; target=&quot;_blank&quot;&gt;Running averages&lt;/a&gt;, also called &lt;em&gt;rolling average&lt;/em&gt;, &lt;em&gt;rolling mean &lt;/em&gt;and &lt;em&gt;moving average,&lt;/em&gt; can be calculated in several different ways:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Simple Moving Average &lt;/li&gt;    &lt;li&gt;Cumulative Moving Average &lt;/li&gt;    &lt;li&gt;Weighted Moving Average &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;For my scenario I needed a simple, fast and accurate average, so I settled on implementing the &lt;a href=&quot;http://en.wikipedia.org/wiki/Moving_average#Simple_moving_average&quot; target=&quot;_blank&quot;&gt;simple moving average calculator&lt;/a&gt; below.&lt;/p&gt;  &lt;div class=&quot;csharpcode&quot;&gt;&amp;#160;&amp;#160; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; SimpleRunningAverage     &lt;br /&gt;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; _size;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;[] _values = &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; _valuesIndex = 0;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; _valueCount = 0;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; _sum = 0;     &lt;br /&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; SimpleRunningAverage(&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; size)     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.Diagnostics.Debug.Assert(size &amp;gt; 0);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _size = Math.Max(size, 1);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _values = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;[_size];     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }     &lt;br /&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; Add(&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; newValue)     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;rem&quot;&gt;// calculate new value to add to sum by subtracting the&lt;/span&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;rem&quot;&gt;// value that is replaced from the new value;&lt;/span&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; temp = newValue - _values[_valuesIndex];     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _values[_valuesIndex] = newValue;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _sum += temp;     &lt;br /&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _valuesIndex++;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _valuesIndex %= _size;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (_valueCount &amp;lt; _size)     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _valueCount++;     &lt;br /&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; _sum / _valueCount;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }     &lt;br /&gt;&amp;#160;&amp;#160; }     &lt;br /&gt;&lt;/div&gt; &lt;style type=&quot;text/css&quot;&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type=&quot;text/css&quot;&gt;




.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;  &lt;div class=&quot;csharpcode&quot;&gt;&amp;#160;&lt;/div&gt;  &lt;div class=&quot;csharpcode&quot;&gt;&amp;#160;&lt;/div&gt;  &lt;div class=&quot;csharpcode&quot;&gt;&lt;/div&gt;  &lt;p&gt;Here is how to use it:&lt;/p&gt;  &lt;pre class=&quot;csharpcode&quot;&gt;      SimpleRunningAverage avg = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; SimpleRunningAverage(4);
      &lt;span class=&quot;kwrd&quot;&gt;foreach&lt;/span&gt; (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; i &lt;span class=&quot;kwrd&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;[] { 1, 2, 3, 4, 4, 4, 4 })
      {
         Console.WriteLine(avg.Add(i));
      }&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;For an implementation with more bells and whistles check out &lt;a href=&quot;http://www.codeproject.com/KB/recipes/SimpleMovingAverage.aspx&quot; target=&quot;_blank&quot;&gt;Marc Cliftons great article&lt;/a&gt;.&lt;/p&gt;  </description><link>http://zybermark.blogspot.com/2011/04/simple-fast-and-accurate-running.html</link><author>noreply@blogger.com (Zybermark)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6707555.post-7702323127900716108</guid><pubDate>Mon, 28 Mar 2011 13:10:00 +0000</pubDate><atom:updated>2011-03-28T07:10:49.301-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">music</category><category domain="http://www.blogger.com/atom/ns#">Zybermark</category><title>How Music Works – Melody – Recommended Video Series</title><description>&lt;p&gt;While researching music I came across this awesome video series “&lt;a href=&quot;http://www.imdb.com/title/tt0934149/&quot; target=&quot;_blank&quot;&gt;How Music Works&lt;/a&gt;”. In this series &lt;a href=&quot;http://en.wikipedia.org/wiki/Howard_Goodall&quot; target=&quot;_blank&quot;&gt;Howard Goodall&lt;/a&gt; does a brilliant job introducing the&amp;#160; components that make up music. A real joy to watch!&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Melody&lt;/h3&gt;  &lt;p&gt;In this part of the series Goodall covers Melody. He explains what makes a melody effective, Archetypal patterns (scales), the pentatonic system and how to achieve moods in music. &lt;/p&gt;  &lt;p&gt;Enjoy!&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div style=&quot;padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px&quot; id=&quot;scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:43cfa5ad-64b0-4bd2-bf60-2c53e950c0a2&quot; class=&quot;wlWriterEditableSmartContent&quot;&gt;&lt;div id=&quot;f3752acf-461d-488b-a6db-63cc9ddbb870&quot; style=&quot;margin: 0px; padding: 0px; display: inline;&quot;&gt;&lt;div&gt;&lt;a href=&quot;http://www.youtube.com/watch?v=PnbOWi6f_IM&quot; target=&quot;_new&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2_J4I5HIp4Ol4cuDnJCWkQgYYsC7Y2Vc39lRoGAETKrj5yNCiNvNuBX46AB_Ve_ofvxZgAaDNcxB1UoVM6j4YfS2F5ORxmoHIBTn3XGtJpZ6ve_zcEPdc0O_NbKZu4cHTaoM2lg/?imgmax=800&quot; style=&quot;border-style: none&quot; galleryimg=&quot;no&quot; onload=&quot;var downlevelDiv = document.getElementById(&#39;f3752acf-461d-488b-a6db-63cc9ddbb870&#39;); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;448\&amp;quot; height=\&amp;quot;252\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/PnbOWi6f_IM?hl=en&amp;amp;hd=1\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/PnbOWi6f_IM?hl=en&amp;amp;hd=1\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; width=\&amp;quot;448\&amp;quot; height=\&amp;quot;252\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;width:448px;clear:both;font-size:.8em&quot;&gt;Melody–Part 1&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;    &lt;div style=&quot;padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px&quot; id=&quot;scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:ba8f9a56-c233-4dfa-ae1c-95a8c93d008b&quot; class=&quot;wlWriterEditableSmartContent&quot;&gt;&lt;div id=&quot;569bc445-17f4-41f4-9de9-fc0d74f2ce5f&quot; style=&quot;margin: 0px; padding: 0px; display: inline;&quot;&gt;&lt;div&gt;&lt;a href=&quot;http://www.youtube.com/watch?v=4dalL5FpWR8&quot; target=&quot;_new&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmhrIXl6cKdzmU1aDRxBjS7n_LCVvKG_l6ZmpF-0vbz4gPQT_6H_f0pcXPrn1xpAKwAXSHuzHAyBACZP5DiVXK0A6iWH9IaFNX8laBL-D3j0zNUac4IkTxLGt_Jg6tUYXwsjEJKg/?imgmax=800&quot; style=&quot;border-style: none&quot; galleryimg=&quot;no&quot; onload=&quot;var downlevelDiv = document.getElementById(&#39;569bc445-17f4-41f4-9de9-fc0d74f2ce5f&#39;); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;448\&amp;quot; height=\&amp;quot;252\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/4dalL5FpWR8?hl=en&amp;amp;hd=1\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/4dalL5FpWR8?hl=en&amp;amp;hd=1\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; width=\&amp;quot;448\&amp;quot; height=\&amp;quot;252\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;width:448px;clear:both;font-size:.8em&quot;&gt;Melody–Part 2&lt;/div&gt;&lt;/div&gt;    &lt;p&gt;&amp;#160;&lt;/p&gt;    &lt;div style=&quot;padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px&quot; id=&quot;scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:54f1c17e-cb27-4c57-b66c-aafc3a5b4074&quot; class=&quot;wlWriterEditableSmartContent&quot;&gt;&lt;div id=&quot;0cb9e8f4-f23d-4e56-9cb6-afad83936f40&quot; style=&quot;margin: 0px; padding: 0px; display: inline;&quot;&gt;&lt;div&gt;&lt;a href=&quot;http://www.youtube.com/watch?v=KrY_3_6fsjM&quot; target=&quot;_new&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEij28Uy8qfj-WAvHIxiHHCuOAvFe8el8CdTJsJq35gU9CQj_9AzMDQEWnY_wBYK4niyeFXtdgWPnpDJ2MeUjXEuJhIvpNKzxfESKfM68TyIYFm7b4EJ8kUCbPgqCgZdhQttqzEDDg/?imgmax=800&quot; style=&quot;border-style: none&quot; galleryimg=&quot;no&quot; onload=&quot;var downlevelDiv = document.getElementById(&#39;0cb9e8f4-f23d-4e56-9cb6-afad83936f40&#39;); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;448\&amp;quot; height=\&amp;quot;252\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/KrY_3_6fsjM?hl=en&amp;amp;hd=1\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/KrY_3_6fsjM?hl=en&amp;amp;hd=1\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; width=\&amp;quot;448\&amp;quot; height=\&amp;quot;252\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;width:448px;clear:both;font-size:.8em&quot;&gt;Melody–Part 3&lt;/div&gt;&lt;/div&gt;    &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div style=&quot;padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px&quot; id=&quot;scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:0d1d5b75-7fff-4314-8c0d-419ae6032734&quot; class=&quot;wlWriterEditableSmartContent&quot;&gt;&lt;div id=&quot;1a7aff7d-0a0c-4edd-a8e9-eef2dc46d01c&quot; style=&quot;margin: 0px; padding: 0px; display: inline;&quot;&gt;&lt;div&gt;&lt;a href=&quot;http://www.youtube.com/watch?v=k4gp0WKrgqY&quot; target=&quot;_new&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdipICd9Hwh12lE4j5g-w5UcOu7EmaQrB4eN4JR_TRZE3Rgs83dTGpmvoKB0eI8m2Ewa8jWr9oclo7EAvQZJtUeUnrI-PIofXZWgTzuDf-k5OKiA5hxnLpH3AX3wWQlh6zCAMb9Q/?imgmax=800&quot; style=&quot;border-style: none&quot; galleryimg=&quot;no&quot; onload=&quot;var downlevelDiv = document.getElementById(&#39;1a7aff7d-0a0c-4edd-a8e9-eef2dc46d01c&#39;); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;448\&amp;quot; height=\&amp;quot;252\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/k4gp0WKrgqY?hl=en&amp;amp;hd=1\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/k4gp0WKrgqY?hl=en&amp;amp;hd=1\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; width=\&amp;quot;448\&amp;quot; height=\&amp;quot;252\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;width:448px;clear:both;font-size:.8em&quot;&gt;Melody–Part 4&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div style=&quot;padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px&quot; id=&quot;scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:1d1af13d-77a5-402b-a75b-a9bf30967a2b&quot; class=&quot;wlWriterEditableSmartContent&quot;&gt;&lt;div id=&quot;c6e46a7a-0f16-42ba-8277-066c88aa9ee7&quot; style=&quot;margin: 0px; padding: 0px; display: inline;&quot;&gt;&lt;div&gt;&lt;a href=&quot;http://www.youtube.com/watch?v=aPmnho7OvT8&quot; target=&quot;_new&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOogOJF_R-JFrUVN8qaZEWYVz7UlLROslMg52MA_gi7_kGd1HUZizeBHn3ZKacfHDGQNabxDLLOy-A8W-3A-Y1lnpdz5TAQtllG8sgLTMZjYZnEA00lMesZJPCln-zWYprXtxtog/?imgmax=800&quot; style=&quot;border-style: none&quot; galleryimg=&quot;no&quot; onload=&quot;var downlevelDiv = document.getElementById(&#39;c6e46a7a-0f16-42ba-8277-066c88aa9ee7&#39;); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;448\&amp;quot; height=\&amp;quot;252\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/aPmnho7OvT8?hl=en&amp;amp;hd=1\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/aPmnho7OvT8?hl=en&amp;amp;hd=1\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; width=\&amp;quot;448\&amp;quot; height=\&amp;quot;252\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;width:448px;clear:both;font-size:.8em&quot;&gt;Melody–Part 5&lt;/div&gt;&lt;/div&gt;  </description><link>http://zybermark.blogspot.com/2011/03/how-music-works-melody-recommended.html</link><author>noreply@blogger.com (Zybermark)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6707555.post-7612586643845682097</guid><pubDate>Sat, 19 Mar 2011 05:20:00 +0000</pubDate><atom:updated>2014-01-25T17:23:40.181-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">music</category><category domain="http://www.blogger.com/atom/ns#">tutorial</category><category domain="http://www.blogger.com/atom/ns#">VSTi</category><category domain="http://www.blogger.com/atom/ns#">Zybermark</category><title>CutterMusic Revitar 2 VSTi Tutorial – How To Use Hammer On/Pull Off</title><description>The free &lt;a href=&quot;http://www.cuttermusic.com/productsRV2.htm&quot; target=&quot;_blank&quot;&gt;Revitar VSTi&lt;/a&gt; by CutterMusic (&lt;a href=&quot;http://www.vstplanet.com/News/10/Revitar_v2.0.htm&quot; target=&quot;_blank&quot;&gt;see VstPlanet&lt;/a&gt;) supports Hammer On/Pull Off when playing in mono mode. In this tutorial I will show you how to apply these playing techniques through MIDI notes. It is important to note that Revitar makes a distinction between playing single notes using all strings and “mono” mode which plays all notes using a single string.&lt;br /&gt;
In chapter 3.1 the manual describes these modes as follows:&lt;br /&gt;
&lt;blockquote&gt;
When playing single notes two modes are available.&amp;nbsp; In the ﬁrst mode, you allow Revitar to select which string each note is played on.&amp;nbsp; In the second mode “mono” is selected, and Revitar is forced to play all notes on a single string.&amp;nbsp; In Mono mode, transitions between notes can use slides or hammer on/pull off techniques.&amp;nbsp; To create a slide effect hold down one key while pressing another.&amp;nbsp; The type of transition effect is controlled by the &lt;b&gt;slide knob&lt;/b&gt;.&lt;/blockquote&gt;
&lt;h3&gt;
&amp;nbsp;&lt;/h3&gt;
&lt;h3&gt;
What is Hammer On/Pull Off:&lt;/h3&gt;
&lt;a href=&quot;http://www.guitarnoise.com/&quot; target=&quot;_blank&quot;&gt;Guitar Noise&lt;/a&gt; has a great &lt;a href=&quot;http://www.guitarnoise.com/lesson/hammer-on-pull-off-tap-repeat/&quot; target=&quot;_blank&quot;&gt;lesson on using these techniques&lt;/a&gt; and defines them as follows:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Hammer on&lt;/b&gt; – Note generated by lightly snapping your finger down behind a fret. &lt;/li&gt;
&lt;li&gt;&lt;b&gt;Pull off&lt;/b&gt; – Note generated by removing your finger from a string, slightly pulling the string as you do. &lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;h3&gt;
Hammer On&lt;/h3&gt;
To play a hammer on note with the Revitar VSTi the start of the note has to be played while the previous note is still held. The example below demonstrates this. The first measure plays all notes non-overlapping; each note is strummed. The second measure overlaps most notes, resulting in hammer ons for the 2nd, 3rd, 4th and 6th, 7th and 8th notes. &lt;a href=&quot;http://www.filefreak.com/files/783581_0jcmv/Revitar_tut1_HammerOn.mp3&quot; target=&quot;_blank&quot;&gt;Play the audio example&lt;/a&gt; to listen to the difference.&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1iz_-dLJtASC6lHbvZM0jydSd__HxzU1rzI_ra2pMBh4BgBdZ54HCTuz-YKrpOSL4dwWGEaRk_JHZOlcz_R7u-RWdAuTArRJjq9FN-1AuWAvQk-84VhEFZkUxyXVZWQiSU01csw/s1600-h/NormalAndHammerOn_500%5B8%5D.png&quot;&gt;&lt;img alt=&quot;NormalAndHammerOn_500&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgh6OdhCBzO-BDVFs_meJQcN5JG1xgmj-YlFWjLL20LEmwzHJ6WyY9soPa3Ic59Wx9uXh5Y_xpGcNxr2TljJcNr81VXhF_P8nOVGpTmrQPRGCUmbZl_unz92PXTr29sM7OI37WU2g/?imgmax=800&quot; height=&quot;121&quot; style=&quot;background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;NormalAndHammerOn_500&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;     &lt;br /&gt;
&lt;a href=&quot;http://www.filefreak.com/files/783581_0jcmv/Revitar_tut1_HammerOn.mp3&quot;&gt;HammerOn MP3&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Hammer On/Pull Off&lt;/h3&gt;
To play a pull off after a hammer on you need to keep holding the first note until the end of the hammer on note – holding the first note too long will create a hammer on of the first note in addition to the pull off. The example below shows this in action. The second note in each measure is played using hammer on/pull off. &lt;a href=&quot;http://www.filefreak.com/files/783582_nquse/Revitar_tut1_HammerOnPullOff.mp3&quot; target=&quot;_blank&quot;&gt;Listen to the audio example&lt;/a&gt; to hear this in action. &lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjm1ITP4SZyXt3Q9DYunqPDp81CLQ8ozN3f_blN7CZhHIMyYLOqAL0GNQT-qcWC0KiJJ-aNt9XeMj-n59nIeEis42kIKExTJcFFayxq_zG5ePwD2gPDeUs1svTVrL3Aun4GqqiBaw/s1600-h/HammerOnPullOff_500%5B4%5D.png&quot;&gt;&lt;img alt=&quot;HammerOnPullOff_500&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh818SgR2wMP9cBl6bwoLCoWdWu2I2xa-0JJnUc3Hcg8p8Rzx6SE5FU_u8otOoL0Fn4XcTd-CH57aPLEJzclXl9kc8RA1WfBFOU_k2F8AJKZxTXg2xxamyav8PiPRUw78lmtImBbQ/?imgmax=800&quot; height=&quot;116&quot; style=&quot;background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;HammerOnPullOff_500&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;     &lt;br /&gt;
&lt;a href=&quot;http://www.filefreak.com/files/783582_nquse/Revitar_tut1_HammerOnPullOff.mp3&quot;&gt;HammerOn PullOff MP3&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Controlling Hammer On/Pull Off Amount&lt;/h3&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBp2G1JGebbnz9I1oL4jiSbfXSdqbtiZqzd2BSQlYE4OXsey4A81q3dW_G6EEvXFvuXevGIvu1OBwbX2NoH1mS1_XwEePRqLuOE07UDcEfEr3CfrtZv7hUCW6pSyzxnaZXRxkBpg/s1600-h/RevitarTut_Strings_Slide%5B13%5D.png&quot;&gt;&lt;img align=&quot;right&quot; alt=&quot;RevitarTut_Strings_Slide&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQtztmEm2Qt3jikB1tAQg51ff_jidVqPYQ32F-VYNerWDp5G8-aRmZq-JggI4eYXasKNmXyNEVfk8b_EzoPKHKeIVPB0LKFOiujhrGKL1WFsfmeCQitd1N_IWnwF2EaHBYP7heBw/?imgmax=800&quot; height=&quot;125&quot; style=&quot;background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; float: right; margin: 0px 6px 0px 2px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;RevitarTut_Strings_Slide&quot; width=&quot;240&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
The amount of hammer on/pull off is controlled through the Slide control in the Strings section and note velocity.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Slide Control&lt;/h3&gt;
The manual describes the slide control as follows:&lt;br /&gt;
&lt;blockquote&gt;
Slide: Default MIDI CC:&amp;nbsp;&amp;nbsp; 2      &lt;br /&gt;
Controls the type and rate of note transitions.&amp;nbsp; Note transitions       &lt;br /&gt;
only occur in Mono and Chord modes.&amp;nbsp; If the knob is greater than       &lt;br /&gt;
the 9 o’clock position notes are transitioned by sliding with de-       &lt;br /&gt;
creasing rates.&amp;nbsp; A knob position less than the 9 o’clock position       &lt;br /&gt;
turns on hammer on / pull off transitions.&amp;nbsp; The amount of hammer       &lt;br /&gt;
on / pull off increases as the knob is turned counter clockwise.&amp;nbsp; &lt;br /&gt;
The amount of hammer on / pull off is also controlled by the note’s velocity.&lt;/blockquote&gt;
This example sweeps from a note Slide rate of 0.01 in the first measure to a Hammer/Pull of 1.00 in the fifth measure. Notice the switch between Slide and Hammer/Pull mode in the second measure when &lt;a href=&quot;http://www.filefreak.com/files/783583_sa9h4/Revitar_tut1_SlideSweep.mp3&quot; target=&quot;_blank&quot;&gt;listening to the audio&lt;/a&gt;.&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW2I_D0Ro8RMsK83JGrkqaZ4V1zR_iwwZXbQApGD3p7s29AuRj_aPojx0YRMPzXqEHcsOi5WTdppqOwhKDqrav2w5-XWr77spH4Ff5IQXA6CiJZDhMXvPzviXEXna7JXd-tMiS8g/s1600-h/HammerPullSweep_500%5B4%5D.png&quot;&gt;&lt;img alt=&quot;HammerPullSweep_500&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6krf1tmOMLusn-se_vg5A3AGoYbfV45ZzHVR4vO-GXw3cCoSWJnpOHlajAYqOgn8RbvpE6qFrEy3bn9CcXjLLPYnr8xeKnOv5mHe9N-oQlKN2G6DLcvjZFqi-AogNvsVc_MToog/?imgmax=800&quot; height=&quot;113&quot; style=&quot;background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;HammerPullSweep_500&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;     &lt;br /&gt;
&lt;a href=&quot;http://www.filefreak.com/files/783583_sa9h4/Revitar_tut1_SlideSweep.mp3&quot;&gt;Slide Sweep MP3&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Velocity&lt;/h3&gt;
The other mechanism to control the hammer on/pull off amount is note velocity. This example sweeps the note velocity of the second note in each measure from minimum (0) through maximum (127). &lt;a href=&quot;http://www.filefreak.com/files/783584_s3tas/Revitar_tut1_VelocityIncrease.mp3&quot; target=&quot;_blank&quot;&gt;Listen to the audio example&lt;/a&gt;.&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEit-R6gn36BpMLw2SrZAqI7hwa0KjKakJ9bsItgPQhDV3_QGraGK-P6GTB0QQuHa-0gWCfQ-Nsdcp1MCVSCXxB-0q0Nsp7v8hhI_GR80wRPjGqgN6nmADVkR2-avWKRLxHwqpo8bA/s1600-h/VelocityIncrease_500%5B17%5D.png&quot;&gt;&lt;img alt=&quot;VelocityIncrease_500&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjU9dWDvmChZZxZSyZrpWl7P7RlYd5a3DW2e2VejBk6KYgGh9xHw6d25Z_q7raJgEOUH2xajf2AfpVG7LhgY80K7BANTRyPKJ5nY3tVyKUN7JeB-rCV9SnyRcSWr38oqZfyq7EVLQ/?imgmax=800&quot; height=&quot;181&quot; style=&quot;background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;VelocityIncrease_500&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;     &lt;br /&gt;
&lt;a href=&quot;http://www.filefreak.com/files/783584_s3tas/Revitar_tut1_VelocityIncrease.mp3&quot;&gt;Velocity Increase MP3&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I hope this tutorial helps you master this awesome VSTi. Please leave a comment if you have questions or feedback!&lt;br /&gt;
Thanks!&lt;br /&gt;
&lt;br /&gt;
P.S. If you are looking for a copy of the manual, you can find it&amp;nbsp;&lt;a href=&quot;http://marksletterink.com/wiki/music.RevitarVstManual.ashx&quot;&gt;here&lt;/a&gt;. </description><link>http://zybermark.blogspot.com/2011/03/revitar-vsti-tutorial-how-to-use-hammer.html</link><author>noreply@blogger.com (Zybermark)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgh6OdhCBzO-BDVFs_meJQcN5JG1xgmj-YlFWjLL20LEmwzHJ6WyY9soPa3Ic59Wx9uXh5Y_xpGcNxr2TljJcNr81VXhF_P8nOVGpTmrQPRGCUmbZl_unz92PXTr29sM7OI37WU2g/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6707555.post-2562531504460431749</guid><pubDate>Sun, 06 Mar 2011 17:43:00 +0000</pubDate><atom:updated>2011-03-08T07:09:02.179-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">music</category><category domain="http://www.blogger.com/atom/ns#">Zybermark</category><title>Time To Face The Music</title><description>I have picked up creating music again, an old hobby which I used to pour my heart and soul into. 15 years have passed since I was last actively making music and it had been nagging at me to pick it back up. I needed a new passion besides &lt;a href=&quot;http://www.passionatesoftware.com/?p=56&quot; target=&quot;_blank&quot;&gt;love for coding&lt;/a&gt; and 18 months ago I started on my journey from &lt;a href=&quot;http://en.wikipedia.org/wiki/Tracker_%28music_software%29&quot; target=&quot;_blank&quot;&gt;8-bit Trackers&lt;/a&gt; into the &lt;a href=&quot;http://en.wikipedia.org/wiki/Digital_audio_workstation&quot; target=&quot;_blank&quot;&gt;Digital&amp;#160; Audio Workstation&lt;/a&gt; world of today.   &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;object height=&quot;81&quot; width=&quot;100%&quot;&gt; &lt;param name=&quot;movie&quot; value=&quot;http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F10799009&amp;amp;show_comments=true&amp;amp;auto_play=false&quot;&gt;&lt;/param&gt; &lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt; &lt;embed allowscriptaccess=&quot;always&quot; height=&quot;81&quot; src=&quot;http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F10799009&amp;amp;show_comments=true&amp;amp;auto_play=false&quot; type=&quot;application/x-shockwave-flash&quot; width=&quot;100%&quot;&gt;&lt;/embed&gt; &lt;/object&gt;&lt;span&gt;&lt;a href=&quot;http://soundcloud.com/zybermark/synth-13-2011&quot;&gt;Synth 13 - 2011&lt;/a&gt; by &lt;a href=&quot;http://soundcloud.com/zybermark&quot;&gt;zybermark&lt;/a&gt;&lt;/span&gt;   &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;8-bit Trackers&lt;/h3&gt;  &lt;p&gt;The first tracker I worked with was &lt;a href=&quot;http://nl.wikipedia.org/wiki/FAC_Soundtracker&quot; target=&quot;_blank&quot;&gt;FAC SoundTracker&lt;/a&gt; which sported 9 monophonic FM channels and an ADPCM channel, the resulting output was a mono audio stream. With the release of &lt;a href=&quot;http://nl.wikipedia.org/wiki/Moonblaster&quot; target=&quot;_blank&quot;&gt;Moonblaster&lt;/a&gt; the MSX scene was propelled into a pseudo stereo universe; the MSX home computer had 2 fairly similar sound expansion cards, by routing the output of these separately to the left and right channels a stereo sound was created. The audio hardware had not changed so this tracker still featured 9 monophonic FM channels and an ADPCM channel, however because 3 channels were used for drums this effectively brought it down to 6 FM channels + drums. This dual sound generator model allowed for some interesting sound design; by detuning one side slightly more or using totally different FM patches some interesting sounds could be created.&lt;/p&gt;  &lt;p&gt;These trackers were different from most trackers in the day because they used FM channels instead of sample channels to create the compositions. This still heavily biases my preference towards composing using real notes, as opposed to prerecorded clips.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Sequencer 1.0&lt;/h3&gt;  &lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAwzgGTa2cEToWMXOy1fLBBqD1uKl9NEq9qSwK7TEhGKr6a3_Itp9guJK8prA6ySLifimjulyo0b34DN6pxFNYGcpmY8RVMdm6GtfMx68W93KjPFe55hgMlkBZfmMPzJ_rfsInng/s1600-h/Cubase1%5B2%5D.png&quot;&gt;&lt;img style=&quot;background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px&quot; title=&quot;Cubase1&quot; border=&quot;0&quot; alt=&quot;Cubase1&quot; align=&quot;right&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgpdPyYtC6WCCeog64rZqNyCBJHJ7FLMa5vgBHTmg0-H2ZvfYbjQaBdA_YpKGeOvg06u0ej6USv4sNotM5640oGs9hX6-NTFaQ73nb79JCnicLPN1NxaqIn4aCXSXbUKSKYUIEkw/?imgmax=800&quot; width=&quot;244&quot; height=&quot;154&quot; /&gt;&lt;/a&gt;I tinkered around with MIDI and my &lt;a href=&quot;http://www.crumblenet.co.uk/keyb/pss-780.html&quot; target=&quot;_blank&quot;&gt;Yamaha PSS-780&lt;/a&gt; back then (PC + MPU-401 + Cakewalk 1.0, Atari ST 1024 + Cubase), but never ended up doing any serious work with it. Even though I enjoyed my PSS-780, the challenge of composing using MIDI was a lot steeper than using the trackers I had at my disposal. Using a tracker also made my music more portable because within my circle of friends the hardware was much more prolific than my particular MIDI setup.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Facing the DAW&lt;/h3&gt;  &lt;p&gt;My initial focus was on getting (back) up to speed on all the technologies used in creating digital music nowadays. Tweakheadz Labs’ &lt;a href=&quot;http://www.tweakheadz.com/guide.htm&quot; target=&quot;_blank&quot;&gt;Guide to the Home and Project Studio&lt;/a&gt; proved to be an excellent resource for this; Scott McLean at &lt;a href=&quot;http://trancemusicmastery.com/&quot; target=&quot;_blank&quot;&gt;TranceMusicMastery&lt;/a&gt; also has some great videos on working with the DAW technology of today. Armed with this newfound knowledge I set off on a project to recreate an old song: “Synth 13”; I considered this song to be “OK” and did not want to burn myself out on my favorite one.&lt;/p&gt;  &lt;p&gt;I had purchased a copy of Cakewalk Music Creator 3 a couple of years ago,set it as my goal to use that to recreate the original sound as closely as possible and started recreating the song by ear. Over time I got my hands on the original scores again to help analyze a couple busy parts, but most of the song element were still very vivid in my mind. In retrospect, the size of this learning process was just staggering! Recreating the original score was the easiest part; mastering the sequencer and its quirks, using effects effectively and finding and creating similar sounds turned into a yearlong project! Having wrapped up the initial pass I was fairly content with the &lt;a href=&quot;http://soundcloud.com/zybermark/synth-13-2009&quot; target=&quot;_blank&quot;&gt;final result of this project&lt;/a&gt;, recreating the original sound, but I&amp;#160; was far away from the quality I wanted to produce. The tools at my disposal in MC3 felt limiting to me; limited number of virtual synths, limited number of effects, limited number of tracks, etc. etc. I also felt that the synths and host program were not working well together, lots of funny quirks, timing issues, clicks, pops. Maybe it was just my mind rebelling against the DAW but I was fairly comfortable with this new musical creation environment and decided it was time to upgrade. I wanted to be able to take my current projects and seamlessly continue; sticking with a Cakewalk product thus was the best choice, so I invested in a copy of &lt;a href=&quot;http://www.amazon.com/gp/product/B004BD7CDK?ie=UTF8&amp;amp;tag=drh4xvoi-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B004BD7CDK&quot; target=&quot;_blank&quot;&gt;Sonar X1 Producer&lt;/a&gt;. That took care of getting better tools: awesome new synths, plugins, unlimited tracks and a fancy new UI. I still needed to improve my mixing skills; &lt;a href=&quot;http://www.amazon.com/gp/product/1598632515?ie=UTF8&amp;amp;tag=drh4xvoi-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=1598632515&quot; target=&quot;_blank&quot;&gt;The Mixing Engineer’s Handbook&lt;/a&gt; turned out to be a great help to sharpen these skills and get really close to the sound I was aiming for: &lt;a href=&quot;http://soundcloud.com/zybermark/synth-13-2011&quot; target=&quot;_blank&quot;&gt;Synth 13 – 2011&lt;/a&gt;, which you can find at the beginning of this post. &lt;/p&gt;  &lt;p&gt;I will share more about this project in a future post.&lt;/p&gt;  </description><link>http://zybermark.blogspot.com/2011/03/time-to-face-music.html</link><author>noreply@blogger.com (Zybermark)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgpdPyYtC6WCCeog64rZqNyCBJHJ7FLMa5vgBHTmg0-H2ZvfYbjQaBdA_YpKGeOvg06u0ej6USv4sNotM5640oGs9hX6-NTFaQ73nb79JCnicLPN1NxaqIn4aCXSXbUKSKYUIEkw/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6707555.post-5915487029763740427</guid><pubDate>Fri, 18 Jun 2010 00:13:00 +0000</pubDate><atom:updated>2010-06-24T18:45:04.482-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">.net</category><category domain="http://www.blogger.com/atom/ns#">DrH4x0rsVoid</category><category domain="http://www.blogger.com/atom/ns#">Expression Blend</category><category domain="http://www.blogger.com/atom/ns#">microsoft</category><title>Blend Error: The specified solution configuration &amp;quot;Debug|HPD&amp;quot; is invalid.</title><description>&lt;p&gt;When trying to compile a project in &lt;a href=&quot;http://www.microsoft.com/expression/products/blend_overview.aspx&quot; target=&quot;_blank&quot;&gt;Microsoft Expression Blend 4&lt;/a&gt; I got the following error:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;myproject.sln.metaproj : error MSB4126: The specified solution configuration &amp;quot;Debug|HPD&amp;quot; is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform=&amp;quot;Any CPU&amp;quot;) or leave those properties blank to use the default solution configuration.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;To resolve this issue you need to remove an interfering environment variable named “PLATFORM“.      &lt;br /&gt;&lt;/strong&gt;This can be done in three easy steps (without &lt;a title=&quot;hacking the registry to remove the PLATFORM environment variable&quot; href=&quot;http://social.expression.microsoft.com/Forums/en-US/blend/thread/0f5068da-b9cb-4978-afb5-cd2cea924a3a&quot; target=&quot;_blank&quot;&gt;hacking the registry&lt;/a&gt;)!&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB_Nl914MgrKNNghvSMfsiOoY8E5buOy5L8YB6wEsp2QsPDuoG-cjALabWtWC-iQ9CTMF8cDMhryGYpObSCb0JtVR0WuoIC_Z2WQDLbnV_2UJYcEZPhyphenhyphenscK-4gwNnC397K4Vfkiw/s1600-h/image%5B3%5D.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; align=&quot;left&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsr2YrZLcTkDba3IPU7KAwvk60BR-83h709yDtnYzI4iLKP5Klwiq6hnl7mDBRDBbscxS3KOPqWlzlkoZu6uOemaFB7EJKALFpw3D579iUxG3giopf5CbjepPTvCAIpgaFm-2MTg/?imgmax=800&quot; width=&quot;221&quot; height=&quot;244&quot; /&gt;&lt;/a&gt;&lt;strong&gt;1.&lt;/strong&gt; &lt;strong&gt;Open the Environment Variables dialog.      &lt;br /&gt;&lt;/strong&gt;On the start menu Right-Click on “Computer”, select “Properties”, then click on “Advanced system settings” in the left column and finally locate and click the “Environment Variables…” button.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; &lt;strong&gt;Remove the PLATFORM environment variable.&lt;/strong&gt;     &lt;br /&gt;In the System variables list locate and select the PLATFORM variable and click Delete to remove it. Hit OK to close the Environment Variables dialog box.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; &lt;strong&gt;Make it work.&lt;/strong&gt;     &lt;br /&gt;Now restart Blend and you will be able to compile your projects.&lt;/p&gt;  </description><link>http://zybermark.blogspot.com/2010/06/blend-error-specified-solution.html</link><author>noreply@blogger.com (Zybermark)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsr2YrZLcTkDba3IPU7KAwvk60BR-83h709yDtnYzI4iLKP5Klwiq6hnl7mDBRDBbscxS3KOPqWlzlkoZu6uOemaFB7EJKALFpw3D579iUxG3giopf5CbjepPTvCAIpgaFm-2MTg/s72-c?imgmax=800" height="72" width="72"/><thr:total>3</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6707555.post-3251985638072496925</guid><pubDate>Wed, 28 Oct 2009 13:07:00 +0000</pubDate><atom:updated>2010-01-16T11:19:14.944-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DrH4x0rsVoid</category><category domain="http://www.blogger.com/atom/ns#">microsoft</category><category domain="http://www.blogger.com/atom/ns#">software</category><category domain="http://www.blogger.com/atom/ns#">technology</category><category domain="http://www.blogger.com/atom/ns#">vista</category><category domain="http://www.blogger.com/atom/ns#">Windows7</category><title>HP a1750e Upgrade to Windows 7</title><description>&lt;p&gt;I upgraded my HP Pavilion a1750e machine from &lt;a href=&quot;http://www.microsoft.com/windows/windows-vista/default.aspx&quot; target=&quot;_blank&quot;&gt;Vista&lt;/a&gt; to &lt;a href=&quot;http://www.microsoft.com/windows/windows-7/&quot; target=&quot;_blank&quot;&gt;Windows 7&lt;/a&gt; (32 bit) over the weekend, here is how it all went down…&lt;/p&gt;  &lt;h3&gt;Preparation&lt;/h3&gt;  &lt;p&gt;Before doing anything I wanted to make sure my system would be able to run Windows 7 so I &lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyID=1b544e90-7659-4bd9-9e51-2497c146af15&amp;amp;displaylang=en&quot; target=&quot;_blank&quot;&gt;downloaded the upgrade advisor&lt;/a&gt; and performed an analysis. The analysis takes a couple of minutes to do its work before showing you a report with all the (potential) problems you will encounter, allowing you to get your system ready before taking the big leap into an exciting new OS. The report is split up in sections covering the system hardware, devices (drivers) and programs.&lt;/p&gt;  &lt;p&gt;One of the first things the upgrade report points out in the system section is the &lt;a href=&quot;http://h10025.www1.hp.com/ewfrf/wc/document?docname=c01778879&amp;amp;lc=en&amp;amp;dlc=en&amp;amp;cc=us&amp;amp;product=3369460&amp;amp;os=2093&amp;amp;lang=en&quot; target=&quot;_blank&quot;&gt;HP webpage describing how to upgrade your system&lt;/a&gt;, i recommend you take a look at it.&lt;/p&gt;  &lt;p&gt;Drivers were listed as available for all hardware devices that come standard with this system. Two ‘unknown’ devices were listed for me: “HP psc 1600 series” (a printer) and “Yamaha USB-MIDI Driver (WDM)”. I took the opportunity to install the &lt;a href=&quot;http://www.global.yamaha.com/download/usb_midi/&quot; target=&quot;_blank&quot;&gt;latest USB-MIDI driver from Yamaha&lt;/a&gt; (um304x86 at the time of this writing), it still functioned properly after the upgrade. The printer driver was automatically updated by the hardware wizard after the upgrade.&lt;/p&gt;  &lt;p&gt;The programs section looked a little more problematic:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Canon Camera Window MC 6 for ZoomBrowser EX, version 6.3.0.8, Known issues.      &lt;br /&gt;I uninstalled this program before upgrading. &lt;/li&gt;    &lt;li&gt;Hardware Diagnostic Tools, version 5.00.4262.12, PC-Doctor, Inc., Update available.      &lt;br /&gt;I have never used this program and did not update it. &lt;em&gt;- If you experienced problems with it please leave me a comment.&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;iTunes, version 7.4.0.28, Apple Inc., Reinstall after upgrade.      &lt;br /&gt;I uninstalled this program before upgrading. &lt;/li&gt;    &lt;li&gt;Microsoft Expression Web, version 12.0.6215.1000, Microsoft Corporation, Update available.      &lt;br /&gt;I did not bother updating it (yet). &lt;/li&gt;    &lt;li&gt;Roxio Express Labeler 3, version 2.1.0, Roxio, Update available.      &lt;br /&gt;I did not update this program (yet). &lt;em&gt;- If you experienced problems with this program please leave me a comment.&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;Skype™ 3.8, version 3.8.188, Skype Technologies S.A., Known issues.      &lt;br /&gt;I upgraded Skype to the latest version before upgrading which made the warning go away. &lt;/li&gt;    &lt;li&gt;Windows Mobile Device Center, version 6.1.6965.0, Microsoft Corporation, Reinstall after upgrade.      &lt;br /&gt;I uninstalled this program before upgrading, then reinstalled &lt;a href=&quot;http://www.microsoft.com/windowsmobile/en-us/downloads/microsoft/device-center-download.mspx&quot; target=&quot;_blank&quot;&gt;Windows Mobile Device Center&lt;/a&gt; after the upgrade and connected my &lt;a href=&quot;http://h10010.www1.hp.com/wwpc/us/en/sm/WF05a/215348-215348-64929-314903-215384-421420.html&quot; target=&quot;_blank&quot;&gt;iPaq&lt;/a&gt;. The driver got automatically installed and it appears to function properly. &lt;/li&gt; &lt;/ul&gt;  &lt;h3&gt;Execution&lt;/h3&gt;  &lt;p&gt;After all this prep work I started the upgrade which completed successfully in approximately three hours.&lt;/p&gt;  &lt;p&gt;My system is the lucky owner of two sound devices, onboard “Realtek High Definition Audio” and a “Creative AudioPCI (ES1371,ES1373) (WDM)” card, the settings for these devices were seamlessly transferred during the upgrade and they still function properly. Very impressive. I think it is very cool you can hot-switch default audio output devices while playing sound in Windows 7!&lt;/p&gt;  &lt;h3&gt;Issues&lt;/h3&gt;  &lt;p&gt;Two issues I am aware of thus far:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Canon Camera Window MC 6 for ZoomBrowser EX      &lt;br /&gt;After upgrading I downloaded the latest ZoomBrowser EX installer from the Canon website: &lt;a href=&quot;http://www.usa.canon.com/consumer/controller?act=ModelInfoAct&amp;amp;tabact=DownloadDetailTabAct&amp;amp;fcategoryid=320&amp;amp;modelid=11998&quot; target=&quot;_blank&quot;&gt;ZoomBrowser EX 6.4.1 Updater&lt;/a&gt;, Windows 7 is not available as a supported OS for downloads so I picked the Vista version. &lt;strike&gt;Unfortunately the Camera Window application is not functioning.&lt;/strike&gt; – &lt;em&gt;Setting the CameraWindow application to run in Vista SP2 compatibility mode will resolve this issue.&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;&lt;strike&gt;Powersaving for the display does not work (NVIDIA GeForce 7900 GT/GTO).        &lt;br /&gt;The display will go black but it never gets turned off&lt;/strike&gt;. -&amp;#160; This issue was caused by the screensaver, changing to a different screensaver resolved the issue.&lt;/li&gt; &lt;/ul&gt;  </description><link>http://zybermark.blogspot.com/2009/10/hp-a1750e-upgrade-to-windows-7.html</link><author>noreply@blogger.com (Zybermark)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6707555.post-2810484921857641128</guid><pubDate>Wed, 23 Sep 2009 04:48:00 +0000</pubDate><atom:updated>2009-09-22T22:54:57.082-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Code</category><category domain="http://www.blogger.com/atom/ns#">DrH4x0rsVoid</category><category domain="http://www.blogger.com/atom/ns#">PuTTY</category><category domain="http://www.blogger.com/atom/ns#">software</category><title>How To Determine If A Window Is Active (In C)</title><description>&lt;p&gt;As promised in my previous blog describing &lt;a href=&quot;http://zybermark.blogspot.com/2009/08/how-to-add-activity-notification-to.html&quot; target=&quot;_blank&quot;&gt;how to add activity notification flash to PuTTY&lt;/a&gt; here is another way to check if the window is active. Instead of keeping track of the current window state by handling the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms646274%28VS.85%29.aspx&quot; target=&quot;_blank&quot;&gt;WM_ACTIVATE&lt;/a&gt; message you can directly query a window for its status with &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms633516%28VS.85%29.aspx&quot; target=&quot;_blank&quot;&gt;GetWindowInfo()&lt;/a&gt;. The &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms632610%28VS.85%29.aspx&quot; target=&quot;_blank&quot;&gt;WINDOWINFO&lt;/a&gt;.dwWindowStatus field will be set to WS_ACTIVECAPTION when the window is active. &lt;/p&gt;  &lt;p&gt;Paste the following snippet at the end of window.c:&lt;/p&gt;  &lt;div style=&quot;font-family: consolas; background: silver; color: black; font-size: 10pt&quot;&gt;   &lt;pre style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;/* MARK SLETTERINK - ACTIVITY NOTIFICATION SUPPORT - WINDOW ACTIVE DETECTION2 */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;/* SNIPPET ID: {CE84000D-9024-45f1-B0E6-5029AD1B257F} */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;BOOL is_window_active()&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;{&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160; BOOL bActive=FALSE;&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160; BOOL bResult;&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160; WINDOWINFO wi;&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160; memset(&amp;amp;wi, 0, &lt;span style=&quot;color: blue&quot;&gt;sizeof&lt;/span&gt;(wi));&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160; wi.cbSize=&lt;span style=&quot;color: blue&quot;&gt;sizeof&lt;/span&gt;(wi);&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160; bResult=GetWindowInfo(hwnd, &amp;amp;wi);&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160; &lt;span style=&quot;color: blue&quot;&gt;if&lt;/span&gt;(bResult)&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; bActive = (wi.dwWindowStatus==WS_ACTIVECAPTION);&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160; &lt;span style=&quot;color: blue&quot;&gt;return&lt;/span&gt; bActive;&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;}&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;/* MARK SLETTERINK - END OF ACTIVITY NOTIFICATION SUPPORT - WINDOW ACTIVE DETECTION2 */&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Then add a forward declaration to the forward declarations (Snippet ID: D8B4F4A3-F870-4ded-B298-EEB71701D25D), it will look like this:&lt;/p&gt;

&lt;div style=&quot;font-family: consolas; background: silver; color: black; font-size: 10pt&quot;&gt;
  &lt;pre style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;/* MARK SLETTERINK - ACTIVITY NOTIFICATION SUPPORT - FLASH METHODS FORWARD DECLARATIONS AND VARS */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;/* SNIPPET ID: {D8B4F4A3-F870-4ded-B298-EEB71701D25D}-20090922*/&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: blue&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;void&lt;/span&gt; flash_window_activity(&lt;span style=&quot;color: blue&quot;&gt;int&lt;/span&gt; mode);&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: blue&quot;&gt;static&lt;/span&gt; BOOL window_is_active=TRUE;&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: blue&quot;&gt;static&lt;/span&gt; BOOL activity_blink_done=FALSE;&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;&lt;strong&gt;BOOL is_window_active();&lt;/strong&gt;&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;/* MARK SLETTERINK - END OF ACTIVITY NOTIFICATION SUPPORT - FLASH METHODS FORWARD DECLARATIONS AND VARS*/&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;With this new code in place all that is left is updating the activity detection logic to use it. This is implemented in the from_backend method, replace the use of the window_is_active boolean with the new is_window_active() method call so the code will look like this:&lt;/p&gt;

&lt;div style=&quot;font-family: consolas; background: silver; color: black; font-size: 10pt&quot;&gt;
  &lt;pre style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: blue&quot;&gt;int&lt;/span&gt; from_backend(&lt;span style=&quot;color: blue&quot;&gt;void&lt;/span&gt; *frontend, &lt;span style=&quot;color: blue&quot;&gt;int&lt;/span&gt; is_stderr, &lt;span style=&quot;color: blue&quot;&gt;const&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;char&lt;/span&gt; *data, &lt;span style=&quot;color: blue&quot;&gt;int&lt;/span&gt; len)&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;{&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;/* MARK SLETTERINK - ACTIVITY NOTIFICATION SUPPORT - SESSION ACTIVITY DETECTION */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;/* SNIPPET ID: {9198643F-09DF-466f-971F-EB05EA15A85E}-20090922 */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160; &lt;span style=&quot;color: blue&quot;&gt;if&lt;/span&gt;(!&lt;strong&gt;is_window_active())&lt;/strong&gt;&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; flash_window_activity(2);&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;/* MARK SLETTERINK - END OF ACTIVITY NOTIFICATION SUPPORT - SESSION ACTIVITY DETECTION */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160; &lt;span style=&quot;color: blue&quot;&gt;return&lt;/span&gt; term_data(term, is_stderr, data, len);&lt;/pre&gt;

  &lt;pre style=&quot;margin: 0px&quot;&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;All that is left now is compiling the code and firing up &lt;a href=&quot;http://www.chiark.greenend.org.uk/~sgtatham/putty/&quot; target=&quot;_blank&quot;&gt;PuTTY&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;  </description><link>http://zybermark.blogspot.com/2009/09/how-to-determine-if-window-is-active-in.html</link><author>noreply@blogger.com (Zybermark)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6707555.post-608239195037499072</guid><pubDate>Mon, 31 Aug 2009 01:53:00 +0000</pubDate><atom:updated>2009-09-22T22:50:40.670-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Code</category><category domain="http://www.blogger.com/atom/ns#">DrH4x0rsVoid</category><category domain="http://www.blogger.com/atom/ns#">PuTTY</category><category domain="http://www.blogger.com/atom/ns#">software</category><category domain="http://www.blogger.com/atom/ns#">windows</category><title>How to add Activity Notification to PuTTY</title><description>&lt;p&gt;For over a decade &lt;a href=&quot;http://www.chiark.greenend.org.uk/~sgtatham/putty/&quot; target=&quot;_blank&quot;&gt;PuTTY&lt;/a&gt; has been my Telnet/SSH client of choice for Windows. I mostly use it as a &lt;a href=&quot;http://en.wikipedia.org/wiki/MUD&quot; target=&quot;_blank&quot;&gt;MUD&lt;/a&gt; client nowadays and missed one convenience feature: activity notifications. Chat clients all flash for attention when activity occurs and it would be a great addition to streamline my &lt;a href=&quot;http://rubberoom.org/&quot; target=&quot;_blank&quot;&gt;social&lt;/a&gt; &lt;a href=&quot;http://www.kobramud.org/&quot; target=&quot;_blank&quot;&gt;mudlife&lt;/a&gt;, so I set out on a quest to add it…&lt;/p&gt;  &lt;p&gt;First of all you need to have &lt;a title=&quot;Microsoft Visual C++ 2008 Express Edition&quot; href=&quot;http://go.microsoft.com/?linkid=7653520&quot; target=&quot;_blank&quot;&gt;Microsoft Visual C++&lt;/a&gt; installed to compile the &lt;a href=&quot;http://the.earth.li/~sgtatham/putty/latest/putty-src.zip&quot; target=&quot;_blank&quot;&gt;sourcecode for Windows&lt;/a&gt; which can be found on the &lt;a href=&quot;http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html&quot; target=&quot;_blank&quot;&gt;PuTTY Download page&lt;/a&gt;. Get the sources unzipped and load the workspace “putty-src\WINDOWS\MSVC\PUTTY.DSW”, you will need to go through a conversion to a Visual Studio 2008 solution when using VS2008. All code additions and changes are done in the file &lt;strong&gt;WINDOW.C&lt;/strong&gt; in the “putty” project.&lt;/p&gt;  &lt;p&gt;To support activity notification we need to know when there is activity and notify the user by making the window flash if the window is not active and it has not already done a flash. This brings us down to three problems to solve: detecting activity, knowing when the window is not active and flashing the window.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Flashing the PuTTY Window&lt;/h3&gt;  &lt;p&gt;PuTTY already has the option to use the window flash as a visual bell so that code can be used as a template. Notice how this feature also has been implemented in the PuTTY code itself to support flash on older Windows OSes that do not support the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms679347%28VS.85%29.aspx&quot; target=&quot;_blank&quot;&gt;FlashWindowEx&lt;/a&gt; API method. (I have left this code in place, but it has not been tested.) &lt;/p&gt;  &lt;p&gt;The following code snippet must be added at the end of the file:&lt;/p&gt; &lt;style type=&quot;text/css&quot;&gt;


.cf { font-family: consolas; font-size: 10pt; color: black; background: silver; }
.cl { margin: 0px; }
.cb2 { color: blue; }
.cb1 { color: green; }&lt;/style&gt;  &lt;div class=&quot;cf&quot;&gt;   &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;/* MARK SLETTERINK - ACTIVITY NOTIFICATION SUPPORT - FLASH METHODS */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;/* SNIPPET ID: {34060BBE-6F8C-4bc1-AF1F-97B3FC8D24A4} */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;cb2&quot;&gt;void&lt;/span&gt; flash_window_timer_activity(&lt;span class=&quot;cb2&quot;&gt;void&lt;/span&gt; *ctx, &lt;span class=&quot;cb2&quot;&gt;long&lt;/span&gt; now)&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;{&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;cb2&quot;&gt;if&lt;/span&gt; (flashing &amp;amp;&amp;amp; now - next_flash &amp;gt;= 0) {&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; flash_window_activity(1);&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;}&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;cb2&quot;&gt;void&lt;/span&gt; flash_window_activity(&lt;span class=&quot;cb2&quot;&gt;int&lt;/span&gt; mode)&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;{&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160; &lt;span class=&quot;cb2&quot;&gt;if&lt;/span&gt;(mode==0) {&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;cb1&quot;&gt;/* stop */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160; } &lt;span class=&quot;cb2&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;cb2&quot;&gt;if&lt;/span&gt; (mode==2)&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160; {&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;cb1&quot;&gt;/* start */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;cb2&quot;&gt;if&lt;/span&gt; (!flashing &amp;amp;&amp;amp; !activity_blink_done) {&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; flashing = 1;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; activity_blink_done=TRUE;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;cb2&quot;&gt;if&lt;/span&gt; (p_FlashWindowEx) {&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;cb1&quot;&gt;/* For so-called &amp;quot;steady&amp;quot; mode, we use uCount=2, which&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; * seems to be the traditional number of flashes used&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; * by user notifications (e.g., by Explorer).&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; * uCount=0 appears to enable continuous flashing, per&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; * &amp;quot;flashing&amp;quot; mode, although I haven&#39;t seen this&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; * documented. */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; flash_window_ex(FLASHW_ALL | FLASHW_TIMER,&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; (cfg.beep_ind == B_IND_FLASH ? 0 : 2),&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0 &lt;span class=&quot;cb1&quot;&gt;/* system cursor blink rate */&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;cb1&quot;&gt;/* No need to schedule timer */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } &lt;span class=&quot;cb2&quot;&gt;else&lt;/span&gt; {&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; FlashWindow(hwnd, TRUE);&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; next_flash = schedule_timer(450, flash_window_timer_activity, hwnd);&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160; }&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160; &lt;span class=&quot;cb2&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;cb2&quot;&gt;if&lt;/span&gt;(mode==1)&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160; {&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;cb1&quot;&gt;/* maintain */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;cb2&quot;&gt;if&lt;/span&gt; (flashing &amp;amp;&amp;amp; !p_FlashWindowEx) {&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; FlashWindow(hwnd, TRUE);&amp;#160;&amp;#160; &lt;span class=&quot;cb1&quot;&gt;/* toggle */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; next_flash = schedule_timer(450, flash_window_timer_activity, hwnd);&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160; }&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;}&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;/* MARK SLETTERINK - END OF ACTIVITY NOTIFICATION SUPPORT - FLASH METHODS */&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Add the following snippet to the forward declarations at the top of the file (surrounding code is show for reference to the location where it should be placed and must not be added):&lt;/p&gt;

&lt;div class=&quot;cf&quot;&gt;
  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;#define&lt;/span&gt; TIMING_TIMER_ID 1234&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;cb2&quot;&gt;long&lt;/span&gt; timing_next_time;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;/* MARK SLETTERINK - ACTIVITY NOTIFICATION SUPPORT - FLASH METHODS FORWARD DECLARATIONS AND VARS */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;/* SNIPPET ID: {D8B4F4A3-F870-4ded-B298-EEB71701D25D}*/&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;cb2&quot;&gt;void&lt;/span&gt; flash_window_activity(&lt;span class=&quot;cb2&quot;&gt;int&lt;/span&gt; mode);&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;static&lt;/span&gt; BOOL window_is_active=TRUE;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;static&lt;/span&gt; BOOL activity_blink_done=FALSE;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;/* MARK SLETTERINK - END OF ACTIVITY NOTIFICATION SUPPORT - FLASH METHODS FORWARD DECLARATIONS AND VARS*/&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;cb2&quot;&gt;struct&lt;/span&gt; {&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160; HMENU menu;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;The activity_blink_done boolean ensures the window flash gets triggered only one time once the window has become inactive and activity occurs. &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h3&gt;Detecting the Window Active State&lt;/h3&gt;

&lt;p&gt;There are &lt;a href=&quot;http://zybermark.blogspot.com/2009/09/how-to-determine-if-window-is-active-in.html&quot; target=&quot;_blank&quot;&gt;several ways&lt;/a&gt; of doing this, I embarked on the adventure of using a handler for the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms646274%28VS.85%29.aspx&quot; target=&quot;_blank&quot;&gt;WM_ACTIVATE&lt;/a&gt; message to keep track of the current state because it seemed to blend in well with the rest of the code in place. The handler also clears the activity_blink_done variable so a new flash will be triggered when necessary.&lt;/p&gt;

&lt;p&gt;Add the following snippet at the end of the file:&lt;/p&gt;

&lt;div class=&quot;cf&quot;&gt;
  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;/* MARK SLETTERINK - ACTIVITY NOTIFICATION SUPPORT - WINDOW ACTIVE DETECTION */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;/* SNIPPET ID: {75B2CA9C-49F4-4eb5-AFCF-E3D743C37C44} */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;int&lt;/span&gt; Do_WM_ACTIVATE(HWND a_hwnd, UINT message, WPARAM wParam, LPARAM lParam)&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;{&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160; WORD wAction = LOWORD(wParam);&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160; WORD wMinimized = HIWORD(wParam);&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160; &lt;span class=&quot;cb2&quot;&gt;if&lt;/span&gt;(a_hwnd == hwnd) {&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;cb2&quot;&gt;switch&lt;/span&gt;(wAction)&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;cb2&quot;&gt;case&lt;/span&gt; WA_INACTIVE:&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; window_is_active = FALSE;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; activity_blink_done = FALSE;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;cb2&quot;&gt;break&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;cb2&quot;&gt;case&lt;/span&gt; WA_ACTIVE:&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;cb2&quot;&gt;case&lt;/span&gt; WA_CLICKACTIVE:&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;cb2&quot;&gt;if&lt;/span&gt;(!wMinimized)&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; window_is_active = TRUE;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;cb2&quot;&gt;break&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;cb2&quot;&gt;default&lt;/span&gt;:&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;cb2&quot;&gt;break&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160; }&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;}&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;/* MARK SLETTERINK - END OF ACTIVITY NOTIFICATION SUPPORT - WINDOW ACTIVE DETECTION */&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;With the message handler in place we need to hook it up in the window procedure. To do this we need to add a case statement for the WM_ACTIVATE message in the WndProc method. Insert the following code snippet right before default case handler (surrounding code shown for reference and must not be copied):&lt;/p&gt;

&lt;div class=&quot;cf&quot;&gt;
  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;/* MARK SLETTERINK - ACTIVITY NOTIFICATION SUPPORT - WINDOW ACTIVE DETECTION */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;/* SNIPPET ID: {5AFAA3AB-FB28-45e9-9DE7-E56648A1B5AF} */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;cb2&quot;&gt;case&lt;/span&gt; WM_ACTIVATE:&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Do_WM_ACTIVATE(hwnd, message, wParam, lParam);&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;cb2&quot;&gt;break&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;/* MARK SLETTERINK - END OF ACTIVITY NOTIFICATION SUPPORT - WINDOW ACTIVE DETECTION */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;cb2&quot;&gt;default&lt;/span&gt;:&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class=&quot;cb2&quot;&gt;if&lt;/span&gt; (message == wm_mousewheel || message == WM_MOUSEWHEEL) {&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;For completeness add a forward declaration below the previous forward declaration snippet we added:&lt;/p&gt;

&lt;div class=&quot;cf&quot;&gt;
  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;/* MARK SLETTERINK - ACTIVITY NOTIFICATION SUPPORT - WINDOW ACTIVE DETECTION FORWARD DECLARATION */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;/* SNIPPET ID: {D3292300-A6A3-402f-A0A5-CE259BD25EC0} */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;int&lt;/span&gt; Do_WM_ACTIVATE(HWND a_hwnd, UINT message, WPARAM wParam, LPARAM lParam);&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;/* MARK SLETTERINK - END OF ACTIVITY NOTIFICATION SUPPORT - WINDOW ACTIVE DETECTION FORWARD DECLARATION */&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h3&gt;Detecting Session Activity&lt;/h3&gt;

&lt;p&gt;With the window flash and window state support in place all that is left to do is hooking it up to the session activity detection. Find the from_backend method and insert the code snippet below so the method resembles the code block: &lt;/p&gt;

&lt;div class=&quot;cf&quot;&gt;
  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb2&quot;&gt;int&lt;/span&gt; from_backend(&lt;span class=&quot;cb2&quot;&gt;void&lt;/span&gt; *frontend, &lt;span class=&quot;cb2&quot;&gt;int&lt;/span&gt; is_stderr, &lt;span class=&quot;cb2&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;cb2&quot;&gt;char&lt;/span&gt; *data, &lt;span class=&quot;cb2&quot;&gt;int&lt;/span&gt; len)&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;{&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;/* MARK SLETTERINK - ACTIVITY NOTIFICATION SUPPORT - SESSION ACTIVITY DETECTION */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;/* SNIPPET ID: {9198643F-09DF-466f-971F-EB05EA15A85E} */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160; &lt;span class=&quot;cb2&quot;&gt;if&lt;/span&gt;(!window_is_active)&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; flash_window_activity(2);&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&lt;span class=&quot;cb1&quot;&gt;/* MARK SLETTERINK - END OF ACTIVITY NOTIFICATION SUPPORT - SESSION ACTIVITY DETECTION */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;&amp;#160;&amp;#160; &lt;span class=&quot;cb2&quot;&gt;return&lt;/span&gt; term_data(term, is_stderr, data, len);&lt;/pre&gt;

  &lt;pre class=&quot;cl&quot;&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h3&gt;Enjoy!&lt;/h3&gt;

&lt;p&gt;That completes the code additions. Compile the code, fire up PuTTY and enjoy the new activity notification feature!&lt;/p&gt;

&lt;p&gt;Quest complete! You gained 1 million &lt;a href=&quot;http://en.wikipedia.org/wiki/Experience_point&quot; target=&quot;_blank&quot;&gt;XP&lt;/a&gt;.&lt;/p&gt;  </description><link>http://zybermark.blogspot.com/2009/08/how-to-add-activity-notification-to.html</link><author>noreply@blogger.com (Zybermark)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6707555.post-9179809890518813421</guid><pubDate>Sun, 15 Mar 2009 19:30:00 +0000</pubDate><atom:updated>2009-03-15T13:30:08.874-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">.net</category><category domain="http://www.blogger.com/atom/ns#">Code</category><category domain="http://www.blogger.com/atom/ns#">csharp</category><category domain="http://www.blogger.com/atom/ns#">DrH4x0rsVoid</category><category domain="http://www.blogger.com/atom/ns#">software</category><title>How to parse and modify a URL in .Net</title><description>&lt;p&gt;When you need to modify a url string in .Net code the most prudent way to do so is by using the &lt;a title=&quot;UriBuilder Class (System)&quot; href=&quot;http://msdn.microsoft.com/en-us/library/system.uribuilder.aspx&quot; target=&quot;_blank&quot;&gt;UriBuilder class&lt;/a&gt; from the System namespace because it encapsulates all the quirky rules involved in url parsing. However simply creating a new UriBuilder instance initialized with the url string has the potential for throwing a &lt;a title=&quot;UriFormatException Class (System)&quot; href=&quot;http://msdn.microsoft.com/en-us/library/system.uriformatexception.aspx&quot; target=&quot;_blank&quot;&gt;UriFormatException&lt;/a&gt; which creates a &lt;a title=&quot;Coding Horror: TryParse and the Exception Tax&quot; href=&quot;http://www.codinghorror.com/blog/archives/000358.html&quot; target=&quot;_blank&quot;&gt;serious&lt;/a&gt; &lt;a title=&quot;Exceptions and Performance&quot; href=&quot;http://yoda.arachsys.com/csharp/exceptions.html&quot; target=&quot;_blank&quot;&gt;performance hit&lt;/a&gt; whether the exception is caught and handled or, even worse, your program will fail on an &lt;a title=&quot;CLR Inside Out: Unhandled Exception Processing In The CLR&quot; href=&quot;http://msdn.microsoft.com/en-us/magazine/cc793966.aspx?pr=blog&quot; target=&quot;_blank&quot;&gt;unhandled exception&lt;/a&gt; if your code did not anticipate this. &lt;/p&gt;  &lt;p&gt;The UriFormatException can be easily avoided by first converting the url string to a &lt;a title=&quot;Uri Class (System)&quot; href=&quot;http://msdn.microsoft.com/en-us/library/system.uri.aspx&quot; target=&quot;_blank&quot;&gt;Uri class&lt;/a&gt; instance by calling &lt;a title=&quot;Uri.TryCreate Method (System)&quot; href=&quot;http://msdn.microsoft.com/en-us/library/system.uri.trycreate.aspx&quot; target=&quot;_blank&quot;&gt;Uri.TryCreate(...)&lt;/a&gt; and checking the return value for success. If TryCreate succeeded the resulting Uri instance can then be used to create a UriBuilder instance. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The code below shows a C# example of how to modify the hostname in a url without throwing exceptions.&lt;/p&gt;  &lt;div style=&quot;font-size: 8pt; background: white; color: black; font-family: monospace&quot;&gt;   &lt;p style=&quot;margin: 0px&quot;&gt;[&lt;span style=&quot;color: #2b91af&quot;&gt;TestMethod&lt;/span&gt;]&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: blue&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;void&lt;/span&gt; ModifyUrlHost()&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;{&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160; &lt;span style=&quot;color: blue&quot;&gt;string&lt;/span&gt;[] urls ={&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;http://brokensite.com/test/me.html?a=1&amp;amp;b=2&amp;quot;&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; , &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;https://brokensite.com&amp;quot;&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; , &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;https://brokensite.com/&amp;quot;&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; , &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;http://brokensite.com/default&amp;quot;&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; , &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;/test/me.html?a=1&amp;amp;b=2&amp;quot;&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; , &lt;span style=&quot;color: #2b91af&quot;&gt;String&lt;/span&gt;.Empty&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; , &lt;span style=&quot;color: blue&quot;&gt;null&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; };&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160; &lt;span style=&quot;color: blue&quot;&gt;string&lt;/span&gt; newHostName=&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;www.somesite.com&amp;quot;&lt;/span&gt;;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160; &lt;span style=&quot;color: blue&quot;&gt;foreach&lt;/span&gt; (&lt;span style=&quot;color: blue&quot;&gt;string&lt;/span&gt; url &lt;span style=&quot;color: blue&quot;&gt;in&lt;/span&gt; urls)&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: #2b91af&quot;&gt;Debug&lt;/span&gt;.WriteLine(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Original Url: &amp;quot;&lt;/span&gt; + url);&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: blue&quot;&gt;string&lt;/span&gt; newUrl = url;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: #2b91af&quot;&gt;Uri&lt;/span&gt; uri;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: blue&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #2b91af&quot;&gt;Uri&lt;/span&gt;.TryCreate(url, &lt;span style=&quot;color: #2b91af&quot;&gt;UriKind&lt;/span&gt;.Absolute, &lt;span style=&quot;color: blue&quot;&gt;out&lt;/span&gt; uri))&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: #2b91af&quot;&gt;Debug&lt;/span&gt;.WriteLine(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Uri.TryCreate succeeded&amp;quot;&lt;/span&gt;);&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: #2b91af&quot;&gt;UriBuilder&lt;/span&gt; builder = &lt;span style=&quot;color: blue&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af&quot;&gt;UriBuilder&lt;/span&gt;(uri);&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; builder.Host = newHostName;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; newUrl = builder.Uri.ToString();&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: blue&quot;&gt;else&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: #2b91af&quot;&gt;Debug&lt;/span&gt;.WriteLine(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Uri.TryCreate failed&amp;quot;&lt;/span&gt;);&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: #2b91af&quot;&gt;Debug&lt;/span&gt;.WriteLine(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;New Url&amp;#160;&amp;#160;&amp;#160;&amp;#160; : &amp;quot;&lt;/span&gt; + newUrl);&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: #2b91af&quot;&gt;Debug&lt;/span&gt;.WriteLine(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;);&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: blue&quot;&gt;if&lt;/span&gt;(newUrl!=&lt;span style=&quot;color: blue&quot;&gt;null&lt;/span&gt;)&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: #2b91af&quot;&gt;Assert&lt;/span&gt;.IsFalse(newUrl.Contains(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;brokensite.com&amp;quot;&lt;/span&gt;), &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;url still contains brokensite.com&amp;quot;&lt;/span&gt;);&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;}&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;This test generates the following output:&lt;/p&gt;  &lt;div style=&quot;font-size: 8pt; background: white; color: black; font-family: monospace&quot;&gt;   &lt;p style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;//Original Url: http://brokensite.com/test/me.html?a=1&amp;amp;b=2&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;//Uri.TryCreate succeeded&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;//New Url&amp;#160;&amp;#160;&amp;#160;&amp;#160; : http://www.somesite.com/test/me.html?a=1&amp;amp;b=2&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;//Original Url: https://brokensite.com&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;//Uri.TryCreate succeeded&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;//New Url&amp;#160;&amp;#160;&amp;#160;&amp;#160; : https://www.somesite.com/&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;//Original Url: https://brokensite.com/&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;//Uri.TryCreate succeeded&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;//New Url&amp;#160;&amp;#160;&amp;#160;&amp;#160; : https://www.somesite.com/&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;//Original Url: http://brokensite.com/default&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;//Uri.TryCreate succeeded&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;//New Url&amp;#160;&amp;#160;&amp;#160;&amp;#160; : http://www.somesite.com/default&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;//Original Url: /test/me.html?a=1&amp;amp;b=2&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;//Uri.TryCreate failed&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;//New Url&amp;#160;&amp;#160;&amp;#160;&amp;#160; : /test/me.html?a=1&amp;amp;b=2&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;//Original Url: &lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;//Uri.TryCreate failed&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;//New Url&amp;#160;&amp;#160;&amp;#160;&amp;#160; : &lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;//Original Url: &lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;//Uri.TryCreate failed&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;//New Url&amp;#160;&amp;#160;&amp;#160;&amp;#160; :&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  </description><link>http://zybermark.blogspot.com/2009/03/how-to-parse-and-modify-url-in-net.html</link><author>noreply@blogger.com (Zybermark)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6707555.post-7444962783042475859</guid><pubDate>Thu, 22 Jan 2009 03:37:00 +0000</pubDate><atom:updated>2009-01-21T20:37:26.336-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DrH4x0rsVoid</category><title>Being Polite Could Get You Killed!</title><description>&lt;p&gt;&lt;em&gt;But wouldn&#39;t you rather die a gentleman than live as a savage?&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;--&lt;/p&gt;  &lt;p&gt;More British passengers died on the Titanic because &lt;a href=&quot;http://news.bbc.co.uk/2/hi/americas/7843154.stm&quot; target=&quot;_blank&quot;&gt;they queued politely&lt;/a&gt; for lifeboats, researchers believe. &lt;/p&gt;  &lt;p&gt;&amp;quot;The American culture was set up to be a more individualist culture and the British culture was more about the gentlemanly behaviour,&amp;quot; Mr Savage says. &lt;/p&gt;  &lt;p&gt;&amp;quot;You&#39;ve got to remember that this is the Edwardian period when to be a gentleman was the peak of society.&amp;quot; &lt;/p&gt;  &lt;p&gt;Mr Savage said: &amp;quot;There was one gentleman who was rather wealthy... who went back downstairs after he put his wife on the [life] boat... put on his tuxedo...went back upstairs and smoked... with the idea that if I am going die, I may as well die as a gentleman and well-dressed.&amp;quot;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now THAT is my kind of man! AMEN BROTHER!&lt;/p&gt;  </description><link>http://zybermark.blogspot.com/2009/01/being-polite-could-get-you-killed.html</link><author>noreply@blogger.com (Zybermark)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6707555.post-7645702830737291823</guid><pubDate>Mon, 19 Jan 2009 05:54:00 +0000</pubDate><atom:updated>2009-01-19T06:49:49.252-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">.net</category><category domain="http://www.blogger.com/atom/ns#">Code</category><category domain="http://www.blogger.com/atom/ns#">csharp</category><category domain="http://www.blogger.com/atom/ns#">DrH4x0rsVoid</category><category domain="http://www.blogger.com/atom/ns#">software</category><title>Reusable Generic Exception Wrapper in C#</title><description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;When crossing boundaries between software layers you are sometimes faced with the requirement to wrap a meaningless exception from a lower layer into a more meaningful exception for users from the higher layer. The pattern described below helps with implementing this requirement in a reusable way. It is in no way meant to be a catch-all for every situation where you have to deal with exceptions, but when applied correctly can prove to be an invaluable tool in your toolkit. See &lt;a href=&quot;http://www.amazon.com/gp/product/0321246756?ie=UTF8&amp;amp;tag=drh4xvoi-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0321246756&quot; target=&quot;_blank&quot;&gt;Framework Design Guidelines&lt;/a&gt;, Chapter 7 (7.2.3) for more one exception wrapping.&lt;/p&gt;  &lt;p&gt;The approach used is to wrap the logic that can fail in a delegate and have this delegate executed by the WrapExceptions method. The WrapExceptions method then takes responsibility of handling the exceptions appropriately. It should be modified to handle only the applicable exceptions; some exceptions you might not want to wrap e.g. StackOverflowException, OutOfMemoryException and ThreadAbortException because you cannot recover from them. An added advantage of wrapping the failure prone code in a delegate is that it allows you to easily wrap it around existing code.&lt;/p&gt;  &lt;p&gt;The WrapExceptions code snippet:&lt;/p&gt;  &lt;div style=&quot;font-size: 8pt; background: white; color: black; font-family: courier new&quot;&gt;   &lt;p style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: green&quot;&gt;// public delegate void Action();&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: blue&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;void&lt;/span&gt; WrapExceptions(&lt;span style=&quot;color: #2b91af&quot;&gt;Action&lt;/span&gt; action)&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;{&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160; &lt;span style=&quot;color: blue&quot;&gt;try&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; action();&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160; &lt;span style=&quot;color: blue&quot;&gt;catch&lt;/span&gt; (&lt;span style=&quot;color: #2b91af&quot;&gt;MyApplicationException&lt;/span&gt;)&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: green&quot;&gt;// just rethrow exception, it &lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: green&quot;&gt;// was already properly handled&lt;/span&gt;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: blue&quot;&gt;throw&lt;/span&gt;;&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160; &lt;span style=&quot;color: blue&quot;&gt;catch&lt;/span&gt; (&lt;span style=&quot;color: #2b91af&quot;&gt;Exception&lt;/span&gt; e)&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: blue&quot;&gt;throw&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af&quot;&gt;MyApplicationException&lt;/span&gt;(e);&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;}&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;And then you can use it as follows:&lt;/p&gt;  &lt;div style=&quot;font-size: 8pt; background: white; color: black; font-family: courier new&quot;&gt;   &lt;p style=&quot;margin: 0px&quot;&gt;&lt;span style=&quot;color: blue&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;void&lt;/span&gt; WrapMyException(&lt;span style=&quot;color: blue&quot;&gt;string&lt;/span&gt; filepath, &lt;span style=&quot;color: blue&quot;&gt;string&lt;/span&gt; myLine)&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;{&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160; WrapExceptions(&lt;span style=&quot;color: blue&quot;&gt;delegate&lt;/span&gt;()&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: blue&quot;&gt;using&lt;/span&gt; (&lt;span style=&quot;color: #2b91af&quot;&gt;TextWriter&lt;/span&gt; writer = &lt;span style=&quot;color: blue&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af&quot;&gt;StreamWriter&lt;/span&gt;(filepath))&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; writer.WriteLine(myLine);&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;&amp;#160;&amp;#160; });&lt;/p&gt;    &lt;p style=&quot;margin: 0px&quot;&gt;}&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Let me know your thoughts on this approach. What problems did it solve, and did it introduce new ones?&lt;/p&gt;  </description><link>http://zybermark.blogspot.com/2009/01/reusable-generic-exception-wrapper.html</link><author>noreply@blogger.com (Zybermark)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6707555.post-4294915702661039045</guid><pubDate>Sun, 11 Jan 2009 17:54:00 +0000</pubDate><atom:updated>2009-01-11T10:54:21.202-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DrH4x0rsVoid</category><category domain="http://www.blogger.com/atom/ns#">NVidia</category><category domain="http://www.blogger.com/atom/ns#">vista</category><category domain="http://www.blogger.com/atom/ns#">windows</category><title>More pain with NVidia...</title><description>&lt;p&gt;It has been a while since I last tried to find a stable video driver and reader &lt;a href=&quot;http://zybermark.blogspot.com/2008/07/black-screen-after-vista-wakes-up-from.html?showComment=1228945080000#c1778490867839885277&quot; target=&quot;_blank&quot;&gt;Gregg&#39;s question&lt;/a&gt; made me pull the trigger on another adventure in driver-installation-land. It has been a nightmare!&lt;/p&gt;  &lt;p&gt;I started out with trying to reproduce the problem desribed in &lt;a href=&quot;http://zybermark.blogspot.com/2008/07/black-screen-after-vista-wakes-up-from.html&quot; target=&quot;_blank&quot;&gt;&#39;Black Screen after Vista Wakes Up from Sleep with NVidia Driver 7.15.11.7521&#39;&lt;/a&gt; by installing the latest NVidia GeForce video driver available: &lt;a href=&quot;http://www.nvidia.com/object/winvista_x86_178.24_whql.html&quot; target=&quot;_blank&quot;&gt;GeForce Release 178 WHQL&lt;/a&gt; (Version: 178.24, Release Date: October 15, 2008, Operating System: Windows Vista 32-bit, Language: U.S. English, File Size: 85 MB). A reboot later the version number now was at 7.15.11.7824. A quick cycle through sleep-and-resume confirmed the problem was still there. Ouch! Reader Eddy had spent some time troubleshooting this issue as well and &lt;a href=&quot;http://zybermark.blogspot.com/2008/07/black-screen-after-vista-wakes-up-from.html?showComment=1225158300000#c1353630510189416881&quot; target=&quot;_blank&quot;&gt;pointed out the resolution played a role in it&lt;/a&gt;, I am running in 1280x1024 32 bit color. So I changed the color bits from 32 to 16: problem still there, lowered the resolution to 1152x864: problem gone! (I skipped a number of steps here, if NVidia wants scientific data they can hire me and pay for my precious time). Unfortunately now the screen looks like somebody put Vaseline in my eyes. Yuck!&lt;/p&gt;  &lt;p&gt;Ok, so the screen was ugly, but I could go through a sleep-and-resume cycle. Was it worth the ugly screen? Absolutely not! Time to run system restore and get back to my original driver setup...&lt;/p&gt;  &lt;p&gt;Unfortunately kicking off system restore to my old restore point presented me with a &lt;a href=&quot;http://en.wikipedia.org/wiki/Blue_Screen_of_Death&quot; target=&quot;_blank&quot;&gt;blue screen&lt;/a&gt; during the process.&lt;/p&gt;  &lt;p&gt;...&lt;/p&gt;  &lt;p&gt;Eventually my system rebooted, Vista prompted me to its awareness of the crash, I sent the crash report and Microsoft pointed the finger at the NVidia SATA driver. Gaaaaa! Oh well, that was fun, I figured I would try system restore again only to find every single restore point had vanished. Automatic, Manual, they are all gone! Somebody pinch me! My screen looks like all pixels are smeared into eachother and I&#39;m stuck with a broken driver setup. Wake me up from this nightmare!&lt;/p&gt;  &lt;p&gt;Moving on...&lt;/p&gt;  &lt;p&gt;My SATA driver is broken, Microsoft says I need to get latest from NVidia... I figured I could put NVidia to work for me this time and use the wizard from the website to determine the Motherboard software download I needed. The verdict? &lt;a href=&quot;http://www.nvidia.com/content/DriverDownload/download_confirmation.asp?url=http://us.download.nvidia.com/Windows/nForce/15.24/15.24_nforce_winvista32_international_whql.exe&quot; target=&quot;_blank&quot;&gt;GeForce 6150LE / nForce 430&lt;/a&gt; (nForce Driver Version 15.24 WHQL, Release Date: September 12, 2008). Sounds good. Download, install, reboot. This installer puts a driver for just about every piece of hardware they created on your system, and as it comes as a package I would expect them to work together very well. (GeForce 6150 LE driver version 7.15.11.7540, SATA driver version 10.3.0.42.) Unfortunately, a &#39;quick&#39; sleep-and-resume cycle showed the problem was still there and Windows Update tells me there are updated drivers available for my nForce networking and SATA controller.&lt;/p&gt;  &lt;p&gt;Installed GeForce 6150LE driver version 178.24 again and rebooted. Worked with the system for a couple of days and on my next reboot I blue-screened again. Installing the latest SATA driver through Windows Update seems to have resolved that issue. But for now I have disabled sleep mode.&lt;/p&gt;  &lt;p&gt;Conclusion: Problem still not fixed.&lt;/p&gt;  </description><link>http://zybermark.blogspot.com/2009/01/more-pain-with-nvidia.html</link><author>noreply@blogger.com (Zybermark)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6707555.post-3078702678636457094</guid><pubDate>Sat, 30 Aug 2008 16:46:00 +0000</pubDate><atom:updated>2008-08-30T10:46:58.053-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">.net</category><category domain="http://www.blogger.com/atom/ns#">Code</category><category domain="http://www.blogger.com/atom/ns#">DrH4x0rsVoid</category><category domain="http://www.blogger.com/atom/ns#">software</category><title>The Pitfall of ICloneable</title><description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;Or, why you should never use ICloneable.&lt;/p&gt;  &lt;p&gt;So I decided I needed to support cloning for my objects so I can modify the object and compare it to the original (very useful for unit-testing, dirty checking, etc.). The .Net framework comes with a handy interface to publish this ability called ICloneable. The documentation states &amp;quot;Supports cloning, which creates a new instance of a class with the same value as an existing instance&amp;quot;. Great! It comes with one method: Clone. Can&#39;t be too hard to implement this interface, right?&lt;/p&gt;  &lt;p&gt;A quick peek at the documentation for the Clone method says the implementation &amp;quot;Creates a new object that is a copy of the current instance&amp;quot;. And so every textbook implementation goes on to show you how you do that:&lt;/p&gt;  &lt;pre&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt; Clone()
{
&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;   return&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;.MemberwiseClone();
}
&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;But what is the point of that, besides adding more code to maintain? EVERY object already supports MemberwiseClone! Oh yes, we were trying to satisfy an interface contract... But hold on, it gets worse as the documentation then opens up an infinite can of worms with this remark:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Clone can be implemented either as a deep copy or a shallow copy. In a deep copy, all objects are duplicated; whereas, in a shallow copy, only the top-level objects are duplicated and the lower levels contain references.&lt;/p&gt;

  &lt;p&gt;The resulting clone must be of the same type as or a compatible type to the original instance.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The Clone method, and thus the ICloneable interface just became a free-for-all, do as you like, contract. You may deep copy, shallow copy, heck you can even change the type! Technically this can all result in correct code, but the sheer absence of semantics turns the use of this interface into a humongous pitfall. Within your own sphere of influence you can set an expected semantic, but as soon as your code leaves this safe place, or you introduce code from another source which applied different semantics to the ICloneable interface you are in for a debugging session from hell.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ICloneable just became unusable.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strike&gt;Go ahead and mark it as obsolete in your copy of the framework.&lt;/strike&gt; Not all is lost however, you can work around this issue by defining your own interface contract &lt;u&gt;with its own semantics&lt;/u&gt;, but do not inherit it from ICloneable as this would reintroduce the issue. For example:&lt;/p&gt;

&lt;pre&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #808080&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: #008000&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #808080&quot;&gt;&amp;lt;summary&amp;gt;
///&lt;/span&gt;&lt;span style=&quot;color: #008000&quot;&gt; Supports deep-copy cloning, which creates a 
&lt;/span&gt;&lt;span style=&quot;color: #808080&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: #008000&quot;&gt; new instance of a class of the same type and 
&lt;/span&gt;&lt;span style=&quot;color: #808080&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: #008000&quot;&gt; with the same value as an existing instance.
&lt;/span&gt;&lt;span style=&quot;color: #808080&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: #008000&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #808080&quot;&gt;&amp;lt;/summary&amp;gt;
///&lt;/span&gt;&lt;span style=&quot;color: #008000&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #808080&quot;&gt;&amp;lt;typeparam name=&amp;quot;T&amp;quot;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #008000&quot;&gt;Type of the class 
&lt;/span&gt;&lt;span style=&quot;color: #808080&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: #008000&quot;&gt; being cloned.&lt;/span&gt;&lt;span style=&quot;color: #808080&quot;&gt;&amp;lt;/typeparam&amp;gt;
&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;interface&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #2b91af&quot;&gt;IDeepCloneable&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;&amp;lt;T&amp;gt;
{
   &lt;/span&gt;&lt;span style=&quot;color: #808080&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: #008000&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #808080&quot;&gt;&amp;lt;summary&amp;gt;
&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;   &lt;/span&gt;&lt;span style=&quot;color: #808080&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: #008000&quot;&gt; Creates an equally typed deep-copy clone 
&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;   &lt;/span&gt;&lt;span style=&quot;color: #808080&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: #008000&quot;&gt; of this object.
&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;   &lt;/span&gt;&lt;span style=&quot;color: #808080&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: #008000&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #808080&quot;&gt;&amp;lt;/summary&amp;gt;
&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;   &lt;/span&gt;&lt;span style=&quot;color: #808080&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: #008000&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #808080&quot;&gt;&amp;lt;returns&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #008000&quot;&gt;An equally typed deep-copy clone 
&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;   &lt;/span&gt;&lt;span style=&quot;color: #808080&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: #008000&quot;&gt; of this object.&lt;/span&gt;&lt;span style=&quot;color: #808080&quot;&gt;&amp;lt;/returns&amp;gt;
&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;   T Clone();
}&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;This interface contract sets a clear copy and type expectation (and gets rid of the pesky Object return type, that was so 1.0 baby!), but defining cloning semantics is not an easy task. Data containers, business- and UI-objects all have different needs and come with different cloning behaviors. Defining an interface for each of those will help keep expectations clear and ease integration with 3rd party components. However, unless you explicitly implement those interfaces on all classes you will also have to make sure the method names in those interfaces are unique else it will still be too easy to mix incompatible implementations. Always keep the consumer in mind while designing your interface!&lt;/p&gt;

&lt;p&gt;I&#39;m curious to know how you approached your cloning challenge. Leave me a comment!&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;References&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.csharp411.com/c-object-clone-wars/&quot; target=&quot;_blank&quot;&gt;C# Object Clone Wars&lt;/a&gt;, a great recap on different cloning techniques. &lt;/li&gt;

  &lt;li&gt;&lt;a href=&quot;http://www.amazon.com/gp/product/0321246756?ie=UTF8&amp;amp;tag=drh4xvoi-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0321246756&quot; target=&quot;_blank&quot;&gt;Framework Design Guidelines&lt;/a&gt;, it&#39;s on my mandatory reading list. Provides great insight on API design.&lt;/li&gt;

  &lt;li&gt;&lt;a href=&quot;http://www.windojitsu.com/blog/copyctorvsicloneable.html&quot; target=&quot;_blank&quot;&gt;Copy Constructors vs ICloneable -- Redux&lt;/a&gt; &lt;/li&gt;

  &lt;li&gt;&lt;a href=&quot;http://www.codeproject.com/KB/cs/0g_GenericsAndCloning.aspx&quot; target=&quot;_blank&quot;&gt;CodeProject: Generics and Cloning&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;  </description><link>http://zybermark.blogspot.com/2008/08/pitfall-of-icloneable.html</link><author>noreply@blogger.com (Zybermark)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6707555.post-8369643323140674286</guid><pubDate>Tue, 29 Jul 2008 23:52:00 +0000</pubDate><atom:updated>2009-01-11T10:59:10.318-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DrH4x0rsVoid</category><category domain="http://www.blogger.com/atom/ns#">NVidia</category><category domain="http://www.blogger.com/atom/ns#">software</category><category domain="http://www.blogger.com/atom/ns#">technology</category><category domain="http://www.blogger.com/atom/ns#">vista</category><category domain="http://www.blogger.com/atom/ns#">windows</category><title>Black Screen after Vista Wakes Up from Sleep with NVidia Driver Version 7.15.11.7521</title><description>&lt;p&gt;It&#39;s actually not completely black, the top line of pixels still works properly! This problem started for me after I installed the driver update supplied by Windows &lt;a style=&quot;&quot; href=&quot;http://lh5.ggpht.com/mark.sletterink/SI-tTY9MEoI/AAAAAAAAAF8/n2Vg74uHrUA/s1600-h/NVidia_GeForce6150LE_v7.15.11.75215.jpg&quot;&gt;&lt;img style=&quot;border-width: 0px;&quot; alt=&quot;NVidia_GeForce6150LE_v7.15.11.7521&quot; src=&quot;http://lh3.ggpht.com/mark.sletterink/SI-tTyM467I/AAAAAAAAAGA/VyBOPZgwssU/NVidia_GeForce6150LE_v7.15.11.7521_t.jpg?imgmax=800&quot; width=&quot;220&quot; align=&quot;right&quot; border=&quot;0&quot; height=&quot;244&quot; /&gt;&lt;/a&gt;Update for the GeForce 6150 LE; Driver Provider: NVIDIA, Driver Date: 5/22/2008, Driver Version: 7.15.11.7521.  Both manually forcing it and idling to sleep or hibernate produce the same results.&lt;/p&gt;  &lt;p&gt;The rest of the system appears to be functioning properly and pressing the power button will turn off the system. Hitting the [WIN], typing &#39;shutdown /r /t 0&#39; and pressing [enter] will reboot the system. Upon reboot the screen is fine again and neither the EventLog nor Reliability Monitor show any problems.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://lh3.ggpht.com/mark.sletterink/SI-tUJk3tTI/AAAAAAAAAGE/IjeiDTOyIeo/s1600-h/Rollback_Driver_Error3.jpg&quot;&gt;&lt;img style=&quot;border-width: 0px;&quot; alt=&quot;Rollback_Driver_Error&quot; src=&quot;http://lh4.ggpht.com/mark.sletterink/SI-tUbg7cYI/AAAAAAAAAGI/3OeeFPce7zs/Rollback_Driver_Error_thumb1.jpg?imgmax=800&quot; width=&quot;244&quot; align=&quot;right&quot; border=&quot;0&quot; height=&quot;129&quot; /&gt;&lt;/a&gt;I decided to roll back to the previous driver (7.15.11.6222, 7/6/2007), which produced four RunDLL error dialogs: &quot;Error in NVCPL.DLL - Missing entry:NvCplRestorePersistence&quot;. Ouch!&lt;/p&gt;  &lt;p&gt;Now the screen works properly when waking up, but I get greeted with that error dialog. Again, no errors or warning in the EventLog or Reliability Monitor.&lt;/p&gt;  &lt;p&gt;Time for the windows cure-all... DAS (RE)BOOT!&lt;/p&gt;  &lt;p&gt;Excellent! The reboot cleared up that issue. &lt;/p&gt;  &lt;p&gt;Has anyone else experienced this issue? Did you resolve it? How?&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;Related posts:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://zybermark.blogspot.com/2009/01/more-pain-with-nvidia.html&quot;&gt;More Pain with NVidia...&lt;/a&gt;
&lt;/li&gt;&lt;/ul&gt;</description><link>http://zybermark.blogspot.com/2008/07/black-screen-after-vista-wakes-up-from.html</link><author>noreply@blogger.com (Zybermark)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/mark.sletterink/SI-tTyM467I/AAAAAAAAAGA/VyBOPZgwssU/s72-c/NVidia_GeForce6150LE_v7.15.11.7521_t.jpg?imgmax=800" height="72" width="72"/><thr:total>3</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6707555.post-4460279672019200108</guid><pubDate>Mon, 09 Jun 2008 21:03:00 +0000</pubDate><atom:updated>2008-06-09T19:46:04.685-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Code</category><category domain="http://www.blogger.com/atom/ns#">DrH4x0rsVoid</category><category domain="http://www.blogger.com/atom/ns#">flamebait</category><title>Nerdettes are the source of beautiful code?</title><description>&lt;blockquote&gt;   &lt;p&gt;Emma McGrattan, the senior vice-president of engineering for computer-database company Ingres&amp;#8211;and one of Silicon Valley&amp;#8217;s highest-ranking female programmers&amp;#8211;insists that men and women write code differently. Women are more touchy-feely and considerate of those who will use the code later, she says. They&amp;#8217;ll intersperse their code&amp;#8211;those strings of instructions that result in nifty applications and programs&amp;#8211;with helpful comments and directions, explaining why they wrote the lines the way they did and exactly how they did it.      &lt;br /&gt;The code becomes a type of &amp;#8220;roadmap&amp;#8221; for others who might want to alter it or add to it later...&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt; Did she just say I &lt;a href=&quot;http://blogs.wsj.com/biztech/2008/06/06/men-write-code-from-mars-women-write-more-helpful-code-from-venus/&quot; target=&quot;_blank&quot;&gt;code like a girl&lt;/a&gt;? My pursuit of &lt;a href=&quot;http://zybermark.blogspot.com/2008/05/does-universal-beautiful-code-exist.html&quot; target=&quot;_blank&quot;&gt;writing maintainable code&lt;/a&gt; is really an exploration of my feminine side? That is quite the flamebait &lt;a href=&quot;http://www.eclipse.org/org/elections/candidate.php?year=2008&amp;amp;id=mcgrattan&quot; target=&quot;_blank&quot;&gt;Mrs. McGratten&lt;/a&gt; treated the nerdiverse on. :) &lt;/p&gt;  &lt;p&gt;Her goal is noble, but I think &lt;a href=&quot;http://en.wikipedia.org/wiki/Agile_software_development&quot; target=&quot;_blank&quot;&gt;Agile&lt;/a&gt; is wasted on Ingress:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;In an effort to make Ingres&amp;#8217;s computer code more user-friendly and gender-neutral, McGrattan helped institute new coding standards at the company. They require programmers to include a detailed set of comments before each block of code explaining what the piece of code does and why; developers also must supply a detailed history of any changes they have made to the code. The rules apply to both Ingres employees and members of the open-source community who contribute code to Ingres&amp;#8217;s products.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;My question to you: Do you &lt;a href=&quot;http://zybermark.blogspot.com/2008/05/building-software-evil-and-getting.html&quot; target=&quot;_blank&quot;&gt;get anything done&lt;/a&gt;? Or is 90% of time spent on adding code-pretties? &lt;/p&gt;  </description><link>http://zybermark.blogspot.com/2008/06/nerdettes-are-source-of-beautiful-code.html</link><author>noreply@blogger.com (Zybermark)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6707555.post-6348359488164093613</guid><pubDate>Sat, 07 Jun 2008 17:21:00 +0000</pubDate><atom:updated>2008-06-07T17:07:04.332-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DrH4x0rsVoid</category><category domain="http://www.blogger.com/atom/ns#">Realtek HD Audio</category><category domain="http://www.blogger.com/atom/ns#">vista</category><category domain="http://www.blogger.com/atom/ns#">windows</category><title>Realtek HD Audio - upgrading from 6.0.1.5502 to 6.0.1.5548</title><description>&lt;p&gt;The &lt;a href=&quot;http://h10025.www1.hp.com/ewfrf/wc/softwareList?os=2093&amp;amp;lc=en&amp;amp;cc=us&amp;amp;dlc=en&amp;amp;product=3369460%E2%8C%A9=en&quot; target=&quot;_blank&quot;&gt;Software &amp;amp; Driver download&lt;/a&gt; page for my &lt;a href=&quot;http://h10025.www1.hp.com/ewfrf/wc/product?product=3369460&amp;amp;lc=en&amp;amp;cc=us%E2%8C%A9=en&amp;amp;os=2093&amp;amp;dlc=en&quot; target=&quot;_blank&quot;&gt;HP Pavilion a1750e&lt;/a&gt; had an updated audio driver on it, but I assumed Windows Update also had the &lt;a href=&quot;http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&amp;amp;PNid=14&amp;amp;PFid=24&amp;amp;Level=4&amp;amp;Conn=3&amp;amp;DownTypeID=3&amp;amp;GetDown=false&quot; target=&quot;_blank&quot;&gt;latest Realtek HD Audio drivers&lt;/a&gt; for Vista. Since I religiously keep up to date with Windows Update I assumed I was running with the latest drivers. Alas, I was &lt;strike&gt;wrong&lt;/strike&gt; mistaken! &lt;/p&gt;  &lt;p&gt;What is going on here? Why do I have to pick those drivers up from HP? It looks like Microsoft would have to keep a lot of vendor specific updates available, considering this disclaimer found on the Realtek drivers download &lt;a href=&quot;http://www.realtek.com.tw/downloads/downloadsCheck.aspx?Langid=1&amp;amp;PNid=14&amp;amp;PFid=24&amp;amp;Level=4&amp;amp;Conn=3&amp;amp;DownTypeID=3&amp;amp;GetDown=false&quot; target=&quot;_blank&quot;&gt;entry page&lt;/a&gt;.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Audio drivers available for download from the Realtek website are general drivers for our audio ICs, and may not offer the customizations made by your system/motherboard manufacturer. To be sure you obtain the full features/customizations provided in your original audio product, please download the latest drivers from your system/motherboard manufacturer&#39;s website.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt; Yuck! This is lawyer speak for &quot;we don&#39;t do drivers, we&#39;re in the hardware business&quot;. Ergo, you want drivers? Go talk to your hardware vendor. And so I did. Current installed version 6.0.1.5502; Time to put the &lt;a href=&quot;http://h10025.www1.hp.com/ewfrf/wc/softwareDownloadIndex?softwareitem=pv-58189-1&amp;amp;lc=en&amp;amp;cc=us&amp;amp;dlc=en&amp;amp;product=3369460&amp;amp;os=2093%E2%8C%A9=en&quot; target=&quot;_blank&quot;&gt;upgrade to version 6.0.1.5548&lt;/a&gt; to the test. (Release date: 2008-03-01, Description: Realtek High Definition Audio driver update resolves excessive noise issue with HDMI audio.)&lt;/p&gt;  &lt;p&gt;Strangely enough HP software updates still do not seem to be able to use a wizard style for their update dialog, so after running &lt;a href=&quot;ftp://ftp.hp.com/pub/softlib/software9/COL22124/pv-58189-1/sp37324.exe&quot;&gt;sp37324.exe&lt;/a&gt; I am presented with the plea to press YES!   
&lt;a href=&quot;http://lh3.ggpht.com/mark.sletterink/SErDqSBPhfI/AAAAAAAAAE8/vEzMb-9NGVA/s1600-h/ClickYes%5B2%5D.jpg&quot;&gt;&lt;img style=&quot;border: 0px none ;&quot; alt=&quot;ClickYes&quot; src=&quot;http://lh6.ggpht.com/mark.sletterink/SErDrd6KOqI/AAAAAAAAAFA/1GbEJq38wqM/ClickYes_thumb.jpg?imgmax=800&quot; border=&quot;0&quot; height=&quot;116&quot; width=&quot;244&quot; /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Ick! Ok, then. I wonder what the difference is between &quot;No&quot; and &quot;Cancel&quot;. :)&lt;/p&gt;  &lt;p&gt;Next up, a little progress dialog...&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://lh6.ggpht.com/mark.sletterink/SErDr7qQcmI/AAAAAAAAAFE/yfa5GOc5oiA/s1600-h/PleaseWait%5B2%5D.jpg&quot;&gt;&lt;img style=&quot;border: 0px none ;&quot; alt=&quot;PleaseWait&quot; src=&quot;http://lh5.ggpht.com/mark.sletterink/SErDsIGiNII/AAAAAAAAAFI/yit27qvOSLw/PleaseWait_thumb.jpg?imgmax=800&quot; border=&quot;0&quot; height=&quot;89&quot; width=&quot;244&quot; /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Eeeep! No progress shown here, just the moving piece of green that shows it is busy. And after a bit the update is done; Time to click YES again, or No, or Cancel!&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://lh5.ggpht.com/mark.sletterink/SErDsap9ZkI/AAAAAAAAAFM/UP475TrlPDU/s1600-h/UpdateCompleted%5B2%5D.jpg&quot;&gt;&lt;img style=&quot;border: 0px none ;&quot; alt=&quot;UpdateCompleted&quot; src=&quot;http://lh6.ggpht.com/mark.sletterink/SErDsqRpFxI/AAAAAAAAAFQ/ZeDzjp1CLac/UpdateCompleted_thumb.jpg?imgmax=800&quot; border=&quot;0&quot; height=&quot;95&quot; width=&quot;244&quot; /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I chose to be nice, and click YES, the system restarted, and &lt;strong&gt;I still had sound&lt;/strong&gt;. Yay! Unfortunately all my audio configuration settings were wiped out again, so I had to set front and back channels to be split again, but that was the only heartache I got. And just to be sure I checked the version dialog:&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://lh5.ggpht.com/mark.sletterink/SErDtG3-c5I/AAAAAAAAAFU/VHrJ1DVcl4k/s1600-h/driver-v6.0.1.5548-infopanel%5B2%5D.jpg&quot;&gt;&lt;img style=&quot;border: 0px none ;&quot; alt=&quot;driver-v6.0.1.5548-infopanel&quot; src=&quot;http://lh5.ggpht.com/mark.sletterink/SErDtbiZKsI/AAAAAAAAAFY/I4P0zQvobWw/driver-v6.0.1.5548-infopanel_thumb.jpg?imgmax=800&quot; border=&quot;0&quot; height=&quot;197&quot; width=&quot;244&quot; /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Success! &lt;/p&gt;  &lt;p&gt;My question to you, dear reader, is: Where do YOU pull your Realtek HD Audio driver updates from?&lt;/p&gt;</description><link>http://zybermark.blogspot.com/2008/06/realtek-hd-audio-upgrading-from-6015502.html</link><author>noreply@blogger.com (Zybermark)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/mark.sletterink/SErDrd6KOqI/AAAAAAAAAFA/1GbEJq38wqM/s72-c/ClickYes_thumb.jpg?imgmax=800" height="72" width="72"/><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6707555.post-7588284936979840872</guid><pubDate>Fri, 30 May 2008 04:10:00 +0000</pubDate><atom:updated>2008-05-29T22:10:50.382-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DrH4x0rsVoid</category><category domain="http://www.blogger.com/atom/ns#">security</category><category domain="http://www.blogger.com/atom/ns#">software</category><title>Building Software, Evil and Getting Things Done</title><description>&lt;p&gt;&lt;a href=&quot;http://www.codinghorror.com/blog/archives/000021.html&quot; target=&quot;_blank&quot;&gt;Jeff Atwood&lt;/a&gt;&amp;#160; wrote a &lt;a href=&quot;http://www.codinghorror.com/blog/archives/001123.html&quot; target=&quot;_blank&quot;&gt;passionate blog entry&lt;/a&gt; about &lt;a href=&quot;http://en.wikipedia.org/wiki/Craigslist&quot; target=&quot;_blank&quot;&gt;Craigslist&lt;/a&gt; and the demise of the Personals section (amongst others) now that Evil forces have taken over with the help of ever more sophisticated tools and creative solutions. Wouldn&#39;t you agree such is the natural result of the open approach used by Craigslist? &lt;em&gt;Anyone&lt;/em&gt; can post an ad. If they had not taken this approach Craigslist would not have been so successful. Lowering the bar for getting your classifieds in meant getting more ads, because &lt;em&gt;everybody &lt;/em&gt;could do it, &lt;em&gt;without&lt;/em&gt; having to sign away their life. Just like &lt;a href=&quot;http://www.virtualtourist.com/travel/Europe/France/Ile_de_France/Paris-99080/Warnings_or_Dangers-Paris-Pick_Pockets-BR-1.html&quot; target=&quot;_blank&quot;&gt;tourist&lt;/a&gt; &lt;a href=&quot;http://www.virtualtourist.com/travel/Europe/Netherlands/Provincie_Noord_Holland/Amsterdam-463377/Warnings_or_Dangers-Amsterdam-TG-C-1.html&quot; target=&quot;_blank&quot;&gt;destinations&lt;/a&gt; attract &lt;a href=&quot;http://www.dailymail.co.uk/news/article-510100/Revealed-How-Romanian-pickpocket-gangs-building-palaces-home-child-slave-labour.html&quot; target=&quot;_blank&quot;&gt;pickpockets&lt;/a&gt; (and &lt;a href=&quot;http://nyc2dailyphoto.blogspot.com/2007/09/beware-of-pickpockets-and-loose-women.html&quot; target=&quot;_blank&quot;&gt;loose women?&lt;/a&gt;), open high-traffic websites attract spammers.&lt;/p&gt;  &lt;p&gt;Craigslist was &lt;a href=&quot;http://www.stevepavlina.com/blog/2008/05/the-value-of-ideas/&quot; target=&quot;_blank&quot;&gt;a great idea&lt;/a&gt;. A great idea that became more than just an idea, it actually got implemented. Maybe the implementation was not perfect by today&#39;s standards but it worked and has &lt;a href=&quot;http://www.sfweekly.com/2005-11-30/news/craig-list-com/&quot; target=&quot;_blank&quot;&gt;paid the bills&lt;/a&gt; for over thirteen years! A proper threat-modeling session in the early days would surely have brought these issues to light, and business-need would have overruled security/abuse. Unfortunately this business model might have seen its&#39; longest days by now.&lt;/p&gt;  &lt;p&gt;Nowadays such openness is no longer feasible. Spammers and crackers are abusing the system every which way they can for personal gain forcing our software solutions to be able to handle every known attack angle and mitigate the future ones as much as possible. Any programmer that takes himself seriously should invest in getting properly educated on the security aspects of programming. Not just because he should create solid code, but because sooner or later it will become a liability. Everybody with a little knack for logic and the ability to use google can cut and paste together a piece of software. Creativity and innovation flourishes! But... would you send your kids out on the road in an innovative car with no brakes? I think not! &lt;/p&gt;  &lt;p&gt;When you make a living writing business software there is a constant struggle between getting things done, and getting them done &lt;strong&gt;right&lt;/strong&gt;. Being able to get things done right generally means &lt;em&gt;you already need to know how to do them right&lt;/em&gt; because there is no time to &lt;a href=&quot;http://www.google.com/&quot; target=&quot;_blank&quot;&gt;search&lt;/a&gt; &lt;a href=&quot;http://ask.com/&quot; target=&quot;_blank&quot;&gt;the&lt;/a&gt; &lt;a href=&quot;http://search.live.com/&quot; target=&quot;_blank&quot;&gt;web&lt;/a&gt; all day for the perfect solution, that deadline is approaching fast. What&#39;s worse, you might not even be aware there is a problem with the chosen implementation. If you are a contractor, do you invest in your &lt;a href=&quot;http://www.giac.org/&quot; target=&quot;_blank&quot;&gt;security education&lt;/a&gt;, or do you focus on getting up to speed on the latest &lt;a href=&quot;http://weblog.raganwald.com/2007/01/dont-overthink-fizzbuzz.html&quot; target=&quot;_blank&quot;&gt;fizz-buzzwords&lt;/a&gt;? If you are a wage-slave, does your company invest in your education, or are you merely a mindless implementer of business requirements? &lt;em&gt;Do &lt;strong&gt;you&lt;/strong&gt; invest in yourself?&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;Invest in yourself!&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;How do I invest in myself? Personally I still prefer a good book over online reading. The author of a book has put an effort into putting together a cohesive set of information to help you advance. When you randomly pull a single chapter out of a book you generally miss context or concepts. Browsing the web is like pulling a subtract of a chapter out of a giant book and all the other related information goes wasted on you. You get a quick answer to a specific detail to a problem, but never get to grasp the whole problem. When I do decide to stick with using the free online resources I make sure I do my research properly; Follow links, make sure I get the context. Granted, most bloggers/authors on the web put a lot of effort into their content, slowly weaving a never-ending book online, but that is not the same as having a book covering a specific topic. :) (Some day we might all go the way of the &lt;a href=&quot;http://www.amazon.com/gp/product/B000FI73MA?ie=UTF8&amp;amp;tag=drh4xvoi-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=B000FI73MA&quot; target=&quot;_blank&quot;&gt;Kindle&lt;/a&gt;, but I prefer the feeling of a solid paper book.)&lt;/p&gt;  &lt;p&gt;In the end we are all responsible for the solutions we produce, so next time you get to implement a great idea make sure you (know how to) do some threat-modeling first (&lt;a href=&quot;http://blogs.msdn.com/sdl/archive/tags/threat+modeling/default.aspx&quot; target=&quot;_blank&quot;&gt;online&lt;/a&gt;, &lt;a href=&quot;http://www.amazon.com/gp/product/0735617228?ie=UTF8&amp;amp;tag=drh4xvoi-20&amp;amp;link_code=as3&amp;amp;camp=211189&amp;amp;creative=373489&amp;amp;creativeASIN=0735617228&quot; target=&quot;_blank&quot;&gt;book&lt;/a&gt;). That shortcut you were about to take &lt;a href=&quot;http://en.wikipedia.org/wiki/Butterfly_effect&quot; target=&quot;_blank&quot;&gt;might&lt;/a&gt; have &lt;a href=&quot;http://en.wikipedia.org/wiki/Chaos_theory&quot; target=&quot;_blank&quot;&gt;changed&lt;/a&gt; the &lt;a href=&quot;http://en.wikipedia.org/wiki/Risks_to_civilization,_humans_and_planet_Earth&quot; target=&quot;_blank&quot;&gt;fate of the planet&lt;/a&gt;!&lt;/p&gt;  </description><link>http://zybermark.blogspot.com/2008/05/building-software-evil-and-getting.html</link><author>noreply@blogger.com (Zybermark)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6707555.post-8300196575905092705</guid><pubDate>Wed, 28 May 2008 04:06:00 +0000</pubDate><atom:updated>2008-05-28T11:43:52.270-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Code</category><category domain="http://www.blogger.com/atom/ns#">DrH4x0rsVoid</category><category domain="http://www.blogger.com/atom/ns#">software</category><title>Does Universal Beautiful Code Exist?</title><description>&lt;p&gt;A &lt;a href=&quot;http://blogs.sun.com/bmc/entry/beautiful_code&quot; target=&quot;_blank&quot;&gt;lot&lt;/a&gt; of &lt;a href=&quot;http://www.codinghorror.com/blog/archives/001062.html&quot; target=&quot;_blank&quot;&gt;debate&lt;/a&gt; is going on about &amp;quot;&lt;a href=&quot;http://www.amazon.com/gp/product/0596510047?ie=UTF8&amp;amp;tag=drh4xvoi-20&amp;amp;link_code=as3&amp;amp;camp=211189&amp;amp;creative=373489&amp;amp;creativeASIN=0596510047&quot; target=&quot;_blank&quot;&gt;Beautiful Code&lt;/a&gt;&amp;quot;. How can you measure the beauty of code? Is it &lt;a href=&quot;http://www.amazon.com/gp/product/0735619670?ie=UTF8&amp;amp;tag=drh4xvoi-20&amp;amp;link_code=as3&amp;amp;camp=211189&amp;amp;creative=373489&amp;amp;creativeASIN=0735619670&quot; target=&quot;_blank&quot;&gt;&amp;quot;solid&amp;quot; code&lt;/a&gt;? Or perhaps &lt;a href=&quot;http://weblog.raganwald.com/2007/04/writing-programs-for-people-to-read.html&quot; target=&quot;_blank&quot;&gt;easily readable&lt;/a&gt; for humans? An efficient &lt;a href=&quot;http://www.amazon.com/gp/product/0262032937?ie=UTF8&amp;amp;tag=drh4xvoi-20&amp;amp;link_code=as3&amp;amp;camp=211189&amp;amp;creative=373489&amp;amp;creativeASIN=0262032937&quot; target=&quot;_blank&quot;&gt;algorithm&lt;/a&gt;, or a fast one? Terse sample code that shows a concept, or production code that is &lt;a href=&quot;http://beautifulcode.oreillynet.com/2007/12/error_handling_the_practice_we.php&quot; target=&quot;_blank&quot;&gt;robust&lt;/a&gt; and fault tolerant? Perhaps a clever solution to a problem, or code that follows &lt;a href=&quot;http://www.amazon.com/gp/search?ie=UTF8&amp;amp;keywords=Framework%20Design%20Guidelines&amp;amp;tag=drh4xvoi-20&amp;amp;index=books&amp;amp;linkCode=ur2&amp;amp;camp=1789&amp;amp;creative=9325&quot; target=&quot;_blank&quot;&gt;coding conventions and guidelines&lt;/a&gt;? Or should it be &lt;a href=&quot;http://www.amazon.com/gp/product/0321126971?ie=UTF8&amp;amp;tag=drh4xvoi-20&amp;amp;link_code=as3&amp;amp;camp=211189&amp;amp;creative=373489&amp;amp;creativeASIN=0321126971&quot; target=&quot;_blank&quot;&gt;patterns&lt;/a&gt; based? What about curly-braces, indentation, comments, letter-casing (NO SHOUTING, IT&#39;S RUDE!) or programming language? Should it exploit all features of the language it was written in, or only use some generic feature-set, libraries or framework commonly found in the language type (imperative, functional, .Net, C-Libraries)? What about &lt;a href=&quot;http://en.wikipedia.org/wiki/Cyclomatic_complexity&quot; target=&quot;_blank&quot;&gt;cyclomatic complexity&lt;/a&gt; and other &lt;a href=&quot;http://en.wikipedia.org/wiki/Software_metric&quot; target=&quot;_blank&quot;&gt;software metrics&lt;/a&gt;? &lt;/p&gt;  &lt;p&gt;Most of those &amp;quot;beauty metrics&amp;quot; are purely gut-feeling based and enforcing metrics like a low cyclomatic complexity generally does not improve code beauty (good luck polishing a coal until it&#39;s a diamond). In my experience code often mirrors the authors&#39; understanding of the problem and thought-process. No amount of computer assisted code analysis can improve that. &lt;/p&gt;  &lt;p&gt;Beautiful code can come in the form of little one-liner gems, or huge elegant architectural diamonds that solve a real-world problem. You will generally find more little gems than big diamonds.&lt;/p&gt;  &lt;p&gt;In the end nobody can win: &lt;a href=&quot;http://www.phrases.org.uk/meanings/59100.html&quot; target=&quot;_blank&quot;&gt;Beauty is in the eye of the beholder&lt;/a&gt;!&lt;/p&gt;  &lt;p&gt;I cannot put it better than David Hume:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Beauty in things exists merely in the mind which contemplates them.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Code beauty is determined by the observers&#39; frame of reference; programming exposure (languages (C, C++, Java, Visual Basic, F#, Ruby, Lisp), Patterns, Algorithms, Operating Systems, formal training, experience (how many times has the beholder been &lt;a href=&quot;http://alarmingdevelopment.org/?p=79&quot; target=&quot;_blank&quot;&gt;burned&lt;/a&gt; by mistakes?), etc.), &lt;a href=&quot;http://haacked.com/archive/2007/05/28/the-only-universal-language-in-software-is-english.aspx&quot; target=&quot;_blank&quot;&gt;native language&lt;/a&gt;, organizational position (Junior Programmer vs. Senior Architect vs IT Director, they have different stakes in the code produced) and even aesthetical preferences.&lt;/p&gt;  &lt;p&gt;Back to my original question: Does UNIVERSAL beautiful code exist?&lt;/p&gt;  &lt;p&gt;Think about that for a minute, I&#39;ll wait... What do you think &lt;a href=&quot;http://en.wikipedia.org/wiki/Greys&quot; target=&quot;_blank&quot;&gt;the Greys&lt;/a&gt; use as their programming language? Something based on &lt;a href=&quot;http://en.wikipedia.org/wiki/Hieroglyph_%28disambiguation%29&quot; target=&quot;_blank&quot;&gt;hieroglyphs&lt;/a&gt; and flow-charts? What about my Ferengi friend &lt;a href=&quot;http://en.wikipedia.org/wiki/Quark_%28Star_Trek%29&quot; target=&quot;_blank&quot;&gt;Quark&lt;/a&gt;? &lt;a href=&quot;http://en.wikipedia.org/wiki/Quantum_programming&quot; target=&quot;_blank&quot;&gt;Quantum languages&lt;/a&gt; like QCL or QFC?&lt;/p&gt;  &lt;p&gt;Good luck getting consensus on that! :)&lt;/p&gt;  &lt;p&gt;So, is there Beautiful Architecture?&lt;/p&gt;  </description><link>http://zybermark.blogspot.com/2008/05/does-universal-beautiful-code-exist.html</link><author>noreply@blogger.com (Zybermark)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6707555.post-5422986669013317479</guid><pubDate>Sat, 17 May 2008 02:59:00 +0000</pubDate><atom:updated>2008-06-07T22:55:46.834-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DrH4x0rsVoid</category><category domain="http://www.blogger.com/atom/ns#">microsoft</category><category domain="http://www.blogger.com/atom/ns#">pocket pc</category><category domain="http://www.blogger.com/atom/ns#">software</category><category domain="http://www.blogger.com/atom/ns#">technology</category><category domain="http://www.blogger.com/atom/ns#">windows ce</category><category domain="http://www.blogger.com/atom/ns#">windows mobile</category><title>Process Explorer for Windows Mobile</title><description>&lt;p&gt;My &lt;a href=&quot;http://h10010.www1.hp.com/wwpc/us/en/sm/WF05a/215348-215348-64929-314903-215384-421420.html&quot; target=&quot;_blank&quot;&gt;iPAQ&lt;/a&gt; with &lt;a href=&quot;http://www.microsoft.com/Windowsmobile/default.mspx&quot; target=&quot;_blank&quot;&gt;Windows Mobile&lt;/a&gt; was acting sluggish, so I went hunting for a &lt;a href=&quot;http://windowshelp.microsoft.com/Windows/en-US/help/0da9bb3d-22c6-4b4d-a020-f75a2a0ef8671033.mspx&quot; target=&quot;_blank&quot;&gt;Task Manager&lt;/a&gt;/&lt;a href=&quot;http://www.microsoft.com/technet/sysinternals/Security/ProcessExplorer.mspx&quot; target=&quot;_blank&quot;&gt;Process Explorer&lt;/a&gt; like utility for it and came across this little gem. Saved me some coding! In the end I&amp;#160; was unable to figure out what exactly caused the slugginesh because the problem went away, but next time it happens I will be prepared!&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://www.dotfred.net/TaskMgr.htm&quot; target=&quot;_blank&quot;&gt;TaskMgr for WM*&lt;/a&gt; is a must-have for every Windows Mobile user, like &lt;strike&gt;a Swiss Army Knife&lt;/strike&gt; my &lt;a href=&quot;http://www.amazon.com/gp/product/B000UVYENS?ie=UTF8&amp;amp;tag=drh4xvoi-20&amp;amp;link_code=as3&amp;amp;camp=211189&amp;amp;creative=373489&amp;amp;creativeASIN=B000UVYENS&quot; target=&quot;_blank&quot;&gt;Leatherman&lt;/a&gt; (don&#39;t leave home without it)! All the basic tools a user needs to keep the system running smooth: Process manager, CPU usage, Application Manager, Service Manager, Device Manager (only WM2005 and above), Windows Manager, Notification Manager, IP Config utility, Ping utility, Net Stats utility, Registry Editor and a &#39;Run program&#39; utility. Kudos to &lt;a href=&quot;http://www.dotfred.net/&quot; target=&quot;_blank&quot;&gt;Dotfred&lt;/a&gt;!&lt;/p&gt;  &lt;p&gt;&amp;lt;rant&amp;gt;I should not need a tool like TaskMgr to keep my system running smoothly. Windows CE is supposed to run a mobile phone, which can be a life-saving device... Last thing I need is a frozen (phrozen?) phone!&amp;lt;/rant&amp;gt; &lt;/p&gt;  </description><link>http://zybermark.blogspot.com/2008/05/process-explorer-for-windows-mobile.html</link><author>noreply@blogger.com (Zybermark)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6707555.post-2017745244346831119</guid><pubDate>Wed, 14 May 2008 14:00:00 +0000</pubDate><atom:updated>2008-12-11T21:08:35.990-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DrH4x0rsVoid</category><category domain="http://www.blogger.com/atom/ns#">performance</category><category domain="http://www.blogger.com/atom/ns#">samurize</category><category domain="http://www.blogger.com/atom/ns#">technology</category><category domain="http://www.blogger.com/atom/ns#">windows</category><title>Monitor Your System Performance With Samurize</title><description>Have you ever wondered what is going on under the hood of your Windows system? Why is it so sluggish and slow (read: sloooooooooow)? Why is my harddisk continuously blinking? Or that CPU fan sounding like a &lt;a href=&quot;http://forum.us.dell.com/supportforums/board/message?board.id=dim_other&amp;amp;message.id=226827&amp;amp;view=by_date_ascending&amp;amp;page=1&quot;&gt;jet engine&lt;/a&gt;? - As a software developer with a passion for code quality and performance I always strive to produce solid code and software algorithms, but you will not know how it actually behaves until you &lt;a href=&quot;http://blogs.msdn.com/ricom/archive/2007/06/13/partly-sunny-chance-of-showers-bring-an-umbrella.aspx&quot;&gt;measure&lt;/a&gt;. Even though software the development environments of today come with an army of sophisticated tools to help you squeeze out the numbers during a test run they do not give you a general feel of how your system normally performs. Windows comes with perfmon, but configuration and interpretation of those graphs is a pain at best. &lt;span style=&quot;font-weight: bold; font-style: italic&quot;&gt;&lt;a href=&quot;http://www.samurize.com/modules/news/&quot;&gt;Samurize&lt;/a&gt; to the rescue!!!&lt;/span&gt;   &lt;br /&gt;  &lt;br /&gt;&lt;span style=&quot;font-size: 130%&quot;&gt;Samurize to the rescue!&lt;/span&gt;   &lt;br /&gt;Using &lt;a href=&quot;http://www.samurize.com/modules/news/&quot;&gt;Samurize&lt;/a&gt; and a little imagination you can build a very slick system status display that will make your friends turn green with envy! The configuration I use looks like this:&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizGXzPliF0WGx3hM7gd4tshqAogQHOM73FfIVNhh60S8q8VOSubrmFNGHW2FxTDsC-uN8FibFnA5S5qiNyXexCSQ8oAadfI1UdqCjbZ5TiTXtsxd95RPPNPZpbTw3bY-c1Pdynmg/s1600-h/Samurize-Full.png&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5200221452812739810&quot; style=&quot;cursor: pointer&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizGXzPliF0WGx3hM7gd4tshqAogQHOM73FfIVNhh60S8q8VOSubrmFNGHW2FxTDsC-uN8FibFnA5S5qiNyXexCSQ8oAadfI1UdqCjbZ5TiTXtsxd95RPPNPZpbTw3bY-c1Pdynmg/s400/Samurize-Full.png&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;   &lt;br /&gt;Once you have settled in on a base set of performance counters and how you would like them displayed, CPU-, Memory- and Disk-Usage histograms are a good place to start, it is easy to expand your configuration to include more items you want to monitor like SQL Server, Network traffic, etc. After creating and selecting your configuration you will want to set the display position to &amp;quot;docked&amp;quot; so the meters are always visible.   &lt;br /&gt;  &lt;br /&gt;Here is a &lt;a title=&quot;Download samurize_zybermark.ini&quot; href=&quot;http://cid-a0a039c5b0d99d3d.skydrive.live.com/self.aspx/Public/Dr.%20H4x0rs%20Void/samurize_zybermark.ini&quot; target=&quot;_blank&quot;&gt;link to download&lt;/a&gt; the configuration I currently use.   &lt;br /&gt;&lt;iframe style=&quot;border-right: rgb(221,229,233) 1px solid; padding-right: 0pt; border-top: rgb(221,229,233) 1px solid; padding-left: 0pt; padding-bottom: 0pt; margin: 3px; border-left: rgb(221,229,233) 1px solid; width: 240px; padding-top: 0pt; border-bottom: rgb(221,229,233) 1px solid; height: 66px; background-color: rgb(255,255,255)&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; src=&quot;http://cid-a0a039c5b0d99d3d.skydrive.live.com/embedrowdetail.aspx/Public/Dr.%20H4x0rs%20Void/samurize_zybermark.ini&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot;&gt;&lt;/iframe&gt;  &lt;br /&gt;  &lt;br /&gt;I will explain how to interpret the different sections of this configuration in future posts.   &lt;br /&gt;&lt;span style=&quot;font-size: 78%&quot;&gt;   &lt;br /&gt;Update: Replaced configuration file contents with a download link.&lt;/span&gt;  </description><link>http://zybermark.blogspot.com/2008/05/monitor-your-system-performance-with.html</link><author>noreply@blogger.com (Zybermark)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizGXzPliF0WGx3hM7gd4tshqAogQHOM73FfIVNhh60S8q8VOSubrmFNGHW2FxTDsC-uN8FibFnA5S5qiNyXexCSQ8oAadfI1UdqCjbZ5TiTXtsxd95RPPNPZpbTw3bY-c1Pdynmg/s72-c/Samurize-Full.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6707555.post-4672332957308778645</guid><pubDate>Fri, 25 Apr 2008 00:50:00 +0000</pubDate><atom:updated>2008-04-24T18:50:41.489-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">vista</category><title>One month with Vista SP1 - One hickup: mobile device not recognized</title><description>&lt;p&gt;So I have been using &lt;a href=&quot;http://www.microsoft.com/windows/products/windowsvista/sp1.mspx&quot; target=&quot;_blank&quot;&gt;Vista SP1&lt;/a&gt; for a month now and have yet to run into any major issues. I get the impression memory usage has been slightly improved, but apart from that I did not notice any improvements or degradations. Same old Vista to me. :)&lt;/p&gt;  &lt;p&gt;One minor issue I ran into: My IPaq failed to get recognized. This manifested itself when I woke up the PC from standby mode. The screen came up, the cursor was blinking, but the mouse and keyboard were unresponsive for over a minute. THAT had never happened before. As a matter of fact, it seems that my keyboard is recognized quicker when waking up from standby with SP1. I should have taken hard measurements, before &amp;amp; after, too late now! But I digress, back to the main issue... Once my peripherals were finally online I noticed synchronization with my IPaq was not happening anymore, even worse, there was no IPaq! Removing and reinserting it in the cradle did not help either. &lt;a href=&quot;http://forums.microsoft.com/WindowsMobile/ShowPost.aspx?PostID=3040290&amp;amp;SiteID=65&quot; target=&quot;_blank&quot;&gt;Performing a soft-reset&lt;/a&gt; on the IPaq fixed the issue and it has not occurred since.&lt;/p&gt;  &lt;p&gt;On that note... &lt;a href=&quot;http://windowsvistablog.com/blogs/windowsvista/archive/2008/04/23/automatic-distribution-of-windows-vista-sp1-begins-today.aspx&quot; target=&quot;_blank&quot;&gt;Today, Microsoft announced they are beginning automatic distribution of SP1 in English, French, German, Spanish, and Japanese&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Related posts:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href=&quot;http://zybermark.blogspot.com/2008/03/vista-sp1-upgrade-with-realtek-high.html&quot; target=&quot;_blank&quot;&gt;Vista SP1 upgrade with Realtek High Definition sound driver v6.0.1.5502 successful!&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href=&quot;http://windowsvistablog.com/blogs/windowsvista/archive/2008/03/18/windows-vista-sp1-released-to-windows-update.aspx&quot;&gt;Realtek sound chipset == no Vista SP1 download in Windows Update?&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href=&quot;http://zybermark.blogspot.com/2008/02/i-love-vista-its-true-i-do-after-having.html&quot;&gt;I Love Vista!&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  </description><link>http://zybermark.blogspot.com/2008/04/one-month-with-vista-sp1-one-hickup.html</link><author>noreply@blogger.com (Zybermark)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6707555.post-3466953915721315186</guid><pubDate>Sun, 20 Apr 2008 21:00:00 +0000</pubDate><atom:updated>2008-12-11T21:08:36.182-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">fun</category><category domain="http://www.blogger.com/atom/ns#">robotics</category><title>Neurotic Drum Beat Robots - A Glympse of the Future?</title><description>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIn9fwldhQN5s8T6hyiBiifiX_5kubj1KimDZ82zAUJHq_MQq712Sx2OKWvD27TjEV_ZHU2v4vC9sIK6-bTOJc4MwEc-sIuo-PmrkqZuW4IbQlU7wykT2jh86QDAFzmptcdqJhzw/s1600-h/EnergizerBunny-180px.jpg&quot;&gt;&lt;img style=&quot;margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIn9fwldhQN5s8T6hyiBiifiX_5kubj1KimDZ82zAUJHq_MQq712Sx2OKWvD27TjEV_ZHU2v4vC9sIK6-bTOJc4MwEc-sIuo-PmrkqZuW4IbQlU7wykT2jh86QDAFzmptcdqJhzw/s400/EnergizerBunny-180px.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5191437467137627634&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;
Very &lt;a href=&quot;http://letsmakerobots.com/node/112&quot;&gt;cute, totally neurotic little robot&lt;/a&gt; that drums on whatever it is &quot;enticed&quot; to play on...

Dress her up in pink and you got yourself an &lt;a href=&quot;http://en.wikipedia.org/wiki/Energizer_Bunny&quot;&gt;energizer bunny&lt;/a&gt;! :)

via &lt;a href=&quot;http://www.synthtopia.com/content/2008/03/23/sampling-drum-machine-robot/&quot;&gt;Synthopia&lt;/a&gt;</description><link>http://zybermark.blogspot.com/2008/04/neurotic-drum-beat-robots-glympse-of.html</link><author>noreply@blogger.com (Zybermark)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIn9fwldhQN5s8T6hyiBiifiX_5kubj1KimDZ82zAUJHq_MQq712Sx2OKWvD27TjEV_ZHU2v4vC9sIK6-bTOJc4MwEc-sIuo-PmrkqZuW4IbQlU7wykT2jh86QDAFzmptcdqJhzw/s72-c/EnergizerBunny-180px.jpg" height="72" width="72"/><thr:total>0</thr:total></item></channel></rss>