<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Musings on Tech and ASP.NET</title>
	<atom:link href="http://jefferytay.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jefferytay.wordpress.com</link>
	<description>Another Geek Blog</description>
	<lastBuildDate>Thu, 31 Dec 2009 23:53:49 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='jefferytay.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/97848a529b92a015ef7c526ea928ca08?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Musings on Tech and ASP.NET</title>
		<link>http://jefferytay.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://jefferytay.wordpress.com/osd.xml" title="Musings on Tech and ASP.NET" />
		<item>
		<title>Customizing the display for AutoCompleteExtender</title>
		<link>http://jefferytay.wordpress.com/2010/01/01/customizing-the-display-for-autocompleteextender/</link>
		<comments>http://jefferytay.wordpress.com/2010/01/01/customizing-the-display-for-autocompleteextender/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 23:53:49 +0000</pubDate>
		<dc:creator>kwanann</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://jefferytay.wordpress.com/?p=146</guid>
		<description><![CDATA[The AutoCompleteExtender that came with the Ajax Control Toolkit is great for linear data, but what happens when you want to customize its output, e.g say you want to display the multiple values in a table form?
This is definately possible since at the end of the day, the UI is rendered using Javascript, however you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jefferytay.wordpress.com&blog=8893556&post=146&subd=jefferytay&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p>The AutoCompleteExtender that came with the Ajax Control Toolkit is great for linear data, but what happens when you want to customize its output, e.g say you want to display the multiple values in a table form?</p>
<p>This is definately possible since at the end of the day, the UI is rendered using Javascript, however you will need to do some tweaking.</p>
<p><strong>WebService</strong></p>
<p>In order to return multiple values, your webservice needs to return an object[] array, or more specifically, a Pair&lt;&gt; array, this is because the client side javascript reading the webservice functions such that if a pair is returned, it will set the whole pair object as the &#8220;value&#8221; for the item.</p>
<p>[WebMethod]<br />
public object[] GetCompletionList(string prefixText, int count)<br />
{<br />
//demo code<br />
if (count == 0)<br />
{<br />
count = 10;<br />
}</p>
<p>if (prefixText.Equals(&#8220;xyz&#8221;))<br />
{<br />
return new string[0];<br />
}</p>
<p>Random random = new Random();<br />
var items = new List<br />
&gt;(count);</p>
<p>var jss = new System.Web.Script.Serialization.JavaScriptSerializer();<br />
for (int i = 0; i &lt; count; i++)<br />
{<br />
char c1 = (char)random.Next(65, 90);<br />
char c2 = (char)random.Next(97, 122);<br />
char c3 = (char)random.Next(97, 122);<br />
int id = i;<br />
int age = random.Next(18, 70);<br />
var item = new Pair(id.ToString(), new object[]{prefixText + c1 + c2 +c3, age});<br />
items.Add(item);<br />
}</p>
<p>return items.ToArray();<br />
}</p>
<p>Now that the webservice is returning the data, lets move on to the client side javascripts. What we need to do is to &#8220;override&#8221; the onClientItemSelected and onClientShowing javascripts </p>
<p>The below example assumes a HTML table display format.</p>
<p>function OnClientItemSelected(behaviour, args) {<br />
var element = behaviour.get_element();<br />
var control = element.control;</p>
<p><strong>//args._value is the pair object which is returned</strong><br />
if (control &amp;&amp; control.set_text)<br />
control.set_text(args._value.First);<br />
else<br />
element.value = args._value.First;<br />
}</p>
<p>function OnClientShowing(behaviour, e) {<br />
var ResultsDiv = behaviour.get_completionList();</p>
<p>for (var i = 0; i &lt; ResultsDiv.childNodes.length; i++) {</p>
<p>var item = ResultsDiv.childNodes[i];</p>
<p><strong>//since the pair object stores the values to display in the second variable, lets get it out to do our own processing</strong><br />
var vals = item._value.Second;</p>
<p> //remove all child nodes</p>
<p>while (item.childNodes.length &gt; 0)<br />
item.removeChild(item.firstChild);</p>
<p>//create the table<br />
var tbl = document.createElement(&#8220;table&#8221;);<br />
tbl.setAttribute(&#8220;width&#8221;, &#8220;100%&#8221;);<br />
tbl.setAttribute(&#8220;border&#8221;, &#8220;1&#8243;);<br />
tbl.setAttribute(&#8220;style&#8221;, &#8220;border: solid 1px black;border-collapse: collapse;&#8221;);<br />
tbl._value = item._value;</p>
<p>var tbody = document.createElement(&#8220;tbody&#8221;);<br />
var tr = document.createElement(&#8220;tr&#8221;);<br />
tr.setAttribute(&#8220;valign&#8221;, &#8220;top&#8221;);<br />
tr._value = item._value;<br />
for (var j = 0; j &lt; vals.length; j++) {<br />
CreateTableCell(tr, vals[j], item._value);<br />
}<br />
tbody.appendChild(tr);<br />
tbl.appendChild(tbody);<br />
item.appendChild(tbl);<br />
}<br />
}</p>
<p>function CreateTableCell(tr, str, value, width) {<br />
td = document.createElement(&#8220;td&#8221;);<br />
<strong>//this is a very important step, if you forget to set the td._value, when onClientSelected triggers, args._value will be null</strong><br />
td._value = value;<br />
td.setAttribute(&#8220;width&#8221;, width);<br />
td.innerHTML = str;<br />
tr.appendChild(td);<br />
}</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jefferytay.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jefferytay.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jefferytay.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jefferytay.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jefferytay.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jefferytay.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jefferytay.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jefferytay.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jefferytay.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jefferytay.wordpress.com/146/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jefferytay.wordpress.com&blog=8893556&post=146&subd=jefferytay&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://jefferytay.wordpress.com/2010/01/01/customizing-the-display-for-autocompleteextender/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/27d3f15ba9242eae1078607670d81806?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kwanann</media:title>
		</media:content>
	</item>
		<item>
		<title>The interesting app_offline.htm file</title>
		<link>http://jefferytay.wordpress.com/2009/11/12/the-interesting-app_offline-htm-file/</link>
		<comments>http://jefferytay.wordpress.com/2009/11/12/the-interesting-app_offline-htm-file/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 12:07:13 +0000</pubDate>
		<dc:creator>kwanann</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://jefferytay.wordpress.com/?p=144</guid>
		<description><![CDATA[For those that&#8217;s still in the dark about this cool feature, here&#8217;s the lowdown on it.
&#160;
If you put a app_offline.htm file inside your asp.net application, on the next request, ASP.NET will shutdown the app domain and return the contents of the file in response to all dynamic asp.net requests. This way, you can easily take [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jefferytay.wordpress.com&blog=8893556&post=144&subd=jefferytay&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p>For those that&#8217;s still in the dark about this cool feature, here&#8217;s the lowdown on it.</p>
<p>&nbsp;</p>
<p>If you put a app_offline.htm file inside your asp.net application, on the next request, ASP.NET will shutdown the app domain and return the contents of the file in response to all dynamic asp.net requests. This way, you can easily take down your site for maintenance and updates and then bring it right up by deleting the file once you are done!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jefferytay.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jefferytay.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jefferytay.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jefferytay.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jefferytay.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jefferytay.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jefferytay.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jefferytay.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jefferytay.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jefferytay.wordpress.com/144/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jefferytay.wordpress.com&blog=8893556&post=144&subd=jefferytay&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://jefferytay.wordpress.com/2009/11/12/the-interesting-app_offline-htm-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/27d3f15ba9242eae1078607670d81806?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kwanann</media:title>
		</media:content>
	</item>
		<item>
		<title>Disabling the program has stopped working promot</title>
		<link>http://jefferytay.wordpress.com/2009/11/12/disabling-the-program-has-stopped-working-promot/</link>
		<comments>http://jefferytay.wordpress.com/2009/11/12/disabling-the-program-has-stopped-working-promot/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 02:42:00 +0000</pubDate>
		<dc:creator>kwanann</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://jefferytay.wordpress.com/?p=142</guid>
		<description><![CDATA[Ever so often, especially when you are using interop inside .net applications, you may trigger some code which will totally crash your system.
This prompt usually does not help in any way whatsoever.
So here&#8217;s how to take it out permanently.
1. Change HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Windows\ErrorMode from 0 to 2
2. Change HKEY_CURRENT_USER\Software\ Microsoft\Windows\Windows Error Reporting\DontShowUI from 0 to 1
  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jefferytay.wordpress.com&blog=8893556&post=142&subd=jefferytay&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p>Ever so often, especially when you are using interop inside .net applications, you may trigger some code which will totally crash your system.</p>
<p>This prompt usually does not help in any way whatsoever.</p>
<p>So here&#8217;s how to take it out permanently.</p>
<p>1. Change HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Windows\ErrorMode from 0 to 2</p>
<p>2. Change HKEY_CURRENT_USER\Software\ Microsoft\Windows\Windows Error Reporting\DontShowUI from 0 to 1</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jefferytay.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jefferytay.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jefferytay.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jefferytay.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jefferytay.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jefferytay.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jefferytay.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jefferytay.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jefferytay.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jefferytay.wordpress.com/142/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jefferytay.wordpress.com&blog=8893556&post=142&subd=jefferytay&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://jefferytay.wordpress.com/2009/11/12/disabling-the-program-has-stopped-working-promot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/27d3f15ba9242eae1078607670d81806?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kwanann</media:title>
		</media:content>
	</item>
		<item>
		<title>Microsoft Visual Studio Team Suite Load Test Part 2 &#8211; Optimizing your load tests</title>
		<link>http://jefferytay.wordpress.com/2009/10/23/microsoft-visual-studio-team-suite-load-test-part-2-optimizing-your-load-tests/</link>
		<comments>http://jefferytay.wordpress.com/2009/10/23/microsoft-visual-studio-team-suite-load-test-part-2-optimizing-your-load-tests/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 22:28:20 +0000</pubDate>
		<dc:creator>kwanann</dc:creator>
				<category><![CDATA[Performance]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://jefferytay.wordpress.com/?p=127</guid>
		<description><![CDATA[Its been quite a while since my first post of VSTS and it seems Mercury Loadrunner has caught up in terms of functionality.
Anyway here&#8217;s my 2nd post in this series which tells you how to improve performance when doing a load test.
Things to note&#8230;
Since the load test agent is licensed based on a per processor [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jefferytay.wordpress.com&blog=8893556&post=127&subd=jefferytay&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p>Its been quite a while since my first post of VSTS and it seems Mercury Loadrunner has caught up in terms of functionality.</p>
<p>Anyway here&#8217;s my 2nd post in this series which tells you how to improve performance when doing a load test.</p>
<p><span style="color:#800080;"><em><strong>Things to note&#8230;</strong></em></span></p>
<p>Since the load test agent is licensed based on a per processor model, it is generally advisable to get a processor with as many cores as possible, and also pump up the ram for the machine, but as the agent is a <strong>32bit</strong> application, it will not be able to use &gt; 4GB of ram and does not work so well in a <strong>x64</strong> environment. Recommended installation environment is still either Windows XP or Windows 2003.</p>
<p>The good news is in VSTS 2010, the agent itself is x64 so all these issues should magically disappear <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>ok back to the main topic, <span style="color:#800080;"><em><strong>how to optimize your load tests<br />
</strong></em></span></p>
<ol>
<li><strong>stick to a x86 os with a maximum of 4GB of ram for load test agents<br />
</strong></li>
<li><strong>Turn on server GC</strong><br />
<blockquote><p>To enable your application to use Server GC, you need to modify either the VSTestHost.exe.config or the QTAgent.exe.config.  If you are not using a Controller and Agent setup, then you need to modify the VSTesthost.exe.config. If you are using a controller and agent, then modify the QTAgent.exe.config for each agent machine.</p>
<p><span style="font-size:10pt;font-family:'Courier New';">Open the correct file.  The locations are</span></p>
<p><span style="font-size:10pt;font-family:'Courier New';">VSTestHost.exe.config &#8211; C:\Program Files\Microsoft Visual Studio 8\Common7\IDE</span></p>
<p><span style="font-size:10pt;font-family:'Courier New';">QTAgent.exe.config &#8211; C:\Program Files\Microsoft Visual Studio 2005 Team Test Load Agent\LoadTest</span></p>
<p><span style="font-size:10pt;font-family:'Courier New';">To enable gcserver you need to add the following line in the runtime section:</span></p>
<p><span style="font-size:10pt;color:black;font-family:'Courier New';">&lt;gcServer enabled=&#8221;true&#8221; /&gt;</span></p>
<p><span style="font-size:10pt;color:black;font-family:'Courier New';">It should look something like:</span></p>
<p><span style="font-size:10pt;color:black;font-family:'Courier New';">&lt;?xml version =&#8221;1.0&#8243;?&gt;<br />
&lt;configuration&gt;<br />
&lt;runtime&gt;<br />
&lt;gcServer enabled=&#8221;true&#8221; /&gt;<br />
&lt;assemblyBinding xmlns=&#8221;urn:schemas-microsoft-com:asm.v1&#8243;&gt;<br />
&lt;probing privatePath=&#8221;PrivateAssemblies;PublicAssemblies&#8221;/&gt;<br />
&lt;/assemblyBinding&gt;<br />
&lt;/runtime&gt;<br />
&lt;/configuration&gt;</span></p>
<p>Source: <a href="http://blogs.msdn.com/slumley/pages/improve-load-test-performance-on-multi-processor-machines.aspx" target="_blank">http://blogs.msdn.com/slumley/pages/improve-load-test-performance-on-multi-processor-machines.aspx</a></p></blockquote>
</li>
<li><strong>Turn on agent connection pooling </strong>(Run Settings -&gt; MySettingsName -&gt;Properties -&gt; WebTest Connection Pool<br />
By default VSTS emulates a client open and closing TCP connections to the server, however these opening and closing of connections take up resources. If your chief aim is to test the server, and especially if your server is sitting behind a load balancer with TCP offloading, turn this off</li>
<li><strong>Create a declarative WebTest </strong>program to easily change parameters inside your webtest<br />
<a href="http://blogs.msdn.com/densto/pages/declarativewebtest-declarativewebtestserializer.aspx" target="_blank">http://blogs.msdn.com/densto/pages/declarativewebtest-declarativewebtestserializer.aspx</a></li>
<li><strong>Specify ResponseBodyCaptureLimit &#8211; </strong>By indicating how much of the response you want to capture for parsing, you can run away from those dreaded agent out of memory errors, this is especially so when you are doing e.g a file download test<br />
<a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.webtesting.webtest.responsebodycapturelimit%28VS.80%29.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.webtesting.webtest.responsebodycapturelimit%28VS.80%29.aspx</a>)</li>
<li><strong>Monitor your servers, but not so frequent</strong>: You don&#8217;t wish to overload your servers just because you want to monitor their performance right</li>
</ol>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jefferytay.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jefferytay.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jefferytay.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jefferytay.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jefferytay.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jefferytay.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jefferytay.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jefferytay.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jefferytay.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jefferytay.wordpress.com/127/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jefferytay.wordpress.com&blog=8893556&post=127&subd=jefferytay&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://jefferytay.wordpress.com/2009/10/23/microsoft-visual-studio-team-suite-load-test-part-2-optimizing-your-load-tests/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/27d3f15ba9242eae1078607670d81806?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kwanann</media:title>
		</media:content>
	</item>
		<item>
		<title>Sony vs Sandisk</title>
		<link>http://jefferytay.wordpress.com/2009/09/29/sonyvssandisk/</link>
		<comments>http://jefferytay.wordpress.com/2009/09/29/sonyvssandisk/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 01:17:48 +0000</pubDate>
		<dc:creator>kwanann</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jefferytay.wordpress.com/?p=137</guid>
		<description><![CDATA[about 3 years ago, i bought a Sony USB 4GB thumbdrive at a PC fair in Taiwan. And recently hearing about the great performance of the Sandisk Cruzer, i decided to get one too!
However when i did a benchmark for the thumbdrives, i realize that although the Cruzer meets the specified speed limits, the ol Sony [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jefferytay.wordpress.com&blog=8893556&post=137&subd=jefferytay&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p>about 3 years ago, i bought a Sony USB 4GB thumbdrive at a PC fair in Taiwan. And recently hearing about the great performance of the Sandisk Cruzer, i decided to get one too!</p>
<p>However when i did a benchmark for the thumbdrives, i realize that although the Cruzer meets the specified speed limits, the ol Sony thumbdrive also meets them!</p>
<p>Kudos to Sony for coming up with such great technology which is way ahead of their peers!</p>
<p><img class="alignnone size-full wp-image-136" title="Sony USB 4GB Performance" src="http://jefferytay.files.wordpress.com/2009/09/sony1.jpg?w=584&#038;h=472" alt="Sony USB 4GB Performance" width="584" height="472" /><img class="alignnone size-full wp-image-134" title="Sandisk Cruzer 16GB Performance" src="http://jefferytay.files.wordpress.com/2009/09/sandisk1.jpg?w=584&#038;h=472" alt="Sandisk Cruzer 16GB Performance" width="584" height="472" /></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jefferytay.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jefferytay.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jefferytay.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jefferytay.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jefferytay.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jefferytay.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jefferytay.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jefferytay.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jefferytay.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jefferytay.wordpress.com/137/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jefferytay.wordpress.com&blog=8893556&post=137&subd=jefferytay&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://jefferytay.wordpress.com/2009/09/29/sonyvssandisk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/27d3f15ba9242eae1078607670d81806?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kwanann</media:title>
		</media:content>

		<media:content url="http://jefferytay.files.wordpress.com/2009/09/sony1.jpg" medium="image">
			<media:title type="html">Sony USB 4GB Performance</media:title>
		</media:content>

		<media:content url="http://jefferytay.files.wordpress.com/2009/09/sandisk1.jpg" medium="image">
			<media:title type="html">Sandisk Cruzer 16GB Performance</media:title>
		</media:content>
	</item>
		<item>
		<title>Removing U3 Partition from Sandisk Drives</title>
		<link>http://jefferytay.wordpress.com/2009/09/26/removing-u3-partition-from-sandisk-drives/</link>
		<comments>http://jefferytay.wordpress.com/2009/09/26/removing-u3-partition-from-sandisk-drives/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 14:52:28 +0000</pubDate>
		<dc:creator>kwanann</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://jefferytay.wordpress.com/?p=131</guid>
		<description><![CDATA[Here&#8217;s the steps on how to remove the U3 Partition completely from Sandisk Drives

 Launch U3
Click on the U3 Icon
Click U3 Launchpad Settings
Click Uninstall

Done  
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jefferytay.wordpress.com&blog=8893556&post=131&subd=jefferytay&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p>Here&#8217;s the steps on how to remove the U3 Partition completely from Sandisk Drives</p>
<ol>
<li> Launch U3</li>
<li>Click on the U3 Icon</li>
<li>Click U3 Launchpad Settings</li>
<li>Click Uninstall</li>
</ol>
<p>Done <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jefferytay.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jefferytay.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jefferytay.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jefferytay.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jefferytay.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jefferytay.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jefferytay.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jefferytay.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jefferytay.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jefferytay.wordpress.com/131/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jefferytay.wordpress.com&blog=8893556&post=131&subd=jefferytay&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://jefferytay.wordpress.com/2009/09/26/removing-u3-partition-from-sandisk-drives/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/27d3f15ba9242eae1078607670d81806?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kwanann</media:title>
		</media:content>
	</item>
		<item>
		<title>Microsoft Visual Studio Team Suite Load Test Part 1 &#8211; VSTS vs Mercury LoadRunner</title>
		<link>http://jefferytay.wordpress.com/2009/09/19/microsoft-visual-studio-team-suite-load-test-part-1-vsts-vs-mercury-loadrunner/</link>
		<comments>http://jefferytay.wordpress.com/2009/09/19/microsoft-visual-studio-team-suite-load-test-part-1-vsts-vs-mercury-loadrunner/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 23:39:11 +0000</pubDate>
		<dc:creator>kwanann</dc:creator>
				<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://jefferytay.wordpress.com/?p=124</guid>
		<description><![CDATA[I&#8217;ve been getting my hands dirty with Visual Studio Team Suite Load Test the past few months. In the coming few months, i will be posting several articles on my experiences with VSTS.
First i&#8217;ll start with a comparison between VSTS and Mercury LoadRunner. I&#8217;m including the version numbers as the newer versions of these 2 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jefferytay.wordpress.com&blog=8893556&post=124&subd=jefferytay&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p>I&#8217;ve been getting my hands dirty with Visual Studio Team Suite Load Test the past few months. In the coming few months, i will be posting several articles on my experiences with VSTS.</p>
<p>First i&#8217;ll start with a comparison between VSTS and Mercury LoadRunner. I&#8217;m including the version numbers as the newer versions of these 2 software promises much much more!</p>
<table border="0" width="100%">
<tbody>
<tr valign="top">
<td><strong>Point of Comparison</strong></td>
<td><strong>Mercury Load Runner 6<br />
</strong></td>
<td><strong>Visual Studio Load Test 2008<br />
</strong></td>
</tr>
<tr valign="top">
<td>Pricing</td>
<td>Unlimited number of agent computers, pricing is per Virtual User (VU)</p>
<p>Useful if you have a whole lot of old computers or if you want to spread the load around in your network to find connection bottlenecks</td>
<td>Pricing is per physical CPU, Microsoft states that each logical CPU can take up to 1000VU</p>
<p>As this is on a per CPU basis, you may want to get a relatively powerful (read 4/6/8 Core CPU, &gt;=8gb) machine to be the load test agent.</p>
<p>Also, <strong>DO NOT</strong> install this on a VM, be it ESX or Hypervisor, performance of the agent in a virtual environment is at least 50% worse as compared to having it installed on a physical machine.</td>
</tr>
<tr valign="top">
<td>Monitoring Capabilities</td>
<td>By default, it does not monitor any server, client parameters, of course these are available if you pay</p>
<p>This means that during any test run, engineers need to be around to monitor the server loads</td>
<td>Able to monitor perfmon statistics (i.e windows machines), you can also specify the statistics to gather and save in your load test report.</p>
<p>It also comes with SQL Tracing for SQL Server, so you can monitor the long running queries with respect to your load test script.</p>
<p>With real time display of the server/client statistics, you can easily tell how the load test is running</p>
<p>On the downside, you will still have to monitor non-windows machines manually.</td>
</tr>
<tr valign="top">
<td>Virtual User Stepping</td>
<td>You can specify User Stepping or Constant User Load</td>
<td>You can specify User Stepping, Constant User Load or Goal based.</p>
<p>Goal based means VSTS will keep increasing the VU until a certain perfmon statistic is matched e.g web server 100% CPU</td>
</tr>
<tr valign="top">
<td>Testing Flexibility</td>
<td>Able to test various systems, including web based, SAP etc</p>
<p>Databinding to text files is supported</p>
<p>Backend is something like C programming so you can easily change the parameters if required</td>
<td>Able to test most systems, any additional functionality can be done via a custom app and using VSTS to run the app</p>
<p>Databinding to various data sources are supported</p>
<p>There are 2 formats to testing, coded and scripted tests.</p>
<p>Coded tests are simple C#/VB codes with events and stuff for ultimate flexibility at the expense of ease of editing.</p>
<p>Scripted tests is similar to what Mercury has to offer</p>
<p>One thing to note: If you have installed the VSTS SDK, you can actually use a program to run thru the scripts and change the parameters for a scripted test, e.g changing the think time for all web requests to 5 seconds.</td>
</tr>
</tbody>
</table>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jefferytay.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jefferytay.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jefferytay.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jefferytay.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jefferytay.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jefferytay.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jefferytay.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jefferytay.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jefferytay.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jefferytay.wordpress.com/124/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jefferytay.wordpress.com&blog=8893556&post=124&subd=jefferytay&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://jefferytay.wordpress.com/2009/09/19/microsoft-visual-studio-team-suite-load-test-part-1-vsts-vs-mercury-loadrunner/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/27d3f15ba9242eae1078607670d81806?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kwanann</media:title>
		</media:content>
	</item>
		<item>
		<title>SEA MVPs Blog-A-Holic!</title>
		<link>http://jefferytay.wordpress.com/2009/09/17/sea-mvps-blog-a-holic/</link>
		<comments>http://jefferytay.wordpress.com/2009/09/17/sea-mvps-blog-a-holic/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 23:39:56 +0000</pubDate>
		<dc:creator>kwanann</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jefferytay.wordpress.com/?p=122</guid>
		<description><![CDATA[SEA MVPs Blog-A-Holic – Unravel the gems hidden within the SEA MVPs community and help spread the word to the entire virtual landscape. Blog about it right now and share it with your technical communities!
Click http://seamvpblogaholic.spaces.live.com/
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jefferytay.wordpress.com&blog=8893556&post=122&subd=jefferytay&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p><strong>SEA MVPs Blog-A-Holic – Unravel the gems hidden within the SEA MVPs community and help spread the word to the entire virtual landscape.</strong> <strong>Blog about it right now and share it with your technical communities!</strong></p>
<p>Click <a href="http://seamvpblogaholic.spaces.live.com/" target="_blank">http://seamvpblogaholic.spaces.live.com/</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jefferytay.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jefferytay.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jefferytay.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jefferytay.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jefferytay.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jefferytay.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jefferytay.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jefferytay.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jefferytay.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jefferytay.wordpress.com/122/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jefferytay.wordpress.com&blog=8893556&post=122&subd=jefferytay&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://jefferytay.wordpress.com/2009/09/17/sea-mvps-blog-a-holic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/27d3f15ba9242eae1078607670d81806?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kwanann</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Server Database Mirroring</title>
		<link>http://jefferytay.wordpress.com/2009/08/20/sql-server-database-mirroring/</link>
		<comments>http://jefferytay.wordpress.com/2009/08/20/sql-server-database-mirroring/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 13:58:07 +0000</pubDate>
		<dc:creator>kwanann</dc:creator>
				<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://jefferytay.wordpress.com/?p=116</guid>
		<description><![CDATA[SQL Server database mirroring is cool, especially in the areas of cost savings. However setting up a proper database mirroring is not as straightforward as it seems, although it is much much easier than doing a clustering.
Things you need to do

Connection String: The databases are in 2 different instances, make sure you use the latest [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jefferytay.wordpress.com&blog=8893556&post=116&subd=jefferytay&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><p>SQL Server database mirroring is cool, especially in the areas of cost savings. However setting up a proper database mirroring is not as straightforward as it seems, although it is much much easier than doing a clustering.</p>
<p>Things you need to do</p>
<ol>
<li><strong>Connection String: </strong>The databases are in 2 different instances, make sure you use the latest SQL Client with the failover partner parameter to ease the failover<br />
<em>&#8220;Provider=SQLNCLI;Data Source=myServerAddress;<strong>Failover Partner=myMirrorServerAddress</strong>;Initial Catalog=myDataBase;Integrated Security=True;&#8221;</em></li>
<li><strong>SQL Accounts: </strong>Mirror the login accounts too!<br />
Microsoft has a KB (<a href="http://support.microsoft.com/kb/918992">http://support.microsoft.com/kb/918992</a>) which teaches you how to create a stored procedure which prints out a create user sql which you can run on the backup server to create an exact duplicate of the user account in the primary server.<br />
i&#8217;ve attached the script here for easy reference</p>
<blockquote><p>USE master<br />
GO<br />
IF OBJECT_ID (&#8217;sp_hexadecimal&#8217;) IS NOT NULL<br />
DROP PROCEDURE sp_hexadecimal<br />
GO<br />
CREATE PROCEDURE sp_hexadecimal<br />
@binvalue varbinary(256),<br />
@hexvalue varchar (514) OUTPUT<br />
AS<br />
DECLARE @charvalue varchar (514)<br />
DECLARE @i int<br />
DECLARE @length int<br />
DECLARE @hexstring char(16)<br />
SELECT @charvalue = &#8216;0x&#8217;<br />
SELECT @i = 1<br />
SELECT @length = DATALENGTH (@binvalue)<br />
SELECT @hexstring = &#8216;0123456789ABCDEF&#8217;<br />
WHILE (@i &lt;= @length)<br />
BEGIN<br />
DECLARE @tempint int<br />
DECLARE @firstint int<br />
DECLARE @secondint int<br />
SELECT @tempint = CONVERT(int, SUBSTRING(@binvalue,@i,1))<br />
SELECT @firstint = FLOOR(@tempint/16)<br />
SELECT @secondint = @tempint &#8211; (@firstint*16)<br />
SELECT @charvalue = @charvalue +<br />
SUBSTRING(@hexstring, @firstint+1, 1) +<br />
SUBSTRING(@hexstring, @secondint+1, 1)<br />
SELECT @i = @i + 1<br />
ENDSELECT @hexvalue = @charvalue<br />
GO</p>
<p>IF OBJECT_ID (&#8217;sp_help_revlogin&#8217;) IS NOT NULL<br />
DROP PROCEDURE sp_help_revlogin<br />
GO<br />
CREATE PROCEDURE sp_help_revlogin @login_name sysname = NULL AS<br />
DECLARE @name sysname<br />
DECLARE @type varchar (1)<br />
DECLARE @hasaccess int<br />
DECLARE @denylogin int<br />
DECLARE @is_disabled int<br />
DECLARE @PWD_varbinary varbinary (256)<br />
DECLARE @PWD_string varchar (514)<br />
DECLARE @SID_varbinary varbinary (85)<br />
DECLARE @SID_string varchar (514)<br />
DECLARE @tmpstr varchar (1024)<br />
DECLARE @is_policy_checked varchar (3)<br />
DECLARE @is_expiration_checked varchar (3)</p>
<p>DECLARE @defaultdb sysname</p>
<p>IF (@login_name IS NULL)<br />
DECLARE login_curs CURSOR FOR</p>
<p>SELECT p.sid, p.name, p.type, p.is_disabled, p.default_database_name, l.hasaccess, l.denylogin FROM<br />
sys.server_principals p LEFT JOIN sys.syslogins l<br />
ON ( l.name = p.name ) WHERE p.type IN ( &#8216;S&#8217;, &#8216;G&#8217;, &#8216;U&#8217; ) AND p.name &lt;&gt; &#8217;sa&#8217;<br />
ELSE<br />
DECLARE login_curs CURSOR FOR</p>
<p>SELECT p.sid, p.name, p.type, p.is_disabled, p.default_database_name, l.hasaccess, l.denylogin FROM<br />
sys.server_principals p LEFT JOIN sys.syslogins l<br />
ON ( l.name = p.name ) WHERE p.type IN ( &#8216;S&#8217;, &#8216;G&#8217;, &#8216;U&#8217; ) AND p.name = @login_name<br />
OPEN login_curs</p>
<p>FETCH NEXT FROM login_curs INTO @SID_varbinary, @name, @type, @is_disabled, @defaultdb, @hasaccess, @denylogin<br />
IF (@@fetch_status = -1)<br />
BEGIN<br />
PRINT &#8216;No login(s) found.&#8217;<br />
CLOSE login_curs<br />
DEALLOCATE login_curs<br />
RETURN -1<br />
END<br />
SET @tmpstr = &#8216;/* sp_help_revlogin script &#8216;<br />
PRINT @tmpstr<br />
SET @tmpstr = &#8216;** Generated &#8216; + CONVERT (varchar, GETDATE()) + &#8216; on &#8216; + @@SERVERNAME + &#8216; */&#8217;<br />
PRINT @tmpstr<br />
PRINT &#8221;<br />
WHILE (@@fetch_status &lt;&gt; -1)<br />
BEGIN<br />
IF (@@fetch_status &lt;&gt; -2)<br />
BEGIN<br />
PRINT &#8221;<br />
SET @tmpstr = &#8216;&#8211; Login: &#8216; + @name<br />
PRINT @tmpstr<br />
IF (@type IN ( &#8216;G&#8217;, &#8216;U&#8217;))<br />
BEGIN &#8212; NT authenticated account/group</p>
<p>SET @tmpstr = &#8216;CREATE LOGIN &#8216; + QUOTENAME( @name ) + &#8216; FROM WINDOWS WITH DEFAULT_DATABASE = [' + @defaultdb + ']&#8216;<br />
END<br />
ELSE BEGIN &#8212; SQL Server authentication<br />
&#8211; obtain password and sid<br />
SET @PWD_varbinary = CAST( LOGINPROPERTY( @name, &#8216;PasswordHash&#8217; ) AS varbinary (256) )<br />
EXEC sp_hexadecimal @PWD_varbinary, @PWD_string OUT<br />
EXEC sp_hexadecimal @SID_varbinary,@SID_string OUT</p>
<p>&#8211; obtain password policy state<br />
SELECT @is_policy_checked = CASE is_policy_checked WHEN 1 THEN &#8216;ON&#8217; WHEN 0 THEN &#8216;OFF&#8217; ELSE NULL END FROM sys.sql_logins WHERE name = @name<br />
SELECT @is_expiration_checked = CASE is_expiration_checked WHEN 1 THEN &#8216;ON&#8217; WHEN 0 THEN &#8216;OFF&#8217; ELSE NULL END FROM sys.sql_logins WHERE name = @name</p>
<p>SET @tmpstr = &#8216;CREATE LOGIN &#8216; + QUOTENAME( @name ) + &#8216; WITH PASSWORD = &#8216; + @PWD_string + &#8216; HASHED, SID = &#8216; + @SID_string + &#8216;, DEFAULT_DATABASE = [' + @defaultdb + ']&#8216;</p>
<p>IF ( @is_policy_checked IS NOT NULL )<br />
BEGIN<br />
SET @tmpstr = @tmpstr + &#8216;, CHECK_POLICY = &#8216; + @is_policy_checked<br />
END<br />
IF ( @is_expiration_checked IS NOT NULL )<br />
BEGIN<br />
SET @tmpstr = @tmpstr + &#8216;, CHECK_EXPIRATION = &#8216; + @is_expiration_checked<br />
END<br />
END<br />
IF (@denylogin = 1)<br />
BEGIN &#8212; login is denied access<br />
SET @tmpstr = @tmpstr + &#8216;; DENY CONNECT SQL TO &#8216; + QUOTENAME( @name )<br />
END<br />
ELSE IF (@hasaccess = 0)<br />
BEGIN &#8212; login exists but does not have access<br />
SET @tmpstr = @tmpstr + &#8216;; REVOKE CONNECT SQL TO &#8216; + QUOTENAME( @name )<br />
END<br />
IF (@is_disabled = 1)<br />
BEGIN &#8212; login is disabled<br />
SET @tmpstr = @tmpstr + &#8216;; ALTER LOGIN &#8216; + QUOTENAME( @name ) + &#8216; DISABLE&#8217;<br />
END<br />
PRINT @tmpstr<br />
END</p>
<p>FETCH NEXT FROM login_curs INTO @SID_varbinary, @name, @type, @is_disabled, @defaultdb, @hasaccess, @denylogin<br />
END<br />
CLOSE login_curs<br />
DEALLOCATE login_curs<br />
RETURN 0<br />
GO</p></blockquote>
</li>
<li><strong>Preparing mirror server: </strong>Make sure the DB is not in use!<br />
DB Mirroring requires you to restore a backup of the existing db on the mirror side!</li>
<li><strong>Preparing mirror DB: </strong>When restoring to the mirror site, set it to RESTORE WITH NORECOVERY</li>
<li><strong>Setup Mirroring:</strong> Pretty straightforward here, right click the db, click properties -&gt; Mirror then click the &#8220;Configure Security&#8221; button to start the wizard</li>
<li><strong>Backup Strategy:</strong> Because database mirroring sets the mirror db to be in a perpentual <em>Restoring</em> state, your normal backup jobs won&#8217;t work on it. <em>Note this is fixed in SQL Server 2008 maintenance plan, you just need to tick the ignore if not online check box</em><br />
Here&#8217;s a sample backup script to get you going</p>
<blockquote><p>use [master]<br />
go<br />
create procedure DailyBackup as<br />
begin<br />
declare @BackupPath varchar(300)<br />
declare @DBName varchar(256)<br />
declare @RecoveryModel int<br />
declare @DT varchar(100)<br />
declare @SQL varchar(4000)</p>
<p>set @BackupPath=N&#8217;D:\backup\&#8217;</p>
<p>DECLARE db_cursor CURSOR FOR<br />
select [name], [recovery_model]<br />
from sys.databases<br />
where state=0 and name not in (&#8216;tempdb&#8217;,'model&#8217;)<br />
OPEN db_cursor<br />
FETCH NEXT FROM db_cursor INTO @DBName, @RecoveryModel</p>
<p>WHILE @@FETCH_STATUS = 0<br />
BEGIN<br />
if (@RecoveryModel &lt;&gt; 3)<br />
begin<br />
&#8211; Backup Transaction Log<br />
set @DT = CONVERT(CHAR(8), GETDATE(), 112) + &#8216;_&#8217; + replace(CONVERT(CHAR(8), GETDATE(), 108), &#8216;:&#8217;, &#8216;_&#8217;)<br />
set @SQL = N&#8217;BACKUP LOG [' + @DBName + N'] TO DISK = N&#8221;&#8217; + @BackupPath + @DBName + @DT + N&#8217;.trn&#8221; WITH NOFORMAT, INIT, NAME = N&#8221;&#8217; + @DBName + N&#8217; Transaction Log Backup&#8221;, SKIP, NOREWIND, NOUNLOAD, STATS = 10&#8242;<br />
print (@SQL)<br />
exec (@SQL)<br />
end</p>
<p>&#8211;Backup Database<br />
set @DT = CONVERT(CHAR(8), GETDATE(), 112) + &#8216;_&#8217; + replace(CONVERT(CHAR(8), GETDATE(), 108), &#8216;:&#8217;, &#8216;_&#8217;)<br />
set @SQL = N&#8217;BACKUP DATABASE [' + @DBName + N'] TO DISK = N&#8221;&#8217; + @BackupPath + @DBName + @DT + N&#8217;.bak&#8221; WITH NOFORMAT, INIT, NAME = N&#8221;&#8217; + @DBName + &#8216; Full Backup&#8221;, SKIP, NOREWIND, NOUNLOAD, STATS = 10&#8242;<br />
print (@SQL)<br />
exec (@SQL)</p>
<p>FETCH NEXT FROM db_cursor INTO @DBName, @RecoveryModel<br />
END</p>
<p>CLOSE db_cursor<br />
DEALLOCATE db_cursor<br />
end</p></blockquote>
</li>
</ol>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jefferytay.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jefferytay.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jefferytay.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jefferytay.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jefferytay.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jefferytay.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jefferytay.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jefferytay.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jefferytay.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jefferytay.wordpress.com/116/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jefferytay.wordpress.com&blog=8893556&post=116&subd=jefferytay&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://jefferytay.wordpress.com/2009/08/20/sql-server-database-mirroring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/27d3f15ba9242eae1078607670d81806?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kwanann</media:title>
		</media:content>
	</item>
		<item>
		<title>Installing Transmission on the DNS323</title>
		<link>http://jefferytay.wordpress.com/2009/08/10/installing-transmission-on-the-dns323/</link>
		<comments>http://jefferytay.wordpress.com/2009/08/10/installing-transmission-on-the-dns323/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 23:29:21 +0000</pubDate>
		<dc:creator>kwanann</dc:creator>
				<category><![CDATA[DNS323]]></category>

		<guid isPermaLink="false">http://jefferytay.wordpress.com/?p=114</guid>
		<description><![CDATA[
SSH to your NAS
Create a folder called packages in your box
mkdir /mnt/HD_a2/packages
Goto the packages folder
cd /mnt/HD_a2/packages
Install uclibc using the 3 commands below
wget http://www.inreto.de/dns323/fun-plug/0.5/packages/uclibc-0.9.29-7.tgz
funpkg -i uclibc-0.9.29-7.tgz
reboot
Installing Transmission using the commands below
wget http://kylek.is-a-geek.org:31337/files/curl-7.18.1.tgz
wget http://kylek.is-a-geek.org:31337/files/Transmission-1.73-7.tgz
funpkg -i curl-7.18.1.tgz
funpkg -i Transmission-1.73-7.tgz
Note if you have previously installed transmission before, you will need to kill the processes. To do so , run [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jefferytay.wordpress.com&blog=8893556&post=114&subd=jefferytay&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<br /><ol>
<li>SSH to your NAS</li>
<li>Create a folder called packages in your box<br />
<strong>mkdir /mnt/HD_a2/packages</strong></li>
<li>Goto the packages folder<br />
<strong>cd /mnt/HD_a2/packages</strong></li>
<li>Install uclibc using the 3 commands below<br />
<strong>wget http://www.inreto.de/dns323/fun-plug/0.5/packages/uclibc-0.9.29-7.tgz<br />
funpkg -i uclibc-0.9.29-7.tgz<br />
reboot</strong></li>
<li>Installing Transmission using the commands below<br />
<strong>wget http://kylek.is-a-geek.org:31337/files/curl-7.18.1.tgz<br />
wget http://kylek.is-a-geek.org:31337/files/Transmission-1.73-7.tgz<br />
funpkg -i curl-7.18.1.tgz<br />
funpkg -i Transmission-1.73-7.tgz</strong></p>
<p>Note if you have previously installed transmission before, you will need to kill the processes. To do so , run top to list all the running processes, the issue kill [pid] e.g kill 2377 for each of the transmission-daemon running, then run the following 2 commands</p>
<p><strong>funpkg -I curl-7.18.1.tgz<br />
funpkg -U Transmission-1.73-7.tgz</strong></p>
<p><strong>chmod a+x /ffp/start/transmission.sh</strong><br />
<strong>reboot</strong></li>
<li>Updating clutch whitelist<br />
<strong>vi /mnt/HD_a2/.transmission-daemon/settings.json</strong></p>
<p>Edit the line with “rpc-whitelist&#8221; to something like &#8220;rpc-whitelist&#8221;: &#8220;127.0.0.1,192.*.*.*&#8221;, (assuming 192.*.*.* is your local ip subnet)<br />
Edit the line with &#8220;download-dir&#8221; to the download path for your torrents e.g download-dir&#8221;: &#8220;\/mnt\/HD_a2\/Torrent\/incomplete&#8221;<br />
Edit the line with &#8220;blocklist-enabled&#8221; to &#8220;blocklist-enabled&#8221;: 1</li>
<li>Access clutch via its url http://[ip of your nas]:9091/</li>
<li>Configuring Block Lists<br />
Goto the transmission block list folder (/mnt/HD_a2/.transmission-daemon/blocklists)<br />
Create a new file containing the following lines</p>
<blockquote><p><em>rm level1.gz -f</em><br />
<em>#wget http://www.bluetack.co.uk/config/level1.gz<br />
wget http://download.m0k.org/transmission/files/level1.gz<br />
tar -x level1.gz </em></p></blockquote>
<p><em> </em>Save the file<em><br />
<strong>chmod a+x update.sh </strong>(set it<strong> </strong>to be executable)<strong><br />
./update.sh </strong>(run the update script, this will take quite a while)</em></li>
<li>If you want an auto update of the block list, just create a cronjob to run the update script<em><strong><br />
</strong><br />
</em></li>
</ol>
<div id="_mcePaste" style="overflow:hidden;position:absolute;left:-10000px;top:397px;width:1px;height:1px;">&lt;blockquote&gt;</div>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jefferytay.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jefferytay.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jefferytay.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jefferytay.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jefferytay.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jefferytay.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jefferytay.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jefferytay.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jefferytay.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jefferytay.wordpress.com/114/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jefferytay.wordpress.com&blog=8893556&post=114&subd=jefferytay&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://jefferytay.wordpress.com/2009/08/10/installing-transmission-on-the-dns323/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/27d3f15ba9242eae1078607670d81806?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kwanann</media:title>
		</media:content>
	</item>
	</channel>
</rss>