<?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>skrud.net &#187; code</title>
	<atom:link href="http://skrud.com/articles/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://skrud.com</link>
	<description>Trust Your Geekflex</description>
	<lastBuildDate>Mon, 24 Nov 2008 20:13:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>ACM and the Canadian Province of Alabama</title>
		<link>http://skrud.com/articles/2008/03/05/acm-and-the-canadian-province-of-alabama/</link>
		<comments>http://skrud.com/articles/2008/03/05/acm-and-the-canadian-province-of-alabama/#comments</comments>
		<pubDate>Wed, 05 Mar 2008 17:42:17 +0000</pubDate>
		<dc:creator>Skrud</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[acm]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[embarrassment]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[wtf]]></category>

		<guid isPermaLink="false">http://www.skrud.net/articles/2008/03/05/acm-and-the-canadian-province-of-alabama/</guid>
		<description><![CDATA[I got an e-mail this morning informing me that since I participated in the ACM ICPC, I was eligible to receive a free ACM Student Membership for one year. ACM is, of course, the Association of Computing Machinery: the &#8220;first society in computing&#8221;. It is a prestigious organization that puts on many conferences (such as [...]]]></description>
			<content:encoded><![CDATA[<p>I got an e-mail this morning informing me that since I participated in the <a href="http://en.wikipedia.org/wiki/ACM_International_Collegiate_Programming_Contest" title="ACM International Collegiate Programming Competition">ACM ICPC</a>, I was eligible to receive a free ACM Student Membership for one year. ACM is, of course, the Association of Computing Machinery: the &#8220;first society in computing&#8221;. It is a prestigious organization that puts on many conferences (such as SIGGRAPH and OOPSLA), present guidelines for teaching Computer Science and Software Engineering curricula, and <em>ACM Fellows</em> are considered to be widely respected and influential individuals in Computer Science. Being a student member of ACM would give me access to a near-infinite set of papers and articles, for one thing, and it would be a valuable resource to have.</p>

<p>I went to the ACM&#8217;s web site to fill out their form for ICPC participants. When I clicked submit, however, I was faced with this upsetting error message:</p>

<p><img src='http://www.skrud.net/files/acm_province.png' alt='ACM Please Provide Canadian Province' /></p>

<p>No matter how many times I clicked &#8220;Submit&#8221; or filled out the form, this dialog would pop up. Following my geek instincts, I was determined to figure out why. I looked at the source code for the web page. Immediately, I noticed the all the code for the Javascript client-side form validation was right there in the page. A couple of quick searches and I found the reason I was looking for.</p>

<p>In validating the form, the Javascript checks to see that you did in fact enter a Canadian province if you selected that your country was Canada. (That is, if you entered something like &#8220;Kentucky&#8221; it would tell you pop up the error dialog, since &#8220;Kentucky&#8221; is not a Canadian province). Fair enough. However the line of code they had for validating Québec was something like this:</p>

<p><code></p>

<pre>if ( form.s_state == "PQ" ) { success = 1; } else { success = 0; }</pre>

<p></code></p>

<p>However in the form itself, as part of a giant list box, was the following option:</p>

<p><code></p>

<pre>&lt;option value="QC"&gt;Quebec&lt;/option&gt;</pre>

<p></code></p>

<p>Obviously, &#8220;QC&#8221; and &#8220;PQ&#8221; are not the same thing. So the form validation fails. What&#8217;s a geek to do? So I opened up Firefox, installed <a href="http://www.getfirebug.com">Firebug</a> and went back to the form. I used Firebug to modify the &lt;option&gt; tag so that it&#8217;s value was &#8220;PQ&#8221;, thus allowing the form to be submitted. I was met with a nasty error debugging page, since apparently &#8220;PQ&#8221; is not a valid key in their database. <strong>This means that the form <em>isn&#8217;t ever being validated on the server side</em>. The values that I fill out, passing the Javascript client-side validation, go straight to their database.</strong></p>

<p>Sufficiently disgruntled, and realizing that there&#8217;s no server-side validation whatsoever (other than some foreign key constraints in the database), I opted to simply disable Javascript in my browser. This worked like a charm. My form was submitted successfully, I received a registration number and confirmation e-mail and everything. <strong>This is analogous to being locked out of a car, and managing to open the door by pressing the &#8220;bypass locking mechanism&#8221;-button that is located on the handle.</strong></p>

<p>But I made a mistake. After disabling Javascript I forgot to select &#8220;Quebec&#8221; from the dropdown box. So according to the ACM, I live in Montreal, in the state of Alabama, in Canada.</p>

<p><img src='http://www.skrud.net/files/acm_address.png' alt='ACM Address Alabama' /></p>

<p>Ridiculous. This is <em>the</em> society of programmers, computer scientists and software engineers &#8212; <strong>and they can&#8217;t even get a simple web form right</strong>. Forms should always, <em>always</em>, <strong><em><u>ALWAYS</u></em></strong> be validated on the server-side. This is elementary. This is basic. This is <em>common-sense</em>.</p>

<p>Don&#8217;t worry, though. I fully plan to notify the <a href="http://www.thedailywtf.com">appropriate individuals</a> to resolve the problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://skrud.com/articles/2008/03/05/acm-and-the-canadian-province-of-alabama/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Imagine Cup Finals: 2nd Place!</title>
		<link>http://skrud.com/articles/2007/06/17/imagine-cup-finals-2nd-place/</link>
		<comments>http://skrud.com/articles/2007/06/17/imagine-cup-finals-2nd-place/#comments</comments>
		<pubDate>Sun, 17 Jun 2007 17:40:21 +0000</pubDate>
		<dc:creator>Skrud</dc:creator>
				<category><![CDATA[2007]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[imaginecup]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[travel]]></category>

		<guid isPermaLink="false">http://www.skrud.net/2007/06/17/imagine-cup-finals-2nd-place/</guid>
		<description><![CDATA[This has been an incredible week. Starting with landing down on Sunday, and meeting my team for the first time: Jay, Scott and Chris, from varying corners of the U.S. We sat down and fleshed out a project idea for a Virtual Classroom system. The idea is to recreate the classroom experience, add new forms [...]]]></description>
			<content:encoded><![CDATA[<p>This has been an incredible week. Starting with landing down on Sunday, and meeting my team for the first time: Jay, Scott and Chris, from varying corners of the U.S. We sat down and fleshed out a project idea for a Virtual Classroom system. The idea is to recreate the classroom experience, add new forms of interaction to it, and extend the reach of world-class professors. People could take courses over the internet, by attending lectures, in <em>real-time</em>, from classrooms around the world. They could interact with the class by asking questions (and eventually, by real-time chat with TAs or other classmates). We had powerpoint slides being synched up from the teacher&#8217;s podium to each student client, and we had the ability for whatever the teacher would draw on the slides to be redrawn on each student&#8217;s screen. We also had streaming audio of the lecture being send to each student. I&#8217;d love to give you guys more detail on the project, so ask me about it over a pint sometime.</p>

<p>The bulk of the week was spent in our hotel room office, coding, testing fixing and coding. We didn&#8217;t have time for any fancy development practices or anything formal; we went for the iterative/last-minute model: get stuff working fast. We got a lot of input from our Microsoft mentors: Jaime, Mike and Justin who came by the hotel nearly every day (and got free dinner ;)), helped us organize ideas and practice our presentation. These guys volunteered plenty of their own time to helping us out, and it was much appreciated.</p>

<p>Yesterday was the big presentation day, where we had to show off what we&#8217;ve done to a panel of judges, which included Microsoft researchers, with backgrounds in physics, and engineering&#8230; It was kind of brutal. The picked apart every presentation to the point where we had no idea whom would win. Obviously, given the limited timeframe, a lot of the projects were in the same relative state of hastily-written code. There was one project that stood out, which was polished and clean, and had a great idea. This was ObjectSpace, which presented a 3D, interactive coding environment that would teach people how to program. We were <em>sure</em> they were going to take first place. Our presentation was pretty good, and we were confident that we&#8217;d be in the top 3.</p>

<p>When it came time to present the awards, however, ObjectSpace came in <em>third</em>. At this point my heart was pounding. We knew we were getting something for sure &#8212; because they brutally singled out the two teams that didn&#8217;t win anything before announcing the winners. And if ObjectSpace came in third, that meant we had a damn good shot at first place, and Korea. Then we called up for second place, or &#8212; as it says my trophy &#8212; &#8220;1st Runner Up&#8221;. (I think &#8220;2nd place&#8221; sounds better). This was more than we could&#8217;ve hoped for, and not bad for a weeks&#8217; worth of work. ;)</p>

<p>I&#8217;m really glad I got the time to meet up with my friends who&#8217;ve moved out here to work at Microsoft, too. I took the time on Tuesday to check out Taphouse Grill with Vivian, and I went over to Nadia&#8217;s apartment to play some pool with her, Ahmed, Eric, and their friend Rosh. Vivian came back out to drink and eat sushi with us last night, too. Who knows when I&#8217;ll get to see these friends again &#8212; hopefully sooner rather than later. I kind of regret not being able to see much of downtown Seattle (we had one afternoon where we went to an arcade/bar and Scott and I defeated House of the Dead 4), but this week has been a <em>blast</em> nonetheless. You can bet I&#8217;ll register for Imagine Cup again next year.</p>

<p>And finally, I&#8217;d like to give a huge THANK YOU to all the organizers. Especially Stephanie, who had the stressful job of being a temporary Mom to some 24 geeks throughout the entire week. She made sure we got fed, met our mentors, had time to practice, and enjoyed ourselves throughout the week.</p>

<p>That&#8217;s it for now &#8212; I&#8217;ve got a plane to catch. :)</p>
]]></content:encoded>
			<wfw:commentRss>http://skrud.com/articles/2007/06/17/imagine-cup-finals-2nd-place/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Perils of Noun-Oriented Thinking</title>
		<link>http://skrud.com/articles/2006/03/30/the-perils-of-noun-oriented-thinking/</link>
		<comments>http://skrud.com/articles/2006/03/30/the-perils-of-noun-oriented-thinking/#comments</comments>
		<pubDate>Thu, 30 Mar 2006 13:26:00 +0000</pubDate>
		<dc:creator>Skrud</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[oop]]></category>

		<guid isPermaLink="false">http://www.skrud.net/2006/03/30/the-perils-of-noun-oriented-thinking/</guid>
		<description><![CDATA[Over at Stevey&#8217;s Blog Rants, there&#8217;s a great article entitled Execution in the Kingdom of Nouns.  Stevey eloquently describes the problems inherent in the Java programming language&#8217;s emphasis on Object-Oriented Programming to the EXTREEEEME.  There&#8217;s a lot of truth is the stories he tells of the problems in Javaland, and insightful comparisons to [...]]]></description>
			<content:encoded><![CDATA[<p>Over at <a href="http://steve-yegge.blogspot.com">Stevey&#8217;s Blog Rants</a>, there&#8217;s a great article entitled <a href="http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html">Execution in the Kingdom of Nouns</a>.  Stevey eloquently describes the problems inherent in the Java programming language&#8217;s emphasis on Object-Oriented Programming <em>to the EXTREEEEME</em>.  There&#8217;s a lot of truth is the stories he tells of the problems in Javaland, and insightful comparisons to other Programming Language Kingdoms.</p>

<p>Java itself does force you to place things in objects, when <em>maybe</em>, an &#8220;object&#8221; is not always the best place for that thing. And while a Java program clearly reveals it&#8217;s <em>architecture</em>, it doesn&#8217;t do a very good job of revealing it&#8217;s <em>intentions</em>. I for one prefer <em>intention-revealing</em> code to anything else. I like being able to glance at a code fragment and say &#8220;I know what this does&#8221; &#8211; without having to look up a class reference API document.</p>

<p>Given all the Java programming I&#8217;ve been doing in one of our projects this semester, Stevey&#8217;s rant sure made me feel a bit better about being bitter. :)</p>
]]></content:encoded>
			<wfw:commentRss>http://skrud.com/articles/2006/03/30/the-perils-of-noun-oriented-thinking/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CUSEC &#8211; Dr. Grogono &amp; Malleable Software</title>
		<link>http://skrud.com/articles/2006/01/20/cusec-dr-grogono-malleable-software/</link>
		<comments>http://skrud.com/articles/2006/01/20/cusec-dr-grogono-malleable-software/#comments</comments>
		<pubDate>Fri, 20 Jan 2006 18:22:17 +0000</pubDate>
		<dc:creator>Skrud</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[cusec]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.skrud.net/2006/01/20/cusec-dr-grogono-malleable-software/</guid>
		<description><![CDATA[Today&#8217;s first keynote speech was given by Concordia&#8217;s Dr. Peter Grogono.  The topic was &#8220;Modular Concurrency.&#8221; He started with a metaphor about an air traffic control system, where a number of controllers would sit in a room looking at a blackboard in order to coordinate aircraft and schedules. However, as the airlines expanded, the [...]]]></description>
			<content:encoded><![CDATA[<p>Today&#8217;s first keynote speech was given by Concordia&#8217;s <a href="http://www.cs.concordia.ca/~grogono">Dr. Peter Grogono</a>.  The topic was &#8220;Modular Concurrency.&#8221; He started with a metaphor about an air traffic control system, where a number of controllers would sit in a room looking at a blackboard in order to coordinate aircraft and schedules. However, as the airlines expanded, the room got bigger, and people would be sitting further and further back. Eventually they&#8217;d start using telescopes in order to view the blackboard. Following more expansions, the telescopes were no good anymore, and the proposed solution was: use bigger telescopes.</p>

<p>Object Oriented Programming has some fundamental flaws. All the languages (and there are more and more languages coming out all the time) are simply bigger telescopes trying to address a similar problem. Dr. Grogono began describing a new programming paradigm and language that he has been working on in collaboration with Brian Shearing (who gave a seminar at Concordia on a similar topic during the summer).  Their paradigm is called <em>Malleable Software</em>.</p>

<p>Their idea is to organize code in <em>cells</em> that have certain capabilities which may or may not be concurrent. (A lot of the talk involved concurrency issues in modern programming languages such as Java and C++ and how they are &#8211; by default or by design &#8211; insecure. However I have not had the opportunity to deal with the concurrency headache, so I&#8217;ve not fallen victim to those insecurities yet). Cells can only exchange data, instead of calling operations on each other. This avoids the problem of having ugly coupling problems, where one method in one class may call another method in another class which modifies the data in the first class &#8230;. and ugliness continues.</p>

<p>Another problem the duo intend to solve involves the use of <code>import</code>, <code>include</code>, etc. statements that so often muck up modern programs. Imagine a huge project where one class may need a number of different functionalities and has to import every single dependent class or header file <em>whether or not you actually use them</em> &#8230; In Malleable Software, a Cell would be <em>given</em> the <em>capabilities</em> to do certain functions (such as the ability to generate random numbers) although I have no idea who or what <em>gives</em> the Cell these abilities. (I remember asking this question to Brian Shearing when he mentioned a similar concept, but I can&#8217;t remember the answer).</p>

<p>Once the audio recordings are out on the CUSEC website, you should listen to this keynote and see what you can get out of it. I think a lot of the malleable software concept is still being played with in its creators heads, so some stuff probably hasn&#8217;t been figured out yet.</p>
]]></content:encoded>
			<wfw:commentRss>http://skrud.com/articles/2006/01/20/cusec-dr-grogono-malleable-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monkey Knife Fight!</title>
		<link>http://skrud.com/articles/2005/12/12/monkey-knife-fight/</link>
		<comments>http://skrud.com/articles/2005/12/12/monkey-knife-fight/#comments</comments>
		<pubDate>Tue, 13 Dec 2005 01:00:35 +0000</pubDate>
		<dc:creator>Skrud</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.skrud.net/2005/12/12/monkey-knife-fight/</guid>
		<description><![CDATA[The Minimal vs. Humane Interfaces thing seemed to generate a lot of discussion, and once instance of Behrouz telling me to get laid.

Either way, there&#8217;s a great play-by-play overview of the discussion in Ruby Advent Calendar Day Nine: Monkey Knife Fight! by Joey deVilla that sums up opinions from various other people and presents a [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://skrud.net/posts/2005/12/10/minimal-vs-humane-interfaces/">Minimal vs. Humane Interfaces</a> thing seemed to generate a lot of discussion, and once instance of Behrouz telling me to get laid.</p>

<p>Either way, there&#8217;s a great play-by-play overview of the discussion in <a href="http://farm.tucows.com/blog/_archives/2005/12/9/1443435.html">Ruby Advent Calendar Day Nine: Monkey Knife Fight!</a> by Joey deVilla that sums up opinions from various other people and presents a lot of sides to the same discussion.</p>

<p>If you&#8217;re still thinking about it, it&#8217;s a great read :D</p>
]]></content:encoded>
			<wfw:commentRss>http://skrud.com/articles/2005/12/12/monkey-knife-fight/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
