<?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/"
	>

<channel>
	<title>Geek</title>
	<atom:link href="http://geek.starbean.net/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://geek.starbean.net</link>
	<description>The experience of a nerd.</description>
	<lastBuildDate>Mon, 28 Jun 2010 01:35:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>search question mark in excel (?)</title>
		<link>http://geek.starbean.net/?p=341</link>
		<comments>http://geek.starbean.net/?p=341#comments</comments>
		<pubDate>Mon, 28 Jun 2010 01:35:44 +0000</pubDate>
		<dc:creator>xen</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://geek.starbean.net/?p=341</guid>
		<description><![CDATA[tried to search for the question mark in Excel but it is treated as a wildcard instead. Found that the escape char in Excel is ~. Which means &#8220;~?&#8221; to find a question mark, and &#8220;~~&#8221; to find a tilde. http://support.microsoft.com/?kbid=214138]]></description>
			<content:encoded><![CDATA[<p>tried to search for the question mark in Excel but it is treated as a wildcard instead.</p>
<p>Found that the escape char in Excel is ~. Which means &#8220;~?&#8221; to find a question mark, and &#8220;~~&#8221; to find a tilde.</p>
<p><a href="http://support.microsoft.com/?kbid=214138">http://support.microsoft.com/?kbid=214138</a></p>
]]></content:encoded>
			<wfw:commentRss>http://geek.starbean.net/?feed=rss2&amp;p=341</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>abc.getXyz()</title>
		<link>http://geek.starbean.net/?p=339</link>
		<comments>http://geek.starbean.net/?p=339#comments</comments>
		<pubDate>Thu, 24 Jun 2010 13:45:19 +0000</pubDate>
		<dc:creator>xen</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://geek.starbean.net/?p=339</guid>
		<description><![CDATA[Why is it not good to keep using &#8220;abc.getXyz()&#8221; in the same method? 1. This is especially important if you are expecting the same value to be returned for each call. A 2nd call can potentially give you a different result from the first, therefore caching it in a local variable is a good idea. [...]]]></description>
			<content:encoded><![CDATA[<p>Why is it not good to keep using &#8220;abc.getXyz()&#8221; in the same method?</p>
<p>1. This is especially important if you are expecting the same value to be returned for each call. A 2nd call can potentially give you a different result from the first, therefore caching it in a local variable is a good idea.</p>
<p>2. The call may be expensive. Each call may be going through a web service to query a database for the return value. If you save it in a local variable it will only be done once. Even if you &#8220;know&#8221; that it doesn&#8217;t now, you should expect polymorphism.</p>
]]></content:encoded>
			<wfw:commentRss>http://geek.starbean.net/?feed=rss2&amp;p=339</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reflecting outer class</title>
		<link>http://geek.starbean.net/?p=335</link>
		<comments>http://geek.starbean.net/?p=335#comments</comments>
		<pubDate>Wed, 17 Mar 2010 14:12:21 +0000</pubDate>
		<dc:creator>xen</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://geek.starbean.net/?p=335</guid>
		<description><![CDATA[Given an inner class object, how do you use reflection to obtain a reference to the outer class? this$0. Field parent = inner.getClass().getDeclaredField("this$0"); parent.setAccessible(true); Object outer = parent.get(inner); If it is a nested inner class, increment the 0.]]></description>
			<content:encoded><![CDATA[<p>Given an inner class object, how do you use reflection to obtain a reference to the outer class? this$0.</p>
<pre><code>
  Field parent = inner.getClass().getDeclaredField("this$0");
  parent.setAccessible(true);
  Object outer = parent.get(inner);
</code></pre>
<p>If it is a nested inner class, increment the 0.</p>
]]></content:encoded>
			<wfw:commentRss>http://geek.starbean.net/?feed=rss2&amp;p=335</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Track memory usage in QTP with WMI</title>
		<link>http://geek.starbean.net/?p=332</link>
		<comments>http://geek.starbean.net/?p=332#comments</comments>
		<pubDate>Wed, 17 Mar 2010 12:28:48 +0000</pubDate>
		<dc:creator>xen</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://geek.starbean.net/?p=332</guid>
		<description><![CDATA[I used QTP to simulate a repeating user scenario in order to trace a memory leak with YourKit over time. So I&#8217;m using this quick &#038; dirty function to poll the application regularly about it&#8217;s raw memory usage. Function GetMemory pid = GetWindow().GetROProperty("process id") Set wmiService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") Set resultset = wmiService.ExecQuery("SELECT WorkingSetSize FROM Win32_Process [...]]]></description>
			<content:encoded><![CDATA[<p>I used QTP to simulate a repeating user scenario in order to trace a memory leak with YourKit over time. So I&#8217;m using this quick &#038; dirty function to poll the application regularly about it&#8217;s raw memory usage.</p>
<pre><code>
Function GetMemory
	pid = GetWindow().GetROProperty("process id")
	Set wmiService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
	Set resultset = wmiService.ExecQuery("SELECT WorkingSetSize FROM Win32_Process WHERE Handle=" &amp; pid)
	For Each result In resultset
		GetMemory = Int(result.WorkingSetSize)
	Next
End Function
</code></pre>
<p>GetWindow() returns a reference to the application window.</p>
<p>It seems even though I SELECT only WorkingSetSize I could get other information such as Handle from the result.</p>
<p>The For Each loop was an easy way out since I didn&#8217;t know how to access the first element.</p>
<p>Reference: <a href="http://www.learnqtp.com/windows-management-instrumentation-wmi-qtp/">http://www.learnqtp.com/windows-management-instrumentation-wmi-qtp/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://geek.starbean.net/?feed=rss2&amp;p=332</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jedit: Find and Replace</title>
		<link>http://geek.starbean.net/?p=330</link>
		<comments>http://geek.starbean.net/?p=330#comments</comments>
		<pubDate>Thu, 18 Feb 2010 13:17:43 +0000</pubDate>
		<dc:creator>xen</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://geek.starbean.net/?p=330</guid>
		<description><![CDATA[jedit&#8217;s Find and Replace feature supports regular expression with capturing groups, so you can match a regular expression in the Find field and use $1 $2 in the Replace field. Together with is &#8220;Directory&#8221; option you can manipulate file content easily.]]></description>
			<content:encoded><![CDATA[<p>jedit&#8217;s Find and Replace feature supports regular expression with capturing groups, so you can match a regular expression in the Find field and use <strong>$1 $2</strong> in the Replace field. Together with is &#8220;Directory&#8221; option you can manipulate file content easily.</p>
]]></content:encoded>
			<wfw:commentRss>http://geek.starbean.net/?feed=rss2&amp;p=330</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
