﻿<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#">
  <title>zen-turkey</title>
  <link rel="alternate" type="text/html" href="http://zen-turkey.com/blog" title="zen-turkey" />
  <tagline>Home of the restive avian hordes...</tagline>
  <id>http://zen-turkey.com/feeds/atom.xml</id>
  <generator>Presstopia</generator>
  <copyright>Copyright (c) 2008 zen-turkey</copyright>
  <modified>2008-11-05T07:38:10Z</modified>
  <entry>
    <title>HL USB-RS232 Not Detected as COM Port + Installation instructions and drivers</title>
    <link rel="alternate" type="text/html" href="http://zen-turkey.com/blog/default.aspx?id=50&amp;t=HL-USBRS232-Not-Detected-as-COM-Port" title="HL USB-RS232 Not Detected as COM Port + Installation instructions and drivers" />
    <author>
      <name>Site Administrator</name>
      <url>http://zen-turkey.com/blog</url>
    </author>
    <id>http://zen-turkey.com/blog/default.aspx?id=50&amp;t=HL-USBRS232-Not-Detected-as-COM-Port</id>
    <modified>2008-11-05T07:38:10Z</modified>
    <issued>2008-11-05T07:17:00Z</issued>
    <created>2008-11-05T07:24:25Z</created>
    <content type="text/html" mode="escaped">So I purchased this USB to DB9 (RS232) converter cable. It was a cheapo one manufactured in China and doesn't even have the manufacturers name on the package. &lt;br&gt;&lt;br&gt;It's distinctive characteristics are the blue terminators and the silver USB cable. A little bit of googling lead me to discover that this particular cable is actually manufactured by the lamentably named HugePine ... whose site I won't even provide the link for because it appears to be nothing more than a link directory and attempt to sell you a driver that should be freely available for download... come to think of it the site doesn't look legit at all IMHO... anyhoo... I managed to finally track down instructions that actually make this cable work properly on Win XP SP3 so I thought I'd share...

Here's the official README from the installation CD (simplified chinese and english):

&lt;br&gt;&lt;br&gt;关于usb-serial驱动程序安装说明：

&lt;br&gt;&lt;br&gt;1) 在win98、winme、win2000,windows XP系统中：
先双击driver里hidcominst程序，它没有任何显示。然后再插上USB线，根据系统提示及可正确安装。安装完成之后，进入设备管理器，在“端口”一栏中可以看到虚拟的串口设备  SemiTech USB-HID-&amp;gt;COM device (COM X ) ，表示设备已经正确安装完成，可以正常使用。
&lt;br&gt;&lt;br&gt;2) 在WinXP系统中：有些可能失败安装HIDCOM driver 。双击driver里HidcomInst程序,就可以在设备管理器的"端口"一栏中可以看到虚拟的串口设备。semiTech.USB-HID-&amp;gt;COM device (COM X ),表示设备已经正确安装完成，可以正常使用. 或者先插上USB线，进入设备管理器，在“人体学输入设备”一栏中可以看到 “HID-compliant Device”和“USB人体学输入设备”
(在此之前请确认已经移去所有其他“USB人体学输入设备”），
在“HID-compliant Device”上点击鼠标右键： 选择：更新驱动程序  选择：从列表或指定位置安装，单击下一步，    选择：不要搜索，我要自己选择要安装的驱动程序.单击下一步，    选择：从磁盘安装，打开浏览，从驱动盘中找到hidcom.INF文件，打开，单击确定，          选择下一步，此时系统会提示微软的数字签证，选择仍然继续，单击完成。在“USB人体学输入设备”上点击鼠标右键：    选择：更新驱动程序
    选择：从列表或指定位置安装，单击下一步，
    选择：不要搜索，我要自己选择要安装的驱动程序.单击下一步，
    选择：从磁盘安装，打开浏览，从驱动盘中找到hidcom.INF文件，打开，单击确定，
          选择下一步，此时系统会提示微软的数字签证，选择仍然继续，单击完成。
完成以上两项更新之后，在设备管理器的“端口”一栏中可以看到虚拟的串口设备  
SemiTech USB-HID-&amp;gt;COM device (COM X ) ，表示设备已经正确安装完成，可以正常使用。

&lt;br&gt;&lt;br&gt;3) 如果在win98、winme、win2000系统安装过程中出现设备不能正常使用，请参看WinXP的
安装方法进行程序升级。

&lt;br&gt;&lt;br&gt;Driver setup: Double-click HidCOMInst contained the INF fils and driver derectory.Nothing will 
appear.then plug the usb device,You can setup by the winzard.

Under some circustances,Windows Xp fails to load the HIDCOM driver,and instead loads
the Windows HID driver for the device.In this case,follow the steps below to force
windows to use the HIDCOM driver.
&lt;br&gt;&lt;br&gt;1.Open up the device manager.
&lt;br&gt;&lt;br&gt;2.Find the Human Interface Device Key related to USB to Serial and right chick on it.
&lt;br&gt;&lt;br&gt;3.Select Update Driver
&lt;br&gt;&lt;br&gt;4.Select"Install from list from specific location" and click Next
&lt;br&gt;&lt;br&gt;5.De-select"Search removable media",Then select"Include this location in Search".
&lt;br&gt;&lt;br&gt;6.Click Brower.Find the directory containing the Ccport.sys driver and click OK.
&lt;br&gt;&lt;br&gt;7.Select"Don't search,Iwill choose the driver to install".Then click Next.
&lt;br&gt;&lt;br&gt;8.Select"SemiTech USB-HID-&amp;gt;COM device" (it may also appear as %OLD DEVICE% or something similar) and click Next.
&lt;br&gt;&lt;br&gt;9.Windows will prompt you for the HIDCOM.sys driver.Click Browse and locate HIDCOM.sys
  and ckick Next     

&lt;br&gt;&lt;br&gt;You can download all the relevant files &lt;a temp_href="/uploads/nov-5-2008/USB TO RS232.rar" href="/uploads/nov-5-2008/USB%20TO%20RS232.rar"&gt;here&lt;/a&gt;

Hope this helps :-)</content>
  </entry>
  <entry>
    <title>Find all literal strings in a VB .NET code file</title>
    <link rel="alternate" type="text/html" href="http://zen-turkey.com/blog/default.aspx?id=47&amp;t=Find-all-literal-strings-in-a-VB-NET-co" title="Find all literal strings in a VB .NET code file" />
    <author>
      <name>Site Administrator</name>
      <url>http://zen-turkey.com/blog</url>
    </author>
    <id>http://zen-turkey.com/blog/default.aspx?id=47&amp;t=Find-all-literal-strings-in-a-VB-NET-co</id>
    <modified>2007-12-19T14:34:02Z</modified>
    <issued>2007-12-19T14:18:00Z</issued>
    <created>2007-12-19T14:20:08Z</created>
    <content type="text/html" mode="escaped">&lt;P&gt;Daaaaaang! It's been a long long time since I've posted anything. Extended hiatus. Well, I'm back now. Here is a little bit of code that I am using in the context of a larger project oriented towards the automated translation of ASP .NET websites. It's very raw but it does the trick. Of course, I should note that I am building this code on top of the excellent &lt;A href="http://www.codeplex.com/ResourceRefactoring" target=_blank&gt;Resource Refactoring Tool&lt;/A&gt; which can be found at &lt;A href="http://www.codeplex.com" target=_blank&gt;Codeplex&lt;/A&gt;. &lt;BR&gt;&lt;BR&gt;Ok so here so here is a very very rapid explanation of how one can use code from the Resource Refactoring tool to extract all string literals from a VB .NET source file (and of course the same logic would be applicable to a C# source file with some slight modifications...)...&lt;/P&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Shared&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Function&lt;/FONT&gt;&lt;FONT size=2&gt; FindAllLiteralsInCodeFile(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT size=2&gt; document &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; TextDocument) &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; List(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Of&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; literalStringList &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; List(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Of&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; docText &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt; = ExtensibilityMethods.GetDocumentText(document).Replace(vbCrLf, vbLf)&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;'get a list of the midpoint position of all words in the document&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; hasMoreSpaces &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Boolean&lt;/FONT&gt;&lt;FONT size=2&gt; = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;True&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; nextSpacePosition &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; Int32 = docText.IndexOf(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;" "&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/FONT&gt;&lt;FONT size=2&gt; nextSpacePosition = -1 &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;hasMoreSpaces = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;False&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; currentMidPoint &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; Int32 = 0&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; currentStartPosition &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; Int32 = 0&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; midPointList &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; List(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Of&lt;/FONT&gt;&lt;FONT size=2&gt; Int32)&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;While&lt;/FONT&gt;&lt;FONT size=2&gt; hasMoreSpaces&lt;/P&gt;
&lt;P&gt;currentMidPoint = currentStartPosition + &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;CInt&lt;/FONT&gt;&lt;FONT size=2&gt;((nextSpacePosition - currentStartPosition) / 2)&lt;/P&gt;
&lt;P&gt;midPointList.Add(currentMidPoint)&lt;/P&gt;
&lt;P&gt;nextSpacePosition = docText.IndexOf((&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;" "&lt;/FONT&gt;&lt;FONT size=2&gt;), nextSpacePosition + 1)&lt;/P&gt;
&lt;P&gt;currentStartPosition = nextSpacePosition + 1&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/FONT&gt;&lt;FONT size=2&gt; nextSpacePosition = -1 &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;hasMoreSpaces = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;False&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;While&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; vbhcs &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; VBHardCodedString&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;For&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Each&lt;/FONT&gt;&lt;FONT size=2&gt; midPoint &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; Int32 &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;In&lt;/FONT&gt;&lt;FONT size=2&gt; midPointList&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; mr &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; MatchResult = vbhcs.CheckForHardCodedString(docText, midPoint, midPoint)&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/FONT&gt;&lt;FONT size=2&gt; mr.Result = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;True&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; foundString &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt; = docText.Substring(mr.StartIndex, (mr.EndIndex - mr.StartIndex))&lt;/P&gt;
&lt;P&gt;literalStringList.Add(foundString)&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Next&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;'now sort and remove duplicates&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;literalStringList.Sort()&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;'now dump the duplicates&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; cleanedList &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; List(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Of&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;For&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Each&lt;/FONT&gt;&lt;FONT size=2&gt; item &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;In&lt;/FONT&gt;&lt;FONT size=2&gt; literalStringList&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Not&lt;/FONT&gt;&lt;FONT size=2&gt; cleanedList.Contains(item) &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;cleanedList.Add(item)&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Next&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Return&lt;/FONT&gt;&lt;FONT size=2&gt; cleanedList&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Function&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;OK, so what are we looking at here? Well very simply we have a method that can be called from the context of a Visual Studio add-in or anywhere else where we have a reference to a &lt;A href="http://msdn2.microsoft.com/en-us/library/envdte80.dte2(VS.80).aspx"&gt;DTE&lt;/A&gt; (or &lt;A href="http://msdn2.microsoft.com/en-us/library/envdte80.dte2(VS.80).aspx"&gt;DTE2&lt;/A&gt;, etc) object from the Visual Studio automation object model. From the DTE object we can obtain a reference to a TextDocument object associated with a VB .NET source file... This is how we would call the above method from the Connect method of a VS2005/2008 add-in:&lt;FONT color=#0000ff size=2&gt;&lt;FONT size=2&gt;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; selection &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; TextSelection = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;DirectCast&lt;/FONT&gt;&lt;FONT size=2&gt;(_applicationObject.ActiveDocument.Selection, TextSelection)&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; allLiteralStrings &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; List(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Of&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt;) = VBCodeFileHandler.FindAllLiteralsInCodeFile(selection.Parent)&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;and that's how that's done. We call the method and it returns a generic list of strings containing all unqiue string literals found in a VB .NET file. Note that in order for this code to work you must add a reference to the ResourceRefactor.Common.CSharp.dll and ResourceRefactor.Common.VB.dll files and you must import the following namespaces:&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Imports&lt;/FONT&gt;&lt;FONT size=2&gt; System.Collections.Generic&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;Imports&lt;/FONT&gt;&lt;FONT size=2&gt; Microsoft.VSPowerToys.ResourceRefactor.Common&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;Imports&lt;/FONT&gt;&lt;FONT size=2&gt; System.Text.RegularExpressions&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;Imports&lt;/FONT&gt;&lt;FONT size=2&gt; EnvDTE&lt;/P&gt;&lt;/FONT&gt;</content>
  </entry>
  <entry>
    <title>Programatically Instantiate and Initialize an ActiveDirectoryMembershipProvider</title>
    <link rel="alternate" type="text/html" href="http://zen-turkey.com/blog/default.aspx?id=46&amp;t=Programatically-Instantiate-and-Initiali" title="Programatically Instantiate and Initialize an ActiveDirectoryMembershipProvider" />
    <author>
      <name>Site Administrator</name>
      <url>http://zen-turkey.com/blog</url>
    </author>
    <id>http://zen-turkey.com/blog/default.aspx?id=46&amp;t=Programatically-Instantiate-and-Initiali</id>
    <modified>2007-11-13T06:26:47Z</modified>
    <issued>2007-09-21T08:07:00Z</issued>
    <created>2007-09-21T08:17:59Z</created>
    <content type="text/html" mode="escaped">OK, so here is some hackery that is not recommended by Microsoft but I found myself needing to do for various reasons: I needed to programatically instantiate and initialize an ActiveDirectoryMemberhsipProvider. Long story. Anyhoo, it is doable but there is some clumsiness associated with it. Before we discuss that here is the code:&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'initialize the ad membership provider&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim admp As New ActiveDirectoryMembershipProvider()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim connUserName As String = "fakeuser"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim connPwd As String = "fakepassword"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim nv As New NameValueCollection()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nv.Add("connectionStringName", connStrName)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nv.Add("connectionUsername", connUserName)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nv.Add("connectionPassword", connPwd)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nv.Add("attributeMapUsername", "sAMAccountName")&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; admp.Initialize("ADDomainADMembershipProvider", nv) &lt;BR&gt;&lt;BR&gt;Now a bit of explanation: the connUserName and ConnPwd are the user name and passwords used to initialize the active directory connection. These variables can both be initialized in the code. The connStrName is the name of the Active Directory LDAP connection string in the web.config file. This is the clumsiness I was referring to earlier. Unfortunately you cannot just set the value of the active directory The &lt;A href="http://msdn2.microsoft.com/en-us/library/system.web.security.activedirectorymembershipprovider.aspx" target=_blank&gt;ActiveDirectoryMembershipProvider&lt;/A&gt; class inherits from the &lt;A href="http://msdn2.microsoft.com/en-us/library/system.configuration.provider.providerbase.aspx" target=_blank&gt;System.Configuration.Provider.ProviderBase&lt;/A&gt; class which defines the &lt;A href="http://msdn2.microsoft.com/en-us/library/system.configuration.provider.providerbase.initialize.aspx" target=_blank&gt;initialize&lt;/A&gt;&lt;BR&gt;method which accepts a name and a NameValueCollection. Interestingly in the &lt;A href="http://msdn2.microsoft.com/en-us/library/system.web.security.activedirectorymembershipprovider.aspx" target=_blank&gt;ActiveDirectoryMembershipProvider&lt;/A&gt; implementation that NameValue is the &lt;I&gt;name &lt;/I&gt;of the ConnectionString which is found in the web.config and not the connection string itself. So any connection strings you use for your programmatically instantiated AD membership providers will still have to be specified in the web.config file. In order to change this behaviour you would have to override the initialize method inherited from the ProviderBase class and my suspicion is that that is a can of worms you do not want to open! Hahaa, the&lt;A href="http://msdn2.microsoft.com/en-us/library/system.web.security.activedirectorymembershipprovider.initialize.aspx" target=_blank&gt; initialize&lt;/A&gt; method for the ActiveDirectoryMembershipProvider is not even meant to be called from user code (of course that just makes it more fun cuz it works)! But I can confirm that it works :-)&lt;BR&gt;&lt;BR&gt;So, there are a number of reasons why you might want to do this. In my case it was because I had users who were authenticating against active directory from an ASP .NET web application, but the users were located in a variety of different organizational units (some were in the base CN=User and some were in other nested OUs). I came to realize after a somewhat frustrating experience that if you initialize you AD membership provider in the following way...&lt;BR&gt;&lt;BR&gt;&amp;lt;add name="SampleADLDAPConnectionString" connectionString="LDAP://test.domain.org/CN=Users,DC=test,DC=domain,DC=org" /&amp;gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;That if you have a user who is for example located in OU=OtherUsers,OU=RemoteSite,OU=SiteA then login will fail for that user, even if they are a valid user on the test.domain.org domain. In order for the AD membership provider to find them you would have to have a connection string something like the following:&lt;BR&gt;&lt;BR&gt;&amp;lt;add name="SampleADLDAPConnectionString2" connectionString="LDAP://test.domain.org/OU=OtherUsers,OU=RemoteSite,OU=SiteA,DC=test,DC=domain,DC=org" /&amp;gt;&lt;BR&gt;&lt;BR&gt;Then the user would be able to successfully authenticate. So I had users scattered throughout like 20 different OUs and I wanted to be able to iterate through all of them when attempting to authenticate a login. That was how I came to need programmatic instantiation of my ad membership provider.&lt;BR&gt;&lt;BR&gt;Hope this helps someone :-)&lt;BR&gt;</content>
  </entry>
  <entry>
    <title>早上在公园</title>
    <link rel="alternate" type="text/html" href="http://zen-turkey.com/blog/default.aspx?id=45&amp;t=" title="早上在公园" />
    <author>
      <name>Site Administrator</name>
      <url>http://zen-turkey.com/blog</url>
    </author>
    <id>http://zen-turkey.com/blog/default.aspx?id=45&amp;t=</id>
    <modified>2007-09-18T15:29:19Z</modified>
    <issued>2007-09-18T15:28:00Z</issued>
    <created>2007-09-18T15:29:19Z</created>
    <content type="text/html" mode="escaped">&lt;FONT lang=ZH-CN face="MS Song" size=2&gt;
&lt;P&gt;我是今天早上在公园跑步的。我经常早上去那儿散步或者做一点儿运动。今天有了些老人在公园。&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT lang=ZH-CN face="MS Song" size=2&gt;他打了太极拳。&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT lang=ZH-CN face="MS Song" size=2&gt;我是很高兴的。&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT lang=ZH-CN face="MS Song" size=2&gt;我问了一位奶奶老师是谁。&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT lang=ZH-CN face="MS Song" size=2&gt;他不知道了。&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT lang=ZH-CN face="MS Song" size=2&gt;太可惜因为&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT lang=ZH-CN face="MS Song" size=2&gt;我是想参加的。&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT lang=ZH-CN face="MS Song" size=2&gt;我可能明天去那所公园再试试参加课。&lt;/P&gt;&lt;/FONT&gt;</content>
  </entry>
  <entry>
    <title>System.Security.AccessControl.FileSystemRights 268435456</title>
    <link rel="alternate" type="text/html" href="http://zen-turkey.com/blog/default.aspx?id=44&amp;t=SystemSecurityAccessControlFileSystem" title="System.Security.AccessControl.FileSystemRights 268435456" />
    <author>
      <name>Site Administrator</name>
      <url>http://zen-turkey.com/blog</url>
    </author>
    <id>http://zen-turkey.com/blog/default.aspx?id=44&amp;t=SystemSecurityAccessControlFileSystem</id>
    <modified>2007-11-13T06:27:00Z</modified>
    <issued>2007-09-17T13:55:00Z</issued>
    <created>2007-09-17T13:59:38Z</created>
    <content type="text/html" mode="escaped">I've seen a number of posts written by people trying to code little utilities that enumerate the access control lists for directories in .NET. &lt;BR&gt;&lt;BR&gt;In VB your code might look something like this:&lt;BR&gt;&lt;FONT face="Courier New" size=2&gt;&lt;BR&gt;&lt;FONT size=1&gt;Dim ds As DirectorySecurity = IO.Directory.GetAccessControl(path)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim bArr As Byte() = ds.GetSecurityDescriptorBinaryForm()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim sid As Security.Principal.SecurityIdentifier = New Security.Principal.SecurityIdentifier(bArr, 0)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim includeExplicit As Boolean = True&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim includeInherited As Boolean = True&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim authRuleColl As AuthorizationRuleCollection = ds.GetAccessRules(includeExplicit, includeInherited, sid.GetType)&lt;BR&gt;For Each r As FileSystemAccessRule In authRuleColl&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim rightsType As String = r.FileSystemRights.ToString&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim controlType As String = r.AccessControlType.ToString&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim currentSID As Security.Principal.SecurityIdentifier = r.IdentityReference.Translate(GetType(Security.Principal.SecurityIdentifier))&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;BR&gt;And the values for &lt;FONT face="Courier New" size=2&gt;rightsType &lt;/FONT&gt;might turn out to be a funny value like 268435456 or 1610612736. Well fear not, your code is not broken... these are merely inherited permissions that have the following meanings:&lt;BR&gt;&lt;BR&gt;268435456 - GENERIC_ALL, which means full control on all FILES under the specified root directory.&lt;BR&gt;&lt;BR&gt;1610612736 - GENERIC_READ | GENERIC_WRITE on all FILES under the specified root directory.&lt;BR&gt;&lt;BR&gt;You can find the enum values in winnt.h. Also check out &lt;A href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=118850&amp;amp;SiteID=1" target=_blank&gt;this link&lt;/A&gt; hope this clears up some confusion some people seem to be facing.&lt;BR&gt;&lt;BR&gt;Cheers :-)&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;</content>
  </entry>
  <entry>
    <title>.NET Wrapper For Torch3Vision</title>
    <link rel="alternate" type="text/html" href="http://zen-turkey.com/blog/default.aspx?id=43&amp;t=NET-Wrapper-For-Torch3Vision" title=".NET Wrapper For Torch3Vision" />
    <author>
      <name>Site Administrator</name>
      <url>http://zen-turkey.com/blog</url>
    </author>
    <id>http://zen-turkey.com/blog/default.aspx?id=43&amp;t=NET-Wrapper-For-Torch3Vision</id>
    <modified>2007-08-28T06:52:00Z</modified>
    <issued>2007-08-28T06:22:00Z</issued>
    <created>2007-08-28T06:24:43Z</created>
    <content type="text/html" mode="escaped">Well after the phenomenal success of my VB .NET wrapper for digital2002's FaceDetection.Wrapper... 0 downloads, 0 comments, 0 interest whatsoever... I've decided to build on that glorious foundation  and that I am going to try to create a .NET wrapper for the &lt;a href="http://torch3vision.idiap.ch/" target="_blank"&gt;Torch3Vision&lt;/a&gt; library. &lt;br&gt;&lt;br&gt;From the looks of it Torch3Vision does a lot of the things &lt;a href="opencvlibrary.sourceforge.net" target="_blank"&gt;OpenCV&lt;/a&gt;  does, but actually seems to do some things a little better. Namely face detection and recognition -which is my obsession du jour (as usual it seems like I am about 10 years too late to jump on this bandwagon, all the real cool seminal research looks like it was being done in the late 90's, but now the technologies seem to be coalescing and maturing nicely so there's still time to have fun with it). &lt;br&gt;&lt;br&gt;The aim of this project is to ultimately have a full set of .NET wrappers for both libraries and then start pimping cheesey shareware apps based on the code. I've already seen a couple of cool apps like &lt;a href="http://bananasecurity.com/" target="_blank"&gt;Banana Screen&lt;/a&gt;  face authentication application, which is based on the &lt;a href="http://www.idiap.ch/" target="_blank"&gt;IDIAP&lt;/a&gt;  technology. I would very much like to create something like this even for my personal use at home as a security system.&lt;br&gt;&lt;br&gt;Anyhoo, I'm going to get started probably this week. Anyone who wants to contribute to project is more than welcome. It will probably be a painful process (for me) as my C++ is unbelievably rusty and years of working in the .NET environment have made me unaccustomed to the old-style syntax. But that goes away quickly.&lt;br&gt;&lt;br&gt;Wish me luck. Give me a shout if you want in on the project :-)&lt;br&gt;</content>
  </entry>
  <entry>
    <title>VB .NET Wrapper For Face Detection</title>
    <link rel="alternate" type="text/html" href="http://zen-turkey.com/blog/default.aspx?id=42&amp;t=VB-NET-Wrapper-For-Face-Detection" title="VB .NET Wrapper For Face Detection" />
    <author>
      <name>Site Administrator</name>
      <url>http://zen-turkey.com/blog</url>
    </author>
    <id>http://zen-turkey.com/blog/default.aspx?id=42&amp;t=VB-NET-Wrapper-For-Face-Detection</id>
    <modified>2007-08-24T11:59:45Z</modified>
    <issued>2007-08-24T11:27:00Z</issued>
    <created>2007-08-24T11:31:58Z</created>
    <content type="text/html" mode="escaped">Well lately I've been kind of interested in facial recognition technology. So I've been reading up a bit and I came across the absolutely amazing &lt;a href="http://opencvlibrary.sourceforge.net/" target="_blank"&gt;OpenCV&lt;/a&gt; and I wanted to start playing with it. Now when I say I wanted to start playing with it, I did not say that I wanted to start porting enormous volumes of unmanaged C code to .NET and start playing with it, I meant I wanted to start playing with it pronto. &lt;br&gt;&lt;br&gt;I poked around a bit to see if I could find some .NET wrappers for this rather wonderful body of code and I did actually find &lt;a href="http://code.google.com/p/opencvdotnet/" target="_blank"&gt;OpenCVDotNet&lt;/a&gt;. Those brave souls seem to be making a concerted effort at basically rewriting the whole library in managed code and for that I say good on 'em :-) However their offering was not quite mature enough to satisfy my hankering for tinkering. And then I came across &lt;a href="http://www.codeproject.com/useritems/iss.asp" target="blank"&gt;this&lt;/a&gt;... jackpot baby! &lt;br&gt;&lt;br&gt;My man &lt;a href="http://www.codeproject.com/script/profile/whos_who.asp?vt=arts&amp;amp;id=355127" target="_blank"&gt;digitals2002&lt;/a&gt; was kind enough to wrap the Face Detection functionality in OpenCV for the lazy cretins of the world like myself who would not deign to do so much actual work :-) Anyhoo, so I started playing around with d's code to see how it would do at detecting faces in static images via a web interface. In the process, I found that for a number of reasons the functions exposed by the FaceDetection.Wrapper dll are extremely cumbersome if not impossible to use from VB .NET. &lt;br&gt;&lt;br&gt;So, I started to code a little wrapper for the wrapper (I don't know why I find myself doing this a lot to use cool stuff in VB .NET... anyhoo...). And then it kind of snowballed and I decided to share it with the world so other VB lamers like me can trod where only intrepid C-sharpians have gone before... uh yeah. Anyways. The documentation is retarded, but I think the solution should build and you can incorporate the dll into your VB windows forms or ASP .NET apps. &lt;br&gt;&lt;br&gt;You can download the solution &lt;b&gt;&lt;a temp_href="http://www.zen-turkey.com/uploads/August-24-2007/Face Detection VB Wrapper.rar" href="http://www.zen-turkey.com/uploads/August-24-2007/Face%20Detection%20VB%20Wrapper.rar"&gt;here...&lt;/a&gt; &lt;/b&gt;It should build without any problems in VS 2005, but the results are dubios for 2003 or any version of Orcase (trust me things get screwy beyond belief with Orcas)&lt;br&gt;&lt;br&gt;Email me or post here if you have questions, shout outs, requests, flames, etc.&lt;br&gt;&lt;br&gt;Here is some sample ASP .NET code in VB using the wrapper...&lt;br&gt;&lt;br&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;Private&lt;/span&gt; &lt;span style="color: blue;"&gt;Sub&lt;/span&gt; TestVBFaceDetectionWrapper()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;Dim&lt;/span&gt;
bmap &lt;span style="color: blue;"&gt;As&lt;/span&gt; Bitmap = &lt;span style="color: blue;"&gt;New&lt;/span&gt;
Bitmap(&lt;span style="color: rgb(163, 21, 21);"&gt;"test.gif"&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;Try&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;'try
default frontal mode&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;Dim&lt;/span&gt;
w &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;New&lt;/span&gt;
ZenTurkey.Wrappers.VBNET.VBFaceLocatorWrapper(bmap)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;If&lt;/span&gt;
w.FoundFaces &lt;span style="color: blue;"&gt;Then&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;'face(s)
detected in frontal mode&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;Try&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;Dim&lt;/span&gt;
g &lt;span style="color: blue;"&gt;As&lt;/span&gt; Graphics = Graphics.FromImage(bmap)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;Dim&lt;/span&gt; p &lt;span style="color: blue;"&gt;As&lt;/span&gt; Pen = &lt;span style="color: blue;"&gt;New&lt;/span&gt;
Pen(Color.Red, 5.0F)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;For&lt;/span&gt;
&lt;span style="color: blue;"&gt;Each&lt;/span&gt; f &lt;span style="color: blue;"&gt;As&lt;/span&gt;
Wrappers.VBNET.FaceCoordinates &lt;span style="color: blue;"&gt;In&lt;/span&gt;
w.FaceCoordinates&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;'draw a red rectangle for each face found in frontal mode&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;g.DrawRectangle(p,
f.TopLeftXCoordinate, f.TopLeftYCoordinate, f.BottomRightXCoordinate,
f.BottomRightYCoordinate)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;Next&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;bmap.Save(&lt;span style="color: rgb(163, 21, 21);"&gt;"frontal-face-results.bmp"&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;g.Dispose()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;p.Dispose()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;Catch&lt;/span&gt;
ex &lt;span style="color: blue;"&gt;As&lt;/span&gt; Exception&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;'i
dunno... maybe problems?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;End&lt;/span&gt;
&lt;span style="color: blue;"&gt;Try&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;End&lt;/span&gt;
&lt;span style="color: blue;"&gt;If&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;'now, try
profile mode&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;w = &lt;span style="color: blue;"&gt;New&lt;/span&gt;
ZenTurkey.Wrappers.VBNET.VBFaceLocatorWrapper(bmap)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;w.CurrentDetectionMode =
Wrappers.VBNET.VBFaceLocatorWrapper.FaceDetectionMode.Profile&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;If&lt;/span&gt;
w.FoundFaces &lt;span style="color: blue;"&gt;Then&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;'face(s)
detected in profile mode&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;Try&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;Dim&lt;/span&gt;
g &lt;span style="color: blue;"&gt;As&lt;/span&gt; Graphics = Graphics.FromImage(bmap)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;Dim&lt;/span&gt;
p &lt;span style="color: blue;"&gt;As&lt;/span&gt; Pen = &lt;span style="color: blue;"&gt;New&lt;/span&gt;
Pen(Color.Orange, 5.0F)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;For&lt;/span&gt;
&lt;span style="color: blue;"&gt;Each&lt;/span&gt; f &lt;span style="color: blue;"&gt;As&lt;/span&gt;
Wrappers.VBNET.FaceCoordinates &lt;span style="color: blue;"&gt;In&lt;/span&gt;
w.FaceCoordinates&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;'draw a red rectangle for each face&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;g.DrawRectangle(p, f.TopLeftXCoordinate,
f.TopLeftYCoordinate, f.BottomRightXCoordinate, f.BottomRightYCoordinate)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;Next&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;bmap.Save(&lt;span style="color: rgb(163, 21, 21);"&gt;"profile-face-results.bmp"&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;g.Dispose()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;p.Dispose()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;Catch&lt;/span&gt;
ex &lt;span style="color: blue;"&gt;As&lt;/span&gt; Exception&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;'i
dunno... maybe problems?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;End&lt;/span&gt;
&lt;span style="color: blue;"&gt;Try&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;End&lt;/span&gt;
&lt;span style="color: blue;"&gt;If&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;Catch&lt;/span&gt;
ex &lt;span style="color: blue;"&gt;As&lt;/span&gt; IO.FileNotFoundException&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;'the
wrapper constructor throws a file not found exception if any of the haar
cascades files are missing&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Response.Write(&lt;span style="color: rgb(163, 21, 21);"&gt;"Face locator prerequisites missing"&lt;/span&gt;
&amp;amp; ex.Message)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;End&lt;/span&gt; &lt;span style="color: blue;"&gt;Try&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;End&lt;/span&gt; &lt;span style="color: blue;"&gt;Sub&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 8pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;br&gt;</content>
  </entry>
  <entry>
    <title>Programatically Finding The Location Of A DLL From Within The DLL</title>
    <link rel="alternate" type="text/html" href="http://zen-turkey.com/blog/default.aspx?id=41&amp;t=Programatically-Finding-The-Location-Of" title="Programatically Finding The Location Of A DLL From Within The DLL" />
    <author>
      <name>Site Administrator</name>
      <url>http://zen-turkey.com/blog</url>
    </author>
    <id>http://zen-turkey.com/blog/default.aspx?id=41&amp;t=Programatically-Finding-The-Location-Of</id>
    <modified>2007-08-31T09:39:53Z</modified>
    <issued>2007-08-23T13:50:00Z</issued>
    <created>2007-08-23T14:04:02Z</created>
    <content type="text/html" mode="escaped">I don't know if you've ever had this problem, but I did recently. I needed to find the location (i.e. the absolute path on the file system) of a dll that was being used by an ASP .NET web application. From the ASP application it would be a simple matter of &lt;a href="http://msdn2.microsoft.com/en-us/library/ms524632.aspx" target="_blank"&gt;Server.MapPath&lt;/a&gt; , in a windows form application you can use &lt;a href="http://msdn2.microsoft.com/en-us/library/system.windows.forms.application.startuppath%28VS.71%29.aspx"&gt;Application&lt;/a&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.io.directory.getcurrentdirectory.aspx"&gt;.&lt;span class="highlight2"&gt;Startup&lt;/span&gt;&lt;/a&gt;&lt;span class="highlight3"&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.io.directory.getcurrentdirectory.aspx" target="_blank"&gt;Path&lt;/a&gt; &lt;/span&gt;and bingo, but from the context of the dll code it is not so simple. So I googled a bit and I saw various suggestions like using:&lt;br&gt;&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.reflection.assembly.getexecutingassembly%28VS.71%29.aspx"&gt;Assembly&lt;/a&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.io.directory.getcurrentdirectory.aspx" target="_blank"&gt;.GetExecutingAssembly().Location&lt;/a&gt;&amp;nbsp; this doesn't work in the context of a DLL running in IIS. You will notice if you try this one out while debugging your ASP .NET application that you will get a temp file path in the framework directory rather than a location with the application root for the web app.&lt;br&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.io.directory.getcurrentdirectory.aspx" target="_blank"&gt;System.IO.Directory.GetCurrentDirectory()&lt;/a&gt; and neither does this.&lt;/li&gt;&lt;/ul&gt;So the solution actually turns out to be:&lt;br&gt;&lt;br&gt;Dim DLLFullPath as String = System.Reflection.&lt;a href="http://www.dotnet247.com/247reference/System/Reflection/Assembly.aspx"&gt;Assembly&lt;/a&gt;.GetExecutingAssembly().CodeBase&lt;br&gt;&lt;br&gt;This little line of code will allow you to programatically determine the current physical location of a dll on the file system from within the dlls code. This was incredibly helpful to me. Hope it's helpful for someone else too.&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
  </entry>
  <entry>
    <title>Programatically Generate a GUID in VB .NET</title>
    <link rel="alternate" type="text/html" href="http://zen-turkey.com/blog/default.aspx?id=40&amp;t=Programatically-Generate-a-GUID-in-VB-N" title="Programatically Generate a GUID in VB .NET" />
    <author>
      <name>Site Administrator</name>
      <url>http://zen-turkey.com/blog</url>
    </author>
    <id>http://zen-turkey.com/blog/default.aspx?id=40&amp;t=Programatically-Generate-a-GUID-in-VB-N</id>
    <modified>2007-08-21T11:01:21Z</modified>
    <issued>2007-08-21T10:58:00Z</issued>
    <created>2007-08-21T11:01:21Z</created>
    <content type="text/html" mode="escaped">&lt;P&gt;Tiny little snippet that I found useful. This will generate a GUID programatically from VB .NET...&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;dim aGUID as System.GUID&lt;BR&gt;aGuid = Guid.NewGuid()&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR&gt;Once you've done this you can get the GUID string by calling the ToString() method of the aGuid object and you're good to go :-)&lt;/P&gt;
&lt;P&gt;Cheers.&lt;/P&gt;</content>
  </entry>
  <entry>
    <title>XLinq REST Toolkit</title>
    <link rel="alternate" type="text/html" href="http://zen-turkey.com/blog/default.aspx?id=39&amp;t=XLinq-REST-Toolkit" title="XLinq REST Toolkit" />
    <author>
      <name>Site Administrator</name>
      <url>http://zen-turkey.com/blog</url>
    </author>
    <id>http://zen-turkey.com/blog/default.aspx?id=39&amp;t=XLinq-REST-Toolkit</id>
    <modified>2007-08-09T07:19:38Z</modified>
    <issued>2007-08-08T13:39:00Z</issued>
    <created>2007-08-08T13:43:42Z</created>
    <content type="text/html" mode="escaped">Well I'm starting to get excited about the release of &lt;a href="/blog/default.aspx?id=37&amp;amp;t=Visual-Studio-2008-Beta-2-and-Team-Explo"&gt;Visual Studio 2008&lt;/a&gt; which is slated for some later this year. The IDE seems much improved and it leverages most of the cool new features available in the &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=d2f74873-c796-4e60-91c8-f0ef809b09ee&amp;amp;displaylang=en" target="_blank"&gt;.NET 3.5 framework&lt;/a&gt;. Now that being said I am sure that some of you out there have an interest in implementing &lt;a href="http://www.xfront.com/REST-Web-Services.html" target="_blank"&gt;REST&lt;/a&gt; services for your .NET applications. My bwoy has taken some initiative in this area and started developing a little REST toolkit that leverages &lt;a href="http://msdn2.microsoft.com/en-us/netframework/aa904594.aspx" target="_blank"&gt;LINQ&lt;/a&gt; and the new &lt;a href="http://msdn2.microsoft.com/en-us/library/ms364068%28vs.80%29.aspx#vb9overview_topic6" target="_blank"&gt;XML literals&lt;/a&gt; in &lt;a href="http://msdn2.microsoft.com/en-us/library/ms364068%28vs.80%29.aspx" target="_blank"&gt;VB 9.0&lt;/a&gt; . You can check it out on &lt;a href="http://www.codeplex.com/RestToolkit"&gt;Codeplex&lt;/a&gt;. I think it's pretty dope and offers a window into where &lt;a href="http://en.wikipedia.org/wiki/Service-oriented_architecture"&gt;SOA&lt;/a&gt; will be headed in the next little while. It will be interesting to see how much MS and other behemoths who seem to have invested a lot in &lt;a href="http://en.wikipedia.org/wiki/SOAP" target="_blank"&gt;SOAP&lt;/a&gt;-based  technology will offer a lot of resistance to this new paradigm or if they will learn from the past and go with the flow. Well, I guess that remains to be seen. &lt;br&gt;&lt;br&gt;For now enjoy the &lt;a href="http://www.codeplex.com/RestToolkit" target="_blank"&gt;Xlinq REST Toolkit&lt;/a&gt; :-)&lt;br&gt;</content>
  </entry>
</feed>