<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-24582276</id><updated>2024-09-02T13:12:17.975+08:00</updated><category term="programming"/><category term="dotnet"/><category term="microsoft"/><category term="javascript"/><category term="IT news"/><category term="c#"/><category term="windows"/><category term="ajax"/><category term="internet explorer"/><category term="open source"/><category term="programming tools"/><category term="visual studio"/><category term="iis"/><category term="vb6"/><category term="acrobat"/><category term="activex"/><category term="azure"/><category term="multithreading"/><category term="obfuscator"/><category term="office 2007"/><category term="pdf"/><category term="sql"/><category term="wcf"/><category term="xml"/><category term="xpath"/><title type='text'>Alexis&#39; Blog</title><subtitle type='html'>main(k){float i,j,r,x,y=-16;&#xa;while(puts(&quot;&quot;),y++&lt;15)&#xa;for(x=0;x++&lt;84;putchar(&quot;.:-;!/&gt;)|&amp;IH%*#&quot;[k&amp;15]))&#xa;for(i=k=r=0;j=r*r-i*i-2+x/25,i=2*r*i+y/10,&#xa;j*j+i*i&lt;11&amp;&amp;k++&lt;111;r=j);}/* Mandelbrot in ASCII. */</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://alexrazon.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default?alt=atom'/><link rel='alternate' type='text/html' href='http://alexrazon.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default?alt=atom&amp;start-index=26&amp;max-results=25'/><author><name>Alex</name><uri>http://www.blogger.com/profile/10741593274002428818</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://i28.photobucket.com/albums/c233/aluxious/alexpsce.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>48</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-24582276.post-1858095310180674620</id><published>2012-07-16T10:32:00.000+08:00</published><updated>2012-07-16T10:33:03.268+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="dotnet"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="programming tools"/><title type='text'>Finding All System Timezones Installed in a Computer</title><content type='html'>&lt;pre style=&quot;background: white; color: black; font-family: Consolas;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt;&amp;nbsp;zones&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;TimeZoneInfo&lt;/span&gt;.GetSystemTimeZones();
&lt;span style=&quot;color: #2b91af;&quot;&gt;Console&lt;/span&gt;.WriteLine(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;The&amp;nbsp;local&amp;nbsp;system&amp;nbsp;has&amp;nbsp;the&amp;nbsp;following&amp;nbsp;{0}&amp;nbsp;time&amp;nbsp;zones&quot;&lt;/span&gt;,&amp;nbsp;zones.Count);
&lt;span style=&quot;color: blue;&quot;&gt;foreach&lt;/span&gt;&amp;nbsp;(&lt;span style=&quot;color: #2b91af;&quot;&gt;TimeZoneInfo&lt;/span&gt;&amp;nbsp;zone&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;in&lt;/span&gt;&amp;nbsp;zones)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;Console&lt;/span&gt;.WriteLine(zone.Id);&lt;/pre&gt;
&lt;div style=&quot;background: white; color: black; font-family: Consolas;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; color: black; font-family: Consolas;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Reference:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; color: black; font-family: Consolas;&quot;&gt;
&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.timezoneinfo.id.aspx&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;http://msdn.microsoft.com/en-us/library/system.timezoneinfo.id.aspx&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://alexrazon.blogspot.com/feeds/1858095310180674620/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/24582276/1858095310180674620' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/1858095310180674620'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/1858095310180674620'/><link rel='alternate' type='text/html' href='http://alexrazon.blogspot.com/2012/07/finding-all-system-timezones-installed.html' title='Finding All System Timezones Installed in a Computer'/><author><name>Alex</name><uri>http://www.blogger.com/profile/10741593274002428818</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://i28.photobucket.com/albums/c233/aluxious/alexpsce.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24582276.post-340099007786106652</id><published>2012-06-08T18:01:00.000+08:00</published><updated>2012-07-16T10:33:31.476+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="programming tools"/><title type='text'>Howl: Growl Your App</title><content type='html'>I recently stumbled upon &lt;a href=&quot;http://howlapp.com/&quot; target=&quot;_blank&quot;&gt;Howl,&lt;/a&gt; which is an app used to push &lt;a href=&quot;http://growl.info/&quot; target=&quot;_blank&quot;&gt;Growl&lt;/a&gt; notifications to your iOS device. It is a great way to get notified with information about your Mac (or &lt;a href=&quot;http://www.growlforwindows.com/&quot; target=&quot;_blank&quot;&gt;PC&lt;/a&gt;) events.&lt;br /&gt;
&lt;br /&gt;
Another use&amp;nbsp;of Howl is instant error notifications. It works well with&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/elmah/&quot; target=&quot;_blank&quot;&gt;Elmah&lt;/a&gt;, which is a good logging system for Asp.NET applications. Elmah supports &lt;em&gt;errorTweet&lt;/em&gt;--with the name coming from, you guess it, Twitter, back when it&amp;nbsp;used to support basic authentication. But really, Elmah can post logs to any URL that supports basic authentication. You have to enable this feature in Elmah first, of course. More details &lt;a href=&quot;http://code.google.com/p/elmah/wiki/HowlingErrors&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;&amp;nbsp;(this is where I get my inspiration from as well).&lt;br /&gt;
&lt;br /&gt;
This blog post is mainly focused on how to submit notifications to the Howl service programmatically. Accomplishing this task via webforms is easy--just create a form with the required inputs, supply your credentials when asked, then voila! &lt;br /&gt;
&lt;br /&gt;
To do this programmatically via C#, you need to reference the &lt;a href=&quot;http://howlapp.com/interface.html&quot; target=&quot;_blank&quot;&gt;Howl API&lt;/a&gt;. It is also assumed that you have a Howl account. The code then is as follows:&lt;br /&gt;
&lt;br /&gt;
1. Create the WebRequest:&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;String&lt;/span&gt;&lt;/span&gt; url = &lt;span style=&quot;color: #a31515;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;@&quot;https://howlapp.com/public/api/notification&quot;&lt;/span&gt;&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;WebRequest&lt;/span&gt;&lt;/span&gt; req = &lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;WebRequest&lt;/span&gt;&lt;/span&gt;.Create(url);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;            req.Method = &lt;span style=&quot;color: #a31515;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;POST&quot;&lt;/span&gt;&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;            req.ContentType = &lt;span style=&quot;color: #a31515;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;application/x-www-form-urlencoded&quot;&lt;/span&gt;&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;            req.Headers.Add(&lt;span style=&quot;color: #a31515;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Keep-Alive: 300&quot;&lt;/span&gt;&lt;/span&gt;); &lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;//optional&lt;/span&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
2. Set the credentials:&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;CredentialCache&lt;/span&gt;&lt;/span&gt; cre = &lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;CredentialCache&lt;/span&gt;&lt;/span&gt;();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;
cre.Add(&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Uri&lt;/span&gt;&lt;/span&gt;(url), &lt;span style=&quot;color: #a31515;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Basic&quot;&lt;/span&gt;&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;NetworkCredential&lt;/span&gt;&lt;/span&gt;(username, password));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;

&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;ASCIIEncoding&lt;/span&gt;&lt;/span&gt; encoding = &lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;ASCIIEncoding&lt;/span&gt;&lt;/span&gt;();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;byte&lt;/span&gt;&lt;/span&gt;[] data = encoding.GetBytes(username + &lt;span style=&quot;color: #a31515;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;:&quot;&lt;/span&gt;&lt;/span&gt; + password); &lt;span style=&quot;color: green;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;// notice the format&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;

&lt;/span&gt;&lt;/span&gt;req.Credentials = cre;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;&lt;span style=&quot;color: green; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;// there&#39;s a space after &#39;Basic &#39;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;req.Headers.Add(&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Authorization&quot;&lt;/span&gt;&lt;/span&gt;, &lt;span style=&quot;color: #a31515;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Basic &quot;&lt;/span&gt;&lt;/span&gt; + &lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Convert&lt;/span&gt;&lt;/span&gt;.ToBase64String(data));&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
3. Write the form data (supply details in the string here):&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt;&lt;/span&gt; (&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;StreamWriter&lt;/span&gt;&lt;/span&gt; sw = &lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;StreamWriter&lt;/span&gt;&lt;/span&gt;(req.GetRequestStream()))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;            {&lt;br /&gt;
                sw.Write(&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;String&lt;/span&gt;&lt;/span&gt;.Format(&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #a31515;&quot;&gt;&lt;span style=&quot;color: #a31515; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&quot;name=Test;title=Test%20Push;description={0}&amp;amp;application=TestApp&amp;amp;icon-name=msn&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;                    , &lt;span style=&quot;color: #a31515;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Some Info&quot;&lt;/span&gt;&lt;/span&gt;));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;            }&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
4. Send the request and read the response:&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;WebResponse&lt;/span&gt;&lt;/span&gt; response = req.GetResponse();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt;&lt;/span&gt; (&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;StreamReader&lt;/span&gt;&lt;/span&gt; reader = &lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;StreamReader&lt;/span&gt;&lt;/span&gt;(response.GetResponseStream()))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&lt;/span&gt; tmp = reader.ReadToEnd();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;                Response.Write(tmp);&lt;br /&gt;
            }&lt;br /&gt;
            Response.End();&lt;/span&gt;
&lt;br /&gt;
The JSON response should look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Times, &amp;quot;Times New Roman&amp;quot;, serif;&quot;&gt;{&quot;payload&quot;:{&quot;notification_sent&quot;:true},&quot;status&quot;:&quot;ok&quot;}&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, you&#39;ll receive the notification in your device.</content><link rel='replies' type='application/atom+xml' href='http://alexrazon.blogspot.com/feeds/340099007786106652/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/24582276/340099007786106652' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/340099007786106652'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/340099007786106652'/><link rel='alternate' type='text/html' href='http://alexrazon.blogspot.com/2012/06/howl-growl-your-app.html' title='Howl: Growl Your App'/><author><name>Alex</name><uri>http://www.blogger.com/profile/10741593274002428818</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://i28.photobucket.com/albums/c233/aluxious/alexpsce.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24582276.post-7946391653415513823</id><published>2012-05-20T12:41:00.000+08:00</published><updated>2012-05-20T12:41:50.145+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="azure"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="microsoft"/><category scheme="http://www.blogger.com/atom/ns#" term="sql"/><title type='text'>Migrating SQL database to SQL Azure</title><content type='html'>&lt;i&gt;*** Note that the Azure SQL is a &lt;/i&gt;subset &lt;i&gt;of the actual SQL Server database engine. Before proceeding, you might want to read up on some&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/windowsazure/ee336245.aspx&quot;&gt;general guidelines&lt;/a&gt;.&lt;/i&gt;
&lt;br /&gt;
&lt;br /&gt;
If you have an existing SQL Server Database that you need to migrate to the cloud (Azure, that is), follow these steps:&lt;br /&gt;
&lt;br /&gt;
First, generate the SQL script using the Generate Scripts Wizard.&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;In Object Explorer, right-click on the database then select Tasks. Click on Generate Scripts.&lt;/li&gt;
&lt;li&gt;When the wizard dialog pops up, click Next and you will be directed to select which object you want to back up. You can select the entire database (via the &lt;i&gt;Script entire database and all database objects&lt;/i&gt; option), or just parts of it (e.g. tables, stored procedures, etc.). Click Next.&lt;/li&gt;
&lt;li&gt;In the Set Scripting Options screen, set the following:&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Output type: Save Script&lt;/li&gt;
&lt;li&gt;Save to file: Single File, then choose where to save the script. Click Advanced.&lt;/li&gt;
&lt;li&gt;Advanced Options:&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Convert UDDTs to Base Types = True&lt;/li&gt;
&lt;li&gt;Types of data to script = Schema and data&lt;/li&gt;
&lt;li&gt;Script for the database engine type = &quot;SQL Azure Database&quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;li&gt;Click OK all the way to generate the script.&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
When the script is ready, switch to your Azure database. First, you need to make sure that the database is existing. If it isn&#39;t, create it first. If you&#39;re migrating an entire database, you may need to drop it first before overwriting. Otherwise, if you need to maintain the existing data, it will be a different story altogether. For the purposes of this guide, we are only concerned with a newly-created database.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
You can migrate the script you have just created in two ways:&lt;/div&gt;
&lt;div&gt;
&lt;ol&gt;
&lt;li&gt;Using SSMS, you can login to your SQL Azure database and run your script from there.&lt;/li&gt;
&lt;li&gt;Using SQL Azure Management Portal, you can open you script from there as well.
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkl1dxiQptyt_vWSd9d045iDKKjrUDbpWgT_hYI8HwtTR9vo5LwQVj4o2TATy2e0PkLmAI-2CoM3TRr2TCfegcDFAcOuB98YpKyYGtcca9QPF5qoCscSH2eXYRGIF0frFddn4S/s1600/azuresql.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkl1dxiQptyt_vWSd9d045iDKKjrUDbpWgT_hYI8HwtTR9vo5LwQVj4o2TATy2e0PkLmAI-2CoM3TRr2TCfegcDFAcOuB98YpKyYGtcca9QPF5qoCscSH2eXYRGIF0frFddn4S/s1600/azuresql.PNG&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://alexrazon.blogspot.com/feeds/7946391653415513823/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/24582276/7946391653415513823' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/7946391653415513823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/7946391653415513823'/><link rel='alternate' type='text/html' href='http://alexrazon.blogspot.com/2012/05/migrating-sql-database-to-sql-azure.html' title='Migrating SQL database to SQL Azure'/><author><name>Alex</name><uri>http://www.blogger.com/profile/10741593274002428818</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://i28.photobucket.com/albums/c233/aluxious/alexpsce.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkl1dxiQptyt_vWSd9d045iDKKjrUDbpWgT_hYI8HwtTR9vo5LwQVj4o2TATy2e0PkLmAI-2CoM3TRr2TCfegcDFAcOuB98YpKyYGtcca9QPF5qoCscSH2eXYRGIF0frFddn4S/s72-c/azuresql.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24582276.post-770115030719265089</id><published>2012-03-02T10:42:00.002+08:00</published><updated>2012-03-02T10:45:12.797+08:00</updated><title type='text'>Getting SID</title><content type='html'>Here&#39;s a simple VBScript to get the &lt;a href=&quot;http://en.wikipedia.org/wiki/Security_Identifier&quot;&gt;Security Identifier&lt;/a&gt; of a local/domain user:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;strComputer = &quot;.&quot;Set objWMIService = GetObject(&quot;winmgmts:\\&quot; &amp;amp;&lt;br /&gt;strComputer &amp;amp; &quot;\root\cimv2&quot;)Set objAccount = objWMIService.Get&lt;br /&gt;_   &lt;br /&gt;(&quot;Win32_UserAccount.Name=&#39;myLogin&#39;,Domain=&#39;myDomain&#39;&quot;)Wscript.Echo&lt;br /&gt;objAccount.SID&lt;br /&gt;&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://alexrazon.blogspot.com/feeds/770115030719265089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/24582276/770115030719265089' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/770115030719265089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/770115030719265089'/><link rel='alternate' type='text/html' href='http://alexrazon.blogspot.com/2012/03/getting-sid.html' title='Getting SID'/><author><name>Alex</name><uri>http://www.blogger.com/profile/10741593274002428818</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://i28.photobucket.com/albums/c233/aluxious/alexpsce.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24582276.post-6965024067614787656</id><published>2009-06-15T13:34:00.002+08:00</published><updated>2009-06-15T13:41:50.385+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="dotnet"/><category scheme="http://www.blogger.com/atom/ns#" term="multithreading"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><title type='text'>MessageBox MultiThreading</title><content type='html'>In one of my WinForms projects, I needed to show a MessageBox dialog. Given the architecture of the program, showing a MessageBox would freeze the window. The user would have to press the &#39;Alt&#39; key from the parent window to show the MessageBox, and click OK.&lt;br /&gt;&lt;br /&gt;As a solution, I multithread the calling of MessageBox.Show(). Nothing new here, but it works.</content><link rel='replies' type='application/atom+xml' href='http://alexrazon.blogspot.com/feeds/6965024067614787656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/24582276/6965024067614787656' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/6965024067614787656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/6965024067614787656'/><link rel='alternate' type='text/html' href='http://alexrazon.blogspot.com/2009/06/messagebox-multithreading.html' title='MessageBox MultiThreading'/><author><name>Alex</name><uri>http://www.blogger.com/profile/10741593274002428818</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://i28.photobucket.com/albums/c233/aluxious/alexpsce.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24582276.post-55043693394839330</id><published>2009-03-09T14:35:00.009+08:00</published><updated>2009-03-09T14:58:42.919+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="microsoft"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="visual studio"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>Quick Update plus Weird VS2005 Error</title><content type='html'>Quick Update: I moved on to another company since a couple of months ago. Had no time to update this blog for almost a year!&lt;br /&gt;&lt;br /&gt;Now, the weird error: I wasn&#39;t able to do searches in VS2005. Many of you may have already encountered this error, and I&#39;ve encountered this a few times already. Thus, I am writing this down so I won&#39;t have to google my solution again.&lt;br /&gt;&lt;br /&gt;The error in the Find Results window was:&lt;br /&gt;&lt;em&gt;“No files were found to look in. Find was stopped in progress.”&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Apparently the solution was to press &lt;strong&gt;Ctrl-Scroll Lock&lt;/strong&gt;. This is the most difficult solution to find without the internet!&lt;br /&gt;&lt;br /&gt;Microsoft has a &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/z613zk0e(VS.80).aspx&quot;&gt;fancier solution&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://alexrazon.blogspot.com/feeds/55043693394839330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/24582276/55043693394839330' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/55043693394839330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/55043693394839330'/><link rel='alternate' type='text/html' href='http://alexrazon.blogspot.com/2009/03/quick-update-plus-weird-vs2005-error.html' title='Quick Update plus Weird VS2005 Error'/><author><name>Alex</name><uri>http://www.blogger.com/profile/10741593274002428818</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://i28.photobucket.com/albums/c233/aluxious/alexpsce.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24582276.post-4555505623348654684</id><published>2008-04-09T14:02:00.003+08:00</published><updated>2008-04-09T14:24:32.458+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="dotnet"/><category scheme="http://www.blogger.com/atom/ns#" term="obfuscator"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="programming tools"/><category scheme="http://www.blogger.com/atom/ns#" term="visual studio"/><title type='text'>Free .Net Obfuscator</title><content type='html'>I&#39;ve stumbled upon a &lt;a href=&quot;http://www.foss.kharkov.ua/g1/projects/eazfuscator/dotnet/&quot;&gt;free .Net obfuscator&lt;/a&gt;--Eazfuscator.NET. So far, it works well for my purposes. Most obfuscators are costly--ranging from $200 to $2000! But this one is freeware and it works better than the free one bundled with Visual Studio 2005.&lt;br /&gt;&lt;br /&gt;It is free and easy to use!</content><link rel='replies' type='application/atom+xml' href='http://alexrazon.blogspot.com/feeds/4555505623348654684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/24582276/4555505623348654684' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/4555505623348654684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/4555505623348654684'/><link rel='alternate' type='text/html' href='http://alexrazon.blogspot.com/2008/04/free-net-obfuscator.html' title='Free .Net Obfuscator'/><author><name>Alex</name><uri>http://www.blogger.com/profile/10741593274002428818</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://i28.photobucket.com/albums/c233/aluxious/alexpsce.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24582276.post-116070977329410159</id><published>2008-04-08T20:00:00.004+08:00</published><updated>2008-04-08T21:18:46.628+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="acrobat"/><category scheme="http://www.blogger.com/atom/ns#" term="activex"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="dotnet"/><category scheme="http://www.blogger.com/atom/ns#" term="microsoft"/><category scheme="http://www.blogger.com/atom/ns#" term="pdf"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="visual studio"/><title type='text'>Printing PDF Using WebBrowser Control in .Net 2.0</title><content type='html'>Okay, after almost a year and an offshore assignment, I finally had a chance to update this blog.&lt;br /&gt;&lt;br /&gt;I was developing a .Net 2.0 C# windows application wherein I basically have to print &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_0&quot;&gt;PDF&lt;/span&gt; files from a Windows application. I tried to use the Adobe Acrobat Reader &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_1&quot;&gt;ActiveX&lt;/span&gt; object embedded in my form to preview and print &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_2&quot;&gt;PDF&lt;/span&gt; documents. It worked fine; I just have to import the COM component and Visual Studio will do most of the &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_3&quot;&gt;Interop&lt;/span&gt; work for me. I then have to locate the file and load it to the &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_4&quot;&gt;AxAcroPDF&lt;/span&gt; control:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_5&quot;&gt;axAcroPDF&lt;/span&gt;1.&lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_6&quot;&gt;LoadFile&lt;/span&gt;(&lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_7&quot;&gt;pdfFileName&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;I&#39;d then delete the &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_8&quot;&gt;PDF&lt;/span&gt; file immediately afterwards to somehow obscure it from the user. The &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_9&quot;&gt;ActiveX&lt;/span&gt; object seems to save it in memory such that I can make a call like:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;blockquote&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_10&quot;&gt;axAcroPDF&lt;/span&gt;1.Print();&lt;/span&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;...and all went smoothly. But when I ran it on another machine with the most recent version of Acrobat (8.1.2), I got an E_&lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_11&quot;&gt;NOINTERFACE&lt;/span&gt; exception. After much research, I then decided to use a &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_12&quot;&gt;WebBrowser&lt;/span&gt; .Net 2.0 control instead. Thus, my codes looked like so:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;blockquote&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_13&quot;&gt;webBrowser&lt;/span&gt;1.Navigate(&lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_14&quot;&gt;pdfFileName&lt;/span&gt;);&lt;/span&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;...assuming of course that the user has a &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_15&quot;&gt;PDF&lt;/span&gt; reader installed and integrated into his web browser. This is a much easier alternative than to using &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_16&quot;&gt;unmanaged&lt;/span&gt; code. However, it does not go away without problems. When I try to call:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;blockquote&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_17&quot;&gt;webBrowser&lt;/span&gt;1.Print();&lt;/span&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I get nothing. I can&#39;t seem to force the browser to print its &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_18&quot;&gt;PDF&lt;/span&gt; contents. To keep the long story short, I had to tinker with the underlying &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_19&quot;&gt;ActiveX&lt;/span&gt; object of the &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_20&quot;&gt;WebBrowser&lt;/span&gt; control. First, I needed a reference to &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_21&quot;&gt;shdocvw&lt;/span&gt;.&lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_22&quot;&gt;dll&lt;/span&gt; (windows system32 directory). Then, I did something like:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;blockquote&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;object n = null;     &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;&lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_23&quot;&gt;SHDocVw&lt;/span&gt;.&lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_24&quot;&gt;WebBrowser&lt;/span&gt; &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_25&quot;&gt;wb&lt;/span&gt; = (SHDocVw.WebBrowser)webBrowser1.ActiveXInstance; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;wb.ExecWB(OLECMDID.OLECMDID_PRINT&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;      , &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_26&quot;&gt;OLECMDEXECOPT&lt;/span&gt;.&lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_27&quot;&gt;OLECMDEXECOPT&lt;/span&gt;_&lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_28&quot;&gt;PROMPTUSER&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;      , ref n&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;      , ref n);&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;br /&gt;It worked! (&lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/bb159690.aspx&quot;&gt;&lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_29&quot;&gt;MSDN&lt;/span&gt; says&lt;/a&gt; that the two pointers are optional so I just put null in there.)</content><link rel='replies' type='application/atom+xml' href='http://alexrazon.blogspot.com/feeds/116070977329410159/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/24582276/116070977329410159' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/116070977329410159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/116070977329410159'/><link rel='alternate' type='text/html' href='http://alexrazon.blogspot.com/2008/04/printing-pdf-using-webbrowser-control.html' title='Printing PDF Using WebBrowser Control in .Net 2.0'/><author><name>Alex</name><uri>http://www.blogger.com/profile/10741593274002428818</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://i28.photobucket.com/albums/c233/aluxious/alexpsce.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24582276.post-7262879292586919340</id><published>2007-07-27T22:13:00.000+08:00</published><updated>2007-07-27T22:23:19.762+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dotnet"/><category scheme="http://www.blogger.com/atom/ns#" term="microsoft"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="wcf"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>WCF</title><content type='html'>&lt;span style=&quot;font-family:trebuchet ms;&quot;&gt;This week I had a Windows Communications Foundation training from &lt;/span&gt;&lt;a href=&quot;http://www.develop.com/&quot;&gt;&lt;span style=&quot;font-family:trebuchet ms;&quot;&gt;Developmentor&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family:trebuchet ms;&quot;&gt;, sponsored by our company. I learned a lot about the new framework (dotnet 3.0) and communications. What interested me the most was the Day 4 topic which was Peer-to-peer applications. Although I might not be able to use it for regular business applications, I would be using it just for fun.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:trebuchet ms;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:trebuchet ms;&quot;&gt;Here is our instructor&#39;s (Scott Reed) del.icio.us link:&lt;/span&gt;&lt;br /&gt;&lt;a href=&quot;http://del.icio.us/mscottreed&quot;&gt;&lt;span style=&quot;font-family:trebuchet ms;&quot;&gt;http://del.icio.us/mscottreed&lt;/span&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://alexrazon.blogspot.com/feeds/7262879292586919340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/24582276/7262879292586919340' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/7262879292586919340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/7262879292586919340'/><link rel='alternate' type='text/html' href='http://alexrazon.blogspot.com/2007/07/wcf.html' title='WCF'/><author><name>Alex</name><uri>http://www.blogger.com/profile/10741593274002428818</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://i28.photobucket.com/albums/c233/aluxious/alexpsce.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24582276.post-499181230095165673</id><published>2007-02-06T16:04:00.000+08:00</published><updated>2007-02-06T16:22:01.138+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="internet explorer"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><title type='text'>Re: Do JavaScript after window.close()</title><content type='html'>There is a slight modification for &lt;a href=&quot;http://alexrazon.blogspot.com/2007/01/do-javascript-after-windowclose.html&quot;&gt;my previous post&lt;/a&gt;. The conditions for the if statement there is inadequate. The bug occurs when refreshing the browser when the mouse is beyond the leftmost side of the window, a valid yet unanticipated negative value for the X. This is evident especially for dual monitors--like what I am using. Thus the new conditions are as follow:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;if&lt;/span&gt; (window.&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;event&lt;/span&gt;.clientX &lt; &lt;span style=&quot;color: rgb(153, 0, 0);&quot;&gt;0&lt;/span&gt;&lt;br /&gt;&amp;&amp;amp; window.&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;event&lt;/span&gt;.clientY &lt; &lt;span style=&quot;color: rgb(153, 0, 0);&quot;&gt;0&lt;/span&gt;&lt;br /&gt;&amp;&amp;amp; (window.&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;event&lt;/span&gt;.clientX &lt; &lt;span style=&quot;color: rgb(153, 0, 0);&quot;&gt;-1000&lt;/span&gt; || window.&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;event&lt;/span&gt;.clientY &lt; &lt;span style=&quot;color: rgb(153, 0, 0);&quot;&gt;-1000&lt;/span&gt;)) {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt; &lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;//do closing routine...&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The 1000 value is a safe value for anticipating the event that we really expect--i.e. closing the window. Apparently, values lower than that seem to cause erroneous triggering.</content><link rel='replies' type='application/atom+xml' href='http://alexrazon.blogspot.com/feeds/499181230095165673/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/24582276/499181230095165673' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/499181230095165673'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/499181230095165673'/><link rel='alternate' type='text/html' href='http://alexrazon.blogspot.com/2007/02/re-do-javascript-after-windowclose.html' title='Re: Do JavaScript after window.close()'/><author><name>Alex</name><uri>http://www.blogger.com/profile/10741593274002428818</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://i28.photobucket.com/albums/c233/aluxious/alexpsce.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24582276.post-6712004604670239379</id><published>2007-02-06T15:45:00.000+08:00</published><updated>2007-02-06T16:03:52.983+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><title type='text'>Re: JavaScript Hashtable Implementation</title><content type='html'>This is in response to my previous post re &lt;a href=&quot;http://alexrazon.blogspot.com/2006/11/javascript-hashtable-implementation.html&quot;&gt;JavaScript Hashtable Implementation&lt;/a&gt;. I modified my code to be able to remove elements, as well as get an enumeration of the elements in cases wherein the keys are strings rather than integers.&lt;br /&gt;&lt;br /&gt;Here are the new members of the Hashtable object:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Methods:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;remove(string keyName)&lt;/span&gt;&lt;/span&gt; - Remove an element by key name&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;getAt(int index)&lt;/span&gt;&lt;/span&gt; - Get the value at the specified index&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;getEnum[int index]&lt;/span&gt;&lt;/span&gt; - Get the &lt;u&gt;key&lt;/u&gt; name at the specified index&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Properties:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;count&lt;/span&gt;&lt;/span&gt; - Get the number of elements of the Hashtable object&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;location&lt;/span&gt;&lt;/span&gt; - (&lt;span style=&quot;font-style: italic;&quot;&gt;deprecated&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;So, here&#39;s the new code:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;// create an instance of the hashtable object&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;function&lt;/span&gt; Hashtable(){&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;this&lt;/span&gt;.hash = &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;new &lt;/span&gt;Array();&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;this&lt;/span&gt;.keys = &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;new &lt;/span&gt;Array();&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;this&lt;/span&gt;.getEnum = &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;new &lt;/span&gt;Array();&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;this&lt;/span&gt;.count = &lt;span style=&quot;color: rgb(153, 0, 0);&quot;&gt;0&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;Hashtable.&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;prototype&lt;/span&gt;.hash = &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;null&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;Hashtable.&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;prototype&lt;/span&gt;.keys = &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;null&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;Hashtable.&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;prototype&lt;/span&gt;.count = &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;null&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;Hashtable.&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;prototype&lt;/span&gt;.getEnum = &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;null&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;// get the value at the specified index&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;Hashtable.&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;prototype&lt;/span&gt;.getAt = &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;function &lt;/span&gt;(index) {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;return this&lt;/span&gt;.hash[&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;this&lt;/span&gt;.getEnum[index]];&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;// get the corresponding value&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;Hashtable.&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;prototype&lt;/span&gt;.get = &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;function &lt;/span&gt;(key) {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;return this&lt;/span&gt;.hash[key];&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;Hashtable.&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;prototype&lt;/span&gt;.remove = &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;function &lt;/span&gt;(key) {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;    for&lt;/span&gt; (&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;var&lt;/span&gt; i = &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;this&lt;/span&gt;.keys.length - &lt;span style=&quot;color: rgb(153, 0, 0);&quot;&gt;1&lt;/span&gt;; i &gt;= &lt;span style=&quot;color: rgb(153, 0, 0);&quot;&gt;0&lt;/span&gt;; i--) {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;        if&lt;/span&gt; (&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;this&lt;/span&gt;.keys[i] == key) {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;            &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;this&lt;/span&gt;.keys.splice(i, &lt;span style=&quot;color: rgb(153, 0, 0);&quot;&gt;1&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;            &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;this&lt;/span&gt;.getEnum.splice(i, &lt;span style=&quot;color: rgb(153, 0, 0);&quot;&gt;1&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;            &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;this&lt;/span&gt;.hash[key] = &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;null&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;            &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;this&lt;/span&gt;.count = &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;this&lt;/span&gt;.keys.length;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;// create an entry in the hashtable&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;Hashtable.&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;prototype&lt;/span&gt;.put = &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;function&lt;/span&gt; (key, value) {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;    if&lt;/span&gt; (value == &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;null&lt;/span&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;        return null&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;    // create a new entry&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;    if&lt;/span&gt; (&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;this&lt;/span&gt;.hash[key] == &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;null&lt;/span&gt;) {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;        &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;this&lt;/span&gt;.keys[&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;this&lt;/span&gt;.keys.length] = key;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;        &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;this&lt;/span&gt;.count = &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;this&lt;/span&gt;.keys.length;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;        &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;this&lt;/span&gt;.getEnum[&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;this&lt;/span&gt;.count - &lt;span style=&quot;color: rgb(153, 0, 0);&quot;&gt;1&lt;/span&gt;]= key;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;    // set the value&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;this&lt;/span&gt;.hash[key] = value;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://alexrazon.blogspot.com/feeds/6712004604670239379/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/24582276/6712004604670239379' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/6712004604670239379'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/6712004604670239379'/><link rel='alternate' type='text/html' href='http://alexrazon.blogspot.com/2007/02/re-javascript-hashtable-implementation.html' title='Re: JavaScript Hashtable Implementation'/><author><name>Alex</name><uri>http://www.blogger.com/profile/10741593274002428818</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://i28.photobucket.com/albums/c233/aluxious/alexpsce.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24582276.post-4048745298459350041</id><published>2007-01-12T10:30:00.000+08:00</published><updated>2007-01-12T10:35:45.841+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iis"/><category scheme="http://www.blogger.com/atom/ns#" term="microsoft"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>IIS 5.1: 403.9 - Access Forbidden: Too many users are connected</title><content type='html'>I found &lt;a href=&quot;HTTP%20403.9%20-%20Access%20Forbidden:%20Too%20many%20users%20are%20connected&quot;&gt;this blog&lt;/a&gt; that addresses my concern in IIS 5.1 for Windows XP. I recently discovered that it is crippled in such a way that it only allows 10 concurrent connections. Moreover, it is hardcoded to be configured to at most 40.  If the maximum concurrent connections have been reached, your website&#39;s users will receive the following error:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;&lt;blockquote&gt;HTTP 403.9 - Access Forbidden: Too many users are connected&lt;/blockquote&gt;&lt;/span&gt;The workaround involves modifying the maximum allowable connections to 40. Still, you&#39;re stuck at 40.</content><link rel='replies' type='application/atom+xml' href='http://alexrazon.blogspot.com/feeds/4048745298459350041/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/24582276/4048745298459350041' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/4048745298459350041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/4048745298459350041'/><link rel='alternate' type='text/html' href='http://alexrazon.blogspot.com/2007/01/iis-51-4039-access-forbidden-too-many.html' title='IIS 5.1: 403.9 - Access Forbidden: Too many users are connected'/><author><name>Alex</name><uri>http://www.blogger.com/profile/10741593274002428818</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://i28.photobucket.com/albums/c233/aluxious/alexpsce.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24582276.post-6458984239003377162</id><published>2007-01-09T18:50:00.000+08:00</published><updated>2007-01-09T18:59:43.927+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ajax"/><category scheme="http://www.blogger.com/atom/ns#" term="internet explorer"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><title type='text'>Do JavaScript after window.close()</title><content type='html'>I needed to do some routines when a user has closed the window.  I do not want those routines to trigger when refreshing the page or unloading the document; I just need them to happen when the browser window is closed.&lt;br /&gt;&lt;br /&gt;This is the usual proposed solution: assign a function on the &lt;span style=&quot;font-weight: bold;font-family:courier new;&quot; &gt;onbeforeunload &lt;/span&gt;event of the body or window. The problem with this is it also triggers when refreshing or moving away from the page (i.e. back or forward). I stumbled upon a solution that proposes tapping the &lt;span style=&quot;font-weight: bold;font-family:courier new;&quot; &gt;onunload &lt;/span&gt;event instead. Thus, I have a function like this:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;function &lt;/span&gt;body_unload() {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;if &lt;/span&gt;(window.&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;event&lt;/span&gt;.clientX &lt; &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;0&lt;/span&gt;) {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;        alert(&lt;span style=&quot;color: rgb(153, 0, 0);&quot;&gt;&quot;The user is closing the window.&quot;&lt;/span&gt;);                            &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    } else {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;        alert(&lt;span style=&quot;color: rgb(153, 0, 0);&quot;&gt;&quot;The user is refreshing or navigating away.&quot;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    }        &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;}&lt;/span&gt;&lt;/blockquote&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;I then assign this to the &lt;span style=&quot;font-weight: bold;font-family:courier new;&quot; &gt;onunload &lt;/span&gt;event of the body. From there I could perform my JavaScript and/or AJAX routines.&lt;br /&gt;&lt;br /&gt;Although this works for my purposes, the main downside of this is that I cannot issue a confirm dialog. The page has been unloaded at this point.</content><link rel='replies' type='application/atom+xml' href='http://alexrazon.blogspot.com/feeds/6458984239003377162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/24582276/6458984239003377162' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/6458984239003377162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/6458984239003377162'/><link rel='alternate' type='text/html' href='http://alexrazon.blogspot.com/2007/01/do-javascript-after-windowclose.html' title='Do JavaScript after window.close()'/><author><name>Alex</name><uri>http://www.blogger.com/profile/10741593274002428818</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://i28.photobucket.com/albums/c233/aluxious/alexpsce.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24582276.post-2379979523102043143</id><published>2007-01-09T10:34:00.000+08:00</published><updated>2007-01-09T10:49:48.109+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="internet explorer"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><title type='text'>Javascript: How to close the browser window without the IE warning</title><content type='html'>In Internet Explorer, when you use window.close() in JavaScript to close the current browser window, you will be asked something like &quot;A script is attempting to close this window. Do you want to continue?&quot; As a programmer, this can be annoying if you are &lt;span style=&quot;font-style: italic;&quot;&gt;un&lt;/span&gt;-maliciously closing the window. A workaround to this would be setting the &lt;span style=&quot;font-weight: bold;font-family:courier new;&quot; &gt;window.opener&lt;/span&gt; property to something else.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;In your JavaScript, have something like:&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;function &lt;/span&gt;logoff() {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;if &lt;/span&gt;(confirm(&lt;span style=&quot;color: rgb(153, 0, 0);&quot;&gt;&quot;Do you want to log off?&quot;&lt;/span&gt;)) {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;        &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;window&lt;/span&gt;.opener = &quot;x&quot;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;        &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;window&lt;/span&gt;.close();&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then in your HTML, have a button or link that calls this JavaScript function onclick.</content><link rel='replies' type='application/atom+xml' href='http://alexrazon.blogspot.com/feeds/2379979523102043143/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/24582276/2379979523102043143' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/2379979523102043143'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/2379979523102043143'/><link rel='alternate' type='text/html' href='http://alexrazon.blogspot.com/2007/01/javascript-how-to-close-browser-window.html' title='Javascript: How to close the browser window without the IE warning'/><author><name>Alex</name><uri>http://www.blogger.com/profile/10741593274002428818</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://i28.photobucket.com/albums/c233/aluxious/alexpsce.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24582276.post-6944381549179868116</id><published>2006-12-14T20:01:00.000+08:00</published><updated>2006-12-14T20:19:07.633+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="microsoft"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>Access Control Lists</title><content type='html'>Ever had Windows XP crash? And worse comes to worse you had to reformat your PC and you need to back up your data? The BIG problem is: you can&#39;t access your folders! Well, here&#39;s a workaround I&#39;ve gathered around the net (that is yet to be personally tested). It is however assumed that you haven&#39;t encrypted (i.e. files with green filenames) your  files. That is &quot;irreversible&quot; and thus cannot be recovered.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;1. Use your drive as a slave drive in another computer. The master should have a Windows XP installed and the user logged on must have administrator rights. Let&#39;s say your data drive is D: while your system drive is C:.&lt;br /&gt;2. Open your trusty command prompt and type the following:&lt;br /&gt;&lt;div style=&quot;text-align: center; font-family: courier new;&quot;&gt;cacls [FOLDER or FILENAME] /E /P [USERNAME]:F&lt;/div&gt;where: FOLDER or FILENAME = the name of folder or filename to gain access to&lt;br /&gt;USERNAME = the currently logged-in user&#39;s Windows XP account name&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;CALCS &lt;/span&gt;is the command to display or modify &lt;a href=&quot;http://en.wikipedia.org/wiki/Access_control_list&quot;&gt;access control lists (ACLs)&lt;/a&gt; of files.&lt;br /&gt;/E            Edit ACL instead of replacing it.&lt;br /&gt;/P user:perm  Replace specified user&#39;s access rights.&lt;br /&gt;            Perm can be: N  None&lt;br /&gt;                         R  Read&lt;br /&gt;                         W  Write&lt;br /&gt;                         C  Change (write)&lt;br /&gt;                         F  Full control&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;3. To restore the ACL for that folder/file:&lt;br /&gt;&lt;div style=&quot;text-align: center; font-family: courier new;&quot;&gt;cacls [FOLDER or FILENAME] /E /R [USERNAME]&lt;/div&gt;&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://alexrazon.blogspot.com/feeds/6944381549179868116/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/24582276/6944381549179868116' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/6944381549179868116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/6944381549179868116'/><link rel='alternate' type='text/html' href='http://alexrazon.blogspot.com/2006/12/access-control-lists.html' title='Access Control Lists'/><author><name>Alex</name><uri>http://www.blogger.com/profile/10741593274002428818</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://i28.photobucket.com/albums/c233/aluxious/alexpsce.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24582276.post-3544337787998981438</id><published>2006-11-27T22:43:00.001+08:00</published><updated>2006-11-27T23:13:57.666+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dotnet"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><title type='text'>ArrayList sorting via IComparable</title><content type='html'>The problem: I have a two-dimensional object array. Each first level element of the array contains five object elements--except for the last one, which only has three. However, I have a procedure that needs to concatenate another array at the end of the original one. Since I need to put the unique three-element object array at the end of the list, I had to find a solution to sort it via the elements&#39; length.&lt;br /&gt;&lt;br /&gt;The immediate solution was to use ArrayList.Sort(IComparer). Okay I created a class that looked similar to this:&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;class &lt;/span&gt;&lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;MyComparer &lt;/span&gt;: &lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;IComparable&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;private object &lt;/span&gt;_data;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;public object&lt;/span&gt; Data&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;       &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt; get &lt;/span&gt;{ &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;return &lt;/span&gt;_data; }&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;public &lt;/span&gt;MyComparer(&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;object &lt;/span&gt;data)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;        _data = data;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;int &lt;/span&gt;&lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;IComparable&lt;/span&gt;.CompareTo(&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;object &lt;/span&gt;obj)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;        &lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;MyComparer &lt;/span&gt;mc = (&lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;MyComparer&lt;/span&gt;)obj;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;        &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;object&lt;/span&gt;[] myData = &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;this&lt;/span&gt;._data &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;as object&lt;/span&gt;[];&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;        &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;object&lt;/span&gt;[] thatData = mc.Data &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;as object&lt;/span&gt;[];&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;        &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;return &lt;/span&gt;(myData.Length &lt; thatData.Length) ? 0 : -1;   }&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To use it in one of my methods:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;private static object&lt;/span&gt;[] _sortChartData(&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;object&lt;/span&gt;[] oData)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    &lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;ArrayList &lt;/span&gt;arrData = &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;ArrayList&lt;/span&gt;();&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;for &lt;/span&gt;(&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;int &lt;/span&gt;i = 0; i &lt;code&gt;&lt;&lt;/code&gt; oData.Length; i++)   {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;        arrData.Add(&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;MyComparer&lt;/span&gt;(oData[i]));&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    arrData.Sort();&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;for &lt;/span&gt;(&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;int &lt;/span&gt;j = 0; j &lt;code&gt;&lt;&lt;/code&gt; arrData.Count; j++)    {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;        arrData[j] = (arrData[j] &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;as &lt;/span&gt;&lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;MyComparer&lt;/span&gt;).Data;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;return &lt;/span&gt;arrData.ToArray();&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;With this I can sort the contents of the original object[] to the one desired.</content><link rel='replies' type='application/atom+xml' href='http://alexrazon.blogspot.com/feeds/3544337787998981438/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/24582276/3544337787998981438' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/3544337787998981438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/3544337787998981438'/><link rel='alternate' type='text/html' href='http://alexrazon.blogspot.com/2006/11/arraylist-sorting-via-icomparable_27.html' title='ArrayList sorting via IComparable'/><author><name>Alex</name><uri>http://www.blogger.com/profile/10741593274002428818</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://i28.photobucket.com/albums/c233/aluxious/alexpsce.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24582276.post-6298098971161409044</id><published>2006-11-20T08:24:00.000+08:00</published><updated>2006-11-20T09:20:17.165+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dotnet"/><category scheme="http://www.blogger.com/atom/ns#" term="microsoft"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><title type='text'>Predicates in dotNet</title><content type='html'>I&#39;ve come across Predicates in dotNet 2.0. I felt so disgusted with too many foreach loops when looping through list collections. So, here was my problem: I have three string Lists&lt;string&gt;, say, A, B and C. List&lt;string&gt; string A is the reference list; while B and C contain elements found in A. By brute force method (and practically the only way we can do it in dotNet 1.x), we do something like:&lt;br /&gt;&lt;/string&gt;&lt;/string&gt;&lt;blockquote  style=&quot;font-family:courier new;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;foreach&lt;/span&gt; (&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;string &lt;/span&gt;strA in A)&lt;br /&gt;{&lt;br /&gt; &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;foreach &lt;/span&gt;(&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;string &lt;/span&gt;strB &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;in &lt;/span&gt;B)&lt;br /&gt; {&lt;br /&gt;     &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;if &lt;/span&gt;(strB.Contains(strB)) { &lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;/* do something... */&lt;/span&gt; }&lt;br /&gt; }&lt;br /&gt; &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;foreach &lt;/span&gt;(&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;string &lt;/span&gt;strC &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;in &lt;/span&gt;C)&lt;br /&gt; {&lt;br /&gt;     &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;if &lt;/span&gt;(strC.StartsWith(strC)) { &lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;/* do something... */&lt;/span&gt; }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;In dotNet 2.0, Predicates are provided for the generic features such as the System.Array and System.Collections.Generic.List classes. These classes provide methods like Find, FindAll, FindLast, etc. that use predicates to help developers search for certain elements in collections via delegates rather than looping at each element. Developers get the ability to &quot;walk&quot; an entire data structure, determining whether each item meets a set of criteria, without having to write the boilerplate code to loop through each row manually. In addition, it is more efficient to go.&lt;br /&gt;&lt;br /&gt;Okay, back to our example. By employing predicates, I created a new class called StringFilter:&lt;br /&gt;&lt;blockquote  style=&quot;font-family:courier new;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;public class&lt;/span&gt; &lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;StringFilter&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt; &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;private string&lt;/span&gt; _strReference;&lt;br /&gt; &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;public bool&lt;/span&gt; ContainsString(string s)&lt;br /&gt; {&lt;br /&gt;     &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;return&lt;/span&gt; s.Contains(_strReference);&lt;br /&gt; }&lt;br /&gt; &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;public bool&lt;/span&gt; StartsWithString(string s)&lt;br /&gt; {&lt;br /&gt;     &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;return&lt;/span&gt; s.StartsWith(_strReference, &lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;StringComparison&lt;/span&gt;.InvariantCultureIgnoreCase);&lt;br /&gt; }&lt;br /&gt; &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;public &lt;/span&gt;StringFilter(string strReference)&lt;br /&gt; {&lt;br /&gt;     _strReference = strReference;&lt;br /&gt; }&lt;br /&gt;}&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;Now, rewriting our example using this new class as predicate:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;foreach &lt;/span&gt;(&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;string &lt;/span&gt;strA &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;in&lt;/span&gt; A)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    &lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;StringFilter&lt;/span&gt; sf = &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: rgb(51, 153, 153);&quot;&gt;StringFilter&lt;/span&gt;(strA);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;if&lt;/span&gt; (B.Exists(sf.ContainsString)) { &lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;/* do something... */&lt;/span&gt; }&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;if&lt;/span&gt; (C.Exists(sf.StartsWithString)) { &lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;/* do something... */&lt;/span&gt; }&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;}&lt;/span&gt;&lt;/blockquote&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;/span&gt;&lt;/span&gt;The new class provides flexibility in searching elements of the collection.</content><link rel='replies' type='application/atom+xml' href='http://alexrazon.blogspot.com/feeds/6298098971161409044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/24582276/6298098971161409044' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/6298098971161409044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/6298098971161409044'/><link rel='alternate' type='text/html' href='http://alexrazon.blogspot.com/2006/11/predicates-in-dotnet.html' title='Predicates in dotNet'/><author><name>Alex</name><uri>http://www.blogger.com/profile/10741593274002428818</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://i28.photobucket.com/albums/c233/aluxious/alexpsce.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24582276.post-7069599304833100290</id><published>2006-11-16T07:34:00.000+08:00</published><updated>2006-11-16T07:40:38.770+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="microsoft"/><category scheme="http://www.blogger.com/atom/ns#" term="office 2007"/><title type='text'>Office 2007</title><content type='html'>The recent Office 2007 RTM presents a bug when opening buildingblocks.dotx. The solution for this is to delete the file and let Office recreate it. It can be located in:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;%drive%:\Documents and Settings\%username%\Application Data\Microsoft\Document Building Blocks\1033&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://alexrazon.blogspot.com/feeds/7069599304833100290/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/24582276/7069599304833100290' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/7069599304833100290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/7069599304833100290'/><link rel='alternate' type='text/html' href='http://alexrazon.blogspot.com/2006/11/office-2007.html' title='Office 2007'/><author><name>Alex</name><uri>http://www.blogger.com/profile/10741593274002428818</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://i28.photobucket.com/albums/c233/aluxious/alexpsce.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24582276.post-116313754521183601</id><published>2006-11-10T13:39:00.000+08:00</published><updated>2006-11-16T07:39:53.947+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="xml"/><category scheme="http://www.blogger.com/atom/ns#" term="xpath"/><title type='text'>Selecting Xml Nodes in MSXML 3 via XPath</title><content type='html'>Apparently, you need to set the SelectionLanguage property of a JavaScript XML Document object to XPath so you can select nodes via XPath.&lt;br /&gt;&lt;blockquote&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);font-family:courier new;&quot; &gt;var&lt;/span&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt; xmldoc = &lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 255);font-family:courier new;&quot; &gt;new &lt;/span&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;ActiveXObject(&quot;Microsoft.XMLDOM&quot;);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0);font-family:courier new;&quot; &gt;// or var xmldoc = new ActiveXObject(&#39;Msxml2.DOMDocument.3.0&#39;);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;xmldoc.async = &quot;false&quot;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;xmldoc.loadXML(xmlData);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;xmldoc.setProperty(&lt;/span&gt;&lt;span style=&quot;color: rgb(153, 0, 0);font-family:courier new;&quot; &gt;&quot;SelectionLanguage&quot;&lt;/span&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: rgb(153, 0, 0);font-family:courier new;&quot; &gt;&quot;XPath&quot;&lt;/span&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;After which you can use XPath to select nodes. This is inevitable for MSXML 3.</content><link rel='replies' type='application/atom+xml' href='http://alexrazon.blogspot.com/feeds/116313754521183601/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/24582276/116313754521183601' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/116313754521183601'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/116313754521183601'/><link rel='alternate' type='text/html' href='http://alexrazon.blogspot.com/2006/11/selecting-xml-nodes-in-msxml-3-via.html' title='Selecting Xml Nodes in MSXML 3 via XPath'/><author><name>Alex</name><uri>http://www.blogger.com/profile/10741593274002428818</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://i28.photobucket.com/albums/c233/aluxious/alexpsce.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24582276.post-116304847023819340</id><published>2006-11-09T12:57:00.000+08:00</published><updated>2006-11-16T07:41:07.942+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dotnet"/><category scheme="http://www.blogger.com/atom/ns#" term="microsoft"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><title type='text'>Re: Introducing .NET Framework 3.0</title><content type='html'>It is officially released.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;The Microsoft .NET Framework 3.0 is the new managed code programming model for Windows®. It combines the power of the .NET Framework version 2.0 with new technologies for building applications that have visually compelling user experiences, seamless communication across technology boundaries, and the ability to support a wide range of business processes. These new technologies are Windows Presentation Foundation, Windows Communication Foundation, Windows Workflow Foundation, and Windows CardSpace. The .NET Framework 3.0 is included as part of the Windows Vista™ operating system; you can install it or uninstall it using Windows Features Control Panel. This redistributable package is for Windows XP and Windows Server 2003. &lt;/blockquote&gt;&lt;u style=&quot;font-weight: bold;&quot;&gt;Downloads:&lt;/u&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyId=10CC340B-F857-4A14-83F5-25634C3BF043&amp;displaylang=en&quot;&gt;.NET Framework 3.0 Runtime Components&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyId=C2B1E300-F358-4523-B479-F53D234CDCCF&amp;amp;displaylang=en&quot;&gt;Windows SDK for Vista and the .NET Framework 3.0&lt;/a&gt; &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyId=5D61409E-1FA3-48CF-8023-E8F38E709BA6&amp;displaylang=en&quot;&gt;Visual Studio 2005 Extensions for .NET Framework 3.0 (Windows Workflow Foundation)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyId=F54F5537-CC86-4BF5-AE44-F5A1E805680D&amp;amp;displaylang=en&quot;&gt;Visual Studio 2005 Extensions for .NET Framework 3.0 (WCF &amp;amp; WPF), November 2006 CTP&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://alexrazon.blogspot.com/feeds/116304847023819340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/24582276/116304847023819340' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/116304847023819340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/116304847023819340'/><link rel='alternate' type='text/html' href='http://alexrazon.blogspot.com/2006/11/re-introducing-net-framework-30.html' title='Re: Introducing .NET Framework 3.0'/><author><name>Alex</name><uri>http://www.blogger.com/profile/10741593274002428818</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://i28.photobucket.com/albums/c233/aluxious/alexpsce.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24582276.post-116280187158853798</id><published>2006-11-06T16:29:00.000+08:00</published><updated>2006-11-16T07:42:16.444+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="vb6"/><title type='text'>Get the volume serial number of a drive</title><content type='html'>This code returns the volume serial for a hard drive (VB6).&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Code&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;Public Declare Function GetVolumeSerialNumber Lib &quot;kernel32&quot; Alias &quot;GetVolumeInformationA&quot; (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As Long, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, ByVal lpMaximumComponentLength As Long, ByVal lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As Long, ByVal nFileSystemNameSize As Long) As Long&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;Public Function VolumeSerial(DriveLetter) As Long&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    Dim Serial As Long&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    Call GetVolumeSerialNumber(UCase(DriveLetter) &amp; &quot;:\&quot;, 0&amp;amp;, 0&amp;, Serial, 0&amp;amp;amp;amp;, 0&amp;, 0&amp;amp;, 0&amp;)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;    VolumeSerial = Serial&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;End Function&lt;/span&gt;&lt;/blockquote&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Example Usage&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;blockquote&gt;MsgBox VolumeSerial(&quot;C&quot;) &lt;/blockquote&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://alexrazon.blogspot.com/feeds/116280187158853798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/24582276/116280187158853798' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/116280187158853798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/116280187158853798'/><link rel='alternate' type='text/html' href='http://alexrazon.blogspot.com/2006/11/get-volume-serial-number-of-drive.html' title='Get the volume serial number of a drive'/><author><name>Alex</name><uri>http://www.blogger.com/profile/10741593274002428818</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://i28.photobucket.com/albums/c233/aluxious/alexpsce.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24582276.post-116278481359203268</id><published>2006-11-06T11:42:00.000+08:00</published><updated>2006-11-14T10:21:00.098+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><title type='text'>JavaScript Hashtable Implementation</title><content type='html'>I needed a hashtable implementation in JavaScript and here&#39;s what I’ve come up. It is used like this:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;var&lt;/span&gt; ht = &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;new &lt;/span&gt;Hashtable();&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;ht.put(&lt;span style=&quot;color: rgb(153, 0, 0);&quot;&gt;“key”&lt;/span&gt;, &lt;span style=&quot;color: rgb(153, 0, 0);&quot;&gt;“value”&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;var&lt;/span&gt; val = ht.get(&lt;span style=&quot;color: rgb(153, 0, 0);&quot;&gt;“key”&lt;/span&gt;); &lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;// returns null if not found&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The implementation is like this:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;function&lt;/span&gt; Hashtable(){&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;    &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;this&lt;/span&gt;.hash = &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;new &lt;/span&gt;Array();&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;    &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;this&lt;/span&gt;.keys = &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;new &lt;/span&gt;Array();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;    &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;this&lt;/span&gt;.location = 0;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;Hashtable.prototype.hash = &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;null&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;Hashtable.prototype.keys = &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;null&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;Hashtable.prototype.location = &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;null&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;Hashtable.prototype.get = &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;function &lt;/span&gt;(key) {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;    &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;return this&lt;/span&gt;.hash[key];&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;Hashtable.prototype.put = &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;function &lt;/span&gt;(key, value) {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;    &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;if &lt;/span&gt;(value == &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;null&lt;/span&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;        &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;return null&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;    &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;if &lt;/span&gt;(&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;this&lt;/span&gt;.hash[key] == null)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;        &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;this&lt;/span&gt;.keys[&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;this&lt;/span&gt;.keys.length] = key;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;    &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;this&lt;/span&gt;.hash[key] = value;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;} &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://alexrazon.blogspot.com/feeds/116278481359203268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/24582276/116278481359203268' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/116278481359203268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/116278481359203268'/><link rel='alternate' type='text/html' href='http://alexrazon.blogspot.com/2006/11/javascript-hashtable-implementation.html' title='JavaScript Hashtable Implementation'/><author><name>Alex</name><uri>http://www.blogger.com/profile/10741593274002428818</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://i28.photobucket.com/albums/c233/aluxious/alexpsce.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24582276.post-116217989112320240</id><published>2006-10-30T11:42:00.000+08:00</published><updated>2006-11-14T10:21:00.036+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="IT news"/><category scheme="http://www.blogger.com/atom/ns#" term="open source"/><title type='text'>Get Songbird!</title><content type='html'>Songbird™ is a desktop Web player, a digital jukebox and Web browser mash-up. Like Winamp, it supports extensions and skins feathers. Like Firefox®, it is built from Mozilla®, cross-platform and open source.&lt;br /&gt;&lt;a href=&quot;http://songbirdnest.com&quot;&gt;&lt;img src=&quot;http://songbirdnest.com/files/images/button_feedme.png&quot; border=&quot;0&quot; alt=&quot;Get Songbird&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://alexrazon.blogspot.com/feeds/116217989112320240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/24582276/116217989112320240' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/116217989112320240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/116217989112320240'/><link rel='alternate' type='text/html' href='http://alexrazon.blogspot.com/2006/10/get-songbird.html' title='Get Songbird!'/><author><name>Alex</name><uri>http://www.blogger.com/profile/10741593274002428818</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://i28.photobucket.com/albums/c233/aluxious/alexpsce.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24582276.post-116183846478223685</id><published>2006-10-26T12:52:00.000+08:00</published><updated>2006-11-14T10:20:59.974+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><title type='text'>GotAPI.Com</title><content type='html'>I stumbled upon this &lt;a href=&quot;http://www.gotapi.com/&quot;&gt;site&lt;/a&gt; that provides quick reference to Web development.</content><link rel='replies' type='application/atom+xml' href='http://alexrazon.blogspot.com/feeds/116183846478223685/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/24582276/116183846478223685' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/116183846478223685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/116183846478223685'/><link rel='alternate' type='text/html' href='http://alexrazon.blogspot.com/2006/10/gotapicom.html' title='GotAPI.Com'/><author><name>Alex</name><uri>http://www.blogger.com/profile/10741593274002428818</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://i28.photobucket.com/albums/c233/aluxious/alexpsce.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24582276.post-116070255563660150</id><published>2006-10-13T09:08:00.000+08:00</published><updated>2006-11-14T10:20:59.912+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="vb6"/><title type='text'>Printer and the CommonDialog</title><content type='html'>In VB6, in order for you to make the Printer object in VB6 recognize the return of the  CommonDialog.ShowPrinter method, you have to set something like:&lt;br /&gt;&lt;br /&gt;Printer.TrackDefault = True&lt;br /&gt;&#39; then show the printer dialog&lt;br /&gt;commonDialog1.ShowPrinter&lt;br /&gt;&lt;br /&gt;The only problem here is that the commonDialog.DefaultPrinter is set to True by default. Thus, it practically sets the default printer to the selected. Any subsequent calls to the Printer object follow the printer selected in the Printer Dialog Box. Essentially you are setting a default printer via the dialog.&lt;br /&gt;&lt;br /&gt;I have yet to find a way to retrieve the hDC (printer device handle) from the CommonDialog Print dialog such that it can be passed to the Printer object--if it indeed is possible. Because right now, I don&#39;t think this is the most efficient way to do it.</content><link rel='replies' type='application/atom+xml' href='http://alexrazon.blogspot.com/feeds/116070255563660150/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/24582276/116070255563660150' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/116070255563660150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24582276/posts/default/116070255563660150'/><link rel='alternate' type='text/html' href='http://alexrazon.blogspot.com/2006/10/printer-and-commondialog.html' title='Printer and the CommonDialog'/><author><name>Alex</name><uri>http://www.blogger.com/profile/10741593274002428818</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://i28.photobucket.com/albums/c233/aluxious/alexpsce.jpg'/></author><thr:total>0</thr:total></entry></feed>