<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' version='2.0'><channel><atom:id>tag:blogger.com,1999:blog-13937734</atom:id><lastBuildDate>Fri, 20 Nov 2009 18:30:23 +0000</lastBuildDate><title>Tips for software engineer</title><description>Tips that make life of a software engineer easier. 

Well, not exactly. Some posts are open questions that I haven't found an answer ... yet</description><link>http://developertips.blogspot.com/</link><managingEditor>noreply@blogger.com (Guogang Hu)</managingEditor><generator>Blogger</generator><openSearch:totalResults>64</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-13937734.post-6605238822180316351</guid><pubDate>Tue, 17 Nov 2009 06:27:00 +0000</pubDate><atom:updated>2009-11-16T22:29:51.505-08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>asp.net</category><category domain='http://www.blogger.com/atom/ns#'>c#</category><title>GridView: get selected rows</title><description>Below is sample C# code to get selected rows in GridView.&lt;br /&gt;&lt;pre name="code" class="cs"&gt;&lt;br /&gt;        protected int[] GetSelectedRows()&lt;br /&gt;        {&lt;br /&gt;            List&lt;int&gt; rowIDs = new List&lt;int&gt;();&lt;br /&gt;            foreach (GridViewRow row in GridView.Rows)&lt;br /&gt;            {&lt;br /&gt;                CheckBox cb = ((CheckBox)row.FindControl("chkRow"));&lt;br /&gt;                if (cb.Checked)&lt;br /&gt;                {&lt;br /&gt;                    string IDString = GridView.DataKeys[row.RowIndex].Value.ToString();&lt;br /&gt;                    rowIDs.Add(Int32.Parse(IDString));&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            return rowIDs.ToArray();&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13937734-6605238822180316351?l=developertips.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://developertips.blogspot.com/2009/11/gridview-get-selected-rows.html</link><author>noreply@blogger.com (Guogang Hu)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-13937734.post-5674188192708107747</guid><pubDate>Tue, 17 Nov 2009 06:15:00 +0000</pubDate><atom:updated>2009-11-16T22:20:45.261-08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>javascript</category><category domain='http://www.blogger.com/atom/ns#'>asp.net</category><category domain='http://www.blogger.com/atom/ns#'>jQuery</category><title>"SelectAll" CheckBox in GridView using jQuery</title><description>Here is a way to do it:&lt;br /&gt;&lt;br /&gt;&lt;pre  name="code" class="js"&gt;&lt;br /&gt;/**&lt;br /&gt; * Register logic for "select all" check box and the group of check boxes &lt;br /&gt; * for each data row.&lt;br /&gt; * &lt;br /&gt; * @param {Object} chkAllSelector     jQuery selector to find the "select all" check box&lt;br /&gt; * @param {Object} chkItemSelector    jQuery selector to find the check boxes for all the rows&lt;br /&gt; */&lt;br /&gt;&lt;br /&gt;function registerSelectAll(chkAllSelector, chkItemSelector) {&lt;br /&gt;    //"select all" checkbox&lt;br /&gt;    var checkAllBox = $(chkAllSelector);&lt;br /&gt;    //checkbox for each row&lt;br /&gt;    var checkItems = $(chkItemSelector);       &lt;br /&gt;    &lt;br /&gt;    //check/uncheck all rows if "select all" is clicked&lt;br /&gt; checkAllBox.bind("click", function(){&lt;br /&gt;            checkItems.each(function(){&lt;br /&gt;                this.checked = checkAllBox[0].checked;&lt;br /&gt;                })&lt;br /&gt;        });&lt;br /&gt;        &lt;br /&gt;    //uncheck "select all" if some rows are unchecked&lt;br /&gt; checkItems.bind("click", function(){&lt;br /&gt;            if(this.checked === false) {&lt;br /&gt;             checkAllBox[0].checked = false;                    &lt;br /&gt;            }&lt;br /&gt;     });                     &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;To use it:&lt;br /&gt;&lt;pre   name="code" class="js"&gt;&lt;br /&gt;registerSelectAll(".chkAllHeader input", ".chkItem input");&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13937734-5674188192708107747?l=developertips.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://developertips.blogspot.com/2009/11/selectall-checkbox-in-gridview-using.html</link><author>noreply@blogger.com (Guogang Hu)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-13937734.post-5726572598150283158</guid><pubDate>Mon, 09 Nov 2009 19:39:00 +0000</pubDate><atom:updated>2009-11-09T11:45:29.956-08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>rant</category><category domain='http://www.blogger.com/atom/ns#'>system administration</category><title>"An unexpected error occurred." accessing Network Connection's properties</title><description>&lt;span style="font-weight: bold;"&gt;Cause: &lt;/span&gt;seems like it suddenly happens after a recent Windows Update. I cannot ping or "remote desktop" to the computer. Trying to access network connection give me this error: "An unexpected error occurred."&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution&lt;/span&gt;:&lt;br /&gt;This seems to fix the problem:&lt;br /&gt;command line:&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;    regsvr32 netshell.dll&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;    regsvr32 ole32.dll&lt;/span&gt;&lt;br /&gt;reboot&lt;br /&gt;&lt;br /&gt;Then I can access the properties page, and I disable/re-enabled firewall. Everything coming back to normal.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;P.S.&lt;/span&gt;&lt;br /&gt;Keep my fingers crossed. Waiting for more surprised from next automatic Windows Update.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13937734-5726572598150283158?l=developertips.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://developertips.blogspot.com/2009/11/unexpected-error-occurred-accessing.html</link><author>noreply@blogger.com (Guogang Hu)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-13937734.post-3781785581968374664</guid><pubDate>Wed, 14 Oct 2009 21:44:00 +0000</pubDate><atom:updated>2009-10-14T22:01:46.243-07:00</atom:updated><title>3D Visualization on iPhone - Got to see it to believe it</title><description>Ziosoft showcased this amazing 3D visualization on iPhone. It is fast and smooth with very high image resolution. With dual touch, seem like it is very easy to control zoom, move cutoff plane, rotate and move object, and select depth of rendering.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.youtube.com/watch?v=sDVAosnh1j4&amp;amp;feature=channel_page"&gt;http://www.youtube.com/watch?v=sDVAosnh1j4&amp;amp;feature=channel_page&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;From their description and the look, it is obvious that there is web server doing the rendering behind. iPhone seem to provide the dual touch and navigation. Still the the speed is impressive. Either the iPhone has very high speed internet access, or there is some very efficient decompress and rendering algorithms running on it so that data transfer rate is not too high.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13937734-3781785581968374664?l=developertips.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://developertips.blogspot.com/2009/10/3d-visualization-on-iphone-got-to-see.html</link><author>noreply@blogger.com (Guogang Hu)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-13937734.post-1894390470174830483</guid><pubDate>Mon, 10 Aug 2009 22:57:00 +0000</pubDate><atom:updated>2009-08-10T15:59:08.507-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>visual studio</category><title>Server Explorer Missing</title><description>Symptom: Visual Studio 2005 Server Explorer is missing.&lt;br /&gt;Reason: A while back, Visual Studio failed to load the server explorer at starup time, and showed a dialog to disable it. I guess I accidentally clicked "yes".&lt;br /&gt;&lt;br /&gt;Solution: run this command in Visual Studio 2005 command line environment:&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-family: courier new;"&gt;                  devenv /resetskippkgs&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13937734-1894390470174830483?l=developertips.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://developertips.blogspot.com/2009/08/server-explorer-missing.html</link><author>noreply@blogger.com (Guogang Hu)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-13937734.post-7175157527809359615</guid><pubDate>Wed, 01 Jul 2009 00:37:00 +0000</pubDate><atom:updated>2009-06-30T17:46:53.813-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>tool</category><category domain='http://www.blogger.com/atom/ns#'>review</category><category domain='http://www.blogger.com/atom/ns#'>C/C++</category><title>Refeactor! for C++ -- Review</title><description>Tried &lt;a href="http://www.devexpress.com/Products/Visual_Studio_Add-in/RefactorCPP/"&gt;Refactor!&lt;/a&gt; for C++ (free version 9.1.5 published June 29, 2009). Visual Studio 2005&lt;br /&gt;&lt;br /&gt;Summary of my experience:&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Pros:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Free;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The idea is very attractive: refactor C++ code with right click and no modal dialogs;&lt;/li&gt;&lt;li&gt;Rename class names seem to work fine;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Cons:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Does not work most of the times. Usually global search and replace did a better job in renaming things;&lt;/li&gt;&lt;li&gt;Affects VS grammar highlight. After installation, code grey out by "&lt;span style="font-family: courier new;"&gt;ifdef&lt;/span&gt;"s are totally messed up. Unistall the softwate, Visual Studio went back to correct grey out;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Recommended?  &lt;/span&gt;No. I uninstalled the software after a few days.&lt;br /&gt;&lt;br /&gt;Still looking for a decent C++ refactoring tool.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13937734-7175157527809359615?l=developertips.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://developertips.blogspot.com/2009/06/refeactor-for-c-review.html</link><author>noreply@blogger.com (Guogang Hu)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-13937734.post-936009080939586298</guid><pubDate>Tue, 30 Dec 2008 01:44:00 +0000</pubDate><atom:updated>2008-12-29T17:55:27.962-08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>troubleshooting</category><category domain='http://www.blogger.com/atom/ns#'>modem</category><title>Modem Error: NO CARRIER</title><description>What to check when you get "NO CARRIER" (numeric code: 3) error from Modem:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Verify Modem is connected to phone line properly;&lt;/li&gt;&lt;li&gt;Verify the phone number you are dialing works properly by calling this number using your phone, and verify that you hear: first ring tone, then the negotiation tone (yes, you should be able to hear the chirping sound over a regular phone);&lt;/li&gt;&lt;/ul&gt;If you can hear the negotiation tone, but frequently get "NO CARRIER" error, here is a solution:&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;Set modem register S7 to a longer timeout value. 50 is the default, you can set it to 120 (ATS7=120). Sometimes, you can set this timeout value through MODEM configuration GUI, you can find something like: "Cancel the call if not connected within __ seconds". &lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13937734-936009080939586298?l=developertips.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://developertips.blogspot.com/2008/12/modem-error-no-carrier.html</link><author>noreply@blogger.com (Guogang Hu)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-13937734.post-2298841313293984533</guid><pubDate>Fri, 07 Nov 2008 22:19:00 +0000</pubDate><atom:updated>2008-11-07T14:31:45.394-08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>tool</category><category domain='http://www.blogger.com/atom/ns#'>setup</category><category domain='http://www.blogger.com/atom/ns#'>Firefox</category><title>Firefox keep crashing -- a solution</title><description>Every couple of days, I will see my Firefox using 99% of CPU and crash.&lt;br /&gt;&lt;br /&gt;I am a web developer. My Firefox has all sorts of add-ons: Abduction, Firebug, Html Validator, ScapBook, Screen grab!, Web Developer, YSlow. So, I do not need YSlow to know why my Firefox is slow and tend to crash.&lt;br /&gt;&lt;br /&gt;I have an idea: how about start two instances of Firefox, one with all the add-ons and the other one clean. I will use the clean one for normal web browsing, and the fully loaded one with development. And, guess what, there is already someone who has done this and posted a blog about it: &lt;a href="http://bdn.backbase.com/blog/dave/firefox-run-a-regular-and-development-profile-at-the-same-time"&gt;Firefox: Run a Regular and Development Profile at the Same Time&lt;/a&gt;. I used the solution, and it works perfectly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13937734-2298841313293984533?l=developertips.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://developertips.blogspot.com/2008/11/firefox-keep-crashing-solution.html</link><author>noreply@blogger.com (Guogang Hu)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-13937734.post-1784410309463628681</guid><pubDate>Sat, 27 Sep 2008 04:14:00 +0000</pubDate><atom:updated>2008-09-26T21:33:33.132-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>system administration</category><category domain='http://www.blogger.com/atom/ns#'>work around</category><category domain='http://www.blogger.com/atom/ns#'>bug</category><title>Blue Screen Trying to Install Windows XP SP3</title><description>During last few months, I have been through a couple of Windows XP SP3 installation. They are mostly eventless. One of the worst was a computer that hung after reboot, but after a forced power recycle that system seem to be fine.&lt;br /&gt;&lt;br /&gt;Just when I am about to conclude that Windows XP SP3 update is pretty good, I got the famous Blue Screen of Death.&lt;br /&gt;&lt;br /&gt;While trying to install Windows XP SP3 on my computer, I got an "&lt;span style="font-family:courier new;"&gt;Access is denied&lt;/span&gt;" error message. So that was not too scary, I typed the error message along with keyword "Windows XP SP3" in Google and found an &lt;a href="http://support.microsoft.com/kb/949377"&gt;MSKB 949377&lt;/a&gt; which provided a solution to this exact problem.&lt;br /&gt;&lt;br /&gt;Now, following KB 949377, I downloaded full Windows XP SP3 package and &lt;span style="font-family:courier new;"&gt;subinacl.exe&lt;/span&gt;, and created &lt;span style="font-family:courier new;"&gt;Reset.CMD&lt;/span&gt;. But, I tried it 3 times, everytime I ran &lt;span style="font-family:courier new;"&gt;Reset.CMD&lt;/span&gt;, it gave me Blue Screen of Death with error message about registry access. So, I did another Google search with keywords: "&lt;span style="font-family:courier new;"&gt;windows xp sp3 access denied subinacl registry blue screen&lt;/span&gt;". Now "&lt;span style="font-family:courier new;"&gt;I'm feeling lucky&lt;/span&gt;". The first hit provides a solution that works perfectly for me.  Here is link to Jason's blog post that solved my problem: &lt;a href="http://www.mrfloppysa.com/wordpress/?p=13"&gt;http://www.mrfloppysa.com/wordpress/?p=13&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The trick is to remove the &lt;span style="font-family:courier new;"&gt;HKLM &lt;/span&gt;line in &lt;span style="font-family:courier new;"&gt;RESET.CMD&lt;/span&gt;. The new RESET.CMD file would be like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;cd /d "%ProgramFiles%\Windows Resource Kits\Tools"&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;REM &lt;/span&gt;&lt;/span&gt;subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f /grant=system=f&lt;/span&gt;&lt;br /&gt;subinacl /subkeyreg HKEY_CURRENT_USER /grant=administrators=f /grant=system=f&lt;br /&gt;subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f /grant=system=f&lt;br /&gt;subinacl /subdirectories %SystemDrive% /grant=administrators=f /grant=system=f&lt;br /&gt;subinacl /subdirectories %windir%\*.* /grant=administrators=f /grant=system=f&lt;br /&gt;secedit /configure /cfg %windir%\repair\secsetup.inf /db secsetup.sdb /verbose&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13937734-1784410309463628681?l=developertips.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://developertips.blogspot.com/2008/09/blue-screen-trying-to-install-windows.html</link><author>noreply@blogger.com (Guogang Hu)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-13937734.post-2023873846138506638</guid><pubDate>Thu, 21 Aug 2008 23:42:00 +0000</pubDate><atom:updated>2008-08-21T16:52:37.784-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>system administration</category><category domain='http://www.blogger.com/atom/ns#'>tool</category><category domain='http://www.blogger.com/atom/ns#'>Windows Services</category><title>How to Delete Broken Windows Service</title><description>As a developer who writes Windows Services, I sometimes get services registered with the source code and executables long gone (because I no longer work on that project). When it finally came the time to cleanup. I found it difficult to remove them from the registry without the original executables.&lt;br /&gt;&lt;br /&gt;After a bit of Google, however, I found a useful tool: &lt;span style="font-family: courier new;"&gt;sc.exe&lt;/span&gt; (Service Controller Tool) come with Windows Resource Kit. This command line tool make deleting service very easy, just run:&lt;br /&gt;&lt;div style="text-align: center; font-family: courier new;"&gt;sc.exe delete [service name]&lt;/div&gt;&lt;br /&gt;Notice: the service name for the command line is not the same as "Name" you see in the list (this is usually the "Display Name"). You need to double click the service to open the properties page. And there you will find "Service Name".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13937734-2023873846138506638?l=developertips.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://developertips.blogspot.com/2008/08/how-to-delete-broken-windows-service.html</link><author>noreply@blogger.com (Guogang Hu)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-13937734.post-1596735014635328207</guid><pubDate>Thu, 24 Jul 2008 23:05:00 +0000</pubDate><atom:updated>2008-07-24T16:26:53.248-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>visual studio</category><category domain='http://www.blogger.com/atom/ns#'>gotcha</category><category domain='http://www.blogger.com/atom/ns#'>C/C++</category><title>C++/CLI Gotchas</title><description>C++/CLI is a hybrid monster. I am very green in the world of C++/CLI. Below are a few very stupid problems I have met.&lt;br /&gt;&lt;br /&gt;Example 1: If you are writing unsafe code in C++/CLI with mixed managed code and unmanaged code, it proved to be more dangerous than plain old C++. Here are a few examples of using System::String together with char (C native data type). Without thorough understanding of the new .NET String class will create code that compiles perfectly but return unexpected results to you in run time.&lt;br /&gt;&lt;pre name="code" class="cpp"&gt;&lt;br /&gt;String^ str = "";&lt;br /&gt;char ch = 'a';&lt;br /&gt;str += ch; //result: str="97", instead of "a", because it called ch.ToString()&lt;br /&gt;str = gcnew String(&amp;ch); //result: str="a@#!$%", because &amp;ch is considered to be a string&lt;br /&gt;str = gcnew String(&amp;ch, 0, 1); //result: str="a" as expected.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Example 2: Visual Studio 2005 Debugger is a liar&lt;br /&gt;&lt;pre name="code" class="cpp"&gt;&lt;br /&gt;int i;&lt;br /&gt;i=1000;&lt;br /&gt;... //all the code in between so that you forgot what is defined&lt;br /&gt;for(int i=0; i &lt; 3; i++)&lt;br /&gt;{&lt;br /&gt;    ...&lt;br /&gt;}&lt;br /&gt;int k = i++; //if you set a break here, Visual Studio Debugger will tell you i=4??!&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I agree that the code above is stupid which is an artifact from trying to correct old VC++ code. But Debugger giving a wrong answer wouldn't help!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13937734-1596735014635328207?l=developertips.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://developertips.blogspot.com/2008/07/ccli-gotchas.html</link><author>noreply@blogger.com (Guogang Hu)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-13937734.post-4475677793444315156</guid><pubDate>Mon, 07 Jul 2008 23:17:00 +0000</pubDate><atom:updated>2008-07-07T16:40:06.184-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>visual studio</category><category domain='http://www.blogger.com/atom/ns#'>work around</category><category domain='http://www.blogger.com/atom/ns#'>bug</category><category domain='http://www.blogger.com/atom/ns#'>C/C++</category><title>C++/CLI Warning C4945</title><description>&lt;span style="font-weight: bold;"&gt;Reason&lt;/span&gt;: This warning was generated because I referenced multiple C# projects in the C++/CLI project, and they all have "copy local" set to true.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution:&lt;/span&gt; Change reference to the C# projects, set all "copy local ..." properties to false.&lt;br /&gt;&lt;br /&gt;A hotfix is available, which does not seem to be in SP1 as of 7/7/2008. So this fix probably will never be publicly available. This proves again C++/CLI is not on the top of TODO list for Visual Studio team.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Reference&lt;/span&gt;:&lt;br /&gt;Microsoft KB 922271: &lt;a href="http://support.microsoft.com/kb/922271"&gt;http://support.microsoft.com/kb/922271&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13937734-4475677793444315156?l=developertips.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://developertips.blogspot.com/2008/07/ccli-warning-c4945.html</link><author>noreply@blogger.com (Guogang Hu)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-13937734.post-2650445770139124833</guid><pubDate>Thu, 08 May 2008 03:39:00 +0000</pubDate><atom:updated>2008-05-07T22:25:39.320-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>visual studio</category><category domain='http://www.blogger.com/atom/ns#'>MFC</category><category domain='http://www.blogger.com/atom/ns#'>C/C++</category><title>Convert VC++6 to VC++7 -- (2)</title><description>Below is a laundry list of the problems and solutions.&lt;br /&gt;&lt;hr /&gt;&lt;span style="font-weight: bold;"&gt;Compiler Error:&lt;/span&gt; &lt;code&gt;fatal error C1083: Cannot open include file: 'fstream.h': No such file or directory&lt;/code&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution: &lt;/span&gt;change include from &lt;code&gt;fsream.h&lt;/code&gt; to &lt;code&gt;fstream&lt;/code&gt;, and add &lt;code&gt;using namespace std;&lt;/code&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Related problems:&lt;/span&gt; &lt;code&gt;ios::nocreate&lt;/code&gt; and &lt;code&gt;ios::noreplace&lt;/code&gt; are deprecated. &lt;code&gt;ios::nocreate &lt;/code&gt;is replace by &lt;code&gt;ios::in&lt;/code&gt;&lt;br /&gt;&lt;hr /&gt;&lt;code&gt;CFile::ReadHuge()&lt;/code&gt; and &lt;code&gt;CFile::WriteHuge()&lt;/code&gt; are obsolete. Use &lt;code&gt;CFile::Read()&lt;/code&gt; and &lt;code&gt;CFile::Write()&lt;/code&gt; instead.&lt;br /&gt;&lt;hr /&gt;Replace &lt;code&gt;&amp;amp;afxChNil&lt;/code&gt; by empty string "".&lt;br /&gt;&lt;hr /&gt;&lt;span style="font-weight: bold;"&gt;Compiler Error:&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;error C2059: syntax error : '&lt;'   &lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;error C2143: syntax error : missing ';' before '&lt;' &lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;error C2182: 'ConstructElements' : illegal use of type 'void' &lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;error C2988: unrecognizable template declaration/definition &lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Solution:&lt;/span&gt; &lt;code&gt;ConstructElements&lt;/code&gt; and &lt;code&gt;DestructElements&lt;/code&gt; are deprecated. Remove definition of these functions. Ref: &lt;a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;318734"&gt;Microsoft KB 318734&lt;/a&gt;&lt;br /&gt;&lt;hr /&gt;&lt;code&gt;WINVER&lt;/code&gt; default changed to 0x0501 (Windows XP). If your program still want to support Windows 2000, the the following line must be included in the project:&lt;br /&gt;&lt;code&gt;#define WINVER 0x0400&lt;/code&gt;&lt;br /&gt;&lt;hr /&gt;&lt;code&gt;CPropetySheetEx&lt;/code&gt;, &lt;code&gt;CPropertyPageEx&lt;/code&gt; are deprecated, they are included back to &lt;code&gt;CPropertySheet&lt;/code&gt; and &lt;code&gt;CPropertyPage&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;code&gt;CString s(45)&lt;/code&gt; no longer compiles. Because &lt;code&gt;CString&lt;/code&gt; is changed to template based function with more constructors. This definition has ambiguous overloaded constructors. Change to &lt;code&gt;CString s((TCHAR)45)&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;VC++7.1 has stricter type requirements. For example, conversion from &lt;code&gt;HANDLE&lt;/code&gt; to &lt;code&gt;int&lt;/code&gt; and &lt;code&gt;uint&lt;/code&gt; is not allowed.&lt;br /&gt;&lt;hr /&gt;&lt;span style="font-weight: bold;"&gt;Compiler Error:&lt;/span&gt;&lt;br /&gt;&lt;code&gt;error C2668: 'sqrt' : ambiguous call to overloaded function&lt;/code&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;&lt;code&gt;sqrt&lt;/code&gt;, &lt;code&gt;fabs&lt;/code&gt;, &lt;code&gt;log&lt;/code&gt; and other CRT math functions support both &lt;code&gt;double&lt;/code&gt; and &lt;code&gt;float&lt;/code&gt; type now. An integer input to these functions will cause the error above.&lt;br /&gt;Example:&lt;br /&gt;&lt;pre&gt;int i = 10;&lt;br /&gt;float f = sqrt(i); //error C2688&lt;br /&gt;float f = sqrt((float)i); //compiles ok&lt;/pre&gt;&lt;br /&gt;&lt;hr /&gt;&lt;span style="font-weight: bold;"&gt;Compiler Error:&lt;/span&gt;&lt;br /&gt;&lt;code&gt;error C2440: 'static_cast' : cannot convert from 'void (__thiscall XXXXXXXX::* )(void)' to 'void (__thiscall XXXXXX::* )(NMHDR *,LRESULT *)'&lt;/code&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;Function signature of event handler &lt;code&gt;OnKillfocus&lt;/code&gt; was changed from &lt;code&gt;void Func(void)&lt;/code&gt; to &lt;code&gt;void Func(NMHDR*, LRESULT*)&lt;/code&gt;.&lt;br /&gt;&lt;hr /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13937734-2650445770139124833?l=developertips.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://developertips.blogspot.com/2008/05/convert-vc6-to-vc7-2.html</link><author>noreply@blogger.com (Guogang Hu)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-13937734.post-9156465923741966484</guid><pubDate>Thu, 01 May 2008 07:34:00 +0000</pubDate><atom:updated>2008-05-01T01:05:10.879-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>visual studio</category><category domain='http://www.blogger.com/atom/ns#'>MFC</category><category domain='http://www.blogger.com/atom/ns#'>C/C++</category><title>Convert VC++6 to VC++7 -- (1)</title><description>VC++6 is a pretty solid product, which can still produce decent software in Windows XP. But Microsoft has decided to stop support for VC6 for about 2 years now. With the arrival of VS2008 and Windows Vista, it might finally be the time to convert those old projects that you still want to keep alive into a newer platform. &lt;br /&gt;&lt;br /&gt;To start the conversion is really easy, just open the .dsp file in Visual Studio 2003. It will convert the project for you automatically, and generate the .vcproj and .sln files. If you are lucky, the next step is press F7 to build the solution and press F5 to run it, and you are done. Unfortunately, 90% of us will need to change the code to make it even compile. VC++6 is less standard compliant than VC++7 and there are some other breaking changes in VC++7.&lt;br /&gt;&lt;br /&gt;This series will report problems I've seen when I convert a VC++6 project to VC++7 and some tips to help smooth the process.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Tip 1&lt;/span&gt;: for a project that is still actively maintained, during the conversion care must be taken so that changes do not break the software under VC++6. Use this to allow the code changes exists peacefully in VC++6:&lt;br /&gt;&lt;pre name="code" class="cpp"&gt;&lt;br /&gt;#if _MSC_VER &gt;=1500&lt;br /&gt;    //this is VC++9.0 or above&lt;br /&gt;#elif _MSC_VER &gt;= 1400&lt;br /&gt;    // this is VC++8.0&lt;br /&gt;#elif _MSC_VER &gt;= 1310&lt;br /&gt;    // this is VC++7.1&lt;br /&gt;#elif _MSC_VER &gt; 1300&lt;br /&gt;    // this is VC++7.0&lt;br /&gt;#else&lt;br /&gt;    //assume VC++6&lt;br /&gt;#endif &lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13937734-9156465923741966484?l=developertips.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://developertips.blogspot.com/2008/05/convert-vc6-to-vc7-1.html</link><author>noreply@blogger.com (Guogang Hu)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-13937734.post-4529216613964588751</guid><pubDate>Mon, 24 Mar 2008 22:11:00 +0000</pubDate><atom:updated>2008-03-24T15:22:23.017-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>ActiveSync</category><category domain='http://www.blogger.com/atom/ns#'>Windows Mobile</category><title>ActiveSync Remote Display for Windows Mobile 5.0 Devices</title><description>&lt;h3&gt;The Problem&lt;/h3&gt;&lt;br /&gt;"ActiveSync Remote Display" (ARD) version 2.03 does not support Windows Mobile 5.0. If a Windows Mobile 5.0 device is connected to a PC through ActiveSync, when you start the program, you will see a dialog with title: "Remote Display for Windows CE" and error message: "The OS or CPU of this device is unknown to this application". After you click OK,it will show another error dialog and a blank screen.&lt;br /&gt;        &lt;br /&gt;&lt;h3&gt;Work Around&lt;/h3&gt;&lt;br /&gt;&lt;h4&gt;To Enable ActiveSync Remote Display&lt;/h4&gt;&lt;br /&gt;Go to directory: &lt;code&gt;C:\Program Files\Windows Mobile Developer Power Toys\ActiveSync_Remote_Display\devices\wce400\armv4&lt;/code&gt;&lt;br /&gt;Copy the two files to the Windows directory on the mobile device.&lt;br /&gt;&lt;h4&gt;To Use the ActiveSync Remote Display&lt;/h4&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Start the ARD program;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;You will see the same error dialog as before, click "OK";&lt;/li&gt;&lt;br /&gt;&lt;li&gt;There will no longer be the second error dialog and you will see the screen shown on the PC or laptop;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;After you are done, click on the ARD icon on the &lt;b&gt;Mobile Device&lt;/b&gt; and select exit (if you simply close the remote display on the PC end, the ARD will still be running on the mobile device);&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13937734-4529216613964588751?l=developertips.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://developertips.blogspot.com/2008/03/activesync-remote-display-for-windows.html</link><author>noreply@blogger.com (Guogang Hu)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-13937734.post-7414605491200300164</guid><pubDate>Thu, 14 Feb 2008 04:54:00 +0000</pubDate><atom:updated>2008-03-28T16:48:30.650-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>streaming</category><category domain='http://www.blogger.com/atom/ns#'>silverlight</category><title>Embed Silverlight Streaming in Blogger</title><description>I tried to post a video hosted on Microsoft Silverlight Streaming service in &lt;a href="http://developertips.blogspot.com/2008/02/microsoft-silverlight-streaming-service.html"&gt;the previous post&lt;/a&gt;. This post will show you how to embed Silverlight in a Blogger post.&lt;br /&gt;&lt;br /&gt;1. Source code to embed the video in Blogger post. &lt;em&gt;Notice&lt;/em&gt;, since Blogger tend to insert &amp;lt;br/&amp;gt; for new lines, the Javascript segment has to be on a single line:&lt;br /&gt;&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;script type="text/javascript" src="http://agappdom.net/h/silverlight.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;function CreateSilverlight() { Silverlight.createHostedObjectEx( { source:"streaming:/[account ID]/MovieTest", parentElement:Wrapper_MovieTest}); } &amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;div id="Wrapper_MovieTest" style="width: 640px; height: 480px;"&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;var Wrapper_MovieTest = document.getElementById("Wrapper_MovieTest"); CreateSilverlight(); &amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;2. manifest.xml (required for Microsoft Silverlight Streaming upload)&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&amp;lt;SilverlightApp&amp;gt;&lt;br /&gt;&amp;lt;source&amp;gt;Movie.xaml&amp;lt;/source&amp;gt;&lt;br /&gt;&amp;lt;version&amp;gt;1.1&amp;lt;/version&amp;gt;&lt;br /&gt;&amp;lt;width&amp;gt;100%&amp;lt;/width&amp;gt;&lt;br /&gt;&amp;lt;height&amp;gt;100%&amp;lt;/height&amp;gt;&lt;br /&gt;&amp;lt;enableHtmlAccess&amp;gt;true&amp;lt;/enableHtmlAccess&amp;gt;&lt;br /&gt;&amp;lt;jsOrder&amp;gt;&lt;br /&gt;  &amp;lt;js&amp;gt;Movie.xaml.js&amp;lt;/js&amp;gt;&lt;br /&gt;&amp;lt;/jsOrder&amp;gt;&lt;br /&gt;&amp;lt;/SilverlightApp&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;3.Movie.xaml (stage layout)&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&amp;lt;Canvas x:Name="movieCanvas"&lt;br /&gt;      xmlns="http://schemas.microsoft.com/client/2007"&lt;br /&gt;      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&lt;br /&gt;      Width="640" Height="480" Background="White" MouseEnter ="mouseEnter"&lt;br /&gt;      MouseLeave ="mouseLeave"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;MediaElement x:Name="movie" Source="Lake.wmv"/&amp;gt;&lt;br /&gt;&amp;lt;Canvas MouseLeftButtonDown="moviePlay"&lt;br /&gt;  Canvas.Left="10" Canvas.Top="365"&amp;gt;&lt;br /&gt;  &amp;lt;TextBlock Canvas.Left="5" Canvas.Top="5" Visibility="Collapsed" x:Name="playButton" Foreground="White"&amp;gt;Play&amp;lt;/TextBlock&amp;gt;&lt;br /&gt;&amp;lt;/Canvas&amp;gt;&lt;br /&gt;&amp;lt;Canvas MouseLeftButtonDown="moviePause"&lt;br /&gt;  Canvas.Left="70" Canvas.Top="365"&amp;gt;&lt;br /&gt;  &amp;lt;TextBlock Canvas.Left="5" Canvas.Top="5" Visibility="Collapsed" x:Name="pauseButton" Foreground="White"&amp;gt;Pause&amp;lt;/TextBlock&amp;gt;&lt;br /&gt;&amp;lt;/Canvas&amp;gt;&lt;br /&gt;&amp;lt;Canvas MouseLeftButtonDown="movieStop"&lt;br /&gt;  Canvas.Left="130" Canvas.Top="365"&amp;gt;&lt;br /&gt;  &amp;lt;TextBlock Canvas.Left="5" Canvas.Top="5" Visibility="Collapsed" x:Name="stopButton" Foreground="White"&amp;gt;Stop&amp;lt;/TextBlock&amp;gt;&lt;br /&gt;&amp;lt;/Canvas&amp;gt;&lt;br /&gt;&amp;lt;/Canvas&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;4. Movie.xaml.js (event handler, logic)&lt;br /&gt;&lt;pre name="code" class="js"&gt;&lt;br /&gt;function movieStop(sender, args) {&lt;br /&gt;  sender.findName("movie").stop();&lt;br /&gt;}&lt;br /&gt;function moviePause(sender, args) {&lt;br /&gt;  sender.findName("movie").pause();&lt;br /&gt;}&lt;br /&gt;function moviePlay(sender, args) {&lt;br /&gt;  sender.findName("movie").play();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function mouseEnter(sender, args) {&lt;br /&gt;  setControlVisibility(sender, "Visible");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function mouseLeave(sender, args) {&lt;br /&gt;  setControlVisibility(sender, "Collapsed");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function setControlVisibility(sender, visibility) {&lt;br /&gt;  sender.findName("playButton").visibility = visibility;&lt;br /&gt;  sender.findName("stopButton").visibility = visibility;&lt;br /&gt;  sender.findName("pauseButton").visibility = visibility;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Files 2-4 and the movie are added to a zip file and uploaded to the Microsoft Silverlight Streaming host.&lt;br /&gt;&lt;p&gt;&lt;b&gt;P.S.&lt;/b&gt; &lt;br /&gt;You might also be interested in the following previous posts:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;If you like how the code snippets are formatted on this page, you might want to read my other post: &lt;a href="http://developertips.blogspot.com/2007/08/syntaxhighlighter-on-blogger.html"&gt;Using SyntaxHighlighter on BLOGGER&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://developertips.blogspot.com/2007/12/embedding-chart-in-web-pages-made-easy.html"&gt;Embedding Chart in Web Pages Made Easy&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13937734-7414605491200300164?l=developertips.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://developertips.blogspot.com/2008/02/silverlight-streaming-source.html</link><author>noreply@blogger.com (Guogang Hu)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-13937734.post-7854698514499022668</guid><pubDate>Wed, 13 Feb 2008 07:37:00 +0000</pubDate><atom:updated>2008-02-13T00:13:01.083-08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>streaming</category><category domain='http://www.blogger.com/atom/ns#'>silverlight</category><title>Microsoft Silverlight Streaming Service Test</title><description>This is a test of &lt;a href="http://silverlight.live.com/"&gt;Microsoft Silverlight Streaming&lt;/a&gt; -- a free service that provides 4GB online space for Silverlight application hosting. You will need Silverlight 1.1 or higher to see the content. Move mouse over the video to see the movie controls. Resources for this implementation: a video file from Windows Vista, &lt;a href="http://silverlight.net/GetStarted/"&gt;Silverlight 1.1 SDK&lt;/a&gt;, &lt;a href="http://www.microsoft.com/express/"&gt;Visual Studio Express&lt;/a&gt; (Visual Web Developer 2008 Express Edition), and a &lt;a href="http://silverlight.live.com/"&gt;Microsoft Silverlight Streaming&lt;/a&gt; account.&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript" src="http://agappdom.net/h/silverlight.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;function CreateSilverlight() { Silverlight.createHostedObjectEx( { source:"streaming:/52057/MovieTest", parentElement:Wrapper_MovieTest}); } &lt;/script&gt;&lt;br /&gt;&lt;div id="Wrapper_MovieTest" style="width: 640px; height: 480px;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;var Wrapper_MovieTest = document.getElementById("Wrapper_MovieTest"); CreateSilverlight(); &lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13937734-7854698514499022668?l=developertips.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://developertips.blogspot.com/2008/02/microsoft-silverlight-streaming-service.html</link><author>noreply@blogger.com (Guogang Hu)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-13937734.post-4364505909389187472</guid><pubDate>Tue, 11 Dec 2007 00:27:00 +0000</pubDate><atom:updated>2007-12-10T16:35:10.188-08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>complain</category><title>"Newer Version" of GMail does not like Firefox</title><description>It is hard to believe, but our old faithful Google is producing a newer version which is badder than the older version.&lt;br /&gt;&lt;br /&gt;I am generally happy with Firefox. But after the "newer" version of GMail is out, I am forced to use IE more, because Firefox will crash on GMail before I can do anything. These are frequent places of crash:&lt;br /&gt;&lt;br /&gt;- send a new email;&lt;br /&gt;- browse trash or spam folder;&lt;br /&gt;- close a tab with GMail;&lt;br /&gt;&lt;br /&gt;After switch to the "older" version of GMail, the crash problem goes away immediately. Hopefully the next "newer" version of GMail will be a better one.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13937734-4364505909389187472?l=developertips.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://developertips.blogspot.com/2007/12/newer-version-of-gmail-does-not-like.html</link><author>noreply@blogger.com (Guogang Hu)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-13937734.post-1242091098680240585</guid><pubDate>Fri, 07 Dec 2007 19:00:00 +0000</pubDate><atom:updated>2007-12-07T12:13:36.139-08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>javascript</category><category domain='http://www.blogger.com/atom/ns#'>yui</category><category domain='http://www.blogger.com/atom/ns#'>tool</category><category domain='http://www.blogger.com/atom/ns#'>API</category><category domain='http://www.blogger.com/atom/ns#'>library</category><category domain='http://www.blogger.com/atom/ns#'>google</category><category domain='http://www.blogger.com/atom/ns#'>flash</category><category domain='http://www.blogger.com/atom/ns#'>chart</category><title>Embedding Chart in Web Pages Made Easy</title><description>This week, embedding charts in your web page (either dynamic or static) is made extremely easy by the release of two new tools by Yahoo and Google. Both released free tools to help create chart online.&lt;br /&gt;&lt;br /&gt;I am not sure if this is competition between Yahoo and Google or just coincidence. The two tools are released within the same week (this week):&lt;br /&gt;&lt;a href="http://developer.yahoo.com/yui/"&gt;YUI&lt;/a&gt; 2.4.0 released on 12/04/2007&lt;br /&gt;&lt;a href="http://code.google.com/apis/chart/"&gt;Google Chart API&lt;/a&gt; released on 12/06/2007&lt;br /&gt;&lt;br /&gt;The two tools actually complement each other.&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Google Chart API:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Nothing can describe it better than the following text on their web site:&lt;br /&gt;&lt;blockquote&gt;The Google Chart API lets you dynamically generate charts. To see the Chart API in action, open up a browser window and copy the following URL into it: &lt;p&gt;&lt;code&gt;http://chart.apis.google.com/chart?cht=p3&amp;amp;chd=s:hW&amp;amp;chs=250x100&amp;amp;chl=Hello|World&lt;/code&gt;&lt;/p&gt; Press the Enter or Return key ...&lt;/blockquote&gt;&lt;span style="font-weight: bold;"&gt;Pros:&lt;/span&gt;&lt;br /&gt;- absolutely the simplest and the easiest chart tool I have ever seen;&lt;br /&gt;- there is no CPU overhead on your web server and client's computer;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Cons:&lt;/span&gt;&lt;br /&gt;- may have problem serving chart over SSL (at least IE will complain about secure and non-secure content on the same page);&lt;br /&gt;- chart is static, no user interaction;&lt;br /&gt;- very limited control over chart's look and feel;&lt;br /&gt;- can only show limited data range;&lt;br /&gt;- can only show limited number of data points;&lt;br /&gt;- your data has to be sent to a Google server, it may be a security concert;&lt;br /&gt;&lt;br /&gt;Below is a sample chart serve by Google Chart API. It is the real thing! Served dynamically from Google's server farms! It takes me only 20 seconds to embed it into this blog.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://chart.apis.google.com/chart?chs=200x125&amp;amp;chd=s:helloWorld&amp;amp;cht=lc&amp;amp;chxt=x,y&amp;amp;chxl=0:%7CMar%7CApr%7CMay%7CJune%7CJuly%7C1:%7C%7C50+Kb"&gt;&lt;img style="cursor: pointer; width: 183px; height: 114px;" src="http://chart.apis.google.com/chart?chs=200x125&amp;amp;chd=s:helloWorld&amp;amp;cht=lc&amp;amp;chxt=x,y&amp;amp;chxl=0:%7CMar%7CApr%7CMay%7CJune%7CJuly%7C1:%7C%7C50+Kb" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Yahoo! User Interface Library (YUI):&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;YUI implementation is based on a Flash component. You will need to write JavaScript to control the data and look&amp;amp;feel on the Flash chart.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Pros:&lt;/span&gt;&lt;br /&gt;- Rich user interaction (there is potential to allow user zoom, pan, or edit charts);&lt;br /&gt;- More control over look and feel;&lt;br /&gt;- Can show more data;&lt;br /&gt;- Can be hosted on your own server (no worry about Google being BIG BROTHER or going BANKRUPT);&lt;br /&gt;- Less Internet traffic is required (only need to download data, not PNG or any other image files);&lt;br /&gt;- Can serve live data (again, only data download is needed, we can afford to update the chart frequently);&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Cons:&lt;/span&gt;&lt;br /&gt;- substantial JavaScipt programming and HTML editing is required;&lt;br /&gt;- end user need to have Flash Player 9.0.45 or higher (not many people have that as on December 2007);&lt;br /&gt;- end user's computer must have some spare CPU power, especially when multiple charts are embedded on the web page;&lt;br /&gt;&lt;br /&gt;As an obvious proof of the difficulty to start using YUI, I am not willing to try to embed a sample chart here in my blog! :-(&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;The Verdict:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;If you want a simple chart embedded on a static page or your blog, use Google Chart API.&lt;br /&gt;If you have total control of your web server, and want to create powerful dynamic charts, use YUI 2.4.0's experimental chart component.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Last Words:&lt;/span&gt;&lt;br /&gt;Of course, if you have enough server side CPU power and deep programming knowledge, server side chart rendering always give you ultimate control over the look and feel of your charts. On this end, you have these great open source libraries to help you: &lt;a href="http://zedgraph.org/"&gt;ZedGrap &lt;/a&gt;(C#), &lt;a href="http://www.jfree.org/jfreechart/"&gt;JFreeChart &lt;/a&gt;(Java), &lt;a href="http://developer.yahoo.com/flash/"&gt;ASTRA &lt;/a&gt;(Flash).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13937734-1242091098680240585?l=developertips.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://developertips.blogspot.com/2007/12/embedding-chart-in-web-pages-made-easy.html</link><author>noreply@blogger.com (Guogang Hu)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-13937734.post-5301918057061076902</guid><pubDate>Thu, 08 Nov 2007 20:13:00 +0000</pubDate><atom:updated>2008-02-01T11:26:38.537-08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>IE</category><category domain='http://www.blogger.com/atom/ns#'>debug</category><category domain='http://www.blogger.com/atom/ns#'>MFC</category><category domain='http://www.blogger.com/atom/ns#'>ActiveX</category><title>Error Installing ActiveX in IE</title><description>If an ActiveX component fails to install in IE, to find out the source of the problem, you just need to select IE menu: &lt;span style="font-family:courier new;"&gt;Tools &gt; Internet Options&lt;/span&gt;, click "&lt;span style="font-family:courier new;"&gt;Settings&lt;/span&gt;" button in the "&lt;span style="font-family:courier new;"&gt;Browsing history&lt;/span&gt;" group, then click the "&lt;span style="font-family:courier new;"&gt;View files&lt;/span&gt;" button. There should be a file named like this: "&lt;span style="font-family:courier new;"&gt;?CodeDownloadErrorLog!name={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}&lt;/span&gt;". This is the error log that contains a bit more information to help find the source of installation failure. The above description is based on IE 7, you should be able to find similar options in other IE versions.&lt;br /&gt;&lt;br /&gt;In my specific case, the error log looks like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;*** Code Download Log entry (07 Nov 2007 @ 10:01:26) ***&lt;br /&gt;Code Download Error: (hr = 800c0300) Unknown Error!!&lt;br /&gt;Operation failed. Detailed Information:&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;LOG: Item mfc42.dll being processed.&lt;br /&gt;ERR: INF Processing:  Failed (800c0300) processing: mfc42.dll&lt;br /&gt;. Cannot get primary/default language!LOG: URL Download Complete: hrStatus:0, hrOSB:800c0300, hrResponseHdr:0, URL:(*****.CAB)&lt;br /&gt;LOG: Reporting Code Download Completion: (hr:800c0300 (FAILED), CLASSID: e45975a1..., szCODE:(*****.cab), MainType:(null), MainExt:(null))&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Below is the related section in the .inf file:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; [mfc42.dll]&lt;br /&gt; FileVersion=6,2,4131,0&lt;br /&gt; file=http://[Web Server]/libraries.cab&lt;br /&gt; RegisterServer=no&lt;br /&gt; DestDir=11&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;After I commented out the "FileVersion" parameter, the ActiveX component is installed  successfully.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; [mfc42.dll]&lt;br /&gt; ;FileVersion=6,2,4131,0&lt;br /&gt; file=http://[Web Server]/libraries.cab&lt;br /&gt; RegisterServer=no&lt;br /&gt; DestDir=11&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Since the problem only happens on Windows 2000 computers, and my development environment in Windows XP Pro. I suspect that the MFC42 library provided by me may not be compatible with Win2000. Or the MFC42 is already in use by Win2000, and Win2000 have difficulty upgrading to the newer version provided by me.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13937734-5301918057061076902?l=developertips.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://developertips.blogspot.com/2007/11/error-installing-activex-in-ie.html</link><author>noreply@blogger.com (Guogang Hu)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-13937734.post-727698893162683910</guid><pubDate>Wed, 07 Nov 2007 19:40:00 +0000</pubDate><atom:updated>2008-12-09T11:39:22.889-08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>system administration</category><category domain='http://www.blogger.com/atom/ns#'>work around</category><category domain='http://www.blogger.com/atom/ns#'>Windows API</category><title>Reboot Remote Computer</title><description>"Remote Desktop" makes it easy to manage Windows computers remotely.&lt;br /&gt;&lt;br /&gt;But, if you want to reboot the remote computer, you will be frustrated. Because there is no "Shut Down" button on the start menu. The trick is to click on the "Windows Security" menu which will bring up the "Windows Security" dialog which gives you the options to "Shut Down..." computer. You can also use the shortcut: Ctrl+Del+End to access the "Windows Security" dialog.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_C148T9ItPYw/RzIWU9yS7lI/AAAAAAAAA8E/VyFGM_NuXLw/s1600-h/sec.JPG"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_C148T9ItPYw/RzIWU9yS7lI/AAAAAAAAA8E/VyFGM_NuXLw/s400/sec.JPG" alt="" id="BLOGGER_PHOTO_ID_5130187474967129682" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13937734-727698893162683910?l=developertips.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://developertips.blogspot.com/2007/11/reboot-remote-computer.html</link><author>noreply@blogger.com (Guogang Hu)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_C148T9ItPYw/RzIWU9yS7lI/AAAAAAAAA8E/VyFGM_NuXLw/s72-c/sec.JPG' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-13937734.post-8044340608665548085</guid><pubDate>Fri, 02 Nov 2007 20:11:00 +0000</pubDate><atom:updated>2007-11-02T13:25:27.574-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>visual studio</category><category domain='http://www.blogger.com/atom/ns#'>javascript</category><category domain='http://www.blogger.com/atom/ns#'>aptana</category><category domain='http://www.blogger.com/atom/ns#'>tool</category><title>Aptana Out of Beta: 1.0 Released</title><description>Just noticed that Aptana has been out of beta. In the 2.0 era when everything stays "BETA" forever, this is a rare achievement.&lt;br /&gt;&lt;br /&gt;In version 1.0, an open-source &lt;span style="font-weight: bold;"&gt;Community&lt;/span&gt; edition and a commercial &lt;span style="font-weight: bold;"&gt;Professional &lt;/span&gt;edition are available at the same time. The professional edition definitely deserves the nominal price it asked for. But as its name suggests, only professionals really have an urge for that edition. The free Community edition has enough features for 90 percent of its potential users.&lt;br /&gt;&lt;br /&gt;My main IDE is still Visual Studio 2005. But the Javascript editor in Aptana is the best I ever seen. Its auto-complete is way better than even the latest Visual Studio 2008 Beta2.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13937734-8044340608665548085?l=developertips.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://developertips.blogspot.com/2007/11/aptana-out-of-beta-10-released.html</link><author>noreply@blogger.com (Guogang Hu)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-13937734.post-6146001391702104696</guid><pubDate>Thu, 18 Oct 2007 23:44:00 +0000</pubDate><atom:updated>2007-10-18T16:59:58.221-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>javascript</category><category domain='http://www.blogger.com/atom/ns#'>tool</category><category domain='http://www.blogger.com/atom/ns#'>jslint</category><category domain='http://www.blogger.com/atom/ns#'>ant</category><title>JSLint with ANT</title><description>&lt;a href="http://code.google.com/p/jslint4java/"&gt;jslint4java&lt;/a&gt;: &lt;blockquote&gt;&lt;span style="font-weight: bold;font-family:verdana;font-size:180%;"  &gt;"&lt;/span&gt;This is a java wrapper around the fabulous tool by Douglas Crockford, jslint. It provides a simple interface for detecting potential problems in JavaScript code.&lt;span style="font-weight: bold;font-family:verdana;font-size:180%;"  &gt;"&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;With this tool, batch scan JavaScript files with JSLint is a piece of cake. Here is a sample ANT target:&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&amp;lt;target name="jslint.src.js" depends="init"&amp;gt;&lt;br /&gt;&amp;lt;description&amp;gt;scan javascript files using jslint&amp;lt;/description&amp;gt;&lt;br /&gt;&amp;lt;apply executable="java" parallel="false" failonerror="false"&amp;gt;&lt;br /&gt;  &amp;lt;arg value="-jar" /&amp;gt;&lt;br /&gt;  &amp;lt;arg file="${tools.dir}/${jslint}" /&amp;gt;&lt;br /&gt;  &amp;lt;arg value="--bitwise" /&amp;gt;&lt;br /&gt;  &amp;lt;arg value="--browser" /&amp;gt;&lt;br /&gt;  &amp;lt;arg value="--undef" /&amp;gt;&lt;br /&gt;  &amp;lt;arg value="--widget" /&amp;gt;&lt;br /&gt;  &amp;lt;srcfile /&amp;gt;&lt;br /&gt;  &amp;lt;sort xmlns:rcmp="antlib:org.apache.tools.ant.types.resources.comparators"&amp;gt;&lt;br /&gt;    &amp;lt;rcmp:name /&amp;gt;&lt;br /&gt;    &amp;lt;fileset dir="${web.js.dir}"&amp;gt;&lt;br /&gt;      &amp;lt;include name="**/*.js" /&amp;gt;&lt;br /&gt;      &amp;lt;exclude name="**/YUI/**" /&amp;gt;&lt;br /&gt;      &amp;lt;exclude name="**/*-min.js" /&amp;gt;&lt;br /&gt;      &amp;lt;exclude name="**/*-debug.js" /&amp;gt;&lt;br /&gt;    &amp;lt;/fileset&amp;gt;&lt;br /&gt;  &amp;lt;/sort&amp;gt;&lt;br /&gt;&amp;lt;/apply&amp;gt;&lt;br /&gt;&amp;lt;/target&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;For ease of future reference, JSLint output can be redirected to a text file:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;ANT jslint.src.js &gt; jslintreport.txt&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13937734-6146001391702104696?l=developertips.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://developertips.blogspot.com/2007/10/jslint-with-ant.html</link><author>noreply@blogger.com (Guogang Hu)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>3</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-13937734.post-2285447963824529759</guid><pubDate>Thu, 18 Oct 2007 23:16:00 +0000</pubDate><atom:updated>2008-05-30T13:40:04.347-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>javascript</category><category domain='http://www.blogger.com/atom/ns#'>tool</category><category domain='http://www.blogger.com/atom/ns#'>ant</category><category domain='http://www.blogger.com/atom/ns#'>yui compressor</category><title>YUI Compressor in ANT</title><description>Here is a sample ANT target to batch minify all JavaScript files using &lt;a href="http://developer.yahoo.com/yui/compressor/"&gt;YUI Compressor&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&amp;lt;target name="js.minify" depends="init"&amp;gt;&lt;br /&gt;&amp;lt;description&amp;gt;minify js files&amp;lt;/description&amp;gt;&lt;br /&gt;&amp;lt;apply executable="java" parallel="false" failonerror="true"&amp;gt;&lt;br /&gt;&amp;lt;arg value="-jar" /&amp;gt;&lt;br /&gt;&amp;lt;arg file="${tools.dir}/${yuicompressor}" /&amp;gt;&lt;br /&gt;&amp;lt;arg value="--nomunge" /&amp;gt;&lt;br /&gt;&amp;lt;!-- line break set at 20 characters, so that we can get many line breaks, this&lt;br /&gt;   is good for debugging in IE--&amp;gt;&lt;br /&gt;&amp;lt;arg value="--line-break" /&amp;gt;&lt;br /&gt;&amp;lt;arg value="20" /&amp;gt;&lt;br /&gt;&amp;lt;arg value="--preserve-strings" /&amp;gt;&lt;br /&gt;&amp;lt;arg value="--preserve-semi" /&amp;gt;&lt;br /&gt;&amp;lt;arg value="--charset" /&amp;gt;&lt;br /&gt;&amp;lt;arg value="ISO-8859-1" /&amp;gt;&lt;br /&gt;&amp;lt;arg value="-o" /&amp;gt;&lt;br /&gt;&amp;lt;targetfile /&amp;gt;&lt;br /&gt;&amp;lt;srcfile /&amp;gt;&lt;br /&gt;&amp;lt;!-- files are processed in alpha-order so that we can know the progress,&lt;br /&gt;   and easily identify the file that is failed.--&amp;gt;&lt;br /&gt;&amp;lt;sort xmlns:rcmp="antlib:org.apache.tools.ant.types.resources.comparators"&amp;gt;&lt;br /&gt; &amp;lt;rcmp:name /&amp;gt;&lt;br /&gt; &amp;lt;fileset dir="${src.dir}"&amp;gt;&lt;br /&gt;  &amp;lt;include name="**/*.js" /&amp;gt;&lt;br /&gt;  &amp;lt;exclude name="**/YUI/**" /&amp;gt;&lt;br /&gt;  &amp;lt;!-- avoid cycling --&amp;gt;&lt;br /&gt;  &amp;lt;exclude name="**/*-min.js" /&amp;gt;&lt;br /&gt; &amp;lt;/fileset&amp;gt;&lt;br /&gt;&amp;lt;/sort&amp;gt;&lt;br /&gt;&amp;lt;!-- define output file name --&amp;gt;&lt;br /&gt;&amp;lt;mapper type="glob" from="*.js" to="*-min.js" /&amp;gt;&lt;br /&gt;&amp;lt;/apply&amp;gt;&lt;br /&gt;&amp;lt;/target&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;About &lt;a href="http://developer.yahoo.com/yui/compressor/"&gt;YUI Compressor&lt;/a&gt;:&lt;/span&gt; it is a tool to minimize JavaScript and CSS files. I have used it for more 6 months on a public web site without any problem.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;About &lt;a href="http://ant.apache.org/index.html"&gt;ANT&lt;/a&gt;: &lt;/span&gt;I have been using &lt;a href="http://ant.apache.org/index.html"&gt;APACHE ANT&lt;/a&gt; for 7 years, since 2001. To me, an ANT build file structure is more intuitive and scalable than MAKE files.  &lt;blockquote&gt;Apache Ant is a Java-based build tool. In theory, it is kind of like Make, but without Make's wrinkles.&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;This is the post that gets me started on this direction:&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.julienlecomte.net/blog/2007/09/11/building-web-applications-with-apache-ant/"&gt;Building Web Applications With Apache Ant&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13937734-2285447963824529759?l=developertips.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://developertips.blogspot.com/2007/10/yuicompressor-in-ant.html</link><author>noreply@blogger.com (Guogang Hu)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-13937734.post-9220363005091296741</guid><pubDate>Fri, 28 Sep 2007 23:08:00 +0000</pubDate><atom:updated>2008-12-09T11:39:23.091-08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>visual studio</category><title>Open Source File in Visual Studio 2005 with Auto-Complete</title><description>Just discovered this convenient feature of Visual Studio. It is not well publicized by Microsoft, but I believe it is one of those hidden gems of VS2005.&lt;br /&gt;&lt;br /&gt;If you type "&lt;span style="font-family: courier new;"&gt;&gt;open&lt;/span&gt;" followed with the file name in the "&lt;span style="font-weight: bold;"&gt;Command Windows&lt;/span&gt;" or "&lt;span style="font-weight: bold;"&gt;Find/Command Box&lt;/span&gt;", Visual Studio will search the whole solution and try to auto-complete the file name for you (see screenshot below).&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_C148T9ItPYw/Rv2KGyCndiI/AAAAAAAAAyU/j-wDdWbd96U/s1600-h/vs2005cw.JPG"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_C148T9ItPYw/Rv2KGyCndiI/AAAAAAAAAyU/j-wDdWbd96U/s400/vs2005cw.JPG" alt="" id="BLOGGER_PHOTO_ID_5115396600879347234" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;There are 2 other approaches to open a source file in VS2005: 1. use the open file dialog; 2. expand the solution tree and double click on the file of interest.&lt;br /&gt;&lt;br /&gt;This feature is very useful when you have solution with many projects. If you can remember the file's name, this feature allow you to open a file in under 10 seconds. With the other 2 approaches, you will have to browse up and down the project trees to find the file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13937734-9220363005091296741?l=developertips.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://developertips.blogspot.com/2007/09/open-source-file-in-visual-studio-2005.html</link><author>noreply@blogger.com (Guogang Hu)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_C148T9ItPYw/Rv2KGyCndiI/AAAAAAAAAyU/j-wDdWbd96U/s72-c/vs2005cw.JPG' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item></channel></rss>