<?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>big-oh notation - Tan Quach &#187; General</title>
	<atom:link href="http://www.tanquach.com/blog/category/general/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tanquach.com/blog</link>
	<description>The secret to happiness is low expectations.</description>
	<lastBuildDate>Wed, 03 Feb 2010 22:57:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to Make Millions off Rounding Errors</title>
		<link>http://www.tanquach.com/blog/2010/02/03/how-to-make-millions-off-rounding-errors/</link>
		<comments>http://www.tanquach.com/blog/2010/02/03/how-to-make-millions-off-rounding-errors/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 22:07:58 +0000</pubDate>
		<dc:creator>tan</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[bell]]></category>
		<category><![CDATA[rounding errors]]></category>

		<guid isPermaLink="false">http://www.tanquach.com/blog/?p=170</guid>
		<description><![CDATA[Ahh, tax season. The most wonderful time of the year. I recently discovered while going through my past year&#8217;s expenses, that Bell Mobility (my cell phone carrier) has been over-charging me on taxes every month. Well, 11/12 months, actually. Once did I see a rounding error in my favour.
This was odd, but not entirely surprising. [...]]]></description>
			<content:encoded><![CDATA[<p>Ahh, tax season. The most wonderful time of the year. I recently discovered while going through my past year&#8217;s expenses, that Bell Mobility (my cell phone carrier) has been over-charging me on taxes every month. Well, 11/12 months, actually. Once did I see a rounding error in my favour.</p>
<p>This was odd, but not entirely surprising. Bell Canada obviously has legacy software, and as a practitioner I can see how these bugs can get in. But did other people experience this? Did anyone else even care?</p>
<p>On my bill, I found that sometimes the taxes were being rounded up instead of down and other times, just completely wrong as it was off by at most 6 cents sometimes.</p>
<p>When you think about it, 6 cents is not a lot, nor is it worth 20 minutes on the phone with a Bell CSR who doesn&#8217;t stop laughing at you and making smarmy comments about writing you a cheque for $0.06.</p>
<p>But 2 cents, 6 cents, whatever, every month adds up. It adds up to $1.51 over a year in fact. And with 7-8 million customers who don&#8217;t notice, that&#8217;s a lot of revenue for Ma Bell.</p>
<p>So, I went immediately to Google to complain and sure enough there were other people experiencing the same problem but didn&#8217;t feel the need to fight it.</p>
<p>After talking to the CSR, it was revealed that this was in fact, <em>by design</em>. This is part of the billing software because they charge tax on every line item on your phone bill. If the line item was $0.35, they&#8217;d round up $0.0455 cents to an even $0.05.</p>
<p>On my last phone bill, there was over 200 line items, each one being either rounded up or down after having taxes applied. The end result? The sum total was off by $0.04 cents.</p>
<p>So how would you convince Bell to stop this madness? In high school, they taught us about significant digits and how you should keep track of significant digits until at the end before rounding the value. Clearly, whoever programmed this billing system is accumulating fractions of pennies in an off-shore bank account somewhere.</p>
<p>If you&#8217;re a small business or incorporated, you can claim back the GST that you paid. This means there is an opportunity here to actually make money! The key is to maximize the number of times Bell rounds down on each line item. That means making quick phone calls that last less than a minute repeatedly. If you do this a few thousand times, you might be able to make $0.50! Just imagine the money piling in!</p>
<p>I&#8217;ve made a quick chart of how this works out. Hopefully it explains things a lot clearer than I can explain.</p>
<div class="wp-caption aligncenter" style="width: 514px"><img title="Making Money off Rounding Errors" src="http://images.cheezburger.com/completestore/2010/2/3/129097076518074085.png" alt="Now all you need is a (money) laundramat." width="504" height="497" /><p class="wp-caption-text">Now all you need is a (money) Laundromat.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.tanquach.com/blog/2010/02/03/how-to-make-millions-off-rounding-errors/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Trying to Co-Exist with Google</title>
		<link>http://www.tanquach.com/blog/2009/06/04/trying-to-co-exist-with-google/</link>
		<comments>http://www.tanquach.com/blog/2009/06/04/trying-to-co-exist-with-google/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 19:10:26 +0000</pubDate>
		<dc:creator>tan</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Ideas]]></category>

		<guid isPermaLink="false">http://www.tanquach.com/blog/?p=72</guid>
		<description><![CDATA[It seems every time I think of an idea, someone has already thought of it. More so, its typically Google. Previously, I mentioned that it would be great to have a highly collaborative environment for coding. Now, they&#8217;ve just unveiled Google Wave which is going to be the definitive online collaboration environment. It will redefine communication [...]]]></description>
			<content:encoded><![CDATA[<p>It seems every time I think of an idea, someone has already thought of it. More so, its typically Google. Previously, I mentioned that it would be great to have a <a href="http://www.tanquach.com/blog/2008/05/10/the-next-generation-of-collaborative-development/">highly collaborative environment for coding</a>. Now, they&#8217;ve just unveiled <a href="http://wave.google.com">Google Wave</a> which is going to be the definitive online collaboration environment. It will redefine communication on the Internet and how you interact with people. No more trying to organize trips, weeding through endless emails, managing workflows. Google has the answer to everything.</p>
<p>Google has quickly become a depot of innovation and an incubator of ideas. The challenge for the rest of us is to be able to co-exist and if possible, even succeed without being destroyed by Google.</p>
<p>Being an entrepreneur is difficult enough without having this looming cloud of Google sitting on top of you. Once you do find your idea and fall in love with it enough to accept that even if Google is doing it already, that you will still ford ahead and do it, then the fun starts. For the most part, the technology part is the easy part, its everything else that&#8217;s a pain. Marketing and sales can be tough and shouldn&#8217;t be taken for granted. Of course there are some who say that a product markets itself, and that usually just takes patience and hard work.</p>
<p>Check out the video, the intro is a little creepy and cultish, but the demo is pretty neat. You can skip ahead to about 8:02 of the video.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="340" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/v_UyVmITiYQ&amp;hl=en&amp;fs=1&amp;" /><embed type="application/x-shockwave-flash" width="560" height="340" src="http://www.youtube.com/v/v_UyVmITiYQ&amp;hl=en&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tanquach.com/blog/2009/06/04/trying-to-co-exist-with-google/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cope vs. Uncle Bob: Architecture through TDD</title>
		<link>http://www.tanquach.com/blog/2008/09/19/the-cope-vs-uncle-bob/</link>
		<comments>http://www.tanquach.com/blog/2008/09/19/the-cope-vs-uncle-bob/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 15:29:37 +0000</pubDate>
		<dc:creator>tan</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://big-oh.tantastik.org/2008/09/19/the-cope-vs-uncle-bob/</guid>
		<description><![CDATA[Does doing TDD make you a professional? Software debates can be dry at most times, but this debate between Robert C. Martin and Jim Coplien (&#8220;Curiously Recurring Template Patterns&#8221;) gives rest to the notion that TDD can be substituted for good (up-front) architecture. Though friendly and jovial, I found the talk to still be enlightening, [...]]]></description>
			<content:encoded><![CDATA[<p>Does doing TDD make you a professional? Software debates can be dry at most times, but this debate between Robert C. Martin and Jim Coplien (&#8220;Curiously Recurring Template Patterns&#8221;) gives rest to the notion that TDD can be substituted for good (up-front) architecture. Though friendly and jovial, I found the talk to still be enlightening, particularly hearing Cope&#8217;s opinions on XP and the benefits of doing CDD (contract-driven development).<br />
<blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px" class="webkit-indent-blockquote">&#8220;On the other hand I don&#8217;t believe architecture is formed out of whole cloth. I believe that you assemble it one bit at a time, by using good design skills, by using good architectural skills, over the weeks and months of many iterations. And I think that some of the architectural elements that you create, you will destroy; you will experiment in a few iterations with different forms of architecture. Within 2 or 3 iterations you will have settled into the architecture you think is right and then be entering into a phase of tuning. So my view of that is that the architecture evolves, it is informed by code that executes, and it is informed by the tests that you write.&#8221;  &#8211; <a href="http://www.infoq.com/interviews/coplien-martin-tdd" title="The Cope vs. Uncle Bob" target="_blank">http://www.infoq.com/interviews/coplien-martin-tdd</a>  </p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.tanquach.com/blog/2008/09/19/the-cope-vs-uncle-bob/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integration Testing, As a Matter of Course</title>
		<link>http://www.tanquach.com/blog/2008/08/26/integration-testing-as-a-matter-of-course/</link>
		<comments>http://www.tanquach.com/blog/2008/08/26/integration-testing-as-a-matter-of-course/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 03:59:19 +0000</pubDate>
		<dc:creator>tan</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://big-oh.tantastik.org/2008/08/26/integration-testing-as-a-matter-of-course/</guid>
		<description><![CDATA[It is frustrating how so often projects treat unit testing as an afterthought, scheduled somewhere between development completing and QA testing beginning. Project plans seldom meet their deadlines, so unit testing is often the one to suffer. Or in some cases, testing in general.
Frameworks that can assist in unit testing have been a major time [...]]]></description>
			<content:encoded><![CDATA[<p>It is frustrating how so often projects treat unit testing as an afterthought, scheduled somewhere between development completing and QA testing beginning. Project plans seldom meet their deadlines, so unit testing is often the one to suffer. Or in some cases, testing in general.</p>
<p>Frameworks that can assist in unit testing have been a major time saver for the amount of work that would otherwise need to be put in. I&#8217;ve recently re-discovered the joys of development, and in particular test-first development. Using the <span style="font-style: italic">Spring TestContext Framework</span> it has become even easier to not just do unit testing quickly, but also integration testing.</p>
<p>The importance of both is often understated, as integration testing is more crucial when there are external dependencies. With a few annotations, one can create an integration test simply by specifying the database connection settings and focusing on the critical test paths through the business logic.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="java java" style="font-family:monospace;">@RunWith<span style="color: #009900;">&#40;</span>SpringJUnit4ClassRunner.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span>
@ContextConfiguration<span style="color: #009900;">&#40;</span>locations<span style="color: #339933;">=</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">&quot;test-context-data.xml&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
@Transactional
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000000; font-weight: bold;">class</span> BidnessLogicManagerTest <span style="color: #009900;">&#123;</span>
    @Autowired
    <span style="color: #000000; font-weight: bold;">private</span> BidnessLogicManager bidnessLogicManager;
&nbsp;
    @Test
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> shouldRetrieveIdentity<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">Exception</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003399;">Identity</span> identity <span style="color: #339933;">=</span>
              <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">bidnessLogicManager</span>.<span style="color: #006633;">findIdentity</span><span style="color: #009900;">&#40;</span>10L<span style="color: #009900;">&#41;</span>;
        <span style="color: #000000; font-weight: bold;">Assert</span>.<span style="color: #006633;">assertNotNull</span><span style="color: #009900;">&#40;</span>title<span style="color: #009900;">&#41;</span>;
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>The test-context-data.xml contains your usual datasource, transaction manager and other bean configurations.</p>
<p>With this class, you can test logic with rollbacks, test without rollbacks, or you can set up transactions before entering them. If so desired, you can also extend AbstractTransactionalJUnit4SpringContextTests to have access to convenient underlying low-level classes.</p>
<p>This is the way to develop, and its unfortunate that developers will most likely miss out on this, as they are rushing to meet deadlines and pressured to push out code. Using annotations with the <em>Spring TestContext Framework</em> gets us one step closer to having a real internal DSL that allows us to develop in the context of the domain. We can start shedding all the baby fat of traditional Java development, and worry less about all the plumbing.</p>
<p>If Java is to compete with the young, fresh new blood on the horizon, it needs to continue moving in this direction. Java is a powerful language, but it must become more lightweight and faster to develop to stand up against languages like Ruby or even Python.</p>
<hr />See <a href="http://static.springframework.org/spring/docs/2.5.x/reference/testing.html">Chapter 8. Testing with Spring</a> for more information.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tanquach.com/blog/2008/08/26/integration-testing-as-a-matter-of-course/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Snakes in your Coffee</title>
		<link>http://www.tanquach.com/blog/2008/05/21/snakes-in-the-grass/</link>
		<comments>http://www.tanquach.com/blog/2008/05/21/snakes-in-the-grass/#comments</comments>
		<pubDate>Wed, 21 May 2008 14:56:41 +0000</pubDate>
		<dc:creator>tan</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://big-oh.tantastik.org/?p=12</guid>
		<description><![CDATA[In an attempt to be more versatile and perhaps less Java-centric, I&#8217;ve taken a look at learning a new programming language. The choices were narrowed down to classic Objective C, Ruby or Python. Given that Objective C is a bit more arcane and less likely to make much headway on the Internet, I&#8217;ve now got [...]]]></description>
			<content:encoded><![CDATA[<p>In an attempt to be more versatile and perhaps less Java-centric, I&#8217;ve taken a look at learning a new programming language. The choices were narrowed down to classic Objective C, Ruby or Python. Given that Objective C is a bit more arcane and less likely to make much headway on the Internet, I&#8217;ve now got to choose between Ruby and Python.</p>
<p>Looking at both of these language, I can immediately see the similarities. Neither requires compiled binary class files, and both are compact languages. Clearly, Ruby is the more trendy language as everyone and their roommate&#8217;s girlfriend&#8217;s dog seems to be doing it. So I chose Python.</p>
<p>Python is a fairly young language, currently in its 2.x incarnation, and 3.0 under development. Invented in late-80&#8217;s by <strong>Guido van Rossum</strong>, it is heavily influenced by Modula-3 and Haskell (!). It had gained a large cult following of hardcore developers and early praise from the likes of Martin Fowler. Fowler once wrote in his <em>Patterns of Enterprise Applications</em> book that he&#8217;d love to see Python give Java a run for its money. All we need is a huge corporation to back it, and a guerrilla marketing gambit.</p>
<p>In my brief excursion so far, a few programming principles have come into question. Revelations of the clumsiness of the Java language have surfaced and I&#8217;ve gladly enjoyed the experience so far. Certain things that only nerdy computer scientists would fine remotely intriguing, such as comparisons between statically-typed vs. dynamically-typed lanugages, checked vs. unchecked exception and verbosity vs. compactness of a language.</p>
<p>As architects and designers we are resolute in attacking problems creatively and without prejudice. As implementors and builders, we must understand all the tools available to us and appreciate the differences between each. Knowing the advantages and likely uses of one over the other will afford us a greater breadth of knowledge and allow us to make better choices.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tanquach.com/blog/2008/05/21/snakes-in-the-grass/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Waterfall and the Advent of Agility</title>
		<link>http://www.tanquach.com/blog/2008/03/02/waterfall-and-the-advent-of-agility/</link>
		<comments>http://www.tanquach.com/blog/2008/03/02/waterfall-and-the-advent-of-agility/#comments</comments>
		<pubDate>Sun, 02 Mar 2008 23:32:25 +0000</pubDate>
		<dc:creator>tan</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://big-oh.tantastik.org/?p=6</guid>
		<description><![CDATA[I&#8217;ve been following this thread at TSS: Agile Software Development: True Adoption or Just a Label?
So far its been very interesting. The most interesting is this article about Waterfall: Managing the Development of Large Systems The  comments made by the readers are excellent, on both sides of the argument. I especially found this comment [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been following this thread at TSS: <a href="http://www.theserverside.com/news/thread.tss?thread_id=48548">Agile Software Development: True Adoption or Just a Label?</a></p>
<p>So far its been very interesting. The most interesting is this article about Waterfall: <a href="http://www.cs.umd.edu/class/spring2003/cmsc838p/Process/waterfall.pdf" title="Managing the Development of Large Systems">Managing the Development of Large Systems</a> The  comments made by the readers are excellent, on both sides of the argument. I especially found this comment very insightful:</p>
<blockquote style="border-style: none; margin: 0px 0px 0px 40px; padding: 0px" class="webkit-indent-blockquote"><p> <span style="font-size: 14px; line-height: normal" class="Apple-style-span">When you read the Agile Manifesto, note that it&#8217;s not about practices, or languages, or technologies. It&#8217;s about a management style, a style of leading an organization that is very different from the typical command and control, which is still frequently used, particularly in government contracting.</span></p></blockquote>
<blockquote style="border-style: none; margin: 0px 0px 0px 40px; padding: 0px" class="webkit-indent-blockquote"></blockquote>
<blockquote style="border-style: none; margin: 0px 0px 0px 40px; padding: 0px" class="webkit-indent-blockquote"><p><span style="font-size: 14px; line-height: normal" class="Apple-style-span">The Lean Software Development books do a great job of explaining this. I think it really boils down to how contracts are defined. Things like TDD and continuous integration are just lower-level details.</span></p></blockquote>
<p>My experience with agile processes has been interesting, and I have started to wonder how we can possibly measure success when there are no metrics to go by. Are we doing the right thing? I&#8217;ve learned a great deal in the past few years, but mostly in terms of leadership and development practices. I&#8217;ve learned how to become a better coder, but more as an after-effect of following the Agile methodologies. I&#8217;ve become an advocate of Lean Software Development, but this can only be as matter of common sense. How do we recognize the need to be lean or to continue with &#8220;whatever works&#8221;? Perhaps in a few more years, these will become clearer to me (though I wouldn&#8217;t bank on it).<span style="font-size: 14px; line-height: normal" class="Apple-style-span"></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tanquach.com/blog/2008/03/02/waterfall-and-the-advent-of-agility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
