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

<channel>
	<title>So Jake Says:</title>
	<atom:link href="http://www.jakevoytko.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jakevoytko.com/blog</link>
	<description>Ye Olde Computer Science Blogge</description>
	<pubDate>Fri, 16 May 2008 04:00:50 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Where are the Tools for Your Job?</title>
		<link>http://www.jakevoytko.com/blog/2008/05/16/where-are-the-tools-for-your-job/</link>
		<comments>http://www.jakevoytko.com/blog/2008/05/16/where-are-the-tools-for-your-job/#comments</comments>
		<pubDate>Fri, 16 May 2008 04:00:50 +0000</pubDate>
		<dc:creator>Jake</dc:creator>
		
		<category><![CDATA[Quote]]></category>

		<guid isPermaLink="false">http://www.jakevoytko.com/blog/2008/05/16/where-are-the-tools-for-your-job/</guid>
		<description><![CDATA[After taking an abstract algebra class, I decided to revisit something from my cryptography class and figure out how the Number Field Sieve works, since my final project was writing the quadratic sieve [side-note: if anyone wants the code for it, I'll throw it up on the site. Actual sieving was not a requirement, so [...]]]></description>
			<content:encoded><![CDATA[<p>After taking an abstract algebra class, I decided to revisit something from my cryptography class and figure out how the <a href="http://en.wikipedia.org/wiki/General_number_field_sieve">Number Field Sieve</a> works, since my final project was writing the <a href="http://en.wikipedia.org/wiki/Quadratic_sieve">quadratic sieve</a> [side-note: if anyone wants the code for it, I'll throw it up on the site. Actual sieving was not a requirement, so it uses trial division. IIRC, it factors 20-digit numbers pretty quickly].</p>
<p>In the introduction to the paper, I found:</p>
<ul>
<li>An interesting Knuth quote.</li>
<li>An important lesson.</li>
</ul>
<blockquote><p>&quot;Unfortunately we are unable to give a rigorous proof that [the listed runtime] is indeed the expected running time of the number field sieve. Consequently, this paper does not contain a rigorous mathematical result. In this context the following quote from Donald Knuth is of interest: `One of my mathematician friends told me he would be willing to recognize computer science as a worthwhile field of study, as soon as it contains 1000 deep theorems. This criterion should obviously be changed to include algorithms as well as theorems, say 500 deep theorems and 500 deep algorithms.&#8217;</p>
<p>The present paper describes a deep algorithm for the solution of a fundamental problem, and it depends on techniques that have not been of traditional use in this area. We therefore trust that it is of interest to theoretical computer scientists, and that they will appreciate the challenge posed by its rigorous running time analysis.&quot;</p>
<p>&quot;The Number Field Sieve&quot;: Lenstra, Lenstra Jr., Manasse, Pollard. 1990. Copyright ACM.</p></blockquote>
<p>The interesting Knuth chestnut aside, it&#8217;s important to note that even the famous mathematicians draw inspiration from different sources. This is the best argument for perpetually continuing one&#8217;s education, no matter your field of study: the more you know, the more tools you can use.</p>
<p>Integer factorization is ostensibly a number theory problem, but the tools for the job were found in abstract algebra. <strong>Where are the tools for your job?</strong></p>
<p>How are you sure that an Object-oriented database doesn&#8217;t solve your problem better if you&#8217;ve never learned how to use one? How are you sure that you shouldn&#8217;t be writing your web application with Ruby on Rails instead of PHP? Maybe Erlang solves your scaling problems much easier than Java. Maybe those Lisp jerks were right all along.</p>
<p>A lot of different solutions have been introduced by a lot of smart people. There may be a good one you haven&#8217;t tried.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jakevoytko.com/blog/2008/05/16/where-are-the-tools-for-your-job/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How Reddit Will (Maybe) Save Software Development</title>
		<link>http://www.jakevoytko.com/blog/2008/05/12/how-reddit-will-maybe-save-software-development/</link>
		<comments>http://www.jakevoytko.com/blog/2008/05/12/how-reddit-will-maybe-save-software-development/#comments</comments>
		<pubDate>Mon, 12 May 2008 04:00:21 +0000</pubDate>
		<dc:creator>Jake</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.jakevoytko.com/blog/?p=78</guid>
		<description><![CDATA[ Or, This Started as a Diatribe About Bad Programming Books, and Turned Into Beating a Dead Horse.
Decades after The Mythical Man Month  examined the management of software development, projects are still failing at an alarming rate. Some estimates say that as few as 34% of software engineering undertakings are successful. Not only that, [...]]]></description>
			<content:encoded><![CDATA[<p><em></em> <em>Or, This Started as a Diatribe About Bad Programming Books, and Turned Into Beating a Dead Horse.</em></p>
<p>Decades after <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;location=http%3A%2F%2Fwww.amazon.com%2FMythical-Man-Month-Software-Engineering-Anniversary%2Fdp%2F0201835959%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1210547581%26sr%3D8-1&amp;tag=jakvoyshom-20&amp;linkCode=ur2&amp;camp=1789&amp;creative=9325">The Mythical Man Month</a> <img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=jakvoyshom-20&amp;l=ur2&amp;o=1" border="0" alt="" width="1" height="1" /> examined the management of software development, projects are still failing at an alarming rate. Some estimates say that <a href="http://www.softwaremag.com/L.cfm?Doc=newsletter/2004-01-15/Standish">as few as 34%</a> of software engineering undertakings are successful. Not only that, but big projects fail, and fail spectacularly, like the FBI&#8217;s <a href="http://www.intelligententerprise.com/showArticle.jhtml?articleID=59300874">case management system</a> debacle. The whole project was scrapped after it was discovered that you can&#8217;t build software the way the Egyptians built pyramids: draw a triangle blueprint and whip the slaves until it&#8217;s all in place. Since then, effective management and work styles somehow shifted, and the FBI didn&#8217;t keep up.</p>
<p><span style="color: #808080;"><em>Edit: As pointed out by <a href="http://www.babeled.com/">Greg Molyneux</a> , the pyramids were <a href="http://harvardmagazine.com/2003/07/who-built-the-pyramids.html">not built by slaves</a> . Was EVERYTHING I learned in history class in middle school a lie?</em> </span></p>
<p>Programming failures are due to a lack of rigor at all levels. The requirements suck, so the design sucks, so the interaction between modules suck. These problems will continue to persist until development practices assume that the developer and designers are making mistakes, and does everything possible to correct the mistakes early. This will be done, not by a slick methodology from a book, but rather a karma-based social programming application.</p>
<p>To strengthen my case, I want to look first at mathematics.</p>
<h2>Why Does Math Work?</h2>
<p>Mathematics, despite its difficulty, continues its inexorable advance. <span style="text-decoration: line-through;">Theorems</span> Conjectures that have withstood the test of time are falling, one by one; just ask <a href="http://en.wikipedia.org/wiki/Fermat%27s_last_theorem">Fermat</a> and <a href="http://en.wikipedia.org/wiki/Poincar%C3%A9_conjecture">Poincaré</a> . New ground is constantly blazed, and even tired subjects&#8211; such as number theory&#8211; are finding new applications and new life.</p>
<p>First, let&#8217;s get the obvious difference out of the way. Mathematics is largely a theoretical field. Sure, we can often apply it to the real world, but where&#8217;s the fun in that? The goal is <strong><em>not</em> </strong> to produce products for ordinary people, but rather to further mathematics as a subject.</p>
<p>Also only those who are fully interested in mathematics are mathematicians. This does not hold true for software development, as trade programmers exist. I&#8217;ve met them. These programmers simply bang out code day to day as a living, and are not thoroughly passionate about programming.</p>
<p>Now, let&#8217;s see what math does right:</p>
<p><strong>Excellent Peer Review System:</strong> Mathematics is advanced through proofs. These proofs are carefully perused by other mathematicians. Even better, there is an incentive to find mistakes: when an error is discovered in a published paper, the discoverer can write a paper on the subject. This ups the yearly publication count by 1, making the mathematician seem more valuable. It&#8217;s like karma!</p>
<p>At the end of the day, the effect is clear. The only mathematics that survives has seen a thousand eyes, and subtle flaws are discovered in due time. For example, Bertrand Russell discovered a contradiction in set theory near the turn of the century. This caused set theory to be ripped up from the floorboards and be rebuilt on top of new assumptions that did not fall victim to this same flaws. The paradox is now known, unsurprisingly, as <a href="http://en.wikipedia.org/wiki/Russell%27s_paradox">Russell&#8217;s Paradox</a> .</p>
<p>Open source software also has this same advantage of many eyes, but open source software also does not do everything for everybody. Yet.</p>
<h2>So How Can We Fix Software Engineering?</h2>
<p>In one sense, we may not be able to. People are not usually programming for a decade before they enter the field, so it turns out that some people were just never meant to be programmers, and it is too late!</p>
<p>Other people will always code without &quot;reading the manual&quot; on their coding methodology. They will use the waterfall method. They will take eXtreme Programming as a blanket excuse to code without thinking. They will adopt the Rational Unified Process, but forget about that testing thing because it takes too much time. <strong>It could be impossible for collectives of the uninformed to produce good work.</strong></p>
<p>The best, on the other hand, do not need to be regulated. They know better than anybody else about their own personal shortcomings (whether they realize it or not), and they use them to their own advantage. They know they are likely to make breaking changes to their own code, so they use version control. They know that they are going to write bugs, so they do everything they can to automate their finding. They already have a library of old code that is tested and works, so they can finish projects faster.</p>
<p>So to fix development for the rest of us, we need to approach software engineering like we would approach mathematics: with rigor. We need to treat it as if it is an incredibly difficult subject. We need a plan of attack, and there needs to be an excellent review system. However, I strongly suspect that most developers will not willingly go along with the rigor associated with, well, rigor. They may give it good lip service, but when it comes time to write the 60th test case for their physics simulation, they just might start cutting a corner or two. So what will the next programming methodology have to do better? One of the following:</p>
<ol>
<li>Simulate rigor from the unrigorous.</li>
<li>Encourage rigor.</li>
</ol>
<p>The <span style="text-decoration: underline;">Next Big Thing</span> in software engineering methodologies may even do both. How could it accomplish this? Incentive! There has to be an incentive for programmers to do rigorous work, which is why I think that the Next Big Thing will come, not with a book, but with a slick collaboration GUI that encourages/rewards rigorous activities with karma. If Reddit has taught me anything, it is that people will do anything for something as worthless as a karma point. Of course, this would need more serious study before anything was actually produced, but we&#8217;re talking theoretically at this point.</p>
<h2>What The GUI Will Need</h2>
<p>The program would best be served by a karma system, similar to Reddit. The program will need to keep track of (and reward) the activities most associated with rigorous programming.</p>
<p>I haven&#8217;t really worked out the details (being elbow-deep in another project), and there are many details to work out. Ideally, the GUI will be able to reward good design, good requirements, good code, and good tests.</p>
<p>I just want to give you a quick example of how the program can work: rewarding unit tests. When tests are coded well, they tell you when things break, and they tell you when things are (likely) working. It is generally well-agreed that programmers should write unit tests for their code. Despite all of this, the actual writing often fall by the wayside at the 50th unit test for your extremely boring file parsing function.</p>
<p>The program should reward you points for the number of unit tests you write for anybody&#8217;s code. Other programmers are human, and can often simply forget to perform these measures. They could even document the areas that still need work if they are fatigued by the process. They shouldn&#8217;t be penalized for something that should easily be added by another programmer. After all, if the function that they wrote is any good, they will be rewarded with karma for the function.</p>
<p>Obviously, this can be gamed. You can simply write 500 unit tests for the &quot;add()&quot; function written by another programmer&#8217;s class. But not when the karma system comes into play! If other developers find that your unit test additions are worthless, they can downmod the useless unit tests, and they can flag you as abusive.</p>
<p>Why won&#8217;t the developers spend all of their time writing unit tests instead of adding to the development effort? It can be claimed that if they are adding the unit tests and getting upmodded that they <strong>are</strong> contributing to the development effort, but I will not dodge the question.</p>
<p>Why will they not game the system? At the end of the day, they have a manager, usually in their same office. The managers will be able to see who is abusing the system, who is getting the most downmodded votes, and will be able to read comments and get explanations from their team. They will be able to walk down the hall and say, &quot;Hey, dummy! Write the binary parsing utility you&#8217;re assigned and quit spamming unit tests!&quot;</p>
<p>This system has the benefit that, over the long haul, the manager gets to see who has contributed the most to the project, who has the most controversial changes, and who has contributed the least. They will get to see the comments that other developers have left, and they will get to see who is not fitting into the team.</p>
<h2>Why Am I Telling You Instead of Making It Myself?</h2>
<p>There are a few reasons.</p>
<ul>
<li>I&#8217;m sick and tired of using bad software.</li>
<li>It will never actually work in practice for a lot of teams.</li>
</ul>
<p>I will use this project to learn Ruby + Ruby on Rails&#8230; after the few big projects on The List already, but if someone else wants to hack up their own version, awesome! I&#8217;d like to see what is done with it.</p>
<p>Why will it not work in practice? Because politics, unfortunately, plays into programming decisions in some companies. As an intern, I was shocked to find out that this was true. It could be hard to give the thumbs-down to someone&#8217;s code on a Friday afternoon at 4:00 when you know that in a month, they will be your manager.</p>
<p>Not only that, but the workplace is not like the internet. When you flame somebody within the office, they could theoretically come to your cubicle and napalm you in the face. Not pretty.</p>
<p>The Reddit Programming System can only really work if you have a team that understands that everyone makes mistakes, and to just be an adult when someone corrects you. I believe that it can help small-to-medium sized teams, but the teams that would do well with the Reddit Programming System may already be the teams that are doing well with other methodologies.</p>
<p>I have no reason to suspect that it will help teams that aren&#8217;t performing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jakevoytko.com/blog/2008/05/12/how-reddit-will-maybe-save-software-development/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Talking to People, not Computers</title>
		<link>http://www.jakevoytko.com/blog/2008/05/09/talking-to-people-not-computers/</link>
		<comments>http://www.jakevoytko.com/blog/2008/05/09/talking-to-people-not-computers/#comments</comments>
		<pubDate>Fri, 09 May 2008 04:00:21 +0000</pubDate>
		<dc:creator>Jake</dc:creator>
		
		<category><![CDATA[Quote]]></category>

		<guid isPermaLink="false">http://www.jakevoytko.com/blog/?p=77</guid>
		<description><![CDATA[It&#8217;s possible to program a computer in English.  It&#8217;s also possible to make an airplane controlled by reins and spurs. - John McCarthy, 196x.
This is pretty thought-provoking for being a flippant remark on computer language design. I don&#8217;t 100% agree with the sentiment of this quote (which is hard to do in the face [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>It&#8217;s possible to program a computer in English.  It&#8217;s also possible to make an airplane controlled by reins and spurs. - <a href="http://www-formal.stanford.edu/jmc/sayings.html">John McCarthy</a>, 196x.</p></blockquote>
<p>This is pretty thought-provoking for being a flippant remark on computer language design. I don&#8217;t 100% agree with the sentiment of this quote (which is hard to do in the face of the developer of Lisp), but it certainly raises some good issues.</p>
<p>The less written in a language to complete a task, the better the language. English <em>could</em> be used to program computers, but the result would be quite unwieldy. Why? To even talk about mathematics and algorithms out loud, mathematicians and computer scientists need to create precise, exact definitions of every single building block that they use. English doesn&#8217;t cut it, even amongst native speakers. There would need to be a big huge conference of the hive minds of language design to sit and decide what each of the notions would be and how they would be expressed in English, and even then the language would still suck for a lot of programming tasks.</p>
<p>The consequences of vague language are disasterous: proofs are wrong, programs are wrong, and people punch each other in the face. McCarthy has very real concerns: if you told your robot that it should kill time, your wall clock might be in very real danger. There are much better means of specifying algorithms and mathematics, and these should be used when describing algorithms and mathematics.</p>
<p><strong>However&#8230;</strong></p>
<p>As has been pointed out before [<a href="http://www.jakevoytko.com/blog/2008/03/01/people-are-the-problem-not-operator-overloading/">shameless self-reference</a>], one of the main reasons that we have programming languages is to show other people how we talk to the computer. We don&#8217;t program in Lisp or Python or C++ or Fortran because computers explicitly speak these languages. They need to be compiled down to machine language. If we wanted to speak directly to computers, we should be using the machine language. The reason we don&#8217;t is so that we can share our code easily with others, and easily organize our own thoughts. Our languages are designed directly for humans to convey mathematical and algorithmic thought.</p>
<p>Likewise, we don&#8217;t steer airplanes by manually moving the flaps and pouring the fuel into the engines. We have a human interface that flies the airplane for us, that humans can talk to, and humans can listen to. The actual act of flying has nothing to do with moving a joystick or flipping a switch, but it is a handy metaphor.</p>
<p>English is obviously not the right language to manipulate math. However, SQL is little more than structured English, and it acts excellently as a data storage/retrieval language. Even those with no programming experience can get the idea of what a SQL query is attempting to accomplish BECAUSE it is simply structured English.</p>
<p>It all comes down to &#8220;the right tool for the right job.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jakevoytko.com/blog/2008/05/09/talking-to-people-not-computers/feed/</wfw:commentRss>
		</item>
		<item>
		<title>&#8220;You and Your Research&#8221; by Richard Hamming</title>
		<link>http://www.jakevoytko.com/blog/2008/05/05/you-and-your-research-by-richard-hamming/</link>
		<comments>http://www.jakevoytko.com/blog/2008/05/05/you-and-your-research-by-richard-hamming/#comments</comments>
		<pubDate>Mon, 05 May 2008 04:00:26 +0000</pubDate>
		<dc:creator>Jake</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<category><![CDATA[Quote]]></category>

		<guid isPermaLink="false">http://www.jakevoytko.com/blog/?p=76</guid>
		<description><![CDATA[Or: Yes, I&#8217;m studying for finals and don&#8217;t have time for a more rigorous post. 
If you haven&#8217;t read a transcript of the talk &#34;You and Your Research &#34; by Richard Hamming, I highly recommend that you take the 45 minutes and read it.
Since you are unlikely to, I have found the issues most relevant [...]]]></description>
			<content:encoded><![CDATA[<p><em>Or: Yes, I&#8217;m studying for finals and don&#8217;t have time for a more rigorous post. </em></p>
<p>If you haven&#8217;t read a transcript of the talk &quot;<a href="http://www.cs.virginia.edu/~robins/YouAndYourResearch.html">You and Your Research</a> &quot; by Richard Hamming, I highly recommend that you take the 45 minutes and read it.</p>
<p>Since you are unlikely to, I have found the issues most relevant to computer scientists and mathematicians, and discuss them below. This is by no means an exhaustive list of the advice that Hamming gives in this talk, but is some of my favorite advice. If you don&#8217;t read the talk, you&#8217;ll miss important advice, such as how to teach your boss.</p>
<p>The talk focuses on necessary conditions and sufficient conditions for performing great research. You may not be a researcher, but Hamming mentions some great general lessons that apply to all areas of life. When I mention research below, the careful reader should mentally substitute his or her own interest.</p>
<p>For those of you who do not know of Richard Hamming, all you need to do is peruse his list of accomplishments to get a sense of his qualifications to give a talk on world-class research. Enough is named after him that he starts to run into the Euler effect: if you take the right class, the answer to the question &quot;Who do you think discovered this?&quot; is invariably &quot;Hamming!&quot;</p>
<p>I&#8217;m not kidding, though: you should <a href="http://www.cs.virginia.edu/~robins/YouAndYourResearch.html">definitely read the talk</a> .</p>
<h2>More Than Luck: Courage</h2>
<p>The first thing that the great researcher must have on their side, according to Hamming, is courage. The person who sets out to do great work should say to themselves, &quot;I would like to do first-class work.&quot; Great work is not done by luck, after all.</p>
<p>Was Euler lucky to work on so many great math theorems? Was Hamming? How about Einstein? The fact of the matter is that it is partly luck, but that these individuals were trying to do good work. Luck isn&#8217;t the entire part of the equation. As Pasteur said, &quot;Luck favors the prepared mind.&quot; Richard Hamming is even more assertive that luck has little to do with anything:</p>
<blockquote><p>The prepared mind sooner or later finds something important and does it. So yes, it is luck. The particular thing you do is luck, but that you do something is not.<br />
&#8230;<br />
I want to dispose of this matter of luck as being the sole criterion whether you do great work or not. I claim you have some, but not total, control over it. And I will quote, finally, Newton on the matter. Newton said, &quot;If others would think as hard as I did, then they would get similar results.&quot;</p></blockquote>
<p>In reality, great work is done by those who dare to do great work. He uses Claude Shannon as an example. Hamming posits that Shannon&#8217;s &quot;major theorem&quot; was a theorem of great courage.</p>
<blockquote><p>If you think you can&#8217;t, almost surely you are not going to. Courage is one of the things that Shannon had supremely. You have only to think of his major theorem. He wants to create a method of coding, but he doesn&#8217;t know what to do so he makes a random code. Then he is stuck. And then he asks the impossible question, &#8220;What would the average random code do?&#8221; He then proves that the average code is arbitrarily good, and that therefore there must be at least one good code. Who but a man of infinite courage could have dared to think those thoughts?</p></blockquote>
<h2>Plant Acorns</h2>
<p>The most important part of Hamming&#8217;s speech is the idea of planting acorns. Even if Hamming himself does not think this is the case, he mentions the idea enough times that it would certainly get an honorable mention from him. Hamming also mentions that failing to do this will cause great scientists to only become good scientists, but more on that below.</p>
<p>In order to perform really world-class research, you need to work on lots of little problems, and file away the answers. If you develop general solutions to a lot of small problems, and write them so that others can build upon the work, then you will somehow be involved in their eventual solution. Either you will finally have all of the pieces that you need to attack a great problem, or you will contribute to someone else who puts all of the pieces together. After all, as Hamming notes, we should be standing on the shoulders of others, not their toes!</p>
<h2>The Weight of Success</h2>
<p>Let&#8217;s say that your intelligence and determination pay off &#8212; with a little bit of luck. You are now world-famous in your field, and everybody expects you to do great things henceforth. This is a critical tipping point, one where the rest of humanity is going to try to weigh you down.</p>
<p>At one point in the speech, Hamming declares, &quot;The Institute for Advanced Study in Princeton, in my opinion, has ruined more good scientists than any institution has created, judged by what they did before they came and judged by what they did after. Not that they weren&#8217;t good afterwards, but they were superb before they got there and were only good afterwards.&quot; This is a hell of a condemnation of the scientific community: that they would needlessly bog down a great name rather than let the name do some more great work.</p>
<p>The biggest problem is that after your first success, people expect only success from you. You are supposed to only work on great problems, failing to &quot;plant the acorns&quot; that eventually lead to great work. Claude Shannon fell victim to this. After all, once you have developed an entirely new field as your first act, what can be the encore?</p>
<h2>The Value of Kindness and Presentation</h2>
<p>I feel that this is one of the important points that will be most overlooked, so make sure you read and understand these parts of Hamming&#8217;s speech. Hamming goes out of his way to point out to the audience that one of the best things you can do for your own career is to always be nice to the supporting cast of characters that surrounds you. Hamming gives several different examples of this, and speaks at length of the consequences of failing to bend in the right places.</p>
<blockquote><p>Another personality defect is ego assertion and I&#8217;ll speak in this case of my own experience. I came from Los Alamos and in the early days I was using a machine in New York at 590 Madison Avenue where we merely rented time. I was still dressing in western clothes, big slash pockets, a bolo and all those things. I vaguely noticed that I was not getting as good service as other people. So I set out to measure. You came in and you waited for your turn; I felt I was not getting a fair deal. I said to myself, &#8220;Why? No Vice President at IBM said, `Give Hamming a bad time&#8217;. It is the secretaries at the bottom who are doing this. When a slot appears, they&#8217;ll rush to find someone to slip in, but they go out and find somebody else. Now, why? I haven&#8217;t mistreated them.&#8221; Answer, I wasn&#8217;t dressing the way they felt somebody in that situation should. It came down to just that - I wasn&#8217;t dressing properly. I had to make the decision - was I going to assert my ego and dress the way I wanted to and have it steadily drain my effort from my professional life, or was I going to appear to conform better? I decided I would make an effort to appear to conform properly. The moment I did, I got much better service. And now, as an old colorful character, I get better service than other people.</p>
<p>&#8230;</p>
<p>By taking the trouble to tell jokes to the secretaries and being a little friendly, I got superb secretarial help. For instance, one time for some idiot reason all the reproducing services at Murray Hill were tied up. Don&#8217;t ask me how, but they were. I wanted something done. My secretary called up somebody at Holmdel, hopped the company car, made the hour-long trip down and got it reproduced, and then came back. It was a payoff for the times I had made an effort to cheer her up, tell her jokes and be friendly; it was that little extra work that later paid off for me. By realizing you have to use the system and studying how to get the system to do your work, you learn how to adapt the system to your desires. Or you can fight it steadily, as a small undeclared war, for the whole of your life.</p></blockquote>
<p>He also talks at length about other scientists who have decided to &quot;assert their egos&quot; rather than appear nice and play the game. If they decide that they aren&#8217;t going to make the &quot;appearance of conforming&quot;, these people are not going to get extra help. They will need to fight at every moment in order to get the extra help, so they will be putting extra energy into the wrong pursuits in life.</p>
<p>At the end of the day, this can be reduced to swimming. How far are you going to swim with the current, and how far can you make it against the current?</p>
<h2>Drive</h2>
<p>We all know about quotes on drive <a href="http://www.phrases.org.uk/meanings/146600.html">by Edison</a> , but Hamming says it best:</p>
<blockquote><p>Now for the matter of drive. You observe that most great scientists have tremendous drive. I worked for ten years with John Tukey at Bell Labs. He had tremendous drive. One day about three or four years after I joined, I discovered that John Tukey was slightly younger than I was. John was a genius and I clearly was not. Well I went storming into Bode&#8217;s office and said, &#8220;How can anybody my age know as much as John Tukey does?&#8221; He leaned back in his chair, put his hands behind his head, grinned slightly, and said, &#8220;You would be surprised Hamming, how much you would know if you worked as hard as he did that many years.&#8221; I simply slunk out of the office!</p></blockquote>
<h2>Think Great Thoughts</h2>
<p>Hamming clearly enjoys this particular aspect of his approach to life. He talks about how, every Friday, he would only think great thoughts. Not particular thoughts about work, but questions like &quot;What will be the role of computers in all of AT&amp;T?&quot;</p>
<p>Putting yourself in the mindset of only thinking great thoughts for a particular period of time leads you to view oncoming trends and learn how to best take advantage of them. If you can see which way the wave is breaking, you will know which direction you will need to work towards.</p>
<h2>Selling Your Work</h2>
<p>Hamming himself admits that this is a particularly distasteful aspect of the job of a scientist, but it is necessary to sell your research. Everybody out there is trying like hell to find their own research, so you need to show them why your work is so great.</p>
<p>The first skill that you must learn is to sharpen your communication skills. You can&#8217;t show people why your work is so great if you can&#8217;t communicate this. In my opinion, this can sometimes be even better than being truly great: after all, Stephen Wolfram has walked into the scientific spotlight with perhaps as much bombast as science.</p>
<p>You must learn to excel at all forms of talking: not only should you be able to chime in during informal conversations and assert your viewpoint, but you also must be able to get up in front of large crowds of people and give excellent talks.</p>
<p>Hamming speaks at length about what is necessary to give a good talk. The first thing that the scientist must do is to overcome the urge to give an extremely detailed technical talk. Obviously, this is not always possible, but there are excellent odds that your audience will not be interested in a wholly technical talk. They would like to see an explanation as to why a solution is important rather than the details of the solution.</p>
<p>In general, it is important to examine closely the habits of those whose words carry great weight. What do they do differently? They are clearly causing an emotional effect inside of people, and it is important to try to learn from their presentation skills and mimic what they do properly.</p>
<h2>Know Thyself</h2>
<p>Hamming says that it is important to know what your strengths and weaknesses are. It is important to play to your strengths, it is important to help your weaknesses, but it is also truly helpful to be able to turn you weaknesses into assets. Hamming says that he was able to use his ego to his advantage:</p>
<p>I knew that most people who took a sabbatical to write a book, didn&#8217;t finish it on time. So before I left, I told all my friends that when I come back, that book was going to be done! Yes, I would have it done - I&#8217;d have been ashamed to come back without it! I used my ego to make myself behave the way I wanted to.</p>
<h2>In Summary</h2>
<p>Hamming&#8217;s conclusion of the speech says it best:</p>
<blockquote><p>In summary, I claim that some of the reasons why so many people who have greatness within their grasp don&#8217;t succeed are: they don&#8217;t work on important problems, they don&#8217;t become emotionally involved, they don&#8217;t try and change what is difficult to some other situation which is easily done but is still important, and they keep giving themselves alibis why they don&#8217;t. They keep saying that it is a matter of luck. I&#8217;ve told you how easy it is; furthermore I&#8217;ve told you how to reform. Therefore, go forth and become great scientists!&quot;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.jakevoytko.com/blog/2008/05/05/you-and-your-research-by-richard-hamming/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Yes, Jacob, There is a Santa Claus</title>
		<link>http://www.jakevoytko.com/blog/2008/05/02/yes-jacob-there-is-indeed-a-santa-claus/</link>
		<comments>http://www.jakevoytko.com/blog/2008/05/02/yes-jacob-there-is-indeed-a-santa-claus/#comments</comments>
		<pubDate>Fri, 02 May 2008 04:00:51 +0000</pubDate>
		<dc:creator>Jake</dc:creator>
		
		<category><![CDATA[Funny]]></category>

		<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://www.jakevoytko.com/blog/2008/05/02/yes-jacob-there-is-indeed-a-santa-claus/</guid>
		<description><![CDATA[I&#8217;m ignoring my Friday quote to tell you the best prank that has ever been played on me. My final exams are this week, so I don&#8217;t have the time to write rigorous CS/programming/math posts or search for quotes, so today (and possibly Monday) will be amusing anecdotes.
My parents have a long-standing Christmas tradition of [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m ignoring my Friday quote to tell you the best prank that has ever been played on me. My final exams are this week, so I don&#8217;t have the time to write rigorous CS/programming/math posts or search for quotes, so today (and possibly Monday) will be amusing anecdotes.</p>
<p>My parents have a long-standing Christmas tradition of making my sister and I wait for everything to be just perfect before we come downstairs and see the presents that had been laid out. When we were younger, my Dad would shake bells in order to announce Santa&#8217;s departure. My sister and I ran downstairs in a vain attempt to see Santa, only to have my Dad yell &quot;You just missed him! Look at him go! Do you see him across the street?&quot;</p>
<p>Obviously, little 7 year old me was suspicious. I had heard at school &#8211;to no surprise&#8211; there was no Santa, and there were a lot of holes in my Dad&#8217;s story. There was no way that my Dad was mysteriously able to see Santa. On top of that, Santa was supposed to come at midnight.</p>
<p>That year, I ran downstairs as fast as I could, but my Mom yelled for me to slow down, and I did, and I couldn&#8217;t prove that my Dad was the one that was ringing the bells &#8212; even when I found the bells! Santa simply left them for us. He&#8217;s a giver, after all.</p>
<p>That was a challenge. I was going to do the impossible. I was going to outsmart my parents the next year.</p>
<p>My plan was simply to practice running down the stairs as quickly as I could, in as few bounds as I could, and catch my Dad ringing the bells. My speed had almost caught him off-guard this year, and if I could actually let gravity carry me down half of the stairs, then I would land and see him. I was facing some pretty heavy constraints, in that my Dad has gotten up unimaginably earlier than I have my entire life, and my parents did not let us go downstairs on Christmas until they said so. I didn&#8217;t have access to camera technology. My only real option was to catch them in the act.</p>
<p>This plan is obviously weak, and paled in comparison to future plans to catch my parents playing Santa &#8211;which involved undetectable objects like bits of fishing line laid on the floor. It had a decent basis, though: I just had to surprise them. They would never expect me to practically jump down the stairs to catch my Dad pretending to be Santa.</p>
<p>I practiced throughout the year. I got pretty good at taking the stairs in two or three bounds and landing with nary a sound. Finally, Christmas comes, and my mom mischievously lets me go downstairs.</p>
<p><em>Jangle Jangle Jangle! </em> goes the bells downstairs. My sister and I take off for the stairs, and I leap down the stairs in a few bounds (botched maybe a little in my excitement). I land and simultaneously look in the room triumphantly (as the bells did not stop), and I see&#8230;.. a room with presents, devoid of people!</p>
<p>Shocked, I stared in the room for a few seconds, and then flew back upstairs to my parents room. They were lying in their bed, laughing at me. They asked if Santa had come, to which I had no reply. We went back downstairs to open presents, and Christmas continued like normal.</p>
<p>For years I begged them to know how they did it, and I had my own theories. There were just too many different ways that they could have done it. Tape recorders and well-placed neighbors were my two biggest suspects, but the truth turned out to be far better.</p>
<h2>How They Did It</h2>
<p>My parents knew that they had almost been caught when I ran down the stairs the year before.  They perfectly predicted my next move: to get down the stairs as quick as I could. My parents wanted to figure out a way that they could beat me at my own game.</p>
<p>By providence, their bedroom was situated above the room where we opened our presents. My Dad, on Christmas Eve, ran a string out from the bedroom window, over the roof, and down to the window of the room where we would open our presents. He tied the bells on the end of the string. He said that he was worried that it wouldn&#8217;t really produce the same effect, but it worked perfectly. They could jangle it all they wanted from their room and make it sound like someone was shaking the bells in the living room.</p>
<p>My parents were sitting in the comfort of their own bed while I ran downstairs, puzzled over the empty room, ran back upstairs, and threw their door open in pure confusion.</p>
<p>They still say that the best part was the absolutely confused look on my face, knowing they had tricked me, not knowing how.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jakevoytko.com/blog/2008/05/02/yes-jacob-there-is-indeed-a-santa-claus/feed/</wfw:commentRss>
		</item>
		<item>
		<title>It&#8217;s All An Excuse</title>
		<link>http://www.jakevoytko.com/blog/2008/04/28/its-all-an-excuse/</link>
		<comments>http://www.jakevoytko.com/blog/2008/04/28/its-all-an-excuse/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 04:00:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Computer Science]]></category>

		<guid isPermaLink="false">http://www.jakevoytko.com/blog/?p=74</guid>
		<description><![CDATA[As a thought experiment, I recently looked at various programming methodologies to see if I could find common ground between them.
I looked at the following methodologies:

Scrum
XP
IBM&#8217;s Rational Unified Process
The Joel Test

Ideas such as literate programming were ignored from the list, as any of the processes listed above could also be done in conjunction with literate [...]]]></description>
			<content:encoded><![CDATA[<p>As a thought experiment, I recently looked at various programming methodologies to see if I could find common ground between them.</p>
<p>I looked at the following methodologies:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Scrum_(development)">Scrum</a></li>
<li><a href="http://en.wikipedia.org/wiki/Extreme_Programming_Practices">XP</a></li>
<li><a href="http://en.wikipedia.org/wiki/Rational_Unified_Process">IBM&#8217;s Rational Unified Process</a></li>
<li><a href="http://www.joelonsoftware.com/articles/fog0000000043.html">The Joel Test</a></li>
</ul>
<p>Ideas such as <a href="http://en.wikipedia.org/wiki/Literate_programming">literate programming</a> were ignored from the list, as any of the processes listed above could also be done in conjunction with literate programming.</p>
<p>Here&#8217;s my list with explanations. I reckon that all of the methodologies are all an excuse for doing the following:</p>
<p><strong>Think about what your code does before you write it.</strong></p>
<p>&quot;Of course you should do this!&quot; I hear you screaming. However, even the obvious needs to be included in a methodology. For something so obvious, there were quite a few different ways of handling this idea.</p>
<p>The Joel Test, for example, asks &quot;Do you have a spec?&quot; This is similar to the Rational Unified Process, which demands a large up-front Elaboration phase to be mostly complete before any coding begins. These are up-front and monolithic methods of designing products, but it is difficult to argue with the success of either Fog Creek or IBM.</p>
<p>On the opposite end of the spectrum we have Scrum and Extreme Programming, which take release planning on a much more granular scale. At the beginning of the project iteration, you meet with the customers and decide what and how you will attempt to do over the iteration. The difference between Extreme Programming and Scrum is the length of the sprint iterations. Scrum requires that you meet with customers at the beginning of the sprint (15-30 days), and then freeze the requirements over the course of the sprint. Extreme Programming, on the other hand, sets this at about a weekly basis.</p>
<p><strong>Make sure your own code works.</strong></p>
<p>Extreme Programming and The Joel Test are both in-your-face in this regard. The Joel Test specifies that there is a bug database as well as an effort to fix bugs before new releases. Extreme Programming is a test-first methodology, so your code starts out failing the tests (as your code is not even written to begin with), and your task is finished when your code passes all of the necessary tests.</p>
<p>Testing is also a specified phase in the Rational Unified Process, which hints that there should be some form of an automated testing script. Scrum, as a methodology, does not explicitly have a testing requirement, but every single day the team is required to talk about their progress, as well as any roadblocks that they encounter. This is a good encouragement to make sure that the code works, as you will be talking about it on a daily basis.</p>
<p><strong>Frequently check to see if code works.</strong></p>
<p>This was one of the most common ideas between all of the methodologies.</p>
<p>The Joel Test specifies that the programmer should both be able to have a one-click build as well as be able to have access to daily builds. Extreme Programming and Scrum both focus on tiny releases. The IBM Rational Unified Process specifies that you should be able to &quot;demonstrate value iteratively,&quot; which does mean to have frequent builds &#8212; once you transfer from business-ese.</p>
<p><strong>Have someone else make sure your code works.</strong></p>
<p>This was another string thread through all of the different methodologies, and nowhere was this more evident than Extreme Programming. First off, Extreme Programming dictates that programming is done in pairs. While you are typing away at the keyboard, another programmer is behind you, making sure that everything you write is a) valid, and b) in the spirit of the rest of the program. Unit tests also provide an independent verification (if the tests are correct).</p>
<p>The Joel Test strongly emphasizes this point. It specifies that the programmers are supposed to not only have testers, but are supposed to be able to easily do hallway usability testing. Your code is getting worked on from two different angles: not only are all of the module interactions being tested by the testers, but your interface is also being vetted by your fellow programmers.</p>
<p>Scrum and XP also have the results of the project placed in front of the customer frequently to see that what is being produced is ultimately what the customer would like to see.</p>
<p>The Rational Unified Process encourages the iterative development to bring the customers in on releases in order to allow them to weigh in on progress. It also has a specified testing segment, which encourages large teams to form individual testing units that examine the interactions between modules.</p>
<p><strong>Fine Code Granulation</strong></p>
<p>By fine code granulation, I mean that the code should be broken down into the smallest possible functional units. The Rational Unified Process, Scrum, and Extreme Programming all actively encourage participants to have refined iterations with deliverables at the end of each iteration. Granted, this does not necessitiate that the code is modular, but it certainly encourages it. The Joel Test specifies that there should be a daily build that can be tested and monitored for correctness.</p>
<p>In my own personal experience, this is one of the most important aspects of finishing a project quickly: it&#8217;s easier to figure out why a function named &quot;determinant()&quot; is failing than it is to figure out why the determinant section of a function named &quot;matrix_inverse()&quot; is failing.</p>
<p><strong>My Question: Is this a list with all of the necessary and sufficient items?</strong></p>
<p>Should source control be on the list? Probably, but some of the successful projects treat it as a fundimental assumption as opposed to a requirement. Is it always necessary for developers to have flawless working conditions, as Joel claims, or is it sometimes necessary to have the end-of-project crunch?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jakevoytko.com/blog/2008/04/28/its-all-an-excuse/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Simplicity</title>
		<link>http://www.jakevoytko.com/blog/2008/04/25/simplicity/</link>
		<comments>http://www.jakevoytko.com/blog/2008/04/25/simplicity/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 04:00:14 +0000</pubDate>
		<dc:creator>Jake</dc:creator>
		
		<category><![CDATA[Computer Science]]></category>

		<guid isPermaLink="false">http://www.jakevoytko.com/blog/2008/04/25/simplicity/</guid>
		<description><![CDATA[Truth is ever to be found in simplicity, and not in the multiplicity and confusion of things.
~ Isaac Newton, &#34;Rules for methodizing the Apocalypse&#34;, Rule 9
]]></description>
			<content:encoded><![CDATA[<blockquote><p>Truth is ever to be found in simplicity, and not in the multiplicity and confusion of things.</p>
<p>~ Isaac Newton, &quot;Rules for methodizing the Apocalypse&quot;, Rule 9</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.jakevoytko.com/blog/2008/04/25/simplicity/feed/</wfw:commentRss>
		</item>
		<item>
		<title>O Notation via Calculus</title>
		<link>http://www.jakevoytko.com/blog/2008/04/21/o-notation-via-calculus/</link>
		<comments>http://www.jakevoytko.com/blog/2008/04/21/o-notation-via-calculus/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 04:00:45 +0000</pubDate>
		<dc:creator>Jake</dc:creator>
		
		<category><![CDATA[Computer Science]]></category>

		<guid isPermaLink="false">http://www.jakevoytko.com/blog/?p=71</guid>
		<description><![CDATA[Calculus Via O Notation
In the article &#8220;Calculus via O Notation,&#8221; Alexandre Borovik transcribes a letter written by Donald Knuth where Knuth describes the idea of calculus in terms of  notation. He shows that not only is it possible to use  notation in integration and derivation, but that the notation also gives you a [...]]]></description>
			<content:encoded><![CDATA[<h2>Calculus Via O Notation</h2>
<p>In the article &#8220;<a href="http://micromath.wordpress.com/2008/04/14/donald-knuth-calculus-via-o-notation/">Calculus via O Notation</a>,&#8221; Alexandre Borovik transcribes a letter written by Donald Knuth where Knuth describes the idea of calculus in terms of <img src='/blog/wp-content/plugins/latexrender/pictures/c739e7b1285679250be773ba8e183209_1.0pt.gif' title='\mathcal{O}' alt='\mathcal{O}'  style="vertical-align:-1.0pt;" > notation. He shows that not only is it possible to use <img src='/blog/wp-content/plugins/latexrender/pictures/c739e7b1285679250be773ba8e183209_1.0pt.gif' title='\mathcal{O}' alt='\mathcal{O}'  style="vertical-align:-1.0pt;" > notation in integration and derivation, but that the notation also gives you a built-in error estimator.</p>
<p>While the notation is unfamiliar at first, it has a few added advantages. For one, the <img src='/blog/wp-content/plugins/latexrender/pictures/c739e7b1285679250be773ba8e183209_1.0pt.gif' title='\mathcal{O}' alt='\mathcal{O}'  style="vertical-align:-1.0pt;" > term of the equation describes the estimated error of your calculation, which is great for programmers.</p>
<h2>O Notation via Calculus</h2>
<p>I learned the opposite relationship between calculus and <img src='/blog/wp-content/plugins/latexrender/pictures/c739e7b1285679250be773ba8e183209_1.0pt.gif' title='\mathcal{O}' alt='\mathcal{O}'  style="vertical-align:-1.0pt;" > notation: that you can use calculus to derive the <img src='/blog/wp-content/plugins/latexrender/pictures/c739e7b1285679250be773ba8e183209_1.0pt.gif' title='\mathcal{O}' alt='\mathcal{O}'  style="vertical-align:-1.0pt;" > estimate of an algorithm!</p>
<p>The method uses integration, and the method is easier to demonstrate using a simple example than to explain outright:</p>
<p><strong>Contrived Example:</strong> Let&#8217;s say that we want to find the algorithmic complexity (as measured by multiplications) in the following loop:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp">  <span style="color: #0000ff;">int</span> a <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span>;
  <span style="color: #0000ff;">for</span><span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span>; i<span style="color: #000080;">&lt;</span>n; <span style="color: #000040;">++</span>i<span style="color: #008000;">&#41;</span>
      <span style="color: #0000ff;">for</span><span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> j <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span>; j<span style="color: #000080;">&lt;</span>n; <span style="color: #000040;">++</span>j<span style="color: #008000;">&#41;</span>
          <span style="color: #0000ff;">for</span><span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> k <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span>; k<span style="color: #000080;">&lt;</span>n; <span style="color: #000040;">++</span>k<span style="color: #008000;">&#41;</span>
              a<span style="color: #000040;">*</span><span style="color: #000080;">=</span><span style="color: #0000dd;">2</span>;</pre></div></div>

<p>We can trivially rewrite the sum of the loop operations with sigma notation:</p>
<blockquote><p><img src='/blog/wp-content/plugins/latexrender/pictures/1fafc2457b09b8efe17cbe0d73f64118_4.00005pt.gif' title='\sum_{1}^n \sum_{1}^n \sum_{1}^n 1' alt='\sum_{1}^n \sum_{1}^n \sum_{1}^n 1'  style="vertical-align:-4.00005pt;" ></p>
<p><img src='/blog/wp-content/plugins/latexrender/pictures/40554e5a2efdd0991fcf55bc49f5799e_4.00005pt.gif' title='=\sum_{1}^n \sum_{1}^n n' alt='=\sum_{1}^n \sum_{1}^n n'  style="vertical-align:-4.00005pt;" ></p>
<p><img src='/blog/wp-content/plugins/latexrender/pictures/c79144a709e328115702a0992aa9a7b8_4.00005pt.gif' title='= \sum_{1}^n n^2' alt='= \sum_{1}^n n^2'  style="vertical-align:-4.00005pt;" ></p>
<p><img src='/blog/wp-content/plugins/latexrender/pictures/84b29ddeb5dbc7b7ef8603a9ac61099c_1.0pt.gif' title='= n^3' alt='= n^3'  style="vertical-align:-1.0pt;" ></p></blockquote>
<p>Therefore, the complexity of the loop is <img src='/blog/wp-content/plugins/latexrender/pictures/cef9dab61517fb65be93b8bd8c3386cb_3.5pt.gif' title='\mathcal{O}(n^3)' alt='\mathcal{O}(n^3)'  style="vertical-align:-3.5pt;" >.</p>
<p>We can also, more informally, treat this as the definite integral with respect to <em>n</em>. If we look at the inner loop, since we are performing 1 operation <em>n</em> times, our output will be linear. If we have a linear output on the second loop, the output will be <img src='/blog/wp-content/plugins/latexrender/pictures/551894444bf3cb0cc8350594310e2e99_3.5pt.gif' title='\mathcal{O}(n^2)' alt='\mathcal{O}(n^2)'  style="vertical-align:-3.5pt;" >. If we can generalize the summation for any <em>n</em>, we can calculate the integral from 1 to <em>n</em> and determine the order by which the function grows.</p>
<blockquote><p>(<em>Note: For simplicity, I am dropping lower-order terms, since they obviously do not factor into the answer.)</em></p>
<p><img src='/blog/wp-content/plugins/latexrender/pictures/806a8e9e080e5568acd8ea6eca2cafad_4.5556pt.gif' title='\mathcal{O}(\int_1^n\int_1^n\int_1^n1dndndn)' alt='\mathcal{O}(\int_1^n\int_1^n\int_1^n1dndndn)'  style="vertical-align:-4.5556pt;" ></p>
<p><img src='/blog/wp-content/plugins/latexrender/pictures/6f8e3191224cc2efb231628f8e4f3e53_4.5556pt.gif' title='= \mathcal{O}(\int_1^n\int_1^n(n)dndn)' alt='= \mathcal{O}(\int_1^n\int_1^n(n)dndn)'  style="vertical-align:-4.5556pt;" ></p>
<p><img src='/blog/wp-content/plugins/latexrender/pictures/6a1277e8a0b9ddd1565d03aa885d114a_4.44841pt.gif' title='= \mathcal{O}(\int(\frac{n^2}{2}))' alt='= \mathcal{O}(\int(\frac{n^2}{2}))'  style="vertical-align:-4.44841pt;" ></p>
<p><img src='/blog/wp-content/plugins/latexrender/pictures/7aded6d3dccee534b727a87eb6b2c498_4.44841pt.gif' title='= \mathcal{O}(\frac{n^3}{6})' alt='= \mathcal{O}(\frac{n^3}{6})'  style="vertical-align:-4.44841pt;" ></p>
<p><img src='/blog/wp-content/plugins/latexrender/pictures/79e7114e8b33e92953a0e32fd7a51216_3.5pt.gif' title='= \mathcal{O}(n^3)' alt='= \mathcal{O}(n^3)'  style="vertical-align:-3.5pt;" ></p></blockquote>
<h2>Why Does This Work?</h2>
<p>We are looking at the order of the growth of the area under the curve. This order will be the same order that the algorithm grows, as this is based on the same argument by which the <a href="http://en.wikipedia.org/wiki/Rectangle_method">rectangle rule</a> works &#8212; the number of calculations for each <em>n</em> is a rectangle approximation of a continuous function and grows at the same rate for larger <em>n</em>.</p>
<p>It is important to note that this does not give you an exact computation of the number of operations in your algorithm. Instead, this gives you the order of growth of the algorithm with problem size <em>n</em>.</p>
<p>Unfortunately, I can only give an informal argument for why this should work. The professor who introduced this technique to me did it in an offhand remark, so I&#8217;m not sure whether this idea is applicable in all situations. If you have any remarks with a solid mathematical basis, I&#8217;d love to hear them.</p>
<h2>Better Example: Mergesort</h2>
<p>We all know that the number of comparisons in Mergesort grows <img src='/blog/wp-content/plugins/latexrender/pictures/439e07294a82514e293bd5be1708f166_3.5pt.gif' title='\mathcal{O}($n$log_2(n))}' alt='\mathcal{O}($n$log_2(n))}'  style="vertical-align:-3.5pt;" > in the worst case. Let&#8217;s use the integration method to double-check this.</p>
<p><strong>Small Example: An array of 16 elements</strong></p>
<p><strong>First</strong>, we need to break up the problem in terms of a summation of <em>n</em>. Let&#8217;s pick the number of comparisons of arrays of size {1, 2, 4, 8, &#8230;} while Mergesorting an array of 16 elements.</p>
<p>First, we have all of the comparisons of arrays of size 1. We will be performing 8 different sets of comparisons, and we will need 1 comparison in each set.</p>
<p><em>Total comparisons: 8 * 1</em></p>
<p>Second, all of the comparisons of arrays of size 2. We will be performing 4 different sets of comparisons, and we will need 3 comparisons per set.</p>
<p><em>Total comparisons: 4 * 3</em></p>
<p>Third, all of the comparisons of arrays of size 4. We will be performing 2 different sets of comparisons, and we will need 7 comparisons per set.</p>
<p><em>Total comparisons: 2 * 7</em></p>
<p>Lastly, all of the comparisons of arrays of size 8. We have only one set of comparisons, and we will need 15 comparisons per set.</p>
<p><em>Total comparisons: 1 * 15</em></p>
<p><strong>Second, </strong>now that we have the different sets, we need to look for a formula that will give us the right number of comparisons for each stage <em>x</em>.</p>
<p>Stage 1: 8 * 1 = 2^3 * (2^1 - 1)</p>
<p>Stage 2: 4 * 3 = 2^2 * (2^2 - 1)</p>
<p>Stage 3: 2 * 7 = 2^1 * (2^3 - 1)</p>
<p>Stage 4: 1 * 15 = 2^0 * (2^4 - 1)</p>
<p>Our formula for each stage <em>x</em> is therefore:</p>
<p><img src='/blog/wp-content/plugins/latexrender/pictures/e3a8b83dd2921f94f5e7e19c8ed6003d_3.5pt.gif' title='2^{log(n)-x}(2^x-1)' alt='2^{log(n)-x}(2^x-1)'  style="vertical-align:-3.5pt;" ></p>
<p><strong>Third,</strong> we integrate our formula from 1 to <em>n</em>.</p>
<blockquote><p>Our integral will be:</p>
<p><img src='/blog/wp-content/plugins/latexrender/pictures/1149e46840c9764c2a161cf016322bdc_4.5556pt.gif' title='\int_1^{log_2(n)}2^{log_2(n)-x}(2^x-1)' alt='\int_1^{log_2(n)}2^{log_2(n)-x}(2^x-1)'  style="vertical-align:-4.5556pt;" ></p>
<p>Plugging this quickly into Mathematica, we get the answer back:</p>
<p><img src='/blog/wp-content/plugins/latexrender/pictures/a4c578072fef3faca3d6bbd027802d93_6.19841pt.gif' title='\mathcal{O}(Mergesort)= \frac{2-n}{Log(4)}+\frac{n*Log(n/2)}{Log(2)}' alt='\mathcal{O}(Mergesort)= \frac{2-n}{Log(4)}+\frac{n*Log(n/2)}{Log(2)}'  style="vertical-align:-6.19841pt;" ></p>
<p>which, after working through the Logjam, is found to be <img src='/blog/wp-content/plugins/latexrender/pictures/439e07294a82514e293bd5be1708f166_3.5pt.gif' title='\mathcal{O}($n$log_2(n))}' alt='\mathcal{O}($n$log_2(n))}'  style="vertical-align:-3.5pt;" >.</p></blockquote>
<h2>When is This Useful?</h2>
<p>For some people, never: recurrence formulas and basic combinatorics is all they will ever need to solve recurrences. However, some students (mathematicians especially) may be more comfortable dealing with calculus than recurrence formulas.</p>
<p>It never hurts to have another tool in your kit.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jakevoytko.com/blog/2008/04/21/o-notation-via-calculus/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Degrees of Design</title>
		<link>http://www.jakevoytko.com/blog/2008/04/18/degrees-of-design/</link>
		<comments>http://www.jakevoytko.com/blog/2008/04/18/degrees-of-design/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 04:00:21 +0000</pubDate>
		<dc:creator>Jake</dc:creator>
		
		<category><![CDATA[Quote]]></category>

		<guid isPermaLink="false">http://www.jakevoytko.com/blog/?p=72</guid>
		<description><![CDATA[&#8220;What we meant by that was when you start looking at a problem and it seems   really simple with all these simple solutions, you don&#8217;t really understand   the complexity of the problem. And your solutions are way too oversimplified, and they don&#8217;t work. Then you get into the problem, and you [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>&#8220;What we meant by that was when you start looking at a problem and it seems   really simple with all these simple solutions, you don&#8217;t really understand   the complexity of the problem. And your solutions are way too oversimplified, and they don&#8217;t work. Then you get into the problem, and you see it&#8217;s really complicated. And you come up with all these convoluted solutions. That&#8217;s sort of the middle, and that&#8217;s where most people stop, and the   solutions tend to work for a while. But the really great person will keep on going and find, sort of, the key,   underlying principle of the problem. And come up with a beautiful elegant solution that works.&#8221;<em></em></p>
<p><em>~ </em> Steve Jobs: <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;location=http%3A%2F%2Fwww.amazon.com%2FPerfect-Thing-Shuffles-Commerce-Coolness%2Fdp%2F0743285239%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1208478672%26sr%3D8-1&amp;tag=jakvoyshom-20&amp;linkCode=ur2&amp;camp=1789&amp;creative=9325">The Perfect Thing; How the iPod Shuffles; Commerce, Culture, and Coolness</a> <img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=jakvoyshom-20&amp;l=ur2&amp;o=1" border="0" alt="" width="1" height="1" /> by Steven Levy</p></blockquote>
<p>I may hang the last two lines of this quote over my computer. This is a really great summary of the creative process that I&#8217;ve noticed as I&#8217;ve attacked various math and design problems. Getting complex problems right is hard, and finding easy solutions that are applicable to a whole class of problems is damn near impossible. The ability to solve a problem elegantly is not a gift, but won through determination and practice.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jakevoytko.com/blog/2008/04/18/degrees-of-design/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Somewhere Between Vim and Emacs There is a Great Text Editor</title>
		<link>http://www.jakevoytko.com/blog/2008/04/13/somewhere-between-vim-and-emacs-there-is-a-great-text-editor/</link>
		<comments>http://www.jakevoytko.com/blog/2008/04/13/somewhere-between-vim-and-emacs-there-is-a-great-text-editor/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 03:59:57 +0000</pubDate>
		<dc:creator>Jake</dc:creator>
		
		<category><![CDATA[Computer Science]]></category>

		<guid isPermaLink="false">http://www.jakevoytko.com/blog/?p=70</guid>
		<description><![CDATA[Or: Yes, I&#8217;m The 300th Person To Write This Blog Post.
A year and a half ago, I abandoned Visual Studio to try to use the two most popular code editors: Vim and Emacs. Both of them have their advantages, but fall short of being the perfect editor.
Vim
The first coder&#8217;s text editor I used was Vim. [...]]]></description>
			<content:encoded><![CDATA[<p><em>Or: Yes, I&#8217;m The 300th Person To Write This Blog Post.</em></p>
<p>A year and a half ago, I abandoned Visual Studio to try to use the two most popular code editors: Vim and Emacs. Both of them have their advantages, but fall short of being the perfect editor.</p>
<h2>Vim</h2>
<p>The first coder&#8217;s text editor I used was Vim. It took quite a while to get past its infamous learning curve, but once I did, it was wonderful.</p>
<p><strong>Advantages</strong></p>
<ul>
<li><strong>Easy-to-Reach commands: </strong>The basic movement keys in Vim are right under your fingertips. Rather than wasting precious tenths of a second moving back and forth to the arrow keys, all you need to do is shift your right hand over. &#8216;h&#8217; is left, &#8216;l&#8217; is right, &#8216;j&#8217; is down, and &#8216;k&#8217; is up. This may seem weird at first, but after two weeks of using it, you&#8217;ll be disappointed whenever you&#8217;re typing in any other application.Not only that, but a lot of the extra movement keys are very close to the home row. &#8216;$&#8217; and &#8216;0&#8242;, end and beginning of the line, respectively, are nearby. So is &#8216;^&#8217;, which gets you to the first whitespace character on the line. So is &#8216;G&#8217;, or the goto-line command. So is &#8216;w&#8217;, the &#8220;go to next word&#8221; command. No extra modifier keys needed.</li>
</ul>
<ul>
<li><strong>Modal Editing: </strong>A lot of the power that Vim has comes from the fact that keys work differently based on what mode that you are in. If you are in Command Mode (the default mode in Vim), the &#8216;o&#8217; key inserts a line below the current one and changes the mode to Editing Mode (which lets you enter text). If you are in Visual Mode (which is a selection mode), the &#8216;o&#8217; key moves you to the other end of the selection.I&#8217;ve heard some people say that this is a strike against Vim, but I have never had any problem with this.</li>
</ul>
<ul>
<li><strong>&lt;action&gt;&lt;location&gt;: </strong>Once Vim beginners have learned all of the basic ways to move through a document (forward/previous character, forward/previous word, forward/previous line, searching, beginning/end line, etc), the next big epiphany is that you can combine these searches with commands. &#8216;dw&#8217; deletes to the beginning of the next word. &#8216;d$&#8217; deletes to the end of the line. &#8216;dn&#8217; deletes to the next result in a search. The movements can be combined with commands to make complex text manipulation a piece of cake.Vim also comes with dozens of mnemonic commands, such as &#8216;daw&#8217; (&#8221;<strong>d</strong>elete <strong>a</strong> <strong>w</strong>ord&#8221;, deletes the word under the cursor, no matter where you started in the word).</li>
</ul>
<ul>
<li><strong>Easy Repetition: </strong>Vim makes repetition very easy. All you need to do is type a number before you enter the command, and Vim will repeat it that many times. Want to delete the next 6 lines? Type &#8216;6dd&#8217;. Delete 6 words? &#8216;6daw&#8217;.</li>
</ul>
<ul>
<li><strong>Quick Scripting: </strong>In Vim, this is one of the best timesavers available. If you have an action that you would like to do over and over again, you can store a key sequence in a buffer to recall later. For example, to start a macro, all you need to do is type &#8216;qa&#8217;, which will store a macro in the &#8216;a&#8217; buffer. To finish, type &#8216;q&#8217; again. To use the macro, type &#8216;@a&#8217;. To repeat it 100 times. type &#8216;100@a&#8217;. It&#8217;s that easy.</li>
</ul>
<ul>
<li><strong>Fast Search:</strong> Searching in Vim is fantastically easy: all you need to do is type &#8216;/&#8217;, and then type your search regular expression. Search and replace is a lot more arcane: &#8220;:%s/&lt;search regexp&gt;/&lt;replacement text&gt;/gc&#8221; will do a search and replace globally and ask you for confirmation for each replacement. This is a common theme: there is less overhead to executing Vim commands. Sure, there are exceptions, but the stuff you use 80% of the time has been optimized for time.</li>
</ul>
<ul>
<li><strong>Tabs, Buffers, Frames, Windows:</strong> All of the goodies you could ever ask for in this category. You have access to all of the standard ways to move data around. Miss buffers from Emacs? You get to use them in Vim. Miss tabs from Visual Studio? Type &#8220;:tabe&#8221; and use the tabs. Do you like having split screen code? You get that, too.</li>
</ul>
<ul>
<li><strong>Customizable:</strong> Vim has its own scripting language that allows coders to build extensions. The site has a few thousand extensions that have been developed by the community, but I&#8217;ve always found it difficult to navigate.</li>
</ul>
<p><strong>Disadvantages</strong></p>
<ul>
<li><strong>Chokes to death on multiple long lines: </strong>When I mean long, I&#8217;m not saying that Vim is a little slow on lines with 100 characters. If you had a file with multiple lines larger than the screen size (if you had a file of DNA sequences, for instance), you will probably not get the display behavior that you want with the default settings.</li>
</ul>
<ul>
<li><strong>The Learning Curve: </strong>When you finally get up to speed using Vim, it is fantastic. However, it will take you a few weeks before you get used to all of the new commands, and even longer before you stop mixing up the movement keys and the home row. However, this is the kind of tool that is optimized for experts and not beginners.</li>
</ul>
<ul>
<li><strong>Don&#8217;t Sneeze and Type:</strong> Have you ever started typing a sentence while in command mode and not in insert mode? Me too. I&#8217;ve watched half of my file disappear before my very eyes. Fortunately, the undo key (&#8217;u') is not very far away.</li>
</ul>
<h2>Emacs</h2>
<p><em><span style="text-decoration: underline;">Disclaimer</span>: So that I don&#8217;t summon RMS from the depths of the Marianas Trench, mentally replace all instances of &#8220;Emacs&#8221; with &#8220;GNU Emacs&#8221;. It&#8217;s easier to type, and everyone knows what I meant, dammit.</em></p>
<p>Note: In key sequences, &#8220;C&#8221; means &lt;Ctrl&gt; and &#8220;M&#8221; means &lt;Alt&gt;. So C-M-Del means &#8220;&lt;Ctrl&gt;&lt;Alt&gt;&lt;Del&gt;&#8221;</p>
<p><strong>Advantages</strong></p>
<ul>
<li><strong>Easier to Learn</strong>: Emacs has a better learning curve than Vim, as the user is automatically able to start typing. It&#8217;s not until they try to save that they run into their first problem. However, the file menu helpfully gives the users the proper command.</li>
</ul>
<ul>
<li><strong>Many Commands</strong>: Emacs has quite a bit of built in commands. To me, it seems like it has more than Vim, but that could just be a shortcoming of mine. It has a lot of helpful commands that Vim doesn&#8217;t have built in, such as transposition. This allows you to drag a word forward or backwards in a sentence or an argument list.</li>
</ul>
<ul>
<li><strong>Everything but the Kitchen Sink: </strong>The main beauty of Emacs is that you shouldn&#8217;t need to leave your text editor in order to perform mundane tasks related to coding. Sure, Vim lets you compile and debug from the editor, but Emacs lets you check email, use calculators, play games. You can also perform any programming-related task you&#8217;d like. If you know a little eLisp (Emacs Lisp), you can even evaluate Lisp expressions inside of Emacs <em>by default</em>.</li>
</ul>
<ul>
<li><strong>Better Auto-Indent</strong>: It seems like the coding modes in Emacs understand the document structure of programs a lot better, as they get tabbing right very frequently. Some of the modes are also intelligent when there is a tabbing ambiguity. For instance, in the Python writing mode, pressing the &lt;Tab&gt; key multiple times gives you all of the different possible legal tab positions.</li>
</ul>
<ul>
<li><strong>Great Extension Community:</strong> Combining the magic of Lisp with the magic of Emacs, the community has been writing every imaginable extension you can think of since the mid &#8217;80s.</li>
</ul>
<ul>
<li><strong>Good Copy/Cut Behavior: </strong>By default, the copy/cut buffer in Emacs goes through &#8220;rings&#8221;, where you can repeatedly hit M-y in order to get previous items in the copy buffer. In Vim, you need to specify which buffer should be used as a copy, as it will continually overwrite the same one.</li>
</ul>
<ul>
<li><strong>Good Buffer Support: </strong>Once you learn the different buffer commands, they turn out to be a very powerful way to switch documents. You can open new buffers as a scratch pad and turn to old ones in the blink of an eye.</li>
</ul>
<p><strong>Disadvantages</strong></p>
<ul>
<li><strong>Ragtime Typing: </strong>Due to the use of modifier chords, you have to move your hands around quite a bit. The most commonly used key is the &lt;Ctrl&gt; key, so if your keyboard only has one, it is recommended that you swap your &lt;Ctrl&gt; and &lt;Caps Lock&gt; keys. For most of the simple movement, you need to use two keys to move instead of one: C-f to move forward, for instance.</li>
</ul>
<ul>
<li><strong>Emacs Pinky:</strong> After a few weeks of use, I actually started getting the dreaded &#8220;Emacs Pinky&#8221;, a numb sensation in the pinky from constant use of the modifier keys. I took it easy for a few days and wore a wrist brace to find out when I&#8217;ve been abusing hand stretches, and the problem has since disappeared. However, the phenomena is very real, so be careful.</li>
</ul>
<h2>Somewhere There Is a Great Text Editor</h2>
<p>Both of the text editors mentioned here have a lot of great features, but they also have a lot of drawbacks that are not mentioned here. Some certain commands have a lot more overhead then they should. Granted, you can just rebind keys to the command you want. However, this doesn&#8217;t always work when you are bouncing back-and-forth between a lot of different computers.</p>
<p>It would be great if Vim had the &#8220;kitchen sink&#8221; philosophy of Emacs built in, because then I&#8217;d never have to leave Vim and could forever revel in its modal glory. A lot of the buffer/window/tab commands in Vim feel like they have too much typing overhead. For example, typing &#8220;:tabn&#8221; over and over again to switch tabs gets old.</p>
<p>In turn, it would be great if Emacs had a lot less typing overhead for some of its commands. Viper (using VI bindings in Emacs) is a fair compromise, but it somehow feels cheap, and doesn&#8217;t really get away from the Ragtime Typing problem for anything but the most common movements.</p>
<p>In general, I&#8217;ve found that Emacs is a better writer than Vim, as it understands the structure of the document much better. However, I&#8217;ve found that Vim is a much better editor: I can perform a lot of the common editing commands a lot faster in Vim than in Emacs. It&#8217;s missing a few, like word dragging, but that is easily replaced by deleting the word and retyping it in the necessary location.</p>
<p>I think that a great text editor would have the following criteria:</p>
<ul>
<li>Modal (helps cut down on keystrokes).</li>
<li>Low typing overhead for 99% of the most common editing tasks.</li>
<li>Easy on the C-M chord modifiers for the common tasks.</li>
<li>&#8220;The Kitchen Sink&#8221; philosophy. The programmer should never need to leave the editor to do common tasks like check email, the weather, their RSS reader, play basic games, etc.</li>
<li>Great understanding of the document structure, not just best-guessing the tabbing like Vim does.</li>
<li>Easy tabs/buffers/frames/windows.</li>
<li>Great integration with OS and local tools.</li>
</ul>
<p>Anything else?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jakevoytko.com/blog/2008/04/13/somewhere-between-vim-and-emacs-there-is-a-great-text-editor/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
