<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.geekdojo.net/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>byte-wise</title><link>http://blogs.geekdojo.net/richardhsu/default.aspx</link><description> Richard Hsu's blog</description><dc:language>en-US</dc:language><generator>CommunityServer 2.0 (Build: 60217.2664)</generator><item><title>Password trouble: Need to be careful with long passwords</title><link>http://blogs.geekdojo.net/richardhsu/archive/2006/08/27/13353.aspx</link><pubDate>Sun, 27 Aug 2006 18:13:18 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:13353</guid><dc:creator>richardhsu</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.geekdojo.net/richardhsu/comments/13353.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richardhsu/commentrss.aspx?PostID=13353</wfw:commentRss><description>&lt;p&gt;I am a fan of &lt;a href="http://www.grc.com/resume.htm"&gt;Steve Gibson&lt;/a&gt; and his weekly &lt;a href="http://www.grc.com/securitynow.htm"&gt;Security Now&lt;/a&gt; audio talks.&lt;/p&gt; &lt;p&gt;His website has a &lt;a href="https://www.grc.com/passwords.htm"&gt;password generation page&lt;/a&gt;&amp;nbsp;which generates "long, high-quality&amp;nbsp;random passwords" and in the spirit of self defense I copied about 30 characters [half of the generated&amp;nbsp;alpha-numeric password] and paste it into password box of a web application I use. Although the number of '*' characters in the password box was less than the length of password I pasted, I continued and clicked on the 'change password' button. The password change confirmation text appeared and I promptly saved this new long password into &lt;a href="http://www.pluralsight.com/tools.aspx"&gt;Password Minder&lt;/a&gt; [my password remembering application].&lt;/p&gt; &lt;p&gt;When I tried to login with the new long password, I got the 'invalid password' message!&lt;/p&gt; &lt;p&gt;After a few tries I came to the conclusion that the password I put in was probably truncated.&amp;nbsp;However, I had no idea what the maximum password length for the web application was! I looked up the documentation, FAQ&amp;nbsp;etc. but couldn't find the maximum length of the password. It was frustrating.&lt;/p&gt; &lt;p&gt;The way you enter password is through the browser's User Name and Password prompt so it does not limit the no. of&amp;nbsp;characters you can enter which means I cannot use the built in 'Maximum Length' feature that many textboxes have to find the limit.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.richardhsu.net/images/PasswordtroubleNeedtobecarefulwithlongpa_135A3/image03.png"&gt;&lt;img height="132" src="http://www.richardhsu.net/images/PasswordtroubleNeedtobecarefulwithlongpa_135A3/image02.png" width="240" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;The generated password I had was 30 characters long.&lt;/p&gt; &lt;p&gt;Guessing that the web application had a 16 character limit for the password, I&amp;nbsp;copied the first 16 characters of the generated password into the password box and tried. No luck.&lt;/p&gt; &lt;p&gt;Remaining locked out was not an&amp;nbsp;option and the obvious 'brute force' approach of trying different lengths from&amp;nbsp;5 to 30 one by one did not appeal to me.&lt;/p&gt; &lt;p&gt;The key was to find out the password character limit and I resumed on that path. Remembering that the change password box was showing lesser '*' than I had pasted I started searching for any documentation or page which would show me the no. of '*' in the change password page, alas I found it on their FAQ page:-&lt;/p&gt; &lt;p&gt;It looked like the following&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.richardhsu.net/images/PasswordtroubleNeedtobecarefulwithlongpa_135A3/image05.png"&gt;&lt;img height="49" src="http://www.richardhsu.net/images/PasswordtroubleNeedtobecarefulwithlongpa_135A3/image04.png" width="240" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;I thanked my stars and counted them. It was an odd number 15.&lt;/p&gt; &lt;p&gt;So, I copied the first 15 characters of the generated password that I had and it worked! problem solved, lesson learned.&lt;/p&gt; &lt;p&gt;[A long post to describe a simple stupid mistake and lesson learned. I am not even sure I got the story across but I enjoyed every bit of the writing process. &lt;a href="http://ideas.live.com/programpage.aspx?versionId=4372c8c2-b76f-4d44-aea1-9835b61d8dc1"&gt;Live Writer&lt;/a&gt; does make blog writing easier]&lt;/p&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=13353" width="1" height="1"&gt;</description><category domain="http://blogs.geekdojo.net/richardhsu/archive/category/40.aspx">General</category></item><item><title>Start Menu Search using PowerShell</title><link>http://blogs.geekdojo.net/richardhsu/archive/2006/08/21/12311.aspx</link><pubDate>Mon, 21 Aug 2006 08:55:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:12311</guid><dc:creator>richardhsu</dc:creator><slash:comments>376</slash:comments><comments>http://blogs.geekdojo.net/richardhsu/comments/12311.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richardhsu/commentrss.aspx?PostID=12311</wfw:commentRss><description>Searching for programs to run from Start Menu is tedious which lead me to write a &lt;a href="/richardhsu/archive/2006/03/17/10132.aspx"&gt;IronPython script&lt;/a&gt; for it.&lt;br&gt;&lt;br&gt;Tonight, I learned &lt;a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx"&gt;PowerShell&lt;/a&gt; and here is what I have so far which does the same thing:-&lt;br&gt;&lt;br&gt;cd&amp;nbsp; to your '\All Users\Start Menu' directory&lt;br&gt;&lt;br&gt;to search for all programs with the 'sql' in its name, type&lt;br&gt;&lt;span&gt;$hits&amp;nbsp; = ls -recurse -filter *.lnk | where {$_.Fullname -like "*sql*"}&lt;/span&gt;&lt;br&gt;&lt;br&gt;this will display the result of the search&lt;br&gt;&lt;span&gt;echo $hits | select Name&lt;/span&gt;&lt;br&gt;&lt;br&gt;to start the 1st hit in the result, type&lt;br&gt;&lt;span&gt;ii $hits[0].PSPath&lt;/span&gt;&lt;br&gt;&lt;br&gt;that's it!! this will run the program which is first in the list.&lt;br&gt;&lt;br&gt;Sample run :-&lt;br&gt;&lt;br&gt;Objective: To start Visual C# Express IDE&lt;br&gt;&lt;br&gt;&lt;font face="Courier New"&gt;PS C:\Documents and Settings\All Users\Start Menu&amp;gt; &lt;span&gt;$hits = ls -recurse -filter *.lnk | where {$_.Fullname -like "*express*"}&lt;/span&gt;&lt;br&gt;PS C:\Documents and Settings\All Users\Start Menu&amp;gt; &lt;span&gt;echo $hits | select Name&lt;/span&gt;&lt;br&gt;&lt;br&gt;Name&lt;br&gt;----&lt;br&gt;Microsoft Visual C# 2005 Express Edition.lnk&lt;br&gt;Microsoft Visual Web Developer 2005 Express Edition.lnk&lt;br&gt;SQL Server Management Studio Express.lnk&lt;br&gt;&lt;br&gt;PS C:\Documents and Settings\All Users\Start Menu&amp;gt; &lt;span&gt;ii $hits[0].PSPath&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=12311" width="1" height="1"&gt;</description></item><item><title>Preallocating list in python</title><link>http://blogs.geekdojo.net/richardhsu/archive/2006/08/07/list_prealloc_py.aspx</link><pubDate>Tue, 08 Aug 2006 06:06:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:11955</guid><dc:creator>richardhsu</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.geekdojo.net/richardhsu/comments/11955.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richardhsu/commentrss.aspx?PostID=11955</wfw:commentRss><description>I was looking for a way to preallocate a Boolean list in Python but didn't know a simple way.&lt;br&gt;&lt;br&gt;After googling I got the following:-&lt;br&gt;&lt;br&gt;# this would give us a 100 element list, each element initialized to False&lt;br&gt;flags = [False] * 100&lt;br&gt;&lt;br&gt;'interesting' i thought but how do I explain this syntax ?&lt;br&gt;&lt;br&gt;After looking at the Python language reference, I got the explanation:-&lt;br&gt;&lt;br&gt;"The &lt;code&gt;*&lt;/code&gt; (multiplication) operator yields the product of its
arguments.  The arguments must either both be numbers, &lt;u&gt;or one argument
must be an integer (plain or long) and the other must be a sequence&lt;/u&gt;.
In the former case, the numbers are converted to a common type and
then multiplied together.  In the latter case, &lt;u&gt;sequence repetition is
performed&lt;/u&gt;; a negative repetition factor yields an empty sequence."&lt;br&gt;&lt;br&gt;&lt;i&gt;source: http://docs.python.org/ref/binary.html&lt;/i&gt;&lt;br&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=11955" width="1" height="1"&gt;</description></item><item><title>Sql Server Everywhere - the same familiar engine inside a few dlls</title><link>http://blogs.geekdojo.net/richardhsu/archive/2006/07/23/11586.aspx</link><pubDate>Sun, 23 Jul 2006 07:27:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:11586</guid><dc:creator>richardhsu</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.geekdojo.net/richardhsu/comments/11586.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richardhsu/commentrss.aspx?PostID=11586</wfw:commentRss><description>&lt;P&gt;I am&amp;nbsp;comfortable with&amp;nbsp;Sql Server and now we have a small footprint, embedable version&amp;nbsp;of it which&amp;nbsp;makes me happy.&lt;/P&gt;
&lt;P&gt;While going through the various documentation, the following caught my eye:-&lt;/P&gt;
&lt;P class=Body-noindent&gt;"..Alternatively, SQL Server Everywhere Edition can be deployed by copying the engine files (several DLLs totaling less than 2MB) to the application directory.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;The former option helps support scenarios where the user does not have administrative rights on the machine. "&lt;/P&gt;
&lt;P class=Body-noindent&gt;Source: &lt;A href="http://download.microsoft.com/download/7/f/c/7fc20778-4e2e-4944-b432-ed74b404e542/SQLServerEverywhereDatasheet_final.doc"&gt;http://download.microsoft.com/download/7/f/c/7fc20778-4e2e-4944-b432-ed74b404e542/SQLServerEverywhereDatasheet_final.doc&lt;/A&gt;&lt;/P&gt;
&lt;P class=Body-noindent&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=Body-noindent&gt;For me personally, this means that I can write web apps&amp;nbsp;with Sql Server Everywhere without having Sql Server hosting. Currently, I would go with Jet mdb files but this opens up another option.&lt;/P&gt;
&lt;P class=Body-noindent&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=Body-noindent&gt;But I need to dig in and see how different it is from Jet and how similar it is to Sql Server 2005.&lt;/P&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=11586" width="1" height="1"&gt;</description></item><item><title>Rant: Microsoft Urls</title><link>http://blogs.geekdojo.net/richardhsu/archive/2006/06/09/11219.aspx</link><pubDate>Sat, 10 Jun 2006 00:42:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:11219</guid><dc:creator>richardhsu</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.geekdojo.net/richardhsu/comments/11219.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richardhsu/commentrss.aspx?PostID=11219</wfw:commentRss><description>For some strange reasons, Microsoft web site urls tend to be really long. Even the new ones. 

&lt;br&gt;&lt;br&gt;Today, I found out that IronPython was migrated to CodePlex.com and the url for that ?

http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython

&lt;br&gt;&lt;br&gt;Excluding 'http://' part, its 54 characters long. So, if its to be typed by hand, it would take 54 keystrokes. Its very difficult to remember too. &lt;br&gt;&lt;br&gt;The Msn Spaces had a long url as well but they quickly reacted to feedback and made it more friendlier and shorter. Instead of 'spaces.msn.com/members/richard76', they removed the redundant 'members' so now its simply 'spaces.msn.com/richard76' . But because they had 'member' in there before, there potentially exists many links that point to the older version while many would point to the shorter one thereby creating two web address for the same thing!

&lt;br&gt;&lt;br&gt;I hereby request the CodePlex team to reconsider their urls and see if it can be made shorter and simpler.

&lt;br&gt;&lt;br&gt;Present: &lt;font color="#800080"&gt;www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython&lt;/font&gt;

&lt;br&gt;Suggested: &lt;font color="#006400"&gt;&lt;b&gt;www.codeplex.com/IronPython&lt;/b&gt;&lt;/font&gt;

&lt;br&gt;&lt;br&gt;Urls are for human consumption and therefore needs to be friendlier. &lt;br&gt;&lt;br&gt;At present, it looks like a typical geeky function call.

I am guessing they spent way too much time in getting their quality up and missed reading "&lt;a href="http://www.w3.org/Provider/Style/URI"&gt;Cool URIs don't change&lt;/a&gt;" by Tim Berners-Lee :-)&lt;br&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=11219" width="1" height="1"&gt;</description><category domain="http://blogs.geekdojo.net/richardhsu/archive/category/40.aspx">General</category></item><item><title>creating string list - why Python is healthier than C#</title><link>http://blogs.geekdojo.net/richardhsu/archive/2006/04/22/python_healthier_than_csharp.aspx</link><pubDate>Sat, 22 Apr 2006 10:36:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:10662</guid><dc:creator>richardhsu</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.geekdojo.net/richardhsu/comments/10662.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richardhsu/commentrss.aspx?PostID=10662</wfw:commentRss><description>&lt;DIV&gt;I needed a string array, so I go&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="Courier New, Courier, Monospace"&gt;string[] tags = new string[] {"python", "ruby", "good"};&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;but I also need to search for a particular string..&lt;/DIV&gt;
&lt;DIV&gt;to get IndexOf(...) functionality, I change it to [&lt;A href="http://www.ecma-international.org/publications/standards/Ecma-334.htm"&gt;C# v2&lt;/A&gt;]&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="Courier New, Courier, Monospace"&gt;List&amp;lt;string&amp;gt; tags = new List&amp;lt;string&amp;gt;(new string[] {"python", "ruby", "good"});&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;then, thinking that copying strings might not be efficient, looking further, I find that ArrayList has a very interesting&amp;nbsp;static &lt;A href="http://msdn2.microsoft.com/en-us/library/system.collections.arraylist.adapter.aspx" target=_top&gt;Adapter method&lt;/A&gt;, so I change it to &lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="Courier New, Courier, Monospace"&gt;ArrayList tags = ArrayList.Adapter(new string[] {"python", "ruby", "good"});&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;this is still a lot of typing compared to doing it in &lt;A href="http://www.python.org/"&gt;python&lt;/A&gt; syntax&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face="Courier New, Courier, Monospace"&gt;tags = ["python", "ruby", "good"]&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;short and sweet [more&amp;nbsp;finger/keyboard friendly, more eye ball friendly, therefore more healthy]&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;if you are writing or reading just a few lines, its not a problem but when you are working with larger code base, the difference between the syntaxes is enough for you to&amp;nbsp;wish &lt;A href="http://www.gotdotnet.com/workspaces/workspace.aspx?id=ad7acff7-ab1e-4bcb-99c0-57ac5a3a9742" target=_top&gt;IronPython &lt;/A&gt;would make Python a first class CLR language. IronPython v1 is&amp;nbsp;in beta&amp;nbsp;6 now, but its v1 release&amp;nbsp;would still only be a CLS consumer, not producer which means &lt;A href="http://lists.ironpython.com/htdig.cgi/users-ironpython.com/2006-March/002046.html"&gt;ASP.NET&amp;nbsp;+ IronPython&lt;/A&gt; is still in the distance.. :-(&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;let me know if anyone knows a shorter way of declaring and initializing a list of string in C#. thank you in advance.&lt;/DIV&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=10662" width="1" height="1"&gt;</description><category domain="http://blogs.geekdojo.net/richardhsu/archive/category/46.aspx">C#</category><category domain="http://blogs.geekdojo.net/richardhsu/archive/category/196.aspx">.NET v2</category></item><item><title>StartFast: a simple utility that helps you find programs and start it.</title><link>http://blogs.geekdojo.net/richardhsu/archive/2006/03/17/10132.aspx</link><pubDate>Fri, 17 Mar 2006 09:00:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:10132</guid><dc:creator>richardhsu</dc:creator><slash:comments>306</slash:comments><comments>http://blogs.geekdojo.net/richardhsu/comments/10132.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richardhsu/commentrss.aspx?PostID=10132</wfw:commentRss><description>&lt;P&gt;For various reasons my Start menu has many programs and program groups in it. I see three columns of programs when I expand the "All Programs" in my Start menu. This made finding and starting programs a little time consuming.&lt;/P&gt;
&lt;P&gt;So, I decided to do something about it and wrote a&amp;nbsp;python&amp;nbsp;script which would search the shortcuts [.lnk files] in my Start menu and lauch it. Later I also added searching my desktop for shortcuts. To simplify sharing and in the interest of trying out GotDotNet, I published it at &lt;A href="http://www.gotdotnet.com/codegallery/codegallery.aspx?id=908507d6-d66b-4767-b0ae-b7b1562124d6"&gt;GotDotNet and called it StartFast&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Check it out. I am fairly new to python [using &lt;A href="http://www.gotdotnet.com/workspaces/workspace.aspx?id=ad7acff7-ab1e-4bcb-99c0-57ac5a3a9742"&gt;IronPython&lt;/A&gt;] so my style is still very C#. Any suggestions regarding my python style would be appreciated.&lt;/P&gt;
&lt;P&gt;I am aware that Windows Vista will have &lt;A href="http://www.extremetech.com/article2/0,1697,1931920,00.asp"&gt;a program search built into the Start menu&lt;/A&gt;&amp;nbsp;and &lt;A href="http://desktop.google.com/about.html"&gt;Google Desktop&lt;/A&gt;&amp;nbsp;has a &lt;A href="http://desktop.google.com/features.html#quicksearch"&gt;Quick Search&lt;/A&gt; feature for searching programs amongst other things. However, my current OS is Windows XP and I am not interested in using Google Desktop search [I am happy with &lt;A href="http://desktop.yahoo.com/"&gt;Yahoo! desktop search&lt;/A&gt;&amp;nbsp;which I use &lt;STRONG&gt;only&lt;/STRONG&gt; when I need to search for a file. I don't run it as a system tray application].&lt;/P&gt;
&lt;P&gt;This marks a minor return to coding after a long break.&lt;/P&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=10132" width="1" height="1"&gt;</description></item><item><title>Generating large random numbers</title><link>http://blogs.geekdojo.net/richardhsu/archive/2006/01/16/9631.aspx</link><pubDate>Tue, 17 Jan 2006 02:21:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:9631</guid><dc:creator>richardhsu</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.geekdojo.net/richardhsu/comments/9631.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richardhsu/commentrss.aspx?PostID=9631</wfw:commentRss><description>&lt;P&gt;How to generate a positive 10-digit random no. ?&lt;/P&gt;
&lt;P&gt;By positive 10-digit random no., I mean &lt;FONT face="Courier New"&gt;long&lt;/FONT&gt; numbers between 1,000,000,000 and 9,999,999,999&lt;/P&gt;
&lt;P&gt;My quick solution :-&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;using System;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;class LargeRandom {&lt;BR&gt;&amp;nbsp; static void Main() {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Random rand = new Random();&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // generate 20 numbers.&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i=0; i &amp;lt; 20; i++) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int high = rand.Next(10000, 99999);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int&amp;nbsp;low = rand.Next(0, 99999);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine(high * 100000L + low);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp; }&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Ideas ? thoughts ? bugs ? wtf??!!&lt;/P&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=9631" width="1" height="1"&gt;</description></item><item><title>XmlWriterSettings.Encoding vs. XmlWriter.WriteProcessingInstruction</title><link>http://blogs.geekdojo.net/richardhsu/archive/2005/07/16/8675.aspx</link><pubDate>Sat, 16 Jul 2005 22:31:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:8675</guid><dc:creator>richardhsu</dc:creator><slash:comments>1913</slash:comments><comments>http://blogs.geekdojo.net/richardhsu/comments/8675.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richardhsu/commentrss.aspx?PostID=8675</wfw:commentRss><description>&lt;P&gt;I was using XmlWriter [using .NET v2 beta2] to write xml to a stream. The thing I had to write was like :-&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&amp;gt;&lt;BR&gt;&amp;lt;entry xmlns="&lt;/FONT&gt;&lt;A href="http://purl.org/atom/ns"&gt;&lt;FONT face="Courier New"&gt;http://purl.org/atom/ns&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="Courier New"&gt;#"&amp;gt;&lt;BR&gt;...&lt;BR&gt;&amp;lt;/entry&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;to write out the first line i.e. &amp;lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&amp;gt;&lt;BR&gt;I went looking around settings in XmlWriterSettings and I did &lt;/P&gt;
&lt;P&gt;[IrontPython]&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;writerSettings = XmlWriterSettings()&lt;BR&gt;writerSettings.Indent = True&lt;BR&gt;writerSettings.Encoding = Encoding.UTF8&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;writer = XmlWriter.Create(Console.Out, writerSettings)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Then, I see the Xml output and it shows &lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;lt;?xml version="1.0" encoding=&lt;FONT color=#ff0000&gt;"&lt;STRONG&gt;IBM437&lt;/STRONG&gt;"&lt;/FONT&gt;?&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;/FONT&gt;I see IBM437 istead of UTF-8 ??&lt;/P&gt;
&lt;P&gt;Later, I manage to get the desired result by &lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;writerSettings = XmlWriterSettings()&lt;BR&gt;writerSettings.Indent = True&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;writer = XmlWriter.Create(Console.Out, writerSettings)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;STRONG&gt;writer.WriteProcessingInstruction&lt;/STRONG&gt;("xml", "version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"")&lt;BR&gt;...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;is the behaviour of XmlWriter correct ? isn't the default encoding of Xml documents UTF-8 ?&lt;/P&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=8675" width="1" height="1"&gt;</description><category domain="http://blogs.geekdojo.net/richardhsu/archive/category/196.aspx">.NET v2</category></item><item><title>Running ASP.NET v1.1 on Windows XP Home</title><link>http://blogs.geekdojo.net/richardhsu/archive/2005/01/01/5747.aspx</link><pubDate>Sat, 01 Jan 2005 20:42:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:5747</guid><dc:creator>richardhsu</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.geekdojo.net/richardhsu/comments/5747.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richardhsu/commentrss.aspx?PostID=5747</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Verdana&gt;At work, i was given a laptop with Windows XP Home as I am travelling for a few weeks. It had a lot of crap software installed and was very slow, so I [in typical geek fashion] I formatted it and reinstalled a fresh version Windows XP Home. There was no problem getting Visual Studio 6, Sql Server 2000 etc. to work on Windows XP Home but I realised that there was no IIS and I may have to run Gemini [bug tracking system built on ASP.NET] in some other way.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;To cut the story short, this is what i did :-&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;a) copied the wwwroot folder from my Windows 2000 Pro system.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;b) Created a short cut to the ASP.NET WebMatrix WebServer :-&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;"C:\Program Files\Microsoft ASP.NET Web Matrix\v0.6.812\WebServer.exe" &lt;STRONG&gt;/port&lt;/STRONG&gt;:80 &lt;STRONG&gt;/path&lt;/STRONG&gt;:"c:\wwwroot\gemini" &lt;STRONG&gt;/vpath&lt;/STRONG&gt;:"/gemini"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;c) Started the WebServer&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;d) Open IE and typed &lt;A href="http://localhost/Gemini"&gt;http://localhost/Gemini&lt;/A&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;and voila!! it worked!!&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;So far, everything has been working fine, I am able to view my bugs in Gemini again :-), Long live the spirit of WebMatrix!!&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=5747" width="1" height="1"&gt;</description><category domain="http://blogs.geekdojo.net/richardhsu/archive/category/36.aspx">ASP.NET - C#</category><category domain="http://blogs.geekdojo.net/richardhsu/archive/category/46.aspx">C#</category></item><item><title>Sql Server Function: OBJECT_ID({object name},{object type})</title><link>http://blogs.geekdojo.net/richardhsu/archive/2004/11/22/4218.aspx</link><pubDate>Mon, 22 Nov 2004 20:40:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:4218</guid><dc:creator>richardhsu</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.geekdojo.net/richardhsu/comments/4218.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richardhsu/commentrss.aspx?PostID=4218</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Verdana&gt;In order to setup ASP.NET Session State in Sql Sever, we have to run the InstallSqlState.sql script. In the script I came across :-&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;OBJECT_ID('tempdb..ASPStateTempSessions','U')&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;here 'U' is for User&amp;nbsp;table.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;I had used OBJECT_ID before but I wasn't aware of the second parameter which could filter the search&amp;nbsp;based on the object's sysobjects.type column value.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;I looked up the 'Sql Server Books Online' but it shows the function signature as :-&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;OBJECT_ID('object')&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;No mention of the second parameter!!&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;I wonder if its an undocumented feature or am i missing something ?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;Anyways, its a useful thing to know.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=4218" width="1" height="1"&gt;</description><category domain="http://blogs.geekdojo.net/richardhsu/archive/category/40.aspx">General</category></item><item><title>T-Sql: Join and 'Not In' vs Exists and 'Not Exists'</title><link>http://blogs.geekdojo.net/richardhsu/archive/2004/10/05/3325.aspx</link><pubDate>Tue, 05 Oct 2004 22:02:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:3325</guid><dc:creator>richardhsu</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.geekdojo.net/richardhsu/comments/3325.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richardhsu/commentrss.aspx?PostID=3325</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Verdana&gt;&lt;A href="http://www.dotnetjini.com/"&gt;Jignesh Desai&lt;/A&gt; writes on our &lt;A href="http://groups.msn.com/kolkatanet"&gt;UG Forum&lt;/A&gt; :-&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;Intersect you can achieve using joins also....&lt;BR&gt;Select Jignesh.Topic &lt;BR&gt;From Jignesh, Naveen&lt;BR&gt;Where Jignesh.Topic = Naveen.Topic.&lt;BR&gt;[update: this would include repetitions of the topic]&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;Minus query can be formed as :-&lt;BR&gt;Select Topic &lt;BR&gt;From Jignesh &lt;BR&gt;Where Topic Not In (Select Topic From Naveen)&lt;BR&gt;[update: this wouldn't work if there is a&amp;nbsp;null in Naveen.Topic]&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;I replied with the following :-&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;Wouldn't the following be more appropriate ?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;Intersect :-&lt;BR&gt;Select Jignesh.Topic&lt;BR&gt;From Jignesh&lt;BR&gt;Where Exists(Select 1 From Naveen Where Jignesh.Topic=Naveen.Topic)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;Minus :-&lt;BR&gt;Select Topic&lt;BR&gt;From Jignesh&lt;BR&gt;Where Not Exists(Select 1 From Naveen Where Jignesh.Topic=Naveen.Topic)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;I haven't heard from him yet, but I've always sort of wondered regarding what is the REAL difference in terms of performance etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;I am of the [unverified] opinion&amp;nbsp;that Exists and 'Not Exists' is faster but maybe&amp;nbsp;you'll&amp;nbsp;can educate me here. I am looking forward to my copy of Advance T-Sql which I am sure would also teach me a few things.&lt;BR&gt;[update: The adv-tsql book just arrived and its already taught me that 'Not Exists' performs better than 'Not In', we can verify this using 'Show Execution Plan' in Sql Query Analyzer]&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;What do you think ?&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=3325" width="1" height="1"&gt;</description><category domain="http://blogs.geekdojo.net/richardhsu/archive/category/40.aspx">General</category></item><item><title>Gmail Notifier</title><link>http://blogs.geekdojo.net/richardhsu/archive/2004/09/04/3013.aspx</link><pubDate>Sat, 04 Sep 2004 18:24:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:3013</guid><dc:creator>richardhsu</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.geekdojo.net/richardhsu/comments/3013.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richardhsu/commentrss.aspx?PostID=3013</wfw:commentRss><description>&lt;P&gt;via &lt;A href="http://www.vasanthdharmaraj.com/"&gt;Vasanth Dharmaraj&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;"&lt;FONT size=-1&gt;The Gmail Notifier is a downloadable Windows application that alerts you when you have new Gmail messages. It displays an icon in your system tray to let you know if you have unread Gmail messages, and shows you their subjects, senders and snippets, all without your having to open a web browser.&lt;/FONT&gt; " - Google&lt;/P&gt;
&lt;P&gt;Get it here :- &lt;A href="http://toolbar.google.com/gmail-helper/"&gt;http://toolbar.google.com/gmail-helper/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;They just keep on raising the bar for user friendliness, just when you start missing something, they provide it, amazing, no wonder &lt;A href="http://www.eightypercent.net/Archive/2004/09/02.html#a210"&gt;Joe Beda decides to join Google&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=3013" width="1" height="1"&gt;</description><category domain="http://blogs.geekdojo.net/richardhsu/archive/category/40.aspx">General</category></item><item><title>Arial Font has a bug</title><link>http://blogs.geekdojo.net/richardhsu/archive/2004/08/18/2851.aspx</link><pubDate>Thu, 19 Aug 2004 05:22:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:2851</guid><dc:creator>richardhsu</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.geekdojo.net/richardhsu/comments/2851.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richardhsu/commentrss.aspx?PostID=2851</wfw:commentRss><description>&lt;p&gt;I noticed something strange the other day while trying to rename something in TextPad. That the letter l (as in love) in arial font is the same as the letter I (as in Indigo). The first thing that came to my mind was, its a design flaw, in arial font! I am sure a thing like this would have been written about already (although I haven't read anything yet)&amp;nbsp;but couldn't resist putting in my two cents on it. While we are at it, I wonder what fonts do my fellow GeekDojo'ers use at work. From the time I started using WebMatrix, Lucida Console has become my preferred font&amp;nbsp;which I set in WebMatrix, Visual Studio 6, TextPad, Sql Query Analyzer, VS .NET and now the Express IDEs. Also all of them have a light grey background. Prior to lucida console, I used Verdana. Now coming to think of it, I never ever used arial for coding, I onced tried tahoma but abandoned it for the same reason mentioned here for arial.&lt;/p&gt;&lt;p&gt;Here is the text where I noticed the arial font thing :-&lt;/p&gt;&lt;p&gt;&lt;font face="Arial"&gt;spfxaGetItemWIPTransferList in Arial Font&lt;/font&gt; (look at the I after Get and I in WIP and then the l in Arial)&lt;/p&gt;&lt;p&gt;&lt;font face="Tahoma"&gt;spfxaGetItemWIPTransferList in Tahoma&lt;/font&gt; &lt;/p&gt;&lt;p&gt;&lt;font face="Verdana"&gt;spfxaGetItemWIPTransferList in Verdana&lt;/font&gt; &lt;/p&gt;&lt;p&gt;&lt;font face="Lucida Console"&gt;spfxaGetItemWIPTransferList in Lucida Console&lt;/font&gt;&lt;/p&gt;&lt;p&gt;What font do you guys use ? and why ?&lt;/p&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=2851" width="1" height="1"&gt;</description><category domain="http://blogs.geekdojo.net/richardhsu/archive/category/40.aspx">General</category></item><item><title>Assembly References : Need to select all of them ?</title><link>http://blogs.geekdojo.net/richardhsu/archive/2004/08/10/2783.aspx</link><pubDate>Wed, 11 Aug 2004 03:59:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:2783</guid><dc:creator>richardhsu</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.geekdojo.net/richardhsu/comments/2783.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richardhsu/commentrss.aspx?PostID=2783</wfw:commentRss><description>&lt;P&gt;I tried a simple database query using SqlConnection, SqlCommand &amp;amp; SqlDataReader with VC++ 2005 Express but it wasn't compiling giving the messages part of which says :-&lt;/P&gt;
&lt;P&gt;"&lt;STRONG&gt;error C3624: 'System::EnterpriseServices::ITransaction': the compiler cannot find this type&lt;/STRONG&gt;.."&lt;/P&gt;
&lt;P&gt;The cause of the problem was that System.Data.Dll (which contains SqlConnection, SqlCommand &amp;amp; SqlDataReader) referenced two assemblies 'System.EnterpriseServices' &amp;amp; 'System.Transactions' which was not referenced in the project. When I added references to these two dlls, the project compiled and was working!!&lt;/P&gt;
&lt;P&gt;What's weird is that I don't have to do this in .NET 1.1 with C#, meaning I only reference the dll that contains the class and that is it. Even in .NET 1.1, System.Data references those two assemblies but I didn't have to include them, I think this is due to some mismatch in dll versions or am I missing some settings ?? Otherwise, I would have to select all assemblies and their reference and their reference..!!&lt;/P&gt;
&lt;P&gt;I will find the MSFT feedback email for VC Express and send it also but has anyone of you guys faced this same problem ??&lt;/P&gt;
&lt;P&gt;#include "stdafx.h"&lt;BR&gt;using namespace System;&lt;BR&gt;using namespace System::Data::SqlClient;&lt;BR&gt;using namespace System::Data;&lt;/P&gt;
&lt;P&gt;int _tmain() {&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;SqlConnection^ con = gcnew SqlConnection(L"Data Source=Server;Initial Catalog=Northwind; User Id=general; Password=pass");&lt;BR&gt;SqlCommand^ query = gcnew SqlCommand(L"Select * From Employees", con);&lt;BR&gt;con-&amp;gt;Open();&lt;BR&gt;SqlDataReader^ rs = query-&amp;gt;ExecuteReader();&lt;BR&gt;try {&lt;BR&gt;while (rs-&amp;gt;Read()) {&lt;BR&gt;Console::WriteLine(rs[0]);&lt;BR&gt;}&lt;BR&gt;} finally {&lt;BR&gt;rs-&amp;gt;Close();&lt;BR&gt;con-&amp;gt;Close();&lt;BR&gt;}&lt;BR&gt;Console::ReadLine();&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;p.s. formatting code is quite difficult with BlogJet, the problem is with the tabs and newlines, any suggestions ? Got it, using &amp;lt;pre&amp;gt; tags in between the code will preserve the newlines and indents :-). I can't believe how long I've been missing this, didn't know about &amp;lt;pre&amp;gt; tags.&lt;BR&gt;&lt;/P&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=2783" width="1" height="1"&gt;</description><category domain="http://blogs.geekdojo.net/richardhsu/archive/category/196.aspx">.NET v2</category></item></channel></rss>