<?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>gyrmination &#187; Code</title>
	<atom:link href="http://ttwhy.org/home/blog/category/logistical/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://ttwhy.org/home/blog</link>
	<description>from the seeds of gyrm</description>
	<lastBuildDate>Wed, 22 Feb 2012 04:50:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>C# For Programmers</title>
		<link>http://ttwhy.org/home/blog/2010/01/31/c-for-programmers/</link>
		<comments>http://ttwhy.org/home/blog/2010/01/31/c-for-programmers/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 01:09:52 +0000</pubDate>
		<dc:creator>gyrm</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://ttwhy.org/home/blog/?p=188</guid>
		<description><![CDATA[I just breezed through Illustrated C# 2005, and made a list of language features / concepts that struck me for one reason or another, mostly as a function of being either different from (or similar to!) features in other languages I am already familiar with. ref and out parameters pass value objects into or &#8220;out [...]]]></description>
			<content:encoded><![CDATA[<p>I just breezed through <em>Illustrated C# 2005</em>, and made a list of language features / concepts that struck me for one reason or another, mostly as a function of being either different from (or similar to!) features in other languages I am already familiar with.</p>
<dl>
<dt><code>ref</code> and <code>out</code> parameters</dt>
<dd>pass value objects into or &#8220;out of&#8221; methods by reference</dd>
<dt>properties</dt>
<dd>allow exposing properties as fields, backed by getter and/or setter methods</dd>
<dt><code>static</code> constructors</dt>
<dd>where it is possible to initialize static fields</dd>
<dt>finalizers</dt>
<dd>where it is possible to clean up resources used by an instance. Syntax is reminiscent of syntax for C++ destructors.</dd>
<dt>indexers</dt>
<dd>allows the square bracket operator (i.e. <code>[5]</code>) to be applied to instances</dd>
<dt>delegates</dt>
<dd>essentially closures that invoke zero or more methods with the same signature. Event handlers are implemented as delegates, such that adding and removing listeners is accomplished using the <code>+=</code> and <code>-=</code> operators.</dd>
<dt><code>partial</code> classes</dt>
<dd>allow classes to be defined / extended across multiple files</dd>
<dt><code>using</code> statements</dt>
<dd>a convenience construct that maps to a <code>try { ... } finally { ... }</code> block, calling <code>Dispose()</code> (from <code>IDisposable</code>) on the used object if an exception is thrown</dd>
<dt>attributes</dt>
<dd>essentially Java annotations</dd>
<dt>inherited methods with <code>virtual</code>, <code>override</code>, <code>new</code></dt>
<dd>method overridding must be explicitly permitted with <code>virtual</code>. Overriding and hiding also must be explicitly called out, via <code>override</code> and <code>new</code>.</dd>
<dt>iterator blocks, <code>yield return</code> statements</dt>
<dd>when defining new iterators for use in <code>foreach</code> statements</dd>
<dt>nullable value types, <code>??</code> (null coalescing operator)</dt>
<dd>value types can be allowed to have the value <code>null</code>. The null coalescing operator allows an alternative value to be specified more concisely, when a variable is found to be <code>null</code>. Similar to Groovy&#8217;s &#8220;elvis&#8221; operator <code>?:</code> .</dd>
<dt><code>implicit</code> and <code>explicit</code> type conversions</dt>
<dd>conversions can be defined between types for which an inheritance relationship does not exist. Overall, this seems like a confusingly &#8220;clever&#8221; feature to use, and probably best avoided.</dd>
<dt>generics and constraints (<code>where</code> clauses)</dt>
<dd>like Java generics, but with more expressive type constraints expressed as <code>where</code> clauses.</dd>
<dt><code>is</code>, <code>as</code>, <code>typeof()</code></dt>
<dd>how to dynamically check type information; <code>is</code> is like Java&#8217;s <code>instanceof</code>; <code>as</code> is like a C++ <code>dynamic_cast</code>; and <code>typeof()</code> returns a <code>Type</code> object.</dd>
</dl>
]]></content:encoded>
			<wfw:commentRss>http://ttwhy.org/home/blog/2010/01/31/c-for-programmers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Entanglement</title>
		<link>http://ttwhy.org/home/blog/2009/02/21/entanglement/</link>
		<comments>http://ttwhy.org/home/blog/2009/02/21/entanglement/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 04:50:50 +0000</pubDate>
		<dc:creator>gyrm</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://ttwhy.org/home/blog/2009/02/21/entanglement/</guid>
		<description><![CDATA[Just wasted a good chunk of time on an issue I had using Grails &#8211; &#8220;deleted object would be re-saved by cascade&#8221;. Turns out that among the associations you need to remove to clear this error are the bi-directional associations created using belongsTo . I removed belongsTo from the domain object being removed from another [...]]]></description>
			<content:encoded><![CDATA[<p>Just wasted a good chunk of time on an issue I had using Grails &#8211; &#8220;deleted object would be re-saved by cascade&#8221;. Turns out that among the associations you need to remove to clear this error are the <strong>bi-directional associations created using <code>belongsTo</code></strong> . I removed <code>belongsTo</code> from the domain object being removed from another object&#8217;s list and deleted, problem solved! Incidentally the reverse link wasn&#8217;t necessary anyway.</p>
]]></content:encoded>
			<wfw:commentRss>http://ttwhy.org/home/blog/2009/02/21/entanglement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Selenium is Groovy</title>
		<link>http://ttwhy.org/home/blog/2008/09/26/selenium-is-groovy/</link>
		<comments>http://ttwhy.org/home/blog/2008/09/26/selenium-is-groovy/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 03:28:10 +0000</pubDate>
		<dc:creator>gyrm</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Selenium]]></category>

		<guid isPermaLink="false">http://ttwhy.org/home/blog/2008/09/26/selenium-is-groovy/</guid>
		<description><![CDATA[UI-Element has been integrated into Selenium Core in the project&#8217;s subversion repository for some time now. This means no special tricks are necessary to use it &#8211; just specify your map file as a user extension! I&#8217;m posting this announcement mainly because it seems my original UI-Element post is at the top of Google&#8217;s search [...]]]></description>
			<content:encoded><![CDATA[<p>UI-Element has been integrated into Selenium Core in the project&#8217;s subversion repository for some time now. This means no special tricks are necessary to use it &#8211; just specify your map file as a user extension! I&#8217;m posting this announcement mainly because it seems my original UI-Element post is at the top of Google&#8217;s search results, and I wanted to make clear that some things have changed significantly since it was published (but don&#8217;t want to rewrite the thing &#8230; you know, for posterity!).</p>
<p>Here&#8217;s the <a href="http://svn.openqa.org/fisheye/browse/~raw,r=trunk/selenium/trunk/src/main/resources/core/scripts/ui-doc.html">updated documentation link</a> (if it doesn&#8217;t move again).</p>
<p>In other news, there is now a Groovy formatter for Selenium IDE, and support for a special <code>GroovySeleneseTestCase</code> which makes it possible to merge <em>*AndWait</em> commands into single commands. For example:</p>
<pre class="code">
clickAndWait | foo
</pre>
<p>with the Java formatter translates into:</p>
<pre class="code">
selenium.click("foo");
selenium.waitForPageToLoad("30000");
</pre>
<p>while the Groovy formatter simply says:</p>
<pre class="code">
selenium.clickAndWait("foo")
</pre>
<p>Cleaner, and more expressive.</p>
]]></content:encoded>
			<wfw:commentRss>http://ttwhy.org/home/blog/2008/09/26/selenium-is-groovy/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Selenium RC Per-Session Extension Javascript</title>
		<link>http://ttwhy.org/home/blog/2008/05/14/selenium-rc-per-session-extension-javascript/</link>
		<comments>http://ttwhy.org/home/blog/2008/05/14/selenium-rc-per-session-extension-javascript/#comments</comments>
		<pubDate>Thu, 15 May 2008 00:46:24 +0000</pubDate>
		<dc:creator>gyrm</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Selenium]]></category>

		<guid isPermaLink="false">http://ttwhy.org/home/blog/2008/05/14/selenium-rc-per-session-extension-javascript/</guid>
		<description><![CDATA[Several people have asked if it is possible to specify user extension Javascript dynamically with the RC, as opposed to on the command line with the -userExtensions flag when starting up the server. It wasn&#8217;t possible before. It should be now. If you build from r2291 or greater from the RC trunk, you can play [...]]]></description>
			<content:encoded><![CDATA[<p>Several people have asked if it is possible to specify user extension Javascript dynamically with the RC, as opposed to on the command line with the <code>-userExtensions</code> flag when starting up the server. It wasn&#8217;t possible before.</p>
<p>It should be now.</p>
<p>If you build from r2291 or greater from the RC trunk, you can play with it. Basically, the extension Javascript must be specified before the browser is launched, and stays in-play until the session is closed. A sample test has been checked in here:</p>
<p><a href="http://svn.openqa.org/fisheye/browse/selenium-rc/trunk/tests/generated/src/test/java/com/thoughtworks/selenium/thirdparty/SessionExtensionJsTest.java?r=2365">SessionExtensionJsTest.java</a></p>
<p>This probably doesn&#8217;t work for proxy injection mode yet.</p>
<p>Happy extending!  <img src='http://ttwhy.org/home/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Update</strong></p>
<p>It appears too easy to encounter the &#8220;414 Request URI Too Large&#8221; issue. I&#8217;m looking into this.</p>
<p><strong>Update</strong></p>
<p>Looks like the 414 issue is related specifically to the Perl driver (see <a href="http://clearspace.openqa.org/message/43875">this Clearspace post</a>); I noticed it when using Perl, but did not see the issue when running an equivalent test in Groovy:</p>
<pre class="code">
import com.thoughtworks.selenium.*

class URILengthTest extends GroovyTestCase {
    def selenium

    @Override
    void setUp() {
        selenium = new DefaultSelenium('localhost',
            4444, '*firefox',
            'http://alistapart.com')
    }

    @Override
    void tearDown() {
        selenium.stop()
    }

    void testURILength() {
        def extensionJs = new File(
            'selenium-core/src/main/resources/core/scripts/ui-map-sample.js').text

        selenium.setExtensionJs(extensionJs)
        selenium.start()
        selenium.open('http://alistapart.com')
        selenium.click(
            'ui=allPages::section(section=topics)')
        selenium.waitForPageToLoad('5000')
    }
}
</pre>
<p><strong>Update</strong></p>
<p>Unfortunately, the 414 issue also affects the Python and Ruby client drivers (I just tested and verified this). I&#8217;m not about to fix them right this moment, so it appears the you can only truly take advantage of the per-session extension feature (i.e. include extensions of arbitrary size) in Java and Groovy for now.  <img src='http://ttwhy.org/home/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />   The good news is that this issue has already been reported, and JIRA tickets created (<a href="http://jira.openqa.org/browse/SRC-319">SRC-319</a> for Perl, <a href="http://jira.openqa.org/browse/SRC-321">SRC-321</a> for Python, <a href="http://jira.openqa.org/browse/SRC-322">SRC-322</a> for Ruby, and others for C# and PHP).</p>
]]></content:encoded>
			<wfw:commentRss>http://ttwhy.org/home/blog/2008/05/14/selenium-rc-per-session-extension-javascript/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>rt2500</title>
		<link>http://ttwhy.org/home/blog/2008/02/28/rt2500/</link>
		<comments>http://ttwhy.org/home/blog/2008/02/28/rt2500/#comments</comments>
		<pubDate>Fri, 29 Feb 2008 01:14:56 +0000</pubDate>
		<dc:creator>gyrm</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://ttwhy.org/home/blog/2008/02/28/rt2500/</guid>
		<description><![CDATA[My 6-year old laptop is still puttering along. Recently updated the kernel, and had to rebuild the wireless driver. The card is an Asus wl-107. The latest beta of the rt2500 driver doesn&#8217;t work with recent kernels; you need to grab a nightly snapshot. To get the card to work (as opposed to simply flashing [...]]]></description>
			<content:encoded><![CDATA[<p>My 6-year old laptop is still puttering along. Recently updated the kernel, and had to rebuild the wireless driver. The card is an Asus wl-107. The latest beta of the rt2500 driver doesn&#8217;t work with recent kernels; you need to grab a <a href="http://rt2x00.serialmonkey.com/rt2500-cvs-daily.tar.gz">nightly snapshot</a>.</p>
<p>To get the card to work (as opposed to simply flashing its lights while the &#8220;network is unreachable&#8221;), something like the following script should be run. It used to work without the <code>sleep</code> command, but it&#8217;s more touchy now than it used to be.</p>
<pre class="code">
# starts the rt2500 ra0 interface
ifconfig ra0 up
ifconfig ra0 192.168.2.20
route add default gw 192.168.2.1
sleep 15s
iwconfig ra0 mode managed essid <AP> \
channel 1 key restricted <WEP>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ttwhy.org/home/blog/2008/02/28/rt2500/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

