<?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>CodingExperiments.com &#187; Programming</title>
	<atom:link href="http://codingexperiments.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://codingexperiments.com</link>
	<description>$ sudo make money</description>
	<lastBuildDate>Wed, 07 Apr 2010 02:53:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>A Brief History of Build Systems #1: Introduction</title>
		<link>http://codingexperiments.com/a-brief-history-of-build-systems-1-introduction/</link>
		<comments>http://codingexperiments.com/a-brief-history-of-build-systems-1-introduction/#comments</comments>
		<pubDate>Sun, 16 Nov 2008 23:05:08 +0000</pubDate>
		<dc:creator>i80and</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://codingexperiments.com/?p=493</guid>
		<description><![CDATA[The ancient practice of putting various monsters in unexplored regions of maps and the phrase based on that, &#8220;Here be dragons&#8220;, applies still to programming.  Personally, I&#8217;ve always had a dragon the size of a moon (or battlestation, if one prefers) on my own mental map in the area of build systems.  Hopefully, this should [...]]]></description>
			<content:encoded><![CDATA[<p>The ancient practice of putting various monsters in unexplored regions of maps and the phrase based on that, &#8220;<a href="http://en.wikipedia.org/wiki/Here_be_dragons">Here be dragons</a>&#8220;, applies still to programming.  Personally, I&#8217;ve always had a dragon the size of a moon (or battlestation, if one prefers) on my own mental map in the area of <a href="http://en.wikipedia.org/wiki/Build_automation">build systems</a>.  Hopefully, this should be a series, with several tutorials succeeding this brief summary of available options.</p>
<h3>What is a Build System?</h3>
<p>Just a quick introduction for those who are uninitiated into these rgb(0,0,0) arts.  A build system offers a relatively easy way to automate building and packaging of a software system.  While something as simple as a one-line shell script could supposedly be written for smaller projects, this has several problems.  Firstly, it would tend to redundantly and naively recompile objects that have already been built and have not been changed.  Secondly, this has no portability system; that is, it has no way to analyze the host system and find the appropriate utilities and libraries on differing platforms.  There are more reasons, of course, but these are the crux of the matter.</p>
<h3>Current Build Systems</h3>
<h4>Make</h4>
<p><a href="http://en.wikipedia.org/wiki/Make_(software)">Make</a> is one of the oldest build systems, having its first release in 1977 at <a href="http://en.wikipedia.org/wiki/Bell_Labs">Bell Labs</a>.  It is extremely simple, but pays the price; it has no configuration system, nor any automatic dependency analysis.  This makes it a decent choice for smallish projects with any advanced portability needs, but most likely you&#8217;re better served by a more powerful tool.  However, it should be noted that various projects such as Autoconf (see below) serve to expand this utility.</p>
<h4>Autoconf</h4>
<p><a href="http://www.gnu.org/software/autoconf/">Autoconf</a> and <a href="http://www.gnu.org/software/automake/">Automake</a> together form a framework for generating Make scripts.  Autoconf provides the portability configuration system, while Automake will automatically analyze your program structure to determine the order that things need to be rebuilt in.  Unfortunately, on some level, this is merely lipstick on a pig (which is an idiom I used to be able to use without shifting my eyes), and due to the obscure language (<a href="http://en.wikipedia.org/wiki/M4_(language)">m4</a>) used to write Autoconf scripts, this is both a finicky and difficult option to use.  Configuration is slow, and is extremely awkward if you wish to target Microsoft Windows.  Last but not least, it is legendary for being extremely difficult to learn.  It is, however, the most common build system on the Free Desktop.</p>
<h4>SCons</h4>
<p>I&#8217;ll get my bias off of my chest now: <a href="http://www.scons.org./">SCons</a> is my current favorite build system.  The scripts are written in <a href="http://www.python.org./">Python</a>, so you have a very powerful programming language to work within.  The API is a bit less than ideal in some ways, but is still quite usable.  Compilation is fast and portable, as well as being in one step (as opposed to the two-step compilation as used in Autoconf).  The <a href="http://www.gnome.org./">GNOME</a> project is currently considering switching to it from Autoconf.</p>
<h4>Waf</h4>
<p><a href="http://code.google.com./p/waf/">Waf</a> is a descendent of SCons, and thus shares the power of Python.  However, it is expanded in several ways: the API is retooled and is more intuitive in design in some ways; the configuration stage has been spawned into its own step; and compilation is quite pretty.  Despite all of this, it does suffer from a lot of API irregularities and absolutely intolerable documentation.  It is also important to note that Waf is unique in the build systems that I&#8217;m aware of in that the preferred way to use it is to actually ship it with the application itself instead of using a system-wide installation</p>
<h4>CMake</h4>
<p><a href="http://www.cmake.org./">CMake</a> is the build system for <a href="http://www.kde.org./">KDE 4</a>, and is a very nice and simple build system for projects of any size.  However, this clean and simple design is detracted from by the simplistic (though not to the Make extreme by any means) language used to develop for it.  If you can get past this weakness, however, very nice things lie inside, such as an integrated unit testing framework.  It is worth noting that rather than being a base build system, it instead generates files for the native build system (Microsoft Visual C++ on Windows, Makefiles or KDevelop on *NIX, etc.)</p>
<h4>Others</h4>
<p>This is where the <em>real</em> dragons are; the previous build systems I have at least some experience with, but these are build systems I have only heard of.  Despite this, I would feel remiss in my duties to you the reader if I did not at least mention some of the lesser-used options.</p>
<ul>
<li><a href="http://ant.apache.org/">Apache Ant</a> is a build system is aimed at Java projects, and has its project files written in XML.</li>
<li><a href="http://www.perforce.com./jam/jam.html">Perforce Jam</a> appears to be a C/C++ build system with a syntax reminiscent of Make, but with portability features, control structures, and automatic dependency ordering.</li>
<li><a href="http://doc.trolltech.com/4.4/qmake-manual.html">QMake</a> is a Makefile generator not unlike Autoconf, only with a much easier-to-learn syntax.  It is part of the <a href="http://www.trolltech.com./products/">QT toolkit</a>.</li>
</ul>
<p>This list is by no means complete.  If you have a favorite build system, please do mention it in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://codingexperiments.com/a-brief-history-of-build-systems-1-introduction/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Seven Questions That All Newbie Programmers Should Be Asking When Writing Programs</title>
		<link>http://codingexperiments.com/seven-questions-that-all-newbie-programmers-should-be-asking-when-writing-programs/</link>
		<comments>http://codingexperiments.com/seven-questions-that-all-newbie-programmers-should-be-asking-when-writing-programs/#comments</comments>
		<pubDate>Mon, 29 Sep 2008 02:01:02 +0000</pubDate>
		<dc:creator>Rishabh Mishra</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[newbies]]></category>

		<guid isPermaLink="false">http://codingexperiments.com/?p=407</guid>
		<description><![CDATA[Edit: The people on Reddit informed me that some of my questions go against the idea that premature optimization is a bad practice. Introduction &#8220;Listen. Easy now,&#8221; said the old man gently. &#8220;I know, I know. You&#8217;re afraid of making mistakes. Don&#8217;t be. Mistakes can be profited by. Man, when I was younger I shoved [...]]]></description>
			<content:encoded><![CDATA[<p><em>Edit: <a href="http://www.reddit.com/r/programming/comments/7e1a9/seven_questions_that_all_newbie_programmers/">The people on Reddit</a> informed me that some of my questions go against the idea that premature optimization is a bad practice. </em></p>
<h2>Introduction</h2>
<blockquote><p>&#8220;Listen. Easy now,&#8221; said the old man gently. &#8220;I know, I know. You&#8217;re afraid of making mistakes. <em>Don&#8217;t</em> be. Mistakes can be profited by. Man, when I was younger I <em>shoved</em> my ignorance in people&#8217;s faces. They beat me with sticks. By the time I was forty my blunt instruments had been honed to a fine cutting point for me. If you hide your ignorance, no one will hit you and you&#8217;ll never learn. [...]&#8221;</p>
<p>&#8211;Fahrenheit 451</p></blockquote>
<p>Newbie programmers, when set to complete task, will often complete the task in the worst way possible. Of course, most programmers graduate beyond newbies. This post will detail some questions that newbies can ask in order to build better programs.</p>
<p>The below questions are things that all newbie programmers should be asking themselves so they can produce good programs. The questions can also be used as a very simple litmus test to see whether a programmer is a completely lost newbie or not. <a title="Stevey's Drunken Blog Rants™: The Five Essential Phone-Screen Questions " href="http://steve.yegge.googlepages.com/five-essential-phone-screen-questions">The Five Essential Phone-Screen Questions</a> has a set of questions that help find good programmers.</p>
<p>&lt;insert image here&gt;</p>
<p><em>Photo credit: Flickr user <a href="http://flickr.com/photos/31333486@N00/">anomalous4</a> </em></p>
<h2>When coming up with ideas for solutions</h2>
<h3>1) What patterns or algorithms can help me solve the problem?</h3>
<p>Computers work well with numbers, and numbers are full of patterns and sequences. A simple example of a sequence is the Fibonacci sequence, where every number is the sum of the previous two numbers (1, 1, 2, 3, 5, 8, 13&#8230;).</p>
<p>A simple and useful algorithm is the <a href="http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes">Sieve of Eratosthenes</a>, which is used to create lists of prime numbers.</p>
<h3>2) Has somebody else already solved this problem or a similar problem?</h3>
<p>Google called; they said they have the answer to your problem.</p>
<p>For those that can handle looking at the possibly messy code of others, looking online for open source code that can partly, mostly, or completely fill a need is a good idea.</p>
<p>A somewhat recent example is that I was looking for an open source Digg clone in PHP to make slight modifications to, and managed to find <a href="http://www.pligg.com/">Pligg</a>. Unfortunately, Pligg didn&#8217;t manage to fit my needs, but I managed to find <a href="http://www.kubelabs.com/phpdug/">PHPDug</a>, which I like better.</p>
<h3>3) What are potential issues I could run into when solving this problem?</h3>
<p>It is important to think ahead about what issues could be faced when solving a problem.</p>
<p>For an important website, the power of the hardware, the power of the software, and the precautions taken for data loss and downtime, and more should be considered.</p>
<h2>When looking at possible solutions</h2>
<p>The first group of questions are things that newbie, or n00b, programmers should ask themselves when looking at a source code or a way to solve a problem.</p>
<h3>1) Is this method fast as it can be?</h3>
<p>Writing fast programs is a very important thing. Too many people are not patient enough for slow programs, and writing programs that can easily be made faster is not going to make users happy.</p>
<h3>2) Is this method secure?</h3>
<p>I sometimes wonder if it would be more beneficial to beginning developers <a href="http://youtube.com/?v=8To-6VIJZRE">Baller shouted &#8220;Security!&#8221; instead of &#8220;Developers!&#8221;</a>.</p>
<p><img class="alignnone" title="I have a feeling that nobody will understand this little cartoon I made." src="/images/noobs/noobs.png" alt="" width="341" height="234" /></p>
<p>Some common, but dangerous security mistakes that n00bs make are:</p>
<p><strong>1) not escaping user input</strong></p>
<p><a href="http://xkcd.com/327/"><img class="alignnone" src="/images/noobs/exploits_of_a_mom.png" alt="" width="358" height="205" /></a></p>
<p><strong>2) not using file permissions properly</strong></p>
<p>Chmodding everything is 777 is bad. Very bad.</p>
<p><strong>3) using improper encryption to store things</strong></p>
<p><a href="http://xkcd.com/257/"><img class="alignnone" src="/images/noobs/code_talkers.png" alt="" width="500" height="397" /></a></p>
<h3>3) Is there a simpler way of solving this problem?</h3>
<p>If a person has two solutions to solve a problem, that person should always choose the simpler solution. The more complexity there is in a system, the more difficult it is to use and maintain that system.</p>
<h3>4) Is this method scalable?</h3>
<p>Creating software that works perfectly, with the exception it not being scalable at all, is setting up the programmer(s) for some major headaches down the road. A classic example is Twitter&#8217;s severe instability a few months ago.</p>
<h2>Final notes</h2>
<p>All programmers ought to subscribe to <a href="http://www.codinghorror.com/blog/">Coding Horror</a>, a blog with far more useful content than you&#8217;ll ever find in this waste of disk space.</p>
<p>Also remember to ask questions on mailing lists, forums,  and so forth, but only after several hours of experimenting with Google keywords.</p>
]]></content:encoded>
			<wfw:commentRss>http://codingexperiments.com/seven-questions-that-all-newbie-programmers-should-be-asking-when-writing-programs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integer-&gt;String conversion in C/C++</title>
		<link>http://codingexperiments.com/integer-string-conversion-in-cc/</link>
		<comments>http://codingexperiments.com/integer-string-conversion-in-cc/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 18:34:15 +0000</pubDate>
		<dc:creator>i80and</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://codingexperiments.com/?p=324</guid>
		<description><![CDATA[I had cause of late to convert an integer into a string in C.  My research indicated that there was no standardized function to do this, and thus the most portable thing to do was to write my own algorithm.  After fiddling with numbers and masks and such things, I came up with the following [...]]]></description>
			<content:encoded><![CDATA[<p>I had cause of late to convert an integer into a string in C.  My research indicated that there was no standardized function to do this, and thus the most portable thing to do was to write my own algorithm.  After fiddling with numbers and masks and such things, I came up with the following core algorithm:</p>
<pre>#define CONVERT_DIGIT(mask, n, offset)    (( n/mask - ( n/(mask*10))*10) + offset )</pre>
<p>This algorithm may not be as efficient as it could be, but I&#8217;m fairly happy with it given that normally I dodge anything with even a distant correlation to mathematics as if it were the plague.  <em>mask</em> is a power of your number system base <em>b</em>; most of the time, this is going to be a power of 10.  <em>n</em> is the number you want to convert.  <em>offset</em> is used to offset the resulting integer to an ASCII equivalent; this could actually be hard-coded as 48.</p>
<p>Given that the number of digits in <em>n</em> is <em>L</em>, you need to initialize <em>mask</em> to <em>b</em><sup><em>L</em>-1</sup>.  Then run a loop that for each digit in <em>n</em> runs CONVERT_DIGIT( <em>mask</em>, <em>n</em>, 48) and then divides <em>mask</em> by <em>b</em> for the next iteration.</p>
<h3>Caveats</h3>
<p>While the algorithm itself should be O(<em>L</em>), the actual output is going to have some worthless zeros at the start for most values of<em> n</em> that may have to be stripped.  In addition, I&#8217;m not going to explain how to create a string in C, or how to implement this in other languages.  You&#8217;re on your own there.</p>
<p>Also note that while the premise should be solid and I haven&#8217;t seen a situation where it fails, I disavow all responsibility for algorithmic failures and weaknesses.</p>
<p>EDIT:<span> <a href="http://theinterblag.blogspot.com/">Daniel Bruce</a> informed me that the function <a href="http://www.opengroup.org/onlinepubs/009695399/functions/sprintf.html">sprintf()</a> would do the job just as well, only should also work for floating point numbers and is more flexible.  I wish I had known about that before I had spent the time to write this algorithm.<br />
</span></p>
<div class="username"></div>
]]></content:encoded>
			<wfw:commentRss>http://codingexperiments.com/integer-string-conversion-in-cc/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>How to Avoid Some of the Problems in Writing a Working Recommendation Engine</title>
		<link>http://codingexperiments.com/how-to-avoid-some-of-the-problems-in-writing-a-working-recommendation-engine/</link>
		<comments>http://codingexperiments.com/how-to-avoid-some-of-the-problems-in-writing-a-working-recommendation-engine/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 00:17:41 +0000</pubDate>
		<dc:creator>Rishabh Mishra</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://codingexperiments.com/?p=313</guid>
		<description><![CDATA[Introduction When you think about it, having a computer analyze your interests and tell you other things that you might be interested sounds seriously cool. But a lot of recommendation engines hardly ever actually find anything interesting for human users. This post will cover some of the issues that software developers face when trying to [...]]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>When you think about it, having a computer analyze your interests and tell you other things that you might be interested sounds seriously cool. But a lot of recommendation engines hardly ever actually find anything interesting for human users. This post will cover some of the issues that software developers face when trying to write a recommendation engine, and how to reduce the impact of those issues.</p>
<h2>Developers making recommendation engines get annoyed by</h2>
<h3>1. Speed and scalability</h3>
<p>A lot of recommendation engines are for websites such as Amazon. The recommendations have to be served up quickly. One way to solve this is by <em>not</em> generating the recommendations when the page with the recommendations is being requested. The recommendations can be generated at an earlier time and, on page load, can be fetched with database queries or similar.</p>
<p>Another way to solve this is to use the client&#8217;s processing power to either generate the recommendations. For a web application, Javascript can be used to generate recommendation, as this <a title="Personalized Web 2.0 Blog: Del.icio.us Recommendation Engine" href="http://personalized20.blogspot.com/2006/02/delicious-recommendation-engine.html">Delicious recommendation engine</a> does.</p>
<p>There is also the issue of scalability. The system has to be able to quickly generate recommendations for large amounts of users. It would be sad for a recommendation engine to fail, Twitter style.</p>
<h3>2. Malicious folk</h3>
<p>This is an issue when having a recommendation engine that deals with user generated content. It doesn&#8217;t take long to find a Youtube video with literally hundreds of unrelated tags in the hope of tricking users to watch the video.</p>
<p>For some recommendation engines, this isn&#8217;t a problem, but for many, it can be difficult. For the Youtube example that I gave, videos with copious amounts of tags could be ignored by the recommendation engine because it is highly doubtful that nearly every single one of those hundreds of tags are relevant.</p>
<h3>3. Little data</h3>
<p>It would be snap-easy if all the users that your recommendation engine will analyze had large pools of data clearly describing what the users do. It is very difficult to give recommendations based on little data.</p>
<p>One way to attack the <em>little data</em> issue is to not give recommendations until enough data from the user is collected. This results in the user having to do work and wait for the recommendations to appear, which usually isn&#8217;t a good thing.</p>
<p>Another way is to make the recommendations based on the data of others. Recommendations popular among the vast majority of other users (think Digg front page) could be made.</p>
<h3>4. Nothing good to recommend</h3>
<p>Recommendation engines work really well for big sites such as Amazon, Youtube, Digg, and Delicious because those websites have a lot to recommend. It doesn&#8217;t matter what the user&#8217;s interests are, because those websites probably have to have <em>something</em> that would interest the user.</p>
<p>Smaller applications typically do not have as much to recommend, unless they are drawing upon the content of larger applications.</p>
<p>In order for the programmer to solve this, more content must exist in order so at least something interesting can be recommended to the user. If the content is user-generated, encourage users to generate more content by providing some sort of benefit for creating more content.</p>
<h3>5. Duplication</h3>
<p>Youtube is a great example of content duplication. Multiple people will frequently upload the same copyrighted content, creating duplicate content on the Youtube servers. How can a recommendation engine give relevant recommendations, but not have the recommendations be so relevant that the user sees duplicate content.</p>
<p>In the case of Youtube, having the recommendation engine ignore suspiciously similar video titles might help reducing the duplicate recommendations.</p>
]]></content:encoded>
			<wfw:commentRss>http://codingexperiments.com/how-to-avoid-some-of-the-problems-in-writing-a-working-recommendation-engine/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Midori 0.19 Patch</title>
		<link>http://codingexperiments.com/midori-019-patch/</link>
		<comments>http://codingexperiments.com/midori-019-patch/#comments</comments>
		<pubDate>Fri, 15 Aug 2008 17:30:05 +0000</pubDate>
		<dc:creator>i80and</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://codingexperiments.com/?p=297</guid>
		<description><![CDATA[Recently I&#8217;ve been playing with Midori in the wake of being informed that it&#8217;s now an Xfce project.  A nice enough browser, albeit quite solidly still in the development stage.  However, on systems such as mine that lack GLib 2.16 (and therefore GIO), there is a compilation error.  Specifically, there are two problematic zones.  The [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve been playing with <a href="http://www.twotoasts.de/index.php?/pages/midori_summary.html">Midori</a> in the wake of being informed that it&#8217;s now an <a href="http://www.xfce.org/">Xfce</a> project.  A nice enough browser, albeit quite solidly still in the development stage.  However, on systems such as mine that lack <a href="http://gtk.org/">GLib</a> 2.16 (and therefore GIO), there is a compilation error.  Specifically, there are two problematic zones.  The first is a confusion in the macros that check for GLib 2.16 and GtkSourceView that result in a failed compile if you have an older version of GLib in combination with GtkSourceView. Secondly, Midori will attempt to use GLib 2.16 symbols without first checking if the user has GLib 2.16.</p>
<p>So I wrote a patch and submitted a bug report.  The bugs are now fixed in git master, but for the existing stable release (0.19), you can find <a href="http://www.twotoasts.de/bugs/index.php?getfile=53">my patch</a> at the <a href="http://www.twotoasts.de/bugs/index.php?do=details&amp;task_id=88&amp;project=2">relevant bug report</a>.  To apply it, move it into the Midori 0.19 directory and then run</p>
<pre>cat midori-glib216.patch | patch -p1</pre>
]]></content:encoded>
			<wfw:commentRss>http://codingexperiments.com/midori-019-patch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What Twitter Taught Me on How to Build a Web Application</title>
		<link>http://codingexperiments.com/what-twitter-taught-me-on-how-to-build-a-web-application/</link>
		<comments>http://codingexperiments.com/what-twitter-taught-me-on-how-to-build-a-web-application/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 02:05:59 +0000</pubDate>
		<dc:creator>Rishabh Mishra</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[web 2.0]]></category>

		<guid isPermaLink="false">http://codingexperiments.com/?p=247</guid>
		<description><![CDATA[A lot of people are out in the world, looking for something. These people are not looking for a lost dog or wristwatch, but these people are looking for something more valuable; ideas. Ideas are extremely valuable now, and they always have been. Nowadays, ideas have changed slightly. They are more likely to involve software [...]]]></description>
			<content:encoded><![CDATA[<p>A lot of people are out in the world, looking for something. These people are not looking for a lost dog or wristwatch, but these people are looking for something more valuable; ideas. Ideas are extremely valuable now, and they always have been. Nowadays, ideas have changed slightly. They are more likely to involve software and vast server farms. A lot of people are wondering, &#8220;How do I generate an idea that will be popular and generate income for me?&#8221;</p>
<p>I don&#8217;t claim to be an expert, but blogging allows people to pretend to be experts on various topics, so I&#8217;ll take a shot at explaining how to make a popular application. Remember that other negative things, such as the application having a horrible interface, may reduce the effect of these tips.</p>
<h2>How to Make a Popular Application</h2>
<p><strong>1) Create something that nobody needed before, but now that you have showed them, they want it.</strong></p>
<p>This can be called the <em>Twitter effect</em>. In the history of communications, using 140 character messages to communicate isn&#8217;t what people thought that they really needed. Now, some people are crazy about microblogging.</p>
<p>A huge advantage in creating something that nobody previously thought was needed is that in the beginning, the creator has no competitors. Twitter has had massive success while competitors are not close to Twitter&#8217;s user count. Of course, Twitter&#8217;s mistakes have users flocking to <a href="http://friendfeed.com">FriendFeed</a>, <a href="http://identi.ca.com">identi.ca</a>, and <a href="http://plurk.com">Plurk</a>.</p>
<p><strong>2) Create something that can easily be used in many, many ways.</strong></p>
<p>I&#8217;m going to use Twitter as an example again. People are constantly finding new and creative ways to use Twitter. Not everybody is just using it to broadcast what they had for breakfast. <a href="http://cnn.com">CNN</a> is using Twitter so people can quickly be notified of breaking news (find <a href="http://twitter.com/cnn">CNN&#8217;s Twitter account here</a>). Comcast is using Twitter to interact with customers (find <a href="http://twitter.com/comcastcares">Comcast&#8217;s Twitter account here</a>).</p>
<p><strong>2.1) Create something extensible</strong></p>
<p>Both Twitter and Firefox have had a lot of success due to the fact that both are extensible (in slightly different ways). Twitter&#8217;s API allows developers to create things such as <a href="http://twhirl.org/">Twhirl</a> and <a href="http://search.twitter.com">Summize</a> (the latter being acquired by Twitter recently).</p>
<p>When you make something extensible, it makes it much easier to use it in many ways. Firefox is a great example of having an application with many uses through extensions. The Firefox extension <a href="https://addons.mozilla.org/en-US/firefox/addon/427">ScrapBook</a> can make Firefox into a primitive web scraper, <a href="https://addons.mozilla.org/en-US/firefox/addon/5081">Twitterfox</a> gives Firefox the features of a Twitter client, and I could keep going with good Firefox-related examples.</p>
<p><strong>3) Create something that the user thinks saves time.</strong></p>
<p>They say time is money. Interestingly, helping decrease the amount of time it takes to get something done can generate you money. Notice that the title of this tip doesn&#8217;t say, &#8220;Create something that saves time.&#8221; If an application saves time, but potential users think it will waste time, then it does not matter that it saves time.</p>
<p>Conversely, if your application increases the time it takes to get something done, but the user thinks that time is being saved, you will still generate money. The problem with making the user think that time is being saved when time is being wasted is that it does not take very long for the users to figure out that time is not being saved at all. What&#8217;s that? It&#8217;s the sound of the customers walking away with their money.</p>
<p>How does this relate to Twitter? Now, a lot of Twitter users would simply say that Twitter is a time-wasting social network. Still, if a user <em>thinks</em> Twitter is a time-saving service, the user will use it as a time-saving service. Of course, the user might discover that Twitter isn&#8217;t saving them any time and then stop using Twitter. The key here is to use either Twitter itself or Twitter&#8217;s extensibility creatively.</p>
<p>An example of applying <a title="Wikipedia: Getting Things Done" href="http://en.wikipedia.org/wiki/Getting_Things_Done">GTD (Getting Things Done)</a> to Twitter is to <a title="The Cranking Widgets Blog: Hacking Twitter: How to Capture Everything, from Anywhere" href="http://blog.crankingwidgets.com/2007/03/19/capture-with-twitter/">creatively use the SMS features</a>. Depending on the user, it may or may not save time. If you spend enough time thinking about it, more ways to use Twitter and Twitter applications can be thought up.</p>
]]></content:encoded>
			<wfw:commentRss>http://codingexperiments.com/what-twitter-taught-me-on-how-to-build-a-web-application/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Dr. Hany Farid And His Work to Detect Photoshopping</title>
		<link>http://codingexperiments.com/dr-hany-farid-and-his-work-to-detect-photoshopping/</link>
		<comments>http://codingexperiments.com/dr-hany-farid-and-his-work-to-detect-photoshopping/#comments</comments>
		<pubDate>Thu, 26 Jun 2008 03:06:02 +0000</pubDate>
		<dc:creator>Rishabh Mishra</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://codingexperiments.com/?p=142</guid>
		<description><![CDATA[Just now, I finished watching an episode of Nova scienceNOW (yes, that&#8217;s how it&#8217;s capitalized). Covered in that episode is the work of Dr. Hany Farid and his work to develop software to detect photoshopped images. One technique that he demonstrated with software is to detect parts of images that are identical. This is to [...]]]></description>
			<content:encoded><![CDATA[<p>Just now, I finished watching an <a href="http://www.pbs.org/wgbh/nova/sciencenow/0301/">episode of Nova scienceNOW</a> (yes, that&#8217;s how it&#8217;s capitalized). Covered in that episode is the work of <a title="Nova scienceNOW: Profile: Hany Farid" href="http://www.pbs.org/wgbh/nova/sciencenow/0301/03.html">Dr. Hany Farid</a> and his work to develop software to detect photoshopped images.</p>
<p>One technique that he demonstrated with software is to detect parts of images that are identical. This is to detect whether the clone tool has been used on parts of the image.</p>
<p>Another technique demonstrated is to detect where light is coming from. If two people from two different images are cobbled together into one fake image, it is highly possible that the light sources in the original two images are in different places. This means that the two people are illuminated from different directions, and this is shown on the person. If one person is being illuminated from the left side, and another is being illuminated from the right side, you know that the image was originally two images that had different light sources.</p>
<p>Another way to see the light source, assuming that the image you are testing has at least two people with clearly visible eyes, is to analyze the shape and location of the light being reflected off; that is, the <a title="Wikipedia: Specular highlight" href="http://en.wikipedia.org/wiki/Specular_highlight">specular highlight</a>. As the eye can act like a mirror, you can see a little bit about the light source, such as the shape of the light source. You can also see how the light source is hitting the person. If one person has a reflection of a square light source (like from a camera flash), and another person has a reflection of a circular light source hitting the person at a completely different angle, there is a good chance that the photo isn&#8217;t completely real.</p>
<p>Want to learn more about Hany Farid? You can check out (I grabbed <a href="http://www.pbs.org/wgbh/nova/sciencenow/0301/resources.html#h03">all these links from here</a>):</p>
<ul>
<li><a href="http://www.cs.dartmouth.edu/farid/">Hany Farid&#8217;s home page</a></li>
<li><a title="Written by Ron Steinman for The Digital Journalist" href="http://www.digitaljournalist.org/issue0802/digital-forensics-an-interview-with-dr-hany-farid.html">Digital Forensics: An Interview with Dr. Hany Farid</a></li>
<li><a title="Written by Randy Dotinga for Wired" href="http://www.wired.com/gadgets/digitalcameras/news/2007/03/72883">Adobe Tackles Photo Forgeries</a></li>
<li><a title="Written by Claudia Dreifus for the New York Times (*NO* registration required)" href="http://www.nytimes.com/2007/10/02/science/02conv.html">A Conversation With Hany Farid: Proving That Seeing Shouldn’t Always Be Believing</a></li>
<li><a title="By Hany Farid" href="http://www.cs.dartmouth.edu/farid/publications/significance06.pdf">Digital Doctoring: How to Tell the Real From the Fake (PDF Warning)</a></li>
</ul>
<p>So, what&#8217;s your prediction on the future of the Internet, photography, and digital photo manipulation?</p>
]]></content:encoded>
			<wfw:commentRss>http://codingexperiments.com/dr-hany-farid-and-his-work-to-detect-photoshopping/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Another Programming Language for Kids, but This One Is Impressive</title>
		<link>http://codingexperiments.com/another-programming-language-for-kids-but-this-one-is-impressive/</link>
		<comments>http://codingexperiments.com/another-programming-language-for-kids-but-this-one-is-impressive/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 02:52:58 +0000</pubDate>
		<dc:creator>Rishabh Mishra</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://codingexperiments.com/?p=141</guid>
		<description><![CDATA[I just spent today spending my time (I&#8217;m feeling redundant) with an interesting little app, Scratch. It&#8217;s a cool little application that introduces children and early teens to programming and animation. Normally, I haven&#8217;t ever realy gotten the point of programming languages for children. I remember trying out SiMPLE to see how it compared to [...]]]></description>
			<content:encoded><![CDATA[<p>I just spent today <span style="text-decoration: line-through;">spending my time</span> (I&#8217;m feeling redundant) with an interesting little app, <a href="http://scratch.mit.edu/">Scratch</a>. It&#8217;s a cool little application that introduces children and early teens to programming and animation.</p>
<p>Normally, I haven&#8217;t ever realy gotten the point of programming languages for children. I remember trying out <a title="Bad color scheme and animated GIF warning" href="http://www.simplecodeworks.com">SiMPLE</a> to see how it compared to Python, and I wasn&#8217;t impressed. Scratch is actually pretty interesting and I would recommend it as an application to install on the computers of any young relatives you have. It&#8217;s available for Windows (appears to work on Vista), Mac, and Linux (via <a href="http://www.notesmine.com/scratch_installer">an unofficial installer</a>).</p>
<p>Now, what are the advantages of using Scratch over some language like Python or Javascript? And is Scratch a powerful programming tool?</p>
<p>Well, Scratch is centered around building animations and games quickly. Plenty of children would have an easy and fun time creating games in Scratch. Doing similar things in Python or Javascript take more difficulty.</p>
<p>So, what does Scratch look like? A screenshot is below. Click on it to view it full screen.</p>
<p><a href="/images/scratch/1.png"><img src="/images/scratch/1_thumb.png" alt="" width="413" height="302" /></a></p>
<p>Scratch has a graphical display of the code, but contains many control structures that will be familiar to programmers. Some examples are if/else, for (or rather some weaker constructs that do things that for is capable of), and exit.</p>
<p>Of course, many other programming languages have that and more, but the great thing about Scratch is that it has all this and is <em>easy</em>. Anybody can pick it up and start using it.</p>
<p>So, if you have access to kids, admin access to the kids&#8217; computers, and the Internet on those computers.</p>
]]></content:encoded>
			<wfw:commentRss>http://codingexperiments.com/another-programming-language-for-kids-but-this-one-is-impressive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Write Code to Help You</title>
		<link>http://codingexperiments.com/write-code-to-help-you/</link>
		<comments>http://codingexperiments.com/write-code-to-help-you/#comments</comments>
		<pubDate>Sun, 23 Mar 2008 21:27:47 +0000</pubDate>
		<dc:creator>Rishabh Mishra</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://codingexperiments.com/archives/53</guid>
		<description><![CDATA[I write little tools to help me all the time. An example of this is &#8220;Headliner&#8221; (source code coming soon). Headliner is a small prototype web app that takes in an essay title or newspaper headline and gives it the right capitalization. To save space, newspapers only capitalize the first word in each sentence in [...]]]></description>
			<content:encoded><![CDATA[<p>I write little tools to help me all the time. An example of this is &#8220;<a href="http://codingexperiments.com/examples/headliner/index.php" title="Headliner, my prototype web app.">Headliner</a>&#8221; (source code coming soon). Headliner is a small prototype web app that takes in an essay title or newspaper headline and gives it the right capitalization. To save space, newspapers only capitalize the first word in each sentence in the headline.</p>
<p>Essay titles capitalize every word except for <a href="http://en.wikipedia.org/wiki/List_of_English_prepositions" title="Wikipedia's list of English prepositions">prepositions</a> and articles (a, an, the). Headliner knows these rules and applies them on the headlines that you enter into it.</p>
]]></content:encoded>
			<wfw:commentRss>http://codingexperiments.com/write-code-to-help-you/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy AJAX Part 1: Fake it</title>
		<link>http://codingexperiments.com/easy-ajax-part-1-fake-it/</link>
		<comments>http://codingexperiments.com/easy-ajax-part-1-fake-it/#comments</comments>
		<pubDate>Sun, 23 Mar 2008 18:41:13 +0000</pubDate>
		<dc:creator>Rishabh Mishra</dc:creator>
				<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://codingexperiments.com/archives/51</guid>
		<description><![CDATA[Note: This is a post restored from the previous, multi-user installation of WordPress. I didn&#8217;t bother changing the date and time to when I actually wrote this. This is a series of posts that I will make about how to make (or make something that looks like) AJAX-style code. The basic idea behind AJAX is [...]]]></description>
			<content:encoded><![CDATA[<p><em>Note: This is a post restored from the previous, multi-user installation of WordPress. I didn&#8217;t bother changing the date and time to when I actually wrote this. </em></p>
<p>This is a series of posts that I will make about how to make (or make something that looks like) AJAX-style code. The basic idea behind AJAX is to build a website that runs several small HTTP requests to get the information you need instead of reloading the entire page once.</p>
<p>The first part of the series will tell you how to write HTML and Javascript that makes it look like you are using AJAX. It is a cheap trick that can be easily discovered and probably nothing really new. However, it is handy when you need to develop an AJAX-like website really quickly and don&#8217;t have the time to debug.</p>
<p>You can <a title="Example of my fake ajax technique." href="http://codingexperiments.com/examples/ajax/fake/">see the example here</a>. View the source or <a title="CodingExperiments Code Browser showing the Fake Ajax Technique." href="http://codingexperiments.com/examples/index.php?file=/ajax/fake">use the code browser</a> to see how it works.</p>
<p>UPDATE: I linked to the CE Code Browse in the above sentence if you prefer to view the source that way. I also fixed the scrollbar bug that voyagerfan5761 pointed out in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://codingexperiments.com/easy-ajax-part-1-fake-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

