tag:blogger.com,1999:blog-11543399932256507022017-09-15T18:16:51.218+08:00My Second Attempt at BloggingThis blog contains random topics of interest to Robertson (Dick) Chiang including family life, travel, hobbies, work, photography, and technology (lots of it).Dick Chianghttp://www.blogger.com/profile/04862303484551521898noreply@blogger.comBlogger484125DickChiangBloghttps://feedburner.google.comtag:blogger.com,1999:blog-1154339993225650702.post-13894451353585784342015-08-08T17:55:00.003+08:002015-08-08T17:55:45.510+08:00Converting Unix Text Files to Windows / DOSI just hate it when I open a text file in notepad and find out its a Unix file with no \r\n to make it render correctly in the Windows/DOS world. &nbsp;I found this really simple DOS command to solve the problem:<br /><br />c:\&gt; type unix-filename.txt | more /P &gt; dos-filename.txt<br /><br />Source:<br /><br /><a href="http://stackoverflow.com/questions/17579553/windows-command-to-convert-unix-eol-to-windows-eol">http://stackoverflow.com/questions/17579553/windows-command-to-convert-unix-eol-to-windows-eol</a><img src="http://feeds.feedburner.com/~r/DickChiangBlog/~4/lxVdoEAveXw" height="1" width="1" alt=""/>Dick Chianghttp://www.blogger.com/profile/04862303484551521898noreply@blogger.com0http://dickchiang.blogspot.com/2015/08/converting-unix-text-files-to-windows.htmltag:blogger.com,1999:blog-1154339993225650702.post-76686627388287311042015-07-27T22:05:00.002+08:002015-07-28T10:08:19.337+08:00IP Whitelisting a Specific .NET Web Service asmx fileFor the longest time, I've been applying IP whitelisting to an entire website in IIS. &nbsp;But lately, I've been wanting to just apply it to a specific asmx file in the site, while keeping the rest unrestricted. &nbsp;After doing some research, it seems that this can be simply done in IIS 6.0 by right-clicking on the asmx file and choosing File Security.<br /><br />But with Windows 2012 Server and its built-in IIS 8.5, it gets a little more complicated. &nbsp;First, you have to install the IP Security feature from <b>Server Manager</b> if it is not yet installed:<br /><br /><a href="http://www.iis.net/configreference/system.webserver/security/ipsecurity/add">http://www.iis.net/configreference/system.webserver/security/ipsecurity/add</a><br /><br />From my experience with Softlayer, their bare metal installation somehow does not have this feature pre-installed. &nbsp;But with my Cloud Server, all Web Server options were pre-installed. &nbsp;From IIS Manager, go to <i>Content View</i>; right-click the asmx file you want to protect and select <i>Switch to Features View</i>. &nbsp;Then open <i>IP Address and Domain Restriction</i>.<br /><br />Visit this for more information:<br /><br /><a href="http://stackoverflow.com/questions/1075618/limit-access-of-asmx-web-service-to-specific-ip-addresses">http://stackoverflow.com/questions/1075618/limit-access-of-asmx-web-service-to-specific-ip-addresses</a><br /><br />One can also specify the IP restriction by hand via web.config as shown here:<br /><br /><a href="http://serverfault.com/questions/653672/how-to-ip-restrict-access-to-a-website-in-iis8-5-windows-2012r2">http://serverfault.com/questions/653672/how-to-ip-restrict-access-to-a-website-in-iis8-5-windows-2012r2</a><br /><br /><img src="http://feeds.feedburner.com/~r/DickChiangBlog/~4/0GJEi37TSyk" height="1" width="1" alt=""/>Dick Chianghttp://www.blogger.com/profile/04862303484551521898noreply@blogger.com0http://dickchiang.blogspot.com/2015/07/ip-whitelisting-specific-net-web.htmltag:blogger.com,1999:blog-1154339993225650702.post-77839704940242966842015-04-11T00:26:00.001+08:002015-04-11T00:26:17.896+08:00HTTPException Request Timeout with ASP.NET 4.0I'm still doing ongoing debugging of my recent migration from Windows Server 2003 to 2012. &nbsp;I have an ASP.NET code that really takes a long time to process. &nbsp;It works fine with 2003. &nbsp;But when I migrated to 2012, ASP.NET 4.0 is returning an:<br /><br /><span style="background-color: #ffffcc; font-family: 'Lucida Console'; font-size: 12px;">[HttpException (0x80004005): Request timed out.]</span><br /><span style="background-color: #ffffcc; font-family: 'Lucida Console'; font-size: 12px;"><br /></span>after about 2 mins into the process. &nbsp;I'm following the advise here:<br /><br />http://blogs.msdn.com/b/asiatech/archive/2012/06/21/how-to-troubleshoot-httpexception-request-timed-out-asp-net-4-0-64-bit.aspx<br /><br />I added the ff. in my web.config to extend the timeout to 10 mins:<br /><br /><div class="MsoNormal" style="background-color: #d9d9d9; font-family: Arial; font-size: 12.1104001998901px; margin-bottom: 0.0001pt !important; margin-top: 12px;"><span style="font-family: Verdana, sans-serif; font-size: 10pt;"><system .web=""></system></span></div><div class="MsoNormal" style="background-color: #d9d9d9; font-family: Arial; font-size: 12.1104001998901px; margin-bottom: 0.0001pt !important; margin-top: 12px;"><span style="font-family: Verdana, sans-serif; font-size: 10pt;"><httpruntime background:="" executiontimeout="&lt;span style=" yellow="">600</httpruntime></span>"/&gt;</div><div class="MsoNormal" style="background-color: #d9d9d9; font-family: Arial; font-size: 12.1104001998901px; margin-bottom: 0.0001pt !important; margin-top: 12px;"><span style="font-family: Verdana, sans-serif; font-size: 10pt;"></span></div><img src="http://feeds.feedburner.com/~r/DickChiangBlog/~4/hYYS33tIiL8" height="1" width="1" alt=""/>Dick Chianghttp://www.blogger.com/profile/04862303484551521898noreply@blogger.com0http://dickchiang.blogspot.com/2015/04/httpexception-request-timeout-with.htmltag:blogger.com,1999:blog-1154339993225650702.post-52102661659799998472015-04-05T14:19:00.003+08:002015-04-05T14:21:16.669+08:00Resetting Turnkey Linux File Server Admin PasswordI've been using Turnkey Linux file server for a few years and I think it is an excellent appliance software. &nbsp;But my hard drive recently crashed and I had to reinstall. &nbsp;I only got around now to try and create user accounts but couldn't remember what I set the login password as. &nbsp;I tried all the usually suspects but none work.<br /><br />After reading a few sites at Google, I finally found this tip that worked:<br /><br /><a href="http://www.rgiapratama.net/2012/10/16/reset-extplorer-admin-password/">http://www.rgiapratama.net/2012/10/16/reset-extplorer-admin-password/</a><br /><br />Basically, you can manually edit the .htusers.php file of extplorer and change the "admin" password with one that you manually generate using echo | md5sum.<img src="http://feeds.feedburner.com/~r/DickChiangBlog/~4/ByuLzY0Urss" height="1" width="1" alt=""/>Dick Chianghttp://www.blogger.com/profile/04862303484551521898noreply@blogger.com0http://dickchiang.blogspot.com/2015/04/resetting-turnkey-linux-file-server.htmltag:blogger.com,1999:blog-1154339993225650702.post-42095699308628831832015-03-30T08:35:00.001+08:002015-03-30T08:36:01.381+08:00Upgrading to Windows 2012 R2 64-bit Part 2 of 2I was waiting forever for the certificate to be sent by Geotrust last night. &nbsp;Turned out that it was sent to the admin email account. &nbsp;Grrr...<br /><br />Anyway, I approved the certificate via email link this morning and received it in another email. &nbsp;So to continue with the process, the following steps were needed:<br /><br /><ol><li>Install the certificate to IIS 8 --&nbsp;<a href="https://www.digicert.com/ssl-certificate-installation-microsoft-iis-8.htm">https://www.digicert.com/ssl-certificate-installation-microsoft-iis-8.htm</a></li><li>Download the intermediate certificates from Geotrust/RapidSSL (provided in the email link)</li><li>Install the intermediate certificates to Windows 2012 --&nbsp;<a href="https://support.godaddy.com/help/article/4951/installing-an-ssl-certificate-in-microsoft-iis-8?countrysite=ph">https://support.godaddy.com/help/article/4951/installing-an-ssl-certificate-in-microsoft-iis-8?countrysite=ph</a></li><li>Do a quick SSL health check --&nbsp;<a href="https://www.sslshopper.com/ssl-checker.html">https://www.sslshopper.com/ssl-checker.html</a></li></ol><div>And SSL is now running correctly.</div><img src="http://feeds.feedburner.com/~r/DickChiangBlog/~4/5iPRTSiklek" height="1" width="1" alt=""/>Dick Chianghttp://www.blogger.com/profile/04862303484551521898noreply@blogger.com0http://dickchiang.blogspot.com/2015/03/installing-ssl-on-windows-2012.htmltag:blogger.com,1999:blog-1154339993225650702.post-16968435506288202262015-03-30T00:25:00.001+08:002015-03-30T08:35:51.405+08:00Upgrading to Windows 2012 R2 64-bit Part 1 of 2I migrated the secondary server from Windows 2003 Standard 32-bit to Windows 2012 R2 64-bit since Win2003 is not supported anymore and it cannot handle SHA-2 SSL. &nbsp;While my previous attempt to do the same on the virtual server went through like a breeze, doing it on the bare metal server took way much longer than I expected.<br /><br /><ol><li>The OS Reload took 2 hours to complete.</li><li>Upon login, it looks like Softlayer did not install IIS by default unlike with the virtual server. &nbsp;I had to manually search for the instructions and found this --&nbsp;<a href="http://www.iis.net/learn/install/installing-iis-85/installing-iis-85-on-windows-server-2012-r2">http://www.iis.net/learn/install/installing-iis-85/installing-iis-85-on-windows-server-2012-r2</a>.</li><li>After loading the programs, got tons of IIS errors. &nbsp;I did several tests and eventually came to the conclusion that the problem was .NET 4.5 was installed prior to installing IIS. &nbsp;So it has to be reconfigured in order for IIS to recognize it. &nbsp;In the old days, it was just a simple call of <b>aspnet_regiis.exe</b>. &nbsp;But it looks like Win2012 does not support that anymore. &nbsp;Instead, it uses something called <b>dism</b>. &nbsp;This link solved it --&nbsp;<a href="http://support.microsoft.com/en-us/kb/2736284">http://support.microsoft.com/en-us/kb/2736284</a>.</li><li>The above command also correctly installed the ASP.NET State Service.</li><li>When the components look like they are working, I tried making test transactions. &nbsp;I was getting some weird error message that I've never seen before. &nbsp;After doing some Google research, and inserting lots of debug tracers, it turns out that Windows 2012 has IPv6 enabled by default. &nbsp;So the Request.UserAddress was returning an IPv6 address instead of an IPv4 which, in turn, causes problem with the call to GeoIP. &nbsp;The coding suggestion here worked --&nbsp;<a href="http://www.4guysfromrolla.com/articles/071807-1.aspx">http://www.4guysfromrolla.com/articles/071807-1.aspx</a>.</li><li>Then I installed the SMTP Server but could not log into it no matter what settings I was doing on the Firewall. &nbsp;Then I remembered having this same problem a long time ago! &nbsp;Its the McAfee Virus Scan that came with the bare metal server which was blocking SMTP access. &nbsp;The virtual server does not come with McAfee so I did not have such problem. &nbsp;Disabled spam checking at McAfee solved that.</li><li>Now, I'm working on getting my SSL certificate re-issued under the newly loaded OS. &nbsp;I followed this CSR generation instruction --&nbsp;<a href="https://www.digicert.com/csr-creation-microsoft-iis-8.htm">https://www.digicert.com/csr-creation-microsoft-iis-8.htm</a>. &nbsp;Now waiting for Geotrust to send me back my new certificate.</li></ol><div>Sigh, the expected 2 to 3 hour maintenance is now running 6 hours and counting...</div><img src="http://feeds.feedburner.com/~r/DickChiangBlog/~4/ty33IiiQIzQ" height="1" width="1" alt=""/>Dick Chianghttp://www.blogger.com/profile/04862303484551521898noreply@blogger.com0http://dickchiang.blogspot.com/2015/03/upgrading-to-windows-2012-r2-64-bit.htmltag:blogger.com,1999:blog-1154339993225650702.post-50532890357484282072015-03-14T21:20:00.002+08:002015-03-29T20:38:46.905+08:00Installing SMTP Service on Windows 2012With Microsoft's impending end-of-life support for Windows 2003 and all the recent SSL attacks, it looks like moving to SHA-2, TLS1.x, etc. is inevitable. &nbsp;I've previously &nbsp;had an impossible time getting Dragonpay to work correctly on Windows 2008 R2 64-bit at Softlayer. &nbsp;But this time around, when I had the OS reloaded for Windows 2012 64-bit, it was surprisingly smooth. &nbsp;Granted that it took a little bit of getting used to the new interface, but it wasn't that much different from Windows 2008.<br /><br />Figuring out where to find the SMTP service took a bit more of a challenge but I found this incredible and very detailed step-by-step guide that worked perfectly:<br /><br /><a href="http://blog.hyperfive.com/2013/07/how-to-setup-internal-smtp-service-for.html">http://blog.hyperfive.com/2013/07/how-to-setup-internal-smtp-service-for.html</a><br /><br /><br /><img src="http://feeds.feedburner.com/~r/DickChiangBlog/~4/pOcEXQNukEo" height="1" width="1" alt=""/>Dick Chianghttp://www.blogger.com/profile/04862303484551521898noreply@blogger.com0http://dickchiang.blogspot.com/2015/03/installing-smtp-service-on-windows-2012.htmltag:blogger.com,1999:blog-1154339993225650702.post-87669397255587034462013-08-20T12:35:00.001+08:002013-08-20T12:35:19.709+08:00Stuck in GenSan AirportI've been here in Gen San airport for more than 5.5 hours already. &nbsp;Woke up before 5:30am to catch a supposed 7:40am flight. &nbsp;Alas, the Cebu Pacific flight 5J 992 that I'm supposed to take back to Manila has been delayed due to the <a href="http://newsinfo.inquirer.net/469775/maring-floods-kill-7-trap-thousands-in-homes">tropical storm Maring</a>. &nbsp;I heard things are even worse in Manila with flooding everywhere. &nbsp;No idea how I will drive out from Terminal 3 when I do get there.<br /><br />CEB crew fed us with Jollibee Chickenjoy and bottled water. &nbsp;That was nice of them considering its not really their fault -- well, sort of. &nbsp;According to the ground crew, the Manila plane crew is still in the old Domestic Terminal 4 and the road towards Terminal 3 is impassable so they cannot get onboard the plane.<br /><br />I've already finished 1.5 movies -- the 2nd part of <a href="http://www.imdb.com/title/tt1559547/">Beautiful Creatures</a> (I watched the first part on my flight in to GenSan), and <a href="http://www.imdb.com/title/tt1517260/">The Host</a>. &nbsp;Both movies are adaptations from books and belong roughly to the same genre. &nbsp;Beautiful Creatures is a love story between humans and witches (or "Casters" as they are called there), while The Host is a love story between humans and aliens.<br /><br />The Host is based on a novel by Stephenie Meyer, yep, the same one who came up with that godawful vampire love story series (cringe). &nbsp;Sadly, her take on science fiction is not any better. &nbsp;Except for <a href="http://www.imdb.com/name/nm1208167/?ref_=tt_ov_st">Diane Kruger</a> who looked like an alien supermodel, the rest of the cast was pretty lame. &nbsp;The movie was probably a flop in the box office (was it?).<br /><br />Well, the PA system just announced that our flight is estimated to depart at 1:20pm (that's 6 hrs later from the original schedule). &nbsp;I only have 1 movie left on my Samsung S3 -- The Incredible Burt Wonderstone. &nbsp;Better save it for the 1.5 hr flight back to Manila (or should I save it for the wait at Terminal 3 while waiting for the flood water to subside?).<img src="http://feeds.feedburner.com/~r/DickChiangBlog/~4/yNVDuSumRYA" height="1" width="1" alt=""/>Dick Chianghttp://www.blogger.com/profile/04862303484551521898noreply@blogger.com0http://dickchiang.blogspot.com/2013/08/stuck-in-gensan-airport.htmltag:blogger.com,1999:blog-1154339993225650702.post-30999682671635441702013-06-22T23:25:00.000+08:002013-06-23T23:31:12.805+08:00Caitlin's RecitalCaitlin had her third piano recital today at UP Diliman's Aldaba Recital Hall. &nbsp;Her first piece was Mozart's Sonata K.545. &nbsp;Its supposed to be a fast piece, but she seem to have played it way too fast in my opinion.<br /><br /><div class="separator" style="clear: both; text-align: center;"><iframe allowFullScreen='true' webkitallowfullscreen='true' mozallowfullscreen='true' width='320' height='266' src='https://www.youtube.com/embed/dtWnZCpd5SE?feature=player_embedded' FRAMEBORDER='0' /></div><br />For her second piece, Caitlin played Through the Eyes of Love from the movie Ice Castles.<br /><br /><div class="separator" style="clear: both; text-align: center;"><object width="320" height="266" class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://i1.ytimg.com/vi/OgDJREmG_GQ/0.jpg"><param name="movie" value="http://www.youtube.com/v/OgDJREmG_GQ?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" /><param name="bgcolor" value="#FFFFFF" /><param name="allowFullScreen" value="true" /><embed width="320" height="266" src="http://www.youtube.com/v/OgDJREmG_GQ?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" type="application/x-shockwave-flash" allowfullscreen="true"></embed></object></div><br />During the intermission, Teacher Dennis Ortega played a piano solo of Pirates of the Caribbean.<br /><br /><div class="separator" style="clear: both; text-align: center;"><iframe allowFullScreen='true' webkitallowfullscreen='true' mozallowfullscreen='true' width='320' height='266' src='https://www.youtube.com/embed/460-j6eEFIo?feature=player_embedded' FRAMEBORDER='0' /></div><br /><img src="http://feeds.feedburner.com/~r/DickChiangBlog/~4/SfcuLTy5YT4" height="1" width="1" alt=""/>Dick Chianghttp://www.blogger.com/profile/04862303484551521898noreply@blogger.com0http://dickchiang.blogspot.com/2013/06/caitlins-recital.htmltag:blogger.com,1999:blog-1154339993225650702.post-5281430102026583662013-06-15T21:57:00.000+08:002013-06-23T23:25:27.687+08:00Superman 2013The family went to watch the latest reincarnation of Superman in the silver screen -- <b>Man of Steel</b>. &nbsp;The movie has been getting lots of good comments from friends so I had high expectations.<br /><br /><b><span style="font-size: large;">The Cast</span></b><br /><br />At the lead role is <a href="http://www.imdb.com/name/nm0147147/">Henry Cavill</a>. &nbsp;I last saw him at <b>Cold Light of Day</b> opposite Bruce Willis. &nbsp;Let me go straight to the point -- I don't like cleft chins. &nbsp;I know that is very shallow and does not really say anything about the acting skills of the person. &nbsp;But I can't help it. &nbsp;I find cleft chins very distracting. &nbsp;I hated Timothy Dalton's rendition of James Bond 007 because of his chin also. &nbsp;He looked like he really buffed up for the role though. &nbsp;He did not look that big in <b>Cold Light of Day</b> or <b>Immortal</b>.<br /><br /><a href="http://www.imdb.com/name/nm0010736/">Amy Adams</a> made a great Lois Lane. &nbsp;Definitely not as annoying as Margot Kidder in the original Christopher Reeves series. &nbsp;And they made her smart in this movie unlike Margot Kidder who couldn't tell Clark Kent and Superman are one-and-the-same given that their only difference was the eyeglasses.<br /><br />I've never really heard of <a href="http://www.imdb.com/name/nm0788335/">Michael Shannon</a> before this movie, but he played a pretty impressive (and scary) General Zod. &nbsp;He is a good choice too.<br /><br /><span style="font-size: large;"><b>The Music</b></span><br /><br />I like Hans Zimmer's electronica music, but... it just doesn't measure up to a <a href="http://www.imdb.com/name/nm0002354/">John Williams</a> score. &nbsp;After the movie, you wouldn't remember what the Man of Steel soundtrack sounded like. &nbsp;But even 20 to 30 years later, people still know the soundtrack of <b>Star Wars</b>, <b>Indiana Jones</b>, and of course, the original <b>Superman</b> series. &nbsp;John Williams' music takes up a life of its own. &nbsp;I think the <b>Man of Steel</b> producers **should** have used the original theme somehow. &nbsp;They could let Hans Zimmer update it a bit for the 21st century if they do not want it to sound too fanfare-ish.<br /><br /><b><span style="font-size: large;">The Villains</span></b><br /><br />For a superhero who has been around decades (in real time, not comic book time), one would expect Superman has amassed a large pool of arch-enemies. &nbsp;But surprisingly, there seems to be a shortage of them. &nbsp;So far with the movie adaptations, its just either Lex Luthor or General Zod. &nbsp;Zod is not really much of a recurring character in the comic book series unlike Luthor (can't figure out why Superman can't beat this normal mortal with all his superpowers). &nbsp;Bring in Brainiac or some other inter-stellar baddie.<br /><br />In contrast, Batman has a great pool of great enemies to choose from (I hated Jack Nicholson's rendition of Joker in the original Batman movie). &nbsp;Spiderman also has a lot of great villains that has still not appeared in the movies. &nbsp;Even second-tier superheros like The Flash has an entire Rogues Gallery. &nbsp;But Superman seems to be stuck in the same category as Green Lantern who does not have much of a list of enemies other than Sinestro; or Thor who only seem to have Loki as his constant enemy.<br /><br /><span style="font-size: large;"><b>The Plot</b></span><br /><br />DC took some liberty in changing the original Superman mythos. &nbsp;Lois Lane knows from the start that Clark Kent is Superman. &nbsp;Kal-El goes soul-searching as he learned of his powers early in his life and seems to have completely skipped the Superboy/Smallville phase. &nbsp;Jor-El becomes a scientist who apparently is capable of beating up their planet's top military guy (duh!). &nbsp;Well, I guess Russell Crowe is still Gladiator.<br /><br />A couple of scenes that did not make sense to me:<br /><br />1. When Superman and Lois where in Zod's ship, Superman slipped her the black key (with the "S" emblem). &nbsp;Lois later plugs the key into a slot which brings up the consciousness of Jor-El who guides her to escape from the ship. &nbsp;I don't recall Lois ever pulling out the key. &nbsp;So how come at the end when they were going to drop Kal-El's baby spaceship into the alien spaceship, the scientist onboard the plane had another black "S" key to plug in? &nbsp;Where did he get that key from since the one from Kal-El was left at Zod's ship?<br /><br />2. How did Clark Kent, with no previous journalism background whatsoever, become a reporter at the Daily Planet on Day 1 of his work alongside Pulitzer Prize-winning journalists like Lois Lane?<br /><br /><b><span style="font-size: large;">Conclusion</span></b><br /><br />I rate the movie 4 stars out of 5. &nbsp;I felt the Marvel Studios movies (Iron Man 3 and Spiderman) were more fun to watch. &nbsp;Ethan rates the movie 3 stars out of 5 -- because Superman did not wear his red briefs outside as what he was looking forward to see.<br /><br /><img src="http://feeds.feedburner.com/~r/DickChiangBlog/~4/1s-KER_t9aM" height="1" width="1" alt=""/>Dick Chianghttp://www.blogger.com/profile/04862303484551521898noreply@blogger.com0http://dickchiang.blogspot.com/2013/06/superman-2013.htmltag:blogger.com,1999:blog-1154339993225650702.post-50180503664459678452013-06-12T22:30:00.000+08:002013-06-14T22:46:48.266+08:00Internet Explorer 10 (IE10) Causes Problem with ASP.NET ApplicationsA customer reported a problem to me today that the button at our site does not work when used with IE10. &nbsp;I've never encountered this problem before because I use Chrome mainly (I think the only people still using IE are those who do not know how to download a new browser and just sticks to the one pre-installed with their OS).<br /><br />When I fired up my IE10 and tested it against our test server, it also worked fine. &nbsp;After trading screenshots with the customer, I found the problem! &nbsp;It seems that our production server (which runs on an older OS compared to our test server), has an ASP.NET installed that does not recognize IE10! &nbsp;And if it does not recognize a browser, the default system behavior is to assume that the browser is not Javascript-capable and disables support for Javascript altogether. &nbsp;This has the effect of disabling buttons that rely on Javascript. &nbsp;This behavior is documented in <a href="http://www.hanselman.com/blog/BugAndFixASPNETFailsToDetectIE10CausingDoPostBackIsUndefinedJavaScriptErrorOrMaintainFF5ScrollbarPosition.aspx">Scott Hanselman's page</a>.<br /><br />I tried Scott's suggestions from the Machine-Wide and the Site-Only fixes, which basically updates the browser definition file of the .NET framework, to no effect. &nbsp;The hotfix described in the <a href="http://support.microsoft.com/kb/2600100">Microsoft knowledgebase</a> that is supposed to fix this issue also does not work for me.<br /><br />In the end, I tried forcing the browser to emulate IE9 by sending a meta tag from my page as described <a href="http://blog.codefluententities.com/2012/09/28/how-to-enable-ie-9-compatibility-mode-for-your-website/">here</a>:<br /><br /><pre>&lt;meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9"&gt;</pre><br />With .NET websites, inserting this in the Masterpage automatically fixes all pages. &nbsp;IE sucks.<img src="http://feeds.feedburner.com/~r/DickChiangBlog/~4/9NyJqnA1ahA" height="1" width="1" alt=""/>Dick Chianghttp://www.blogger.com/profile/04862303484551521898noreply@blogger.com0http://dickchiang.blogspot.com/2013/06/internet-explorer-10-ie10-causes.htmltag:blogger.com,1999:blog-1154339993225650702.post-79044307382972324952013-05-01T18:06:00.000+08:002013-05-01T18:06:10.936+08:00Programmatic POP3 Email Access with C# .NETFor more than a year already, I've been using Peter Huber's <a href="http://www.codeproject.com/Articles/14304/POP3-Email-Client-NET-2-0">POP3 Email Client for .NET 2.0</a>. &nbsp;It has been working fine for me until recently when I tried automating some more processes. &nbsp;I found out that the old (2006) code does not handle different types of MIME attachments properly. &nbsp;Searching some more at Google, I found out Peter Huber had another C# <a href="http://www.codeproject.com/Articles/15611/POP3-Email-Client-with-full-MIME-Support-NET-2-0">POP3 class that handles MIME</a>. &nbsp;I tried it out but found it just as complicated to use and poorly documented. &nbsp;And it still could not properly read 1 specific email format that I was receiving from a supplier.<br /><br />I tried the <a href="http://hpop.sourceforge.net/">OpenPop.Net</a> project and it solved all my problems! &nbsp;Very simple and intuitive to use. &nbsp;Requires very little effort to read the MIME attachments. &nbsp;It handles all the transcoding behind-the-scenes beautifully. &nbsp;No need to know about Base64, QuotedPrintable, etc. &nbsp;It just works. &nbsp;I'm now migrating my old code based on the Pop3MailClient.cs to OpenPop.Net!<img src="http://feeds.feedburner.com/~r/DickChiangBlog/~4/1H0u6Z-78nE" height="1" width="1" alt=""/>Dick Chianghttp://www.blogger.com/profile/04862303484551521898noreply@blogger.com0http://dickchiang.blogspot.com/2013/05/programmatic-pop3-email-access-with-c.htmltag:blogger.com,1999:blog-1154339993225650702.post-30955170273511541262013-03-29T19:05:00.000+08:002013-04-07T22:14:53.456+08:00Sumilon Bluewater - Holy Week 2013Holy Week came in early this year. &nbsp;To avoid the rush hour crowd, we left town by Wednesday (Mar 26) for <a href="http://www.bluewatersumilon.com.ph/">Sumilon Bluewater</a> in Oslob, Cebu. &nbsp;We took the 7:10am Cebu Pacific flight to Dumaguete. &nbsp;From Dumaguete airport, we were met by the resort representative who took us to the nearby Sibulan Port. &nbsp;The "fast craft" leaves only every hour at the top of the hour. &nbsp;Since we missed &nbsp;the 9am craft, we had to wait for the next one at 10am. &nbsp;The boat ride to Oslob was very dizzying because the waves were very strong. &nbsp; It took about 20 mins to go across. &nbsp;From there, it was another 15 mins or so ride to the Sumilon Resort dock where we had to wait for the 11am ride to the resort.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-5dytPzdEdSU/UV_9euS0c1I/AAAAAAAAL08/22t9j8_l8Rg/s1600/IMG_7325.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="213" src="http://4.bp.blogspot.com/-5dytPzdEdSU/UV_9euS0c1I/AAAAAAAAL08/22t9j8_l8Rg/s320/IMG_7325.JPG" width="320" /></a></div><br />Sumilon Bluewater is part of the Maribago group, which also operates resorts in Cebu and Bohol. &nbsp;Sumilon Bluewater is a bit old already, but it has been reaping the windfall benefits of a recent resurgence in local and foreign tourists due to the presence of the whale sharks (<i>butanding</i>) in Oslob. &nbsp;In fact, other than the whale shark interaction tours, there is really nothing much to do in Sumilon. &nbsp;If one is looking for peace and quiet, then its a good place to go. &nbsp;With only 14 cottages, it offers an exclusive feel and away from the maddening Holy Week crowd of places like Boracay.<br /><br />If you have hyperactive kids looking for activities, Sumilon does not have much to offer. &nbsp;The infinity pool is tiny. &nbsp;The beach shore is too rocky. &nbsp;You cannot really walk on it without wearing sandals. &nbsp;The waves are too strong for kids to swim. &nbsp;The island shuttle van is dilapidated. &nbsp;The rooms are very old but spacious (although, in fairness, they are building new cottages). &nbsp; The island has a natural lagoon where we kayak-ed in the afternoon.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-oLbyHwd1sG0/UV_9i1CA5eI/AAAAAAAAL1U/TXrRIewcusE/s1600/IMG_7339.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="213" src="http://2.bp.blogspot.com/-oLbyHwd1sG0/UV_9i1CA5eI/AAAAAAAAL1U/TXrRIewcusE/s320/IMG_7339.JPG" width="320" /></a></div><br />The highlight of the trip had to be the whale shark interaction on Thur (Mar 28). &nbsp;We took a boat from Sumilon back to the Oslob side. &nbsp;Then it was a very short shuttle ride to the area where the whale sharks were lounging. &nbsp;There must have been around 8 to 10 of them, by my estimate, swimming only several meters from shore. &nbsp;Cols, Caitlin, Ethan and I jumped down from the boat while the folks stayed on the boat. &nbsp;The organizers charge P300 for whale watching only and P500 for diving into the water with the whale sharks.<br /><br />I brought along my <a href="http://dickchiang.blogspot.com/2009/11/underwater-casing-for-canon-eos-400.html">DiCaPac DSLR underwater camera pack</a> but it was next to useless. &nbsp;The waves were too strong, while the pack was very unwieldy and kept floating up. &nbsp;So I just blindly took shots underwater by pointing the camera in the general direction of the <i>butanding</i>. &nbsp;You just have to take my word that the image below is really the "Big Mama" whale shark just a couple of meters away from me. &nbsp;She was about the length of 2 cars.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-fP2TCxC55zs/UV_9pXeJ-rI/AAAAAAAAL18/pW3eHsxzxhY/s1600/IMG_7369.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="213" src="http://4.bp.blogspot.com/-fP2TCxC55zs/UV_9pXeJ-rI/AAAAAAAAL18/pW3eHsxzxhY/s320/IMG_7369.JPG" width="320" /></a></div><br />Conner mostly stayed at our cottage and only joined us when we went swimming within the resort. &nbsp;He did enjoyed the pool but did not really like the beach as the water was too salty. &nbsp;Personally, I thought it was saltier than normal sea water. &nbsp;Just a splash on the face really stings the eyes. &nbsp;Maybe its something in the water that is driving the whale sharks to this part of the world.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-L-E-qpwEE_s/UV_9WfssxMI/AAAAAAAAL0s/Q33x6GEUk8U/s1600/IMG_7522.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="213" src="http://3.bp.blogspot.com/-L-E-qpwEE_s/UV_9WfssxMI/AAAAAAAAL0s/Q33x6GEUk8U/s320/IMG_7522.JPG" width="320" /></a></div><br />Ethan and I went hiking on Fri (Mar 29). &nbsp;It was a 45-min hike and I was fairly impressed with Ethan. &nbsp;He was a good sport even though he tripped and scratched his right knee. &nbsp;The hiking path was actually fairly tough as it was very rocky. &nbsp;I couldn't imagine Caitlin coming along in this hike. &nbsp;She would definitely be complaining all the way.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-2u8nu669RmQ/UV_9TAglbuI/AAAAAAAAL0U/LkDjWEN_wHA/s1600/IMG_7411.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="213" src="http://3.bp.blogspot.com/-2u8nu669RmQ/UV_9TAglbuI/AAAAAAAAL0U/LkDjWEN_wHA/s320/IMG_7411.JPG" width="320" /></a></div><br />There is only one dining place in the entire island -- the Pavilion. &nbsp;The food selection is decent. &nbsp;Food is a bit expensive as one would expect from an island resort, but nowhere near the price level of <a href="http://dickchiang.blogspot.com/2010/04/chiang-family-outing-2010-bellarocca.html">Bellarocca</a>.<br /><br /><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-wQ8k73J_AVE/UV_9Ys0afjI/AAAAAAAAL00/_jkqGNyjOd4/s1600/IMG_7541.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="213" src="http://4.bp.blogspot.com/-wQ8k73J_AVE/UV_9Ys0afjI/AAAAAAAAL00/_jkqGNyjOd4/s320/IMG_7541.jpg" width="320" /></a></div><br />Over-all, it was a good vacation. &nbsp;The <i>butanding</i>&nbsp;interaction is definitely one of those once-in-a-lifetime experience. &nbsp;But Sumilon Bluewater is not really one of those places that I would want to go back to again and again. &nbsp;Once is enough. &nbsp;Onward to our next family adventure!<br /><br /><a href="https://plus.google.com/u/0/photos/100962126709455809716/albums/5863682800595444993">View all our photos here!</a><img src="http://feeds.feedburner.com/~r/DickChiangBlog/~4/_BHTwnWKhoE" height="1" width="1" alt=""/>Dick Chianghttp://www.blogger.com/profile/04862303484551521898noreply@blogger.com0Oslob, Philippines9.5221305 123.428541900000039.5064704999999989 123.40837190000003 9.5377905 123.44871190000002http://dickchiang.blogspot.com/2013/03/sumilon-bluewater-holy-week-2013.htmltag:blogger.com,1999:blog-1154339993225650702.post-83991487449253024732013-02-08T11:23:00.000+08:002013-02-16T11:38:52.893+08:00PLDT Fibr @ HomeAfter five months of waiting, PLDT finally installed their Fibr fiber Internet-to-home service at our house! &nbsp;Sheesh! &nbsp;I don't know exactly why it took them so long to do it. &nbsp;In fairness to their telesales team though, I have to give them credit for being very persistent in following up with me and the contractor throughout all these months.<br /><br />I availed of the 8mbps package for P3,500/month. &nbsp;It comes with one free phone line. &nbsp;The fiber optic access device comes with two VoIP ports which is mapped to a regular Manila number. &nbsp;The audio quality is indistinguishable to a regular POTS service. &nbsp;But I feel (maybe its just my perception) that the post-dial-delay (PDD) is a bit longer compared to regular traditional copper phone service.<br /><br />When the PLDT installer initially tested the speed, it was maxing out at only 5mbps. &nbsp;From what I can tell with his conversation with their central network office, PLDT seems to be performing traffic shaping only to set the speed limit based on the subscribed plan. &nbsp;It does not seem to be a hardware port speed setting typical to traditional DSLAM implementation.<br /><br />When the PLDT guy performed a ping to "google.com", it gave a 1msec reply time. &nbsp;Google must have co-located some servers at PLDT. &nbsp;Otherwise, I cannot think of any other explanation as to how they would have a trans-Pacific latency that low.<br /><br />Is 8mbps Fibr way that much better than plain ol' MyDSL? &nbsp;For downloading large files (aka. Torrent), yes, its night and day difference. &nbsp;But for regular usage for GMail and Facebook, the difference is hardly noticeable. &nbsp;Even uploading and downloading of GMail attachments do not feel significantly faster. &nbsp;Of course, YouTube streaming is much smoother now also for Ethan.<img src="http://feeds.feedburner.com/~r/DickChiangBlog/~4/W5nmZugJa-A" height="1" width="1" alt=""/>Dick Chianghttp://www.blogger.com/profile/04862303484551521898noreply@blogger.com4http://dickchiang.blogspot.com/2013/02/pldt-fibr-home.htmltag:blogger.com,1999:blog-1154339993225650702.post-74902373251280405072013-02-06T13:19:00.001+08:002013-02-06T13:19:06.571+08:00Jackie Chan's Last Action MovieI took the kids to watch the much ballyhooed last action movie of Jackie Chan, Chinese Zodiac. &nbsp;With Jackie Chan retiring from doing action movies, the movie's main selling point is basically -- "this is your last chance to see Jackie Chan in action". &nbsp;This is an HK production and not a Hollywood movie. &nbsp;Supposedly, it has been breaking box office records in China.<br /><br />For a movie whose main target audience are the kids (and ok, maybe the old nostalgic crowd who has followed Jackie since <i>The Drunken Master</i>), the plot is particularly convoluted. &nbsp;I have to be honest -- I did not understand half of what was going on. &nbsp;Sure, the action scenes were fun to watch, but the plot, and the numerous sub-plots, were just all over the place.<br /><br />The stunts were so-so. &nbsp;I have to give credit that Jackie, at his age, can really still do difficult stunts. &nbsp;But over-all, it was nothing surprising already. &nbsp;The James Bond-like movie intro where he was strapped to that suit with wheels was innovative, at least. &nbsp;The overall martial arts of the film was lame. &nbsp;Or maybe after watching HK superstar&nbsp;<a href="http://en.wikipedia.org/wiki/Donnie_Yen">Donnie Yen</a> in <a href="http://en.wikipedia.org/wiki/Donnie_Yen"><i>Ip Man</i></a>, everyone else seem to pale in comparison.<br /><br />The acting, outside of Jackie Chan himself, was really lame. &nbsp;They seem to have hired a bunch of never-heard amateur actors. &nbsp;From the aristocratic French lady, to the Caucasian youth activists, the actors looked like drones memorizing their lines.<br /><br />In the final scene where Jackie swoops down to risk his life to save the Dragon head, there was a flash of hope for a great ending. &nbsp;With Jackie's bloodshot eyes, bloody face, and broken legs, I really thought that they will kill him off. &nbsp;That would have been a first -- Jackie dying in his movie. &nbsp;And it would have been a blaze-of-glory kind of ending. &nbsp;Seemed like a great way to end his action career. &nbsp;But 'no', he was still alive and the sub-plot further gets complicated -- who was that lady at the end? &nbsp;Was that his wife? &nbsp;Girlfriend? &nbsp;Why was she not answering his phone all that time? &nbsp;Why were Jackie's team mates referring to her as "sister"?<br /><br />I still think that the <i>Rush Hour</i> series with Chris Tucker were Jackie's best action-comedy performances.<img src="http://feeds.feedburner.com/~r/DickChiangBlog/~4/wmU6vKBp77M" height="1" width="1" alt=""/>Dick Chianghttp://www.blogger.com/profile/04862303484551521898noreply@blogger.com0http://dickchiang.blogspot.com/2013/02/jackie-chans-last-action-movie.htmltag:blogger.com,1999:blog-1154339993225650702.post-77900078034439501922013-02-01T17:49:00.004+08:002013-02-01T23:15:09.406+08:00Mysteries of the Deposit SlipHaving worked closely with all the major local commercial banks for the past couple of years with <a href="http://www.dragonpay.ph/">Dragonpay</a>, there are some things about the ubiquitous deposit slip that has always boggled me.<br /><br /><u>Mystery #1 - Account Type</u><br /><br />Why do banks ask us to tick the box if the type of account we are depositing to is a "Checking" or "Savings"? &nbsp;Can't the teller tell (no pun there)? &nbsp;Surely by simply encoding the account number in their screen, their system can immediately tell if its a Checking or Savings account. &nbsp;So why even bother asking the depositor to tick it?<br /><br />I noticed that even if you leave this field blank, the teller will just process it anyway without asking. &nbsp;This proves that they can easily tell from their screen. &nbsp;So why bother asking?<br /><br />Kudos to banks like Metrobank whose deposit slip has never seem to have bothered asking for this data as far as I can recall. &nbsp;The 4th digit of your bank account number already tells them if its a PHP or USD, Savings or Checking account. &nbsp;No need to ask.<br /><br /><u>Mystery #2 - Date</u><br /><br />Why on earth do banks ask you to write the date on the deposit slip? &nbsp;Isn't it obvious? &nbsp;Its always the date of that day. &nbsp;The teller will never accept a deposit slip which is dated in the past, nor in the future. &nbsp;The teller will only accept current dated deposit slips. &nbsp;So again -- why bother asking?<br /><br />All banks print validation data on the slip when the teller processes it. &nbsp;And all validation data contains the date and time it was processed. &nbsp;So since the date is already there (based on the back-end system), why are they still asking the depositor to write it?<br /><br /><u>Mystery #3 - Currency</u><br /><br />To a lesser extent, this field is similar to the account type field in my opinion. &nbsp;When the teller types in your account number in their system, they can already tell what is the currency of your account. &nbsp;So why bother asking you?<br /><br /><u>Mystery #4 - Signature</u><br /><br />Why do several banks ask you to sign on the deposit slip? &nbsp;Of what value does it serve? &nbsp;Metrobank, Landbank, UCPB, etc. have this field that perplexes me. &nbsp;The teller never actually validates if that is really your signature by comparing it against a government-issued ID. &nbsp;You can ask your 3-year old kid to doodle in that box and it would not make any difference. &nbsp;Why, oh why?<br /><br /><u>Mystery #5 - Relationship to the Account Holder</u><br /><br />This one seems to be unique to Landbank and UCPB. &nbsp;You (the depositor) have to declare your relationship to the account holder on the deposit slip. &nbsp;Why on earth is that important?!<img src="http://feeds.feedburner.com/~r/DickChiangBlog/~4/5z8lxZjqN-k" height="1" width="1" alt=""/>Dick Chianghttp://www.blogger.com/profile/04862303484551521898noreply@blogger.com0http://dickchiang.blogspot.com/2013/02/mysteries-of-deposit-slip.htmltag:blogger.com,1999:blog-1154339993225650702.post-2155125787965440732013-01-27T17:18:00.004+08:002013-01-27T17:18:41.816+08:00Google Cloud ServersGoogle is now offering cloud server hosting services under the tradename&nbsp;<a href="https://cloud.google.com/products/compute-engine">Google Compute Engine</a>. &nbsp;Its currently limited to Linux Virtual Machines. &nbsp;The pricing is comparable to that of <a href="http://www.rackspace.com/">Rackspace</a>&nbsp;for the same specs. &nbsp;But for entry-level VM's, Rackspace still comes out a bit cheaper. &nbsp;And Rackspace still offers companies more OS options.<br /><br />Where Google is known to excel is in scalability. &nbsp;So companies looking for massive scaling solution and high-performance computation of "BigData" should look into this. &nbsp;I do not know about Google support though compared to dedicated hosting companies like Rackspace or <a href="http://www.softlayer.com/">Softlayer</a>, who have solid track record for excellent support.<img src="http://feeds.feedburner.com/~r/DickChiangBlog/~4/tsf3nk-iiUw" height="1" width="1" alt=""/>Dick Chianghttp://www.blogger.com/profile/04862303484551521898noreply@blogger.com0http://dickchiang.blogspot.com/2013/01/google-cloud-servers.htmltag:blogger.com,1999:blog-1154339993225650702.post-67992206565362486412013-01-22T11:13:00.001+08:002013-01-22T11:13:32.053+08:00Jelly Bean on my Galaxy S IIIMy Samsung Galaxy S III downloaded the latest Android OS (Jelly Bean) and firmware by itself. &nbsp;It just prompted me if I wanted to install it already. &nbsp;The installation process went very smoothly except for a minor inconvenience -- it complained that my external SD is damaged. &nbsp;I've suspected before that I might have removed it improperly as a USB device so it did not get ejected properly. &nbsp;I had to reformat it to make it usable again.<br /><br />The new OS seem zippier (or maybe its just my imagination). &nbsp;For one, I am happy that they re-positioned the Bluetooth icon in the pull-down menu to be accessible on the first screen. &nbsp;With the previous OS version, I had to do an extra swipe to the right just to be able to access it.<br /><br />There is also a multiple window support now. &nbsp;I'm sure this is handy with a tablet but I don't know how useful it is for a Smartphone with a small screen anyway. &nbsp;Splitting your screen further into multiple windows does not really give you that much real estate left. &nbsp;It is kinda cool to see both Facebook and GMail on a tiled layout within the same screen though.<br /><br />The "desktop" already support folders similar to iOS. &nbsp;So multiple icons on the same screen can be grouped together into a "folder". &nbsp;Clicking the "folder" will expand it to what's contained inside.<img src="http://feeds.feedburner.com/~r/DickChiangBlog/~4/J-UohIcbOYo" height="1" width="1" alt=""/>Dick Chianghttp://www.blogger.com/profile/04862303484551521898noreply@blogger.com0http://dickchiang.blogspot.com/2013/01/jelly-bean-on-my-galaxy-s-iii.htmltag:blogger.com,1999:blog-1154339993225650702.post-2538347741533564012012-12-23T16:19:00.000+08:002012-12-30T16:19:51.514+08:00Installing Microsoft SMTP on IISIf ever there was an "SMTP for Dummies" solution, it would have to be Microsoft's SMTP implementation for the Internet Information Server (IIS) of its flagship Windows server products. &nbsp;The product comes free with Windows Servers and just needs to be installed and configured, as it does not normally come pre-installed by default.<br /><br />I recently migrated my servers to the "cloud" and was faced with the prospect of having to run my own SMTP service as the data center does not offer a centralized SMTP service. &nbsp;Linux is normally a much more robust solution, but my skills in setting up SMTP date back to more than a decade ago. I'm so out of touch already with going down that route so I considered the easier way out -- Microsoft IIS.<br /><br />Installing the SMTP service only takes about a minute. &nbsp;One just has to follow these <a href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/e4cf06f5-9a36-474b-ba78-3f287a2b88f2.mspx?mfr=true">steps</a>. &nbsp;Setting it up is also just a matter of pointing-and-clicking for the most part as described <a href="http://www.codeproject.com/Articles/8196/Config-the-Server-SMTP-IIS-to-send-Mail">here</a>. &nbsp;In no time at all, the SMTP service was up and running!<img src="http://feeds.feedburner.com/~r/DickChiangBlog/~4/fMVoiP50hhY" height="1" width="1" alt=""/>Dick Chianghttp://www.blogger.com/profile/04862303484551521898noreply@blogger.com0http://dickchiang.blogspot.com/2012/12/installing-microsoft-smtp-on-iis.htmltag:blogger.com,1999:blog-1154339993225650702.post-75401832805925390542012-12-20T10:25:00.001+08:002012-12-20T10:25:20.889+08:00Sending Email via GMail SMTP using C#I recently availed of a cloud server over at <a href="http://www.rackspace.com/">Rackspace</a>. &nbsp;Since the company does not provide a public SMTP server for their clients, I &nbsp;had two options -- install my own or, as my brother-in-law suggested, use GMail for outgoing SMTP. &nbsp;The latter sounded a lot more appealing as maintaining an SMTP server is not a simple task.<br /><br />I searched around the Internet for sample code and it turned out to be much simpler than I expected with .NET because the System.Net.Mail class structure already has all the stuffs needed to implement the security stuffs. &nbsp;It just looks something like this:<br /><br /><code>System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient();<br />client.Host = "smtp.gmail.com";<br />client.Port = 587;<br />client.EnableSsl = true;<br />client.Credentials = new System.Net.NetworkCredential("dick.chiang@gmail.com", "mypassword");<br /><br />System.Net.Mail.MailAddress from = new System.Net.Mail.MailAddress("dick.chiang@gmail.com", "Dick Chiang");<br />System.Net.Mail.MailAddress to = new System.Net.Mail.MailAddress("someguy@yahoo.com");<br />System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(from, to);<br />message.Subject = "Sample GMail Message";<br />message.Body = "Hello world from GMail!";<br />client.Send(message);<br /></code><img src="http://feeds.feedburner.com/~r/DickChiangBlog/~4/WDMHjKMrJpE" height="1" width="1" alt=""/>Dick Chianghttp://www.blogger.com/profile/04862303484551521898noreply@blogger.com0http://dickchiang.blogspot.com/2012/12/sending-email-via-gmail-smtp-using-c.htmltag:blogger.com,1999:blog-1154339993225650702.post-45060700915967075342012-12-12T09:53:00.001+08:002012-12-12T09:53:11.195+08:00Telnet Client for Windows 7 and 2008 R2I've been trying to debug something for the past couple of days and I just realized that Windows 7 does not have a telnet client installed by default unlike previous versions of Windows (dating back to version 3.11 as I recall). &nbsp;Doing a quick Google research, I found out it can be installed by doing the following:<br /><div><ol class="ordered" style="font-family: 'Segoe UI', Verdana, Arial; font-size: 13px;"><li style="list-style-image: none;">Click&nbsp;<strong>Start</strong>, and then click&nbsp;<strong>Control Panel</strong>.</li><li style="list-style-image: none;">On the&nbsp;<strong>Control Panel Home</strong>&nbsp;page, click&nbsp;<strong>Programs</strong>.</li><li style="list-style-image: none;">In the&nbsp;<strong>Programs and Features</strong>&nbsp;section, click&nbsp;<strong>Turn Windows features on or off</strong>.</li><li style="list-style-image: none;">If the&nbsp;<strong>User Account Control</strong>&nbsp;dialog box appears, confirm that the action it displays is what you want, and then click&nbsp;<strong>Continue</strong>.</li><li style="list-style-image: none;">In the&nbsp;<strong>Windows Features</strong>&nbsp;list, select&nbsp;<strong>Telnet Client</strong>, and then click&nbsp;<strong>OK</strong>.</li></ol></div>Windows 2008 R2 also does not have it installed by default. &nbsp;The following instructions seem to do the trick:<br /><br /><ol class="ordered" style="font-family: 'Segoe UI', Verdana, Arial; font-size: 13px;"><li style="list-style-image: none;">Start Server Manager. Click&nbsp;<strong>Start</strong>, right-click&nbsp;<strong>Computer</strong>, and then click&nbsp;<strong>Manage</strong>.</li><li style="list-style-image: none;">If the&nbsp;<strong>User Account Control</strong>&nbsp;dialog box appears, confirm that the action it displays is what you want, and then click&nbsp;<strong>Continue</strong>.</li><li style="list-style-image: none;">In the&nbsp;<strong>Features Summary</strong>&nbsp;section, click&nbsp;<strong>Add features</strong>.</li><li style="list-style-image: none;">In the&nbsp;<strong>Add Features Wizard</strong>, select&nbsp;<strong>Telnet Client</strong>, and then click&nbsp;<strong>Next</strong>.</li><li style="list-style-image: none;">On the&nbsp;<strong>Confirm Installation Options</strong>&nbsp;page, click&nbsp;<strong>Install</strong>.</li><li style="list-style-image: none;">When installation finishes, on the&nbsp;<strong>Installation Results</strong>&nbsp;page, click&nbsp;<strong>Close</strong>.</li></ol><img src="http://feeds.feedburner.com/~r/DickChiangBlog/~4/rOM63B_JTDc" height="1" width="1" alt=""/>Dick Chianghttp://www.blogger.com/profile/04862303484551521898noreply@blogger.com0http://dickchiang.blogspot.com/2012/12/telnet-client-for-windows-7-and-2008-r2.htmltag:blogger.com,1999:blog-1154339993225650702.post-17564487413285580242012-11-18T19:58:00.001+08:002012-11-18T19:58:39.171+08:00More on Finding Large GMail AttachmentsI previously mentioned this great tool called <a href="http://dickchiang.blogspot.com/2011/06/cleaning-up-my-gmail.html">FindBigMail</a> which scours through your GMail inbox and tag all large attachments. &nbsp;While the service is free for personal use, you &nbsp;have to pay to use it for GMail for Domains accounts (aka. Corporate GMail).<br /><br />But thankfully, it looks like the GMail engineers picked up some ideas and implemented the size search within GMail itself. &nbsp;Try typing "size:10m" or "larger:10m" to find emails larger than 10MB.<br /><br />Aside from the "before:yyyy-mm-dd" date search filter, you can now also type something like "older_than:1y" to retrieve email more than a year old. &nbsp;By mixing this with the "size" search filter, you can now search for old, large email and delete them to free up space!<br /><br /><img src="http://feeds.feedburner.com/~r/DickChiangBlog/~4/UiAEpumzcDU" height="1" width="1" alt=""/>Dick Chianghttp://www.blogger.com/profile/04862303484551521898noreply@blogger.com0http://dickchiang.blogspot.com/2012/11/more-on-finding-large-gmail-attachments.htmltag:blogger.com,1999:blog-1154339993225650702.post-7761276065190489872012-11-01T18:55:00.000+08:002012-11-01T18:55:00.779+08:00Halloween 2012The three kids went out trick-or-treating (well, Conner just stayed inside the car the whole time).<br /><br /><table style="width: 194px;"><tbody><tr><td align="center" style="background: url(https://picasaweb.google.com/s/c/transparent_album_background.gif) no-repeat left; height: 194px;"><a href="https://picasaweb.google.com/100962126709455809716/Halloween2012?authuser=0&amp;feat=embedwebsite"><img height="160" src="https://lh6.googleusercontent.com/-MRErdNnruH8/UJIjFuGinrE/AAAAAAAALw8/JWQQ5oCpuaA/s160-c/Halloween2012.jpg" style="margin: 1px 0 0 4px;" width="160" /></a></td></tr><tr><td style="font-family: arial,sans-serif; font-size: 11px; text-align: center;"><a href="https://picasaweb.google.com/100962126709455809716/Halloween2012?authuser=0&amp;feat=embedwebsite" style="color: #4d4d4d; font-weight: bold; text-decoration: none;">Halloween 2012</a></td></tr></tbody></table><img src="http://feeds.feedburner.com/~r/DickChiangBlog/~4/GFIT_Wy8GhI" height="1" width="1" alt=""/>Dick Chianghttp://www.blogger.com/profile/04862303484551521898noreply@blogger.com0http://dickchiang.blogspot.com/2012/11/halloween-2012.htmltag:blogger.com,1999:blog-1154339993225650702.post-19128713681911933792012-10-12T22:52:00.003+08:002012-10-12T22:52:51.658+08:00Possessive NounI previously thought making a noun into possessive form was as simple as adding an apostrophe-s ('s) if it does not end with an "s", and just a simple apostrophe if it does. &nbsp;I was tutoring my Grade 4 daughter on possessive nouns last night and I was surprised at all the other rules.<br /><br />Rule #1 - If the noun is common and singular, always put apostrophe-s -- even if the noun already ends with an "s" already. So for example, you should say "princess's gown" instead of "princess' gown".<br /><br />Rule #2 - If the noun is proper and single syllable, always put an apostrophe-s also except if the word following it starts with an "s". &nbsp;For example, its "James's car", but "Kris' shoes".<br /><br />Rule #3 - If the noun is proper and multi-syllable, then you follow the standard rule of apostrophe-s if it does not end with an "s", and just apostrophe if it does.<br /><br />Wow! &nbsp;I learned something new from 4th grade!<img src="http://feeds.feedburner.com/~r/DickChiangBlog/~4/_32FvNcZ2FE" height="1" width="1" alt=""/>Dick Chianghttp://www.blogger.com/profile/04862303484551521898noreply@blogger.com0http://dickchiang.blogspot.com/2012/10/possessive-noun.htmltag:blogger.com,1999:blog-1154339993225650702.post-51435471019180626642012-09-29T17:45:00.002+08:002012-09-29T17:51:12.696+08:00Preserving State Between Web Server InstancesOne of my web site applications has been giving me headaches. &nbsp;Every few days, I would encounter an incident when one of the user session seem to lockout the application causing other users to time out. &nbsp;I used Microsoft IIS' application pool function to separate it from the other apps running on the same server so I can easily restart its pool without affecting the others. &nbsp;But still, having to restart the pool every so often is a chore.<br /><br />I decided to spread out the load to several threads by initially setting up a <b>Web Garden</b>. &nbsp;A Web Garden uses multiple worker processes and uses a queue manager to process incoming requests to the application pool. &nbsp;Unlike a Web Farm, which comprises of multiple web servers, a Web Garden just uses multiple worker threads in the same multi-CPU server.<br /><br />The problem I encountered with running apps in a web garden is that values stored in Session variables are local to the worker thread that was assigned to it. &nbsp;So if IIS decide to send you to a different worker thread in subsequent requests, the Session variables used in the other worker thread will completely disappear. &nbsp;I thought of using ViewState at first so that the values are stored on the client side and just passed back on every request. &nbsp;Unfortunately, ViewStates only seem to work for postbacks to the same URL. &nbsp;Once the URL changes, the previous ViewState value is also gone.<br /><br />I found this interesting article on <a href="http://www.primaryobjects.com/CMS/Article124.aspx">how to use OutOfProc Session State servers</a>. &nbsp;By using the <i>StateServer</i> instance, one can save session variables between apps or even between servers. &nbsp;Its not as robust as the <i>SQLServer</i> solution, but its relatively lower overhead. &nbsp;One only need to add the following lines in the web.config's system.web<system .web=".web">&nbsp;section:</system><br /><br /><pre style="background-color: #f3f3f3; font-family: Consolas, 'Courier New', Courier, monospace; font-size: 12px;"><pre class="csharpcode" style="font-family: Consolas, 'Courier New', Courier, monospace;"><br /></pre><pre class="csharpcode" style="font-family: Consolas, 'Courier New', Courier, monospace;">&lt; sessionState mode="stateserver" stateConnectionString="tcpip=127.0.0.1:42424" /&gt;</pre></pre><br />Will be observing if performance improves with this modest adjustment on the design.<img src="http://feeds.feedburner.com/~r/DickChiangBlog/~4/KGDZIT9F5KY" height="1" width="1" alt=""/>Dick Chianghttp://www.blogger.com/profile/04862303484551521898noreply@blogger.com1http://dickchiang.blogspot.com/2012/09/preserving-state-between-web-server.html