<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Observed</title>
	
	<link>http://blog.burcudogan.com</link>
	<description>by Burcu Dogan</description>
	<lastBuildDate>Fri, 26 Feb 2010 14:08:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/burcudogan" /><feedburner:info uri="burcudogan" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/2.0/</creativeCommons:license><image><link>http://creativecommons.org/licenses/by-nc-nd/2.0/</link><url>http://creativecommons.org/images/public/somerights20.gif</url><title>Some Rights Reserved</title></image><feedburner:emailServiceId>burcudogan</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Probably I’m a “products person”</title>
		<link>http://feedproxy.google.com/~r/burcudogan/~3/Dm_FMC1xtO0/</link>
		<comments>http://blog.burcudogan.com/444/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 21:47:19 +0000</pubDate>
		<dc:creator>Burcu Dogan</dc:creator>
				<category><![CDATA[Regular]]></category>
		<category><![CDATA[products]]></category>

		<guid isPermaLink="false">http://blog.burcudogan.com/?p=444</guid>
		<description><![CDATA[It all started when I was younger, almost 15 years ago. As a rebellious child, I decided to publish my own newspaper to share my opinions about products I use daily. I wrote critics, future notes and reviews almost about everything &#8212; from plugs to kitchen tools. Reviewing was boring, but manufacturing was very costly, [...]]]></description>
			<content:encoded><![CDATA[<p>It all started when I was younger, almost 15 years ago. As a rebellious child, I decided to publish my own newspaper to share my opinions about products I use daily. I wrote <em>critics, future notes and reviews almost about everything</em> &#8212; from plugs to kitchen tools. Reviewing was boring, but manufacturing was very costly, and my cheap implementations would be looking very ugly. So, I gave up fast.</p>
<p>I was introduced to programming and computing technology very long time ago. I was pushed to it and fascinated by the flow of bits and bytes. But everything was embodied in 1996, the day I met the Web. Finally there was an easy and cheap way to distribute products. And to be able to ship products, I had to learn programming. This is how I started.</p>
<p>Now as a professional, I still couldn&#8217;t understand why I&#8217;m not also responsible for budget, strategy, concept, ux  et al as a developer. I&#8217;m a products person, I want to code for beautiful products to change mindsets and push the limits for more market visibility. I&#8217;m driven by breakthrough concepts, user interaction improvement, performance, cognition and reasoning. If you cant convince me, I perform bad. To be honest, I&#8217;m not sure this is how a developer should act but this is my formula. My time is valuable and if you want me to invest it in your project, you have to convince me. I never remember myself applying for a company to work on a product I dont believe that I can dedicate myself to.</p>
<p>Most probably this makes me an inefficient developer. I get angry when we don&#8217;t make enough revenue and we ship features that turns into invisible toys that 80% doesnt even use. I find myself crazily analysing the logs where available and trying to understand how users think.</p>
<p>Now ask me how many companies I started. Actual the number is &#8220;one&#8221; &#8212; the sector was totally out of technology business. We had great recognition from major industry players in the USA and our main service was quite profitable for college students. I made some huge mistakes in the past two years with losing the entrepreneurship I have inside. Now I decided to be a half entrepreneur and half time&amp;energy investor.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/burcudogan?a=Dm_FMC1xtO0:S7JK0h1fdTA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=Dm_FMC1xtO0:S7JK0h1fdTA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=Dm_FMC1xtO0:S7JK0h1fdTA:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=Dm_FMC1xtO0:S7JK0h1fdTA:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=Dm_FMC1xtO0:S7JK0h1fdTA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=Dm_FMC1xtO0:S7JK0h1fdTA:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.burcudogan.com/444/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.burcudogan.com/444/</feedburner:origLink></item>
		<item>
		<title>Custom Scroll Distance for UIScrollView</title>
		<link>http://feedproxy.google.com/~r/burcudogan/~3/-IWSuJ-OQ70/</link>
		<comments>http://blog.burcudogan.com/413/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 23:01:27 +0000</pubDate>
		<dc:creator>Burcu Dogan</dc:creator>
				<category><![CDATA[Regular]]></category>

		<guid isPermaLink="false">http://blog.burcudogan.com/?p=413</guid>
		<description><![CDATA[Most recently, I was trying to create a slider for users to navigate between different items. A scroll view was working fine since it implements most of the scrolling behavior I needed in my application natively. But the content I want to scroll was smaller in width and UIScrollView is designed to scroll multiples of [...]]]></description>
			<content:encoded><![CDATA[<p>Most recently, I was trying to create a slider for users to navigate between different items. A scroll view was working fine since it implements most of the scrolling behavior I needed in my application natively. But the content I want to scroll was smaller in width and <strong>UIScrollView </strong>is designed to scroll multiples of its width. This was truly a problem. It was possible to scroll 2-3 items once a time and there were no focus, although I was looking for a one-to-one transition between different items.</p>
<p><a href="http://blog.burcudogan.com/wp-content/uploads/2009/12/scroll11.png"><img class="left alignnone size-medium wp-image-424" title="Slider" src="http://blog.burcudogan.com/wp-content/uploads/2009/12/scroll11-293x300.png" alt="Slider" width="293" height="300" /></a> There were possibilities to listen touches and calculate the positioning of the next item and scroll to it. But to be honest, I had no time to try out fancy and not-stable solutions. Instead of losing myself in the rules of UIScrollView, I wanted UIScrollView to get lost in me. Remind the rule: &#8220;Only scroll multiples of its width horizontally&#8221;. Great, so why not modifying scroll view&#8217;s size? Well, just because I want other items to be visible and lined together to give user a feeling that it is a slider.</p>
<p><a href="http://blog.burcudogan.com/wp-content/uploads/2009/12/scroll2.png"><img class="right alignnone size-medium wp-image-434" src="http://blog.burcudogan.com/wp-content/uploads/2009/12/scroll2-250x300.png" alt="" width="250" height="300" /></a></p>
<p>Normally, that is where you stop, but there appeared a trick to make it work my way. I decided not to clip the subviews of scroll view and TA-DA! Images were lined up together and were visible even though they were not in the bounds of my scroll view. Very simple and clean solution. Inline note please: Before moving to the &#8220;how&#8221;, I want to point out <strong>there is a problem with this trick</strong>. You cannot interact with items out of the scroll view boundaries. If your items are tiny, this is a huge problem because scrolling will only be active for 50-60 pixels. Consequently, use this trick if items are at least %50-%60 of the whole screen.</p>
<p>Start a new window-based Xcode project. Create a view controller with a xib file. Open xib file and add a UIScrollView to the main view. Return back to the controller you created and add a property to connect UIScrollView. Return back to Interface Builder. Modify the width, height and positioning of the view. Connect controller&#8217;s scroll view to UIScrollView we created.<strong> Enable paging and uncheck &#8220;Clip Subviews&#8221;</strong>. Our scroll view is ready to be filled. On the viewDidLoad method, I&#8217;m going to add several images.</p>
<pre>// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {

    [super viewDidLoad];

	int i = 0, cx = 0;

	for(;;i++){

		UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"image%d.png", i + 1]];

		if(image == nil)
			break;

		UIImageView *view = [[UIImageView alloc] initWithImage:image];
		view.frame = CGRectMake(cx,0, scrollView.frame.size.width, scrollView.frame.size.height);
		[scrollView addSubview:view];

		[view release];

		cx += scrollView.frame.size.width;
	}

	scrollView.contentSize = CGSizeMake(cx, scrollView.frame.size.height);

}</pre>
<p>And finally build and run. It is going to work.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/burcudogan?a=-IWSuJ-OQ70:9AOBCZiTDdg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=-IWSuJ-OQ70:9AOBCZiTDdg:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=-IWSuJ-OQ70:9AOBCZiTDdg:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=-IWSuJ-OQ70:9AOBCZiTDdg:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=-IWSuJ-OQ70:9AOBCZiTDdg:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=-IWSuJ-OQ70:9AOBCZiTDdg:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.burcudogan.com/413/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://blog.burcudogan.com/413/</feedburner:origLink></item>
		<item>
		<title>Why should developers blog?</title>
		<link>http://feedproxy.google.com/~r/burcudogan/~3/erSF1DDp6Js/</link>
		<comments>http://blog.burcudogan.com/376/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 08:57:17 +0000</pubDate>
		<dc:creator>Burcu Dogan</dc:creator>
				<category><![CDATA[Regular]]></category>

		<guid isPermaLink="false">http://blog.burcudogan.com/?p=376</guid>
		<description><![CDATA[If I make an statistical study out of my friends and colleges who are developers, I can barely can say 10% of them are blogging. Is blogging a nightmare, a time waster, a cheap-seat show where bloggers act like significant people for them? I don&#8217;t know. I have one prediction: They don&#8217;t like writing. These [...]]]></description>
			<content:encoded><![CDATA[<p>If I make an statistical study out of my friends and colleges who are developers, I can barely can <strong>say 10% of them are blogging</strong>. Is blogging a nightmare, a time waster, a cheap-seat show where bloggers act like significant people for them? I don&#8217;t know. I have one prediction: They don&#8217;t like writing. These people are tech savvy, they are not like my mother who doesn&#8217;t know how to publish on Web. They have sufficient writing capabilities their readers won’t complain about. They have weekends off and most of them are single.<br />
<img class="right size-full wp-image-398" title="Blogging Culture" src="http://blog.burcudogan.com/wp-content/uploads/2009/11/blogging1.gif" alt="Blogging Culture" width="300" height="199" /><br />
I started my Internet fanaticism with writing in 1996-97. But releasing my first personal took another 10 years to happen, just a few years ago in 2006. Since I started to blog technically in a more personal area, my life changed fast. I have met dozens of people regardless of geological distances, interchanged great amount of knowledge, made friends, found people who can challenge me and found jobs. Besides these benefits, I have other reasons to blog technically:</p>
<h2>1. It&#8217;s natural: You have passion for technology</h2>
<p>You don&#8217;t have to have a reason. This should be very natural. If you are passionate about technology, you are also passionate about the trends in tech. Blogging is the top of the game since 2002-2003. Regretting the fashions won’t make you a cooler person. Early adoption gives a better impression. Running a blog and not making money out of it gives me one obvious signal: <em>I&#8217;m passionate about what I&#8217;m doing, this is not just a job to earn my life.</em></p>
<h2>2. Self promotion</h2>
<p>Isn&#8217;t it obvious? Nowadays if you are not on the Web, you are nowhere. You will at least have a personal space to introduce yourself to the world of networks. It&#8217;s good because you can find others who are interested in similar technologies and are passionate for similar concepts.</p>
<h2>3. Self improvement</h2>
<p>How could writing improve my own abilities? It&#8217;s usually being asked. Being socially active is the best thing to find more people who can challenge your existing capabilities. I understand you were the smartest of your family, you had great marks at high school, was a top student at college and now a superstar employee. But due to the existence of your blog, everyday you have replies back to you from smarter people around to remind you are still a beginner. This is a great opportunity to see there are no limits and you are never done.</p>
<p>On the other hand, your blog serves as a timeline which captures your interests, technical knowledge and other capabilities. You can easily review yourself by taking a look at your older posts.</p>
<h2>4. Sharing Knowledge</h2>
<p>And obviously, sharing knowledge has its factor. It’s common for others to struggle where you went down. You may like to share an exceptional bug, a trick to make things work, a newly released product, methodologies, stories, experiences and reviews.</p>
<p>Blogging makes you a better developer. More people you meet, the better person you will be. Physically there are many constraints but an online representation of yours will fasten things. And as a blogger, I want to get that as an RSS feed! <strong>Now there is one thing I&#8217;m curious about. Do you blog or not? Why or why not?</strong></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/burcudogan?a=erSF1DDp6Js:wSHQg-tPgEE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=erSF1DDp6Js:wSHQg-tPgEE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=erSF1DDp6Js:wSHQg-tPgEE:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=erSF1DDp6Js:wSHQg-tPgEE:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=erSF1DDp6Js:wSHQg-tPgEE:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=erSF1DDp6Js:wSHQg-tPgEE:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.burcudogan.com/376/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://blog.burcudogan.com/376/</feedburner:origLink></item>
		<item>
		<title>Maps Development on Android: Registering a Maps API key</title>
		<link>http://feedproxy.google.com/~r/burcudogan/~3/j_jqyHsKCSI/</link>
		<comments>http://blog.burcudogan.com/307/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 12:29:57 +0000</pubDate>
		<dc:creator>Burcu Dogan</dc:creator>
				<category><![CDATA[Regular]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[maps]]></category>

		<guid isPermaLink="false">http://blog.burcudogan.com/?p=307</guid>
		<description><![CDATA[Location based applications are  musts on mobile platforms. Android does not have maps natively but Google Maps team is providing an add-on that comes with Android SDK (at least 1.5). In this post, I&#8217;m not going to show you how to pop out maps on your little mobile screen, but underline the application signature details [...]]]></description>
			<content:encoded><![CDATA[<p>Location based applications are  musts on mobile platforms. Android does not have maps <em>natively</em> but Google Maps team is providing an add-on that comes with Android SDK (at least 1.5). In this post, I&#8217;m not going to show you how to pop out maps on your little mobile screen, but underline the application signature details related with Maps API.</p>
<p>First of all in our to show map tiles properly, we need an API key. This is all because you are requesting from Google Data API and have to agree with the terms of service. I&#8217;m also sure that quote rules also apply.</p>
<p>Every Android application is signed with a signature of the publisher. While obtaining a key, you must provide the MD5 summary of your signature to Google, and Google activates possible transactions between Maps API and the application your signature signs. In order to complete these actions, you have to</p>
<ol>
<li>Obtain the MD5 summary of your signature. If you do not have a signature, you can use the default one.</li>
<li><a href="http://code.google.com/android/maps-api-signup.html">Sign up for an API key</a> directly from Google by providing the hash of your signature.</li>
<li>Use API key with map elements and generate a sample map view.</li>
</ol>
<h2>Obtaining an API key</h2>
<p>You will have to use the keytool to obtain information about signatures. If you haven&#8217;t created one, Android SDK puts a default one in your <code>~/.android</code> directory. In this tutorial, I&#8217;m going to show you how to register with this default signature. Open a terminal prompt and enter</p>
<pre>$ keytool -list -keystore <strong>~/.android/debug.keystore</strong></pre>
<p>It&#8217;s going to ask you the password of the keystore (debug.keystore). Default is &#8220;android&#8221;. If you receive a MalformedKeyringException, you are giving the wrong password. If everything works great, it will output a few lines of information including the hash. Please read the summary line and copy the hash.</p>
<pre>Certificate fingerprint (MD5): <strong>E8:F4:F2:BF:03:F3:3A:3D:F3:52:19:9B:58:20:87:68</strong></pre>
<p>After obtaining the summary key, you can jump to the next level &#8212; <a href="http://code.google.com/android/maps-api-signup.html">signing up for an API key</a>. Give the hash as input and register. Please note the API key Google has given to you.</p>
<h2>Generating Maps on Android</h2>
<p><img class="alignright size-medium wp-image-369 right" title="Maps" src="http://blog.burcudogan.com/wp-content/uploads/2009/11/maps-223x300.png" alt="Maps" width="223" height="300" />Android SDK comes with two archives. First one is the <code>android.jar</code> which contains the standard platform libraries. And <code>maps.jar</code> which is a library dedicated to generation of maps. In the maps API, you will notice <a href="http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/MapView.html">MapView</a>. You can extend MapView to customize and add new features to show a custom map view. Or <a href="http://developer.android.com/guide/tutorials/views/hello-mapview.html">invoke the existing methods</a> to perform simple operations like panning, zooming and adding overlays to show information on the default map. There are great tutorials about Android&#8217;s map view and controller on web, I simply didn&#8217;t want to copy-cat the existing. Google&#8217;s <a href="http://developer.android.com/guide/tutorials/views/hello-mapview.html">Hello, MapView</a> is a place to start.</p>
<h2>Multiple-Developer Cases</h2>
<p>A signature can only be associated with a single API-key. What you are going to do if development is made across a team? You <strong>dont need to </strong>create different signatures for each developer and register them to use Data API one by one. Register a single signature and obtain a key. Then, <em>distibute the signature among the developers</em> &#8211; better add it to your version controlling system.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/burcudogan?a=j_jqyHsKCSI:TcPqEh42fz0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=j_jqyHsKCSI:TcPqEh42fz0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=j_jqyHsKCSI:TcPqEh42fz0:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=j_jqyHsKCSI:TcPqEh42fz0:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=j_jqyHsKCSI:TcPqEh42fz0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=j_jqyHsKCSI:TcPqEh42fz0:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.burcudogan.com/307/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.burcudogan.com/307/</feedburner:origLink></item>
		<item>
		<title>Redis: New Persistent Key-Value Store</title>
		<link>http://feedproxy.google.com/~r/burcudogan/~3/EZ9yBS4Q128/</link>
		<comments>http://blog.burcudogan.com/324/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 21:16:23 +0000</pubDate>
		<dc:creator>Burcu Dogan</dc:creator>
				<category><![CDATA[Regular]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[redis]]></category>

		<guid isPermaLink="false">http://blog.burcudogan.com/?p=324</guid>
		<description><![CDATA[Most recently, I&#8217;m working on Redis which is a key-value datastore with interesting characteristics. It&#8217;s ultra fast and has built in atomic operations to handle concurrent usage. Although everything lives in-memory, Redis syncs with hard disk time to time to serve as permanent storage. Most impressively, downloading Redis and making a working build doesn&#8217;t take [...]]]></description>
			<content:encoded><![CDATA[<p>Most recently, I&#8217;m working on <a href="http://code.google.com/p/redis/">Redis</a> which is a key-value datastore with interesting characteristics. It&#8217;s ultra fast and has built in atomic operations to handle concurrent usage. Although everything lives in-memory, Redis syncs with hard disk time to time to serve as permanent storage. Most impressively, downloading Redis and making a working build doesn&#8217;t take more than a few minutes.</p>
<p>Redis explains itself as a non-volatile memcached with various in-built data structures. Instead of only key and string value pairs, you can have lists and sets as values. There are atomic pop/push operations to work on these structures and increment/decrement functionality to work on numeric values.</p>
<p>Several client libraries are available including Perl, Python, Erlang, C++, Ruby, Scala and PHP. To write a more meaningful post, I&#8217;d like to add lines from a simple Python script.</p>
<pre>
import redis

storage = redis.Redis()
storage.keys("a*")  # returns keys starting with a

storage.get("key1") # returns the value of "key1"
storage.set("key1", "hello world") # setting the value of "key1"
storage.delete("key1") # deletes the pair with key1.

# working on lists
storage.push('key2', 'This is the first value', tail=True)
storage.push('key2', 'This is the second value', tail=True)
print storage.pop('key2')
</pre>
<p>Most of <a href="http://code.google.com/p/redis/wiki/CommandReference">these methods</a> are ported to client libraries and are available in downloadable Redis archive.</p>
<p>Although Redis can not be distributed, it&#8217;s easy to set up a slave node to replicate the master. Since it syncs with hard-disk in certain intervals, there might be data-loss in possible system crashes. So, setting up a slave may decrease the risks. It&#8217;s also advised to use Redis on a central server and manage sharding in the application level.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/burcudogan?a=EZ9yBS4Q128:E07dPuRFnl4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=EZ9yBS4Q128:E07dPuRFnl4:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=EZ9yBS4Q128:E07dPuRFnl4:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=EZ9yBS4Q128:E07dPuRFnl4:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=EZ9yBS4Q128:E07dPuRFnl4:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=EZ9yBS4Q128:E07dPuRFnl4:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.burcudogan.com/324/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.burcudogan.com/324/</feedburner:origLink></item>
		<item>
		<title>Why do Code Reviews Matter?</title>
		<link>http://feedproxy.google.com/~r/burcudogan/~3/8dWMrBJwQqA/</link>
		<comments>http://blog.burcudogan.com/292/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 10:28:46 +0000</pubDate>
		<dc:creator>Burcu Dogan</dc:creator>
				<category><![CDATA[Regular]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://blog.burcudogan.com/?p=292</guid>
		<description><![CDATA[We build software together. Team sizes vary a lot but it&#8217;s usually not 2 or 3. Team members leave, new members join and in the end of the day codebases are shared among large numbers of  different and diverse people from development, testing and deployment.
Code reviewing process is what you take into action every time [...]]]></description>
			<content:encoded><![CDATA[<p>We build software together. Team sizes vary a lot but it&#8217;s usually not 2 or 3. Team members leave, new members join and in the end of the day codebases are shared among large numbers of  different and diverse people from development, testing and deployment.<br />
Code reviewing process is what you take into action every time you make modifications to the code&#8217;s itself. Even though you change a single line, before committing the code to repository, a peer reviews it and confirms it can be submitted. Reviews can help to decrease the number of bugs, vulnerable code pieces, misuses of coding standards and etc. In an environment with no reviewing practices, actual code <strong>wont be directly visible to developers</strong> before an other member opens file(s) for editing. <em>Without reviews, even though build passes QA tests,</em></p>
<ol>
<li>Readability of the code,</li>
<li>Compatibility with coding standards,</li>
<li>Organization of the codebase,</li>
<li>Documentation inside the code <code>/* comments */</code>,</li>
</ol>
<p>will stay as<strong> surprises</strong>. These may lead to a dirty and badly organized base after a few years of continuous development. Asking a peer before you integrate new code into your product is a better approach since you may most probably have more time to fix, reshape and enhance your code if you take the action earlier. Usually only one other team will have time to review your code. But reviewing should be done with two people. First one should be a master, the one that knows the existing system well and can see the big picture. He can guess the impacts of your certain changes among the codebase. Other peer should be ideally someone who is not very familiar with the code, so you can test how easy to get into your code if you have to assign a bug to a new member, how well it suits with patterns in software development, how simple and obvious your solution is.</p>
<p>Consequently, whatever you are working on is shared among people. Asking for a review is always better than not asking and keep your actual contribution as a secret until it needs to be changed.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/burcudogan?a=8dWMrBJwQqA:Ja3enh3bXXc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=8dWMrBJwQqA:Ja3enh3bXXc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=8dWMrBJwQqA:Ja3enh3bXXc:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=8dWMrBJwQqA:Ja3enh3bXXc:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=8dWMrBJwQqA:Ja3enh3bXXc:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=8dWMrBJwQqA:Ja3enh3bXXc:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.burcudogan.com/292/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		<feedburner:origLink>http://blog.burcudogan.com/292/</feedburner:origLink></item>
		<item>
		<title>Let’s modify our representation of addresses in adr microformat</title>
		<link>http://feedproxy.google.com/~r/burcudogan/~3/2qlWWEY7MTQ/</link>
		<comments>http://blog.burcudogan.com/258/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 21:25:37 +0000</pubDate>
		<dc:creator>Burcu Dogan</dc:creator>
				<category><![CDATA[Regular]]></category>
		<category><![CDATA[maps]]></category>
		<category><![CDATA[microformats]]></category>

		<guid isPermaLink="false">http://blog.burcudogan.com/?p=258</guid>
		<description><![CDATA[Microformats define a representation spec for addresses, called adr. This year, I made two distinct proposal to modify the current draft, but turned down each time I tried. In this post, I&#8217;m going to address the current problems and how tiny enhancements can bring new horizons in the retrieval of location based information.
The problem
Current spec [...]]]></description>
			<content:encoded><![CDATA[<p>Microformats define a representation spec for addresses, called <a href="http://microformats.org/wiki/adr">adr</a>. This year, I made two distinct proposal to modify the current draft, but turned down each time I tried. In this post, I&#8217;m going to address the current problems and how tiny enhancements can bring new horizons in the retrieval of location based information.</p>
<h3>The problem</h3>
<p><a href="http://microformats.org/wiki/adr#Format">Current spec</a> does not serve as a latitude, longitude carrier. Current properties only include <em>post-office-box, extended-address, street-address, locality, region, postal-code and country-name</em> which are text fields to form an address. This schema is defined in vCard and migrated to hCard microformat in 2004. Then, the need of address-based extraction led them to copycat this format and call it <em>adr</em>. <strong>vCard&#8217;s final design spec was way before we had online maps. </strong>Nowadays, we have addresses all over the Web. Automatically directing these text addresses to locations on maps or providing a preview on hovers would be the first basic attempts to improve our data representations. But unfortunately, maps are talking more in mathematics than text addresses. In practise, there is a process that takes addresses and transforms them into a latitude, longitude couple and pans map to that location. This process is called <a href="http://en.wikipedia.org/wiki/Geocoding">geocoding</a>, and it is far away from perfection in today&#8217;s scale. Instead of depending on a geocoder to transform addresses into mathematical locations, I suggest microformats to enable built-in (lat, long) arrays in adr.</p>
<h3>Extending adr with a set of latitudes and longitudes</h3>
<p><a href="http://blog.burcudogan.com/wp-content/uploads/2009/08/poly.jpg"><img class="right" title="British Museum" src="http://blog.burcudogan.com/wp-content/uploads/2009/08/t_poly.jpg" alt="" width="320" height="200" /></a>What I&#8217;m going for is to extend adr with an optional list of (lat, long) values. So, in cases where coordinates are given, instead of asking a geocoder to land us on a location we can directly move. But why to use a list of coordinates and not a single point? Because, in spatial domain different geometric structures are being represented as different shapes. Examples are below.</p>
<ol>
<li> If you are talking about a city centre, it&#8217;s most likely to be a <strong>Point</strong>.</li>
<li>Mississippi river is a long long <strong>Line</strong>.</li>
<li>And a university campus is obviously a <strong>Polygon</strong>.</li>
</ol>
<p>In the image above, British Museum is represented by 12 latitudes and longitudes as the inner area which these points compose. On the other hand another representation may be made with the centre point of the museum with (51.529038,-0.128403). Formally speaking, the museum is located on &#8220;<em>British Museum, Great Russell Street, London, WC1B 3DG, UK</em>&#8220;. And this translates to the coordinate I gave. What about using them together to form:</p>
<pre>
&lt;div class="adr"&gt;

&lt;div class="street-address"&gt;Great Russell Street&lt;/div&gt;
&lt;span class="locality"&gt;London&lt;/span&gt;,
&lt;span class="postal-code"&gt;WC1B 3DG&lt;/span&gt;,
&lt;div class="country-name"&gt;UK&lt;/div&gt;

&lt;div class="geo"&gt; &lt;!-- optional coordinates attribute from geo --&gt;
&lt;span class="latitude"&gt;51.529038&lt;/span&gt;,
&lt;span class="longitude"&gt;-0.128403&lt;/span&gt;
&lt;/div&gt;

&lt;/div&gt;
</pre>
<p>In the example above, I&#8217;ve used <a href="http://microformats.org/wiki/geo">geo</a> to include the single point &lt;lat, long&gt; optionally to map the address to a physical location. More useful structures can be defined within standards to enable multiple point entries to provide polygons such as 12-point representation of British Museum in the image above. Or basically, multiple geo entries inside an adr may work.</p>
<p><strong>TODO:</strong> Write about the impact this usage can bring.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/burcudogan?a=2qlWWEY7MTQ:tClsTN854dI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=2qlWWEY7MTQ:tClsTN854dI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=2qlWWEY7MTQ:tClsTN854dI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=2qlWWEY7MTQ:tClsTN854dI:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=2qlWWEY7MTQ:tClsTN854dI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=2qlWWEY7MTQ:tClsTN854dI:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.burcudogan.com/258/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.burcudogan.com/258/</feedburner:origLink></item>
		<item>
		<title>Testing for Accuracy and Precision</title>
		<link>http://feedproxy.google.com/~r/burcudogan/~3/5CnSc8bljzY/</link>
		<comments>http://blog.burcudogan.com/243/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 08:34:22 +0000</pubDate>
		<dc:creator>Burcu Dogan</dc:creator>
				<category><![CDATA[Regular]]></category>
		<category><![CDATA[machine learning]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://blog.burcudogan.com/?p=243</guid>
		<description><![CDATA[Software testing has no boundaries at all. This discipline is so unique that it’s not very common to see systematic approaches due to the variety of material and the changing tradeoffs. A few weeks ago, I came across to a decent software testing article from a Microsoft engineer which was published on Live Spaces. Unfortunately, [...]]]></description>
			<content:encoded><![CDATA[<p>Software testing has no boundaries at all. This discipline is so unique that it’s not very common to see systematic approaches due to the variety of material and the changing tradeoffs. A few weeks ago, I came across to a decent software testing article from a Microsoft engineer which was published on Live Spaces. Unfortunately, it was followed by<em> 2 spam comments</em> &#8212; was very ironic to see such an <strong>assertive article</strong> was ruined by two regular Russian spammers.</p>
<p>I love machine learning and classification. My whole life is being spent between two parameters: accuracy and precision. These are the common statistical values to determine how successful your system is. If you have a search engine, accuracy may tell you what percentage of retrieved documents are really relevant. And percentage is a value to determine how likely your results cover all the relevant documents available.</p>
<p>Surprisingly a few days ago, I was asked to break a machine learning system during a job interview. I was asked to come up with some possible cases. According to my own philosophy, accuracy and precision are parts of the system requirements. They are related with the <strong>quality of the overall product</strong>. But how are you going to collect information to come up with these numbers? Imagine you are working on a searching engine. Is it manageable to find n people and ask them manually if they like the results or not? Will your sample (<em>n people</em>) reflect your user base? How costly it will be and how objective? Is it really scalable? Is it possible to for a human to read all of the documents on the Web and decide which are really related to his search phrase? These are a few introductory level problems with analysis of accuracy and precision.</p>
<h3>Post-Processing and the Importance of Feedback</h3>
<p>It may not be critical for you to release a product with a target accuracy and precision. Mostly, consumer market suits this model the best. But this alone should not be translated into the “inessentiality of the quality tracking”. I am just advising you to track the quality after the release <em>(similar to ship-then-test method).</em> Detect which results are exit-links, provide instant feedback tools for users to relocate their results and etc. Use acquired feedback to improve the existing system. Testing may not be done with the release, you may need to discuss and analyze if your product is performing well and report to your development team and influence them with scalable user-oriented improvements.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/burcudogan?a=5CnSc8bljzY:sd6X1BD__V4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=5CnSc8bljzY:sd6X1BD__V4:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=5CnSc8bljzY:sd6X1BD__V4:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=5CnSc8bljzY:sd6X1BD__V4:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=5CnSc8bljzY:sd6X1BD__V4:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=5CnSc8bljzY:sd6X1BD__V4:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.burcudogan.com/243/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.burcudogan.com/243/</feedburner:origLink></item>
		<item>
		<title>Addresses Not Found in High Traffic</title>
		<link>http://feedproxy.google.com/~r/burcudogan/~3/X-1uB5lehqo/</link>
		<comments>http://blog.burcudogan.com/238/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 13:19:36 +0000</pubDate>
		<dc:creator>Burcu Dogan</dc:creator>
				<category><![CDATA[Regular]]></category>
		<category><![CDATA[dns]]></category>

		<guid isPermaLink="false">http://blog.burcudogan.com/238/</guid>
		<description><![CDATA[My sister found herself a new downloading hobby and I was not planning to be the hobby killer until everything became inaccessible for both of us. She’s heavily downloading recently, I’m not sure about the material but it’s  high load. Pages were coming slower on my side as it was expected and I’m not saying [...]]]></description>
			<content:encoded><![CDATA[<p>My sister found herself a new downloading hobby and I was not planning to be the hobby killer until everything became inaccessible for both of us. She’s <em>heavily downloading</em> recently, I’m not sure about the material but it’s  <strong>high load</strong>. Pages were coming slower on my side as it was expected and I’m not saying I have a wide bandwidth but overall bottleneck was not just the slower uploads or downloads.</p>
<h3>UDP 53, what’s wrong there?</h3>
<p>I started to recognize a pattern. My downloads were even more slower because resolving was failing miserably every time I try. I was not even able to resolve domain names to IP addresses. Had to check myself what might cause this problem. As a quick note, if your local DNS cache (managed by operating systems) doesn&#8217;t have a record of the domain name you’re trying to visit, you make a request to one of the nearby DNS servers to return the associated IP. If your nearby server doesn&#8217;t have that record, it asks to root servers etc. Most of my reader audience knows the story well. This communication is made on UDP port 53. UDP is a <strong>connectionless</strong> way to transmit data. Unlike TCP, you don&#8217;t have to spend time on three-way-handshakes to make a proper connection that both of the sides are aware of. But if your packets get lost, nobody is responsible. It’s like playing a game, many tradeoffs similar to every engineering issue.</p>
<p>I gently asked my sister to stop a while, and started receive not timed-out UDP answers back. Resolving problem was fixed. But I had to be convinced that UDP is the best ever been chosen from. I understood the fact the essential parameter was latency. We have to be fast, faster and fastest as possible. Wanted to take time back to understand why it is designed this way and my problem appeared with a solution in milliseconds.</p>
<h3>Why DNS is using UDP?</h3>
<p>Reliability versus fastness. Remind the rule. If you don’t have the address, ask a <strong>nearby name server</strong>. Is it implicitly saying “<em>Don’t go too far</em>.”? Probably it is. You’re not on a very reliable connection and if your traffic load is very high, there will be many conjunctions, long delays and large jitters. My dns requests most probably couldn&#8217;t even making it to the name server. And since my ISP’s name servers are not reliable, I was using <a href="http://www.opendns.com/">OpenDNS</a>. Translation: <em>I was far far far away from the source</em>.</p>
<p>I fixed the issue. Even crazy downloading is again on, my domains are resolving rapidly at the moment. I’m extremely happy. If you’re using OpenDNS at office or LANs which have more than 20+ clients, make yourself a favor and set up a local name server today.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/burcudogan?a=X-1uB5lehqo:gaFSOpikGpg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=X-1uB5lehqo:gaFSOpikGpg:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=X-1uB5lehqo:gaFSOpikGpg:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=X-1uB5lehqo:gaFSOpikGpg:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=X-1uB5lehqo:gaFSOpikGpg:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=X-1uB5lehqo:gaFSOpikGpg:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.burcudogan.com/238/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://blog.burcudogan.com/238/</feedburner:origLink></item>
		<item>
		<title>Data Manipulation on Client Machines</title>
		<link>http://feedproxy.google.com/~r/burcudogan/~3/eZNKXEF4ds8/</link>
		<comments>http://blog.burcudogan.com/227/#comments</comments>
		<pubDate>Fri, 22 May 2009 11:47:42 +0000</pubDate>
		<dc:creator>Burcu Dogan</dc:creator>
				<category><![CDATA[Regular]]></category>
		<category><![CDATA[clientside]]></category>
		<category><![CDATA[maps]]></category>
		<category><![CDATA[realtime web]]></category>

		<guid isPermaLink="false">http://blog.burcudogan.com/?p=227</guid>
		<description><![CDATA[It&#8217;s my third week and I&#8217;m discussing the scalability of the real-time web. We&#8217;re only talking about text input, realtime search, trend extractions and etc. I had a love growing inside for this instant replier, it makes me feel I&#8217;m more connected to real people (sort of egoism). It&#8217;s good because we have text, none [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s my third week and I&#8217;m <a href="http://friendfeed.com/search?q=realtime&amp;comment=thejbf">discussing</a> the scalability of the real-time web. We&#8217;re only talking about text input, realtime search, trend extractions and etc. I had a love growing inside for this instant replier, it makes me feel I&#8217;m more connected to real people (<em>sort of egoism</em>). It&#8217;s good because we have text, none of the realtime providers are working on more than indexing the &#8220;text&#8221; for searching, as it revealed. Text is medium of communication and there are a lot more: images, audio, videos etc. You are not really interested in multimedia as I guess because, <em>text is cool</em>. You can skim it, you can select it, easily process it. But the world is not man-made and I cant even imagine a moment where maps are served as text, for example. Typing is human&#8217;s built-in analog to digital converter. Love it or not, but we are forced ungracefully by this nature to talk in multimedia when text alone is not efficient enough.</p>
<h3>Realtime Data Processing</h3>
<p>Realtime environment have to play with data to make connections, be able to provide smart searching that does not only depend on full-text comparison. Imagine that they have to tokenize text input to post-process what&#8217;s going on with the message. Almost requires O(n) on CPU. Twitter has about 1 million users, let&#8217;s assume averagely every user enters a new twit once in 3 days and average entry is 100 characters long (doesn&#8217;t sound realistic, but let&#8217;s be optimistic). It converges to 350k posts a day. 350k times tokenizing the 100 character-long input = <strong>35 million characters</strong> are processed during a day.  I tried to tokenize a 100 char string 350k times and it took only 41 seconds since I was using the same string over and over again. With helps of caching, CPU minimizes the memory I/O and it made a huge difference, so my 41 seconds were far from being accurate. But besides tokenizing, there are other operations you have to run. And once you fetch it from memory, you&#8217;re done. Therefore, I believe it&#8217;s not really an extra load to tokenize the input on the server-side.</p>
<p>But, what would you do if you have to post-process terabytes of imagery? I&#8217;m not sure if you are aware of Microsoft&#8217;s Virtual Earth 3D but, it is more like<strong> Google Earth running on your browser</strong>.</p>
<p><a href="http://blog.burcudogan.com/wp-content/uploads/RealtimeWebandDataManipulationofClientMa_A8D3/Untitled2_3.jpg"><img class="inline" style="border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px" title="Virtual Earth 3D" src="http://blog.burcudogan.com/wp-content/uploads/RealtimeWebandDataManipulationofClientMa_A8D3/Untitled2_thumb_3.jpg" border="0" alt="Virtual Earth 3D" width="648" height="288" /></a></p>
<p>A very long time ago, I was making a demo to my friends and showing the Mt. Rainer in WA distinct in 3D mode. Virtual Earth 3D fetches higher quality imagery for forefront. Since there is no colour balance adjustments at VE imagery, many people thought  the level differences on the scene is sort of a corruption and not good looking. I decided to talk to engineers that we can solve this problem with <em>relative histogram equalization</em> (fancy name but easy method). I didn&#8217;t sound perfectly realistic, cause our imagery were tens of terabytes and it was very risky to process them all for such a tiny improvement.<span id="more-227"></span></p>
<p>Luckily, I recognize client power for the first time and the power it brings out. I was going to add a improvement step to equalize imagery once it is loaded as &#8220;it is&#8221; to user machine. User&#8217;s itself was about to play a role to balance images on the front-end.</p>
<h3>Future of the Web: More Realtime Data Needs More Client Power</h3>
<p>Twitter example is quite lightweight, 35 million characters/day is not huge as you may guess. As millions started to use realtime equipment passionately and generate a hundred thousands times more content than this, we may have to take advantage of our user&#8217;s machines mostly for pre and post processing of data. All of the new client technologies are about the provide a rich environment and framework to let the users contribute to the overall system with scalability. Future is going to be all about <strong>making a distribution decision between clients and servers</strong>. If you are a server guy who has no idea on the user machines, study your lesson before this balance dominates the world.</p>
<p><strong>Edit: </strong>Sorry for quoting VE&#8217;s 3D mode with Silverlight, thanks for Jon O&#8217;Brein (a Microsoft MVP) for fixing my deadly fault. I was high or something.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/burcudogan?a=eZNKXEF4ds8:Zy5iiASVbPM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=eZNKXEF4ds8:Zy5iiASVbPM:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=eZNKXEF4ds8:Zy5iiASVbPM:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=eZNKXEF4ds8:Zy5iiASVbPM:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=eZNKXEF4ds8:Zy5iiASVbPM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=eZNKXEF4ds8:Zy5iiASVbPM:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.burcudogan.com/227/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.burcudogan.com/227/</feedburner:origLink></item>
		<item>
		<title>Why Do I See Software Development Job Titles as Nothing but Virtual Positions?</title>
		<link>http://feedproxy.google.com/~r/burcudogan/~3/9qpKt_EMn9Y/</link>
		<comments>http://blog.burcudogan.com/222/#comments</comments>
		<pubDate>Sun, 26 Apr 2009 21:58:34 +0000</pubDate>
		<dc:creator>Burcu Dogan</dc:creator>
				<category><![CDATA[Regular]]></category>
		<category><![CDATA[career]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://blog.burcudogan.com/?p=222</guid>
		<description><![CDATA[There are so various areas and people involved with software that &#8220;software development&#8221; phrase alone doesn&#8217;t give you enough perception about what the real job is. I proclaim that there are stereotypes in this field: code monkeys, every job developers, developers specialized in an area, revolutionary brains, problem solvers etc.  They all share some [...]]]></description>
			<content:encoded><![CDATA[<p>There are so various areas and people involved with software that &#8220;software development&#8221; phrase alone doesn&#8217;t give you enough <em>perception</em> about what the real job is. I proclaim that there are stereotypes in this field: code monkeys, every job developers, developers specialized in an area, revolutionary brains, problem solvers etc. <img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="ISoftwareDeveloper" src="http://blog.burcudogan.com/wp-content/uploads/HowWouldYoustartProgrammingIfyouwereaChi_1EF2/image.png" border="0" alt="ISoftwareDeveloper" width="285" height="122" align="right" /> They all share some characteristics, some behaviours, some little common knowledge. The mutual attribute is only the names. We all know that they can code. But they implement coding behaviour entirely in different ways.</p>
<p>I started to code with a fundamental function to find roots of a 2nd order equation and easily understood how programming can reduce the amount of time I&#8217;m spending on <em>trivial calculations</em>. The Internet was becoming widely available (at least in the community I was living). There was a technology boom, the access rate to the &#8220;<em>new</em>&#8221; were increasing wildly. I decided to learn as far as I can and in the end I became a giant language and framework addict, although I had <strong>no deep knowledge in anything</strong>. But it was driving me because, the particular technology I was interested in was helping me to turn my fancy ideas into concrete products. So, not for doing all for learning the technology&#8217;s itself doesn&#8217;t make me a software developer now? How dramatic.</p>
<h2>Being a software developer with no purpose</h2>
<p>It&#8217;d really taken me far too long to get aware of the ecosystem of a software-dominated system without formal education. However, before  I had reasons to learn, <strong>I had never dreamt of being a professional software developer</strong> – cause all alone <em>it was meaningless, </em>especially in a situation when software you&#8217;re bringing out doesn&#8217;t have any purpose <em>other than making profit</em>. Nobody does have dreams like being the greatest developer in this or that field. People like me usually tend to be remembered with</p>
<ol>
<li>a groundbreaking product, a method changes the concepts, a more efficient way of doing things.</li>
<li>being a leader in a specific area to influence other people.</li>
</ol>
<p>They put meaning into every single duty they are working. I personally don&#8217;t look programming jobs as jobs. It&#8217;s a great opportunity to access a company&#8217;s tools and existing audience to make differences quicker than forming a new start-up, gain respect and deal with financial stuff. But again with purpose, you always have the &#8220;<em>If you&#8217;re not hiring me,</em> <em>I&#8217;ll be doing the same on my own</em>&#8221; advantage under the belt obviously. <span id="more-222"></span></p>
<p>Software is just a tool, not the ultimate reason. Many people in industry don&#8217;t seem to understand it. Of course, the better and deeper you know about the technology, the impact you can make will be larger. Development alone is a very wide and challenging issue, that&#8217;s why it is titled as a separate profession nowadays. But instead of thinking totally machine oriented, you have to have a main goal and use tech to fasten it.</p>
<p>I&#8217;d love to see specialized development titles instead of everyday titles we face today like: software engineer, software developer, software development engineer and etc. <strong>Biotech/Bioinformatics</strong> is a great example alone for separating itself from the<em> mainstream tech community</em>. Take  a look at the following job posting:</p>
<blockquote><p>X is searching for an experienced Software Developer to support the Production Genomics Facility in Y. The mission of the X is applying genomic science to the critical fields of bioenergy, bioremediation and carbon cycle management. The X applies both the latest high-volume sequencing technology and classic Sanger processes to sequence and analyze thousands of large and small genomes&#8230;</p>
<p><strong>Skills Required<br />
</strong>- Create, manage, and query MySQL databases.<br />
- Develop and utilize Perl classes, modules, and scripts for managing data and performing analyses; and Perl/CGI web pages for providing user access.</p></blockquote>
<p>Why don&#8217;t we see similar ads from most of the software/hardware companies today? Give me a reason to get excited of what you are doing now, so that I can check the if I meet with your qualifications.</p>
<p>Consequently, software development title is artificial, it is not concrete. You basically don&#8217;t have a clue about what you&#8217;re going to do <em>inside</em> while you are applying. I wish companies were a little bit specific on titles and descriptions. Yes, I am agree with you that this basically applies to many industries. But, software is a supporting tool in many industries alone. So, it is a special case, it&#8217;s far more problematic.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/burcudogan?a=9qpKt_EMn9Y:G4XccD9eia8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=9qpKt_EMn9Y:G4XccD9eia8:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=9qpKt_EMn9Y:G4XccD9eia8:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=9qpKt_EMn9Y:G4XccD9eia8:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=9qpKt_EMn9Y:G4XccD9eia8:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=9qpKt_EMn9Y:G4XccD9eia8:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.burcudogan.com/222/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.burcudogan.com/222/</feedburner:origLink></item>
		<item>
		<title>Using Paper and Pencil Before Coding</title>
		<link>http://feedproxy.google.com/~r/burcudogan/~3/R2V3G_IvTdM/</link>
		<comments>http://blog.burcudogan.com/210/#comments</comments>
		<pubDate>Sat, 18 Apr 2009 18:02:40 +0000</pubDate>
		<dc:creator>Burcu Dogan</dc:creator>
				<category><![CDATA[Regular]]></category>
		<category><![CDATA[deep thinking]]></category>
		<category><![CDATA[software design]]></category>

		<guid isPermaLink="false">http://blog.burcudogan.com/?p=210</guid>
		<description><![CDATA[I don&#8217;t remind myself starting to code, even a single tiny function, without illustrating it on paper. Do I write code on paper? Yes, I also do that. I adore coding on whiteboards where many people can come together on a coffee break and discuss. Most of the young developers ignore that single rule in [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t remind myself starting to code, even a single tiny function, without illustrating it on paper. <em>Do I write code on paper?</em> Yes, I also do that. I adore coding on whiteboards where many people can come together on a coffee break and discuss. Most of the young developers ignore that single rule in software development. To write decent code, you have to spend <strong>more time on thinking, criticising, brainstorming</strong> – determining what the problem is before getting into the solution. Defining the constraints, getting aware of the exceptions, and so on.</p>
<h2>Early Starting or Deep Thinking?</h2>
<p><a href="http://blog.burcudogan.com/wp-content/uploads/IAlwaysUsePaperandPencil_F241/nbody.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="nbody" src="http://blog.burcudogan.com/wp-content/uploads/IAlwaysUsePaperandPencil_F241/nbody_thumb.jpg" border="0" alt="nbody" width="121" height="119" align="left" /></a>I wish the first idea comes to mind was the perfect one. But usually, it is not even close enough to be a good solution – it is often greedy and very straight-forward. The more you learn about the problem and its characteristics, the better and more efficient solution will pop up. If you start coding in the first hour, you will probably never ever finish the task. I&#8217;d like to share a case study from Jon Bentley&#8217;s amazing book, <a href="http://www.amazon.com/Programming-Pearls-2nd-ACM-Press/dp/0201657880">Programming Pearls</a>.</p>
<p>The story is about Andrew Appel and his experience on reducing the run time of a system from <strong>one year to one day</strong>. They had to simulate the motions of <em>N objects</em> in 3D space, given their masses and initial positions and velocities. They basically were interested to predict the positions of planets, stars, galaxies 10 years, 100 years, 1000 years later. In a 2D space the input may look like the image on the left: a large set of vectors.</p>
<p>The regular simulation programs divide time into small steps and computes the progress of each object at each step. Due to the existing of gravitational field and mass attractions, the computational cost were proportional to N<sup>2</sup>. Appel estimated that 1000 time steps of such a system with <em>N=10000</em> objects would require more than one year on a VAX-11/780 or a day on a <a href="http://en.wikipedia.org/wiki/Cray-1">Cray-1</a>. Andrew had to develop a system far more efficient than a one-year-running turtle. After several speedup improvements, he reduced the runtime to less than a day on VAX-11/780 &#8212; almost 400 times faster than the initial setup.<span id="more-210"></span></p>
<p>He managed to change the concept on many levels to make such a huge difference.</p>
<ol>
<li><strong>Data Structures:</strong> Foremost, O(<em>N<sup>2</sup></em>) had to go. He decided to represent objects as leaves on a binary tree; higher nodes were representing the cluster of objects. The force operating on a particular object can be approximated  by the force exerted by the large clusters. This alone reduced complexity to O(<em>N logN</em>) by a factor of <em>12</em>.</li>
<li><strong>Algorithm Tuning:</strong> Initial algorithm has to use tiny time steps to handle the rare case that two particles come closer to one another. Usages of tree-based structure enabled investigation of such rare cases possible<em> independently from time steps</em>. As a result, Andrew doubled the time step size and <em>halved</em> the run time.</li>
<li><strong>Data Structure Reorganization:</strong> The tree that was representing the initial objects was quite bad in representing the later sets. Reconfiguring the tree at every new step was a bit costly but reduced the number of local calculations and <em>halved</em> the total runtime.</li>
<li><strong>Code Tuning:</strong> Due to additional numerical accuracy provided by the tree, 64-bit floating point number could be replaced by 32 bit single-precision, <em>halved</em> the runtime. Additionally, profiling the application showed that 98% percent of runtime was being spend in one procedure. Rewriting that procedure in assembly  increased the speed by a factor of <em>2,5</em>.</li>
<li><strong>Hardware Extensions:</strong> Moving the program to a similar machine with a floating point accelerator <em>halved</em> the total runtime.</li>
</ol>
<p>Finally new system was requiring only one day to simulate 10k objects. Most of the work done by Andrew Appel were visible without writing a single line of code. If your inventions don&#8217;t rely on the statistical results to be proved, you should be able to make all decisions without writing a single line of code. Being able to predict the system&#8217;s response on paper can make you the the one makes the differences.</p>
<p>Even in professional environments, people tend to start coding as soon as possible. Initial design doesn&#8217;t only lead you functional mistakes and a program with tones of bugs, but may blind you to see the problem from different aspects and representing data in a different ways to fasten the system. Only good estimators can code good software. Therefore, I&#8217;m not interested in which <strong>new fancy technologies you know</strong>, far more interested if you have <em>a wide range from top to hardware</em>, able to see the bottlenecks and improve them on paper. Then, any developer can write the code.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/burcudogan?a=R2V3G_IvTdM:wWrs2GcKHTI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=R2V3G_IvTdM:wWrs2GcKHTI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=R2V3G_IvTdM:wWrs2GcKHTI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=R2V3G_IvTdM:wWrs2GcKHTI:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=R2V3G_IvTdM:wWrs2GcKHTI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=R2V3G_IvTdM:wWrs2GcKHTI:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.burcudogan.com/210/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://blog.burcudogan.com/210/</feedburner:origLink></item>
		<item>
		<title>JPEG to Compress Vector Graphics?</title>
		<link>http://feedproxy.google.com/~r/burcudogan/~3/nhbxEVtzF2I/</link>
		<comments>http://blog.burcudogan.com/201/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 22:26:39 +0000</pubDate>
		<dc:creator>Burcu Dogan</dc:creator>
				<category><![CDATA[Regular]]></category>
		<category><![CDATA[image compression]]></category>
		<category><![CDATA[jpeg]]></category>
		<category><![CDATA[maps]]></category>
		<category><![CDATA[png]]></category>

		<guid isPermaLink="false">http://blog.burcudogan.com/201/</guid>
		<description><![CDATA[Compressing, entropy and information theory have things in common with economics. Nobody&#8217;s going to turn his head unless you stop talking maths. I truly understand they are a bit boring and complex for your grandmother, but surprisingly most of the technical people doesn&#8217;t bother to understand the underlying concept either. In this post, I&#8217;m going [...]]]></description>
			<content:encoded><![CDATA[<p>Compressing, entropy and information theory have things in common with economics. Nobody&#8217;s going to turn his head unless <em>you stop talking maths</em>. I truly understand they are a bit boring and complex for your grandmother, but surprisingly most of the technical people doesn&#8217;t bother to understand the underlying concept either. In this post, I&#8217;m going to pass over the following topics in a daily tongue to illustrate the overall scheme on your mind:</p>
<ol>
<li>What is image compression and why do we use it? </li>
<li>A short brief of JPEG compression. </li>
<li>A review of <a href="http://maps.google.com/">Google Maps</a> and <a href="http://maps.live.com">Live Search Maps</a> for serving images as the primary content. </li>
</ol>
<h2>Introduction to Image Compression</h2>
<p>If you understand the term <em>&quot;compression</em>&quot;, it doesn&#8217;t mean we are over with the definition. Hold on. </p>
<blockquote><p>Image compression, the art and science of reducing the amount of data required to represent an image, is one of the most useful and commercially successful technologies in the field of digital image processing. (<em>Digital Image Processing 3rd Ed., Gonzalez &amp; Woods, page 525</em>)</p>
</blockquote>
<p>Let&#8217;s first try to understand how compression became one of the most commercially successful field in image processing? With the irrepressible popularity of television and Internet (after mid-90s), images and videos become significant elements to represent information. With no compression;&#160; a coloured <a href="http://en.wikipedia.org/wiki/Standard-definition_television">standard TV</a> broadcast, 640&#215;480 wide with refresh rate of 30 frames per seconds, requires 27,648,000 bytes to be transmitted per second. Even in tomorrow&#8217;s technology, supplying a connection of almost 30Mbytes/second just for a TV cast doesn&#8217;t seem to be possible with no doubt. It&#8217;s no surprise to hear many failed quotes back from early 1900s that television will never be able to find opportunity to be on the market.</p>
<h3>Data versus Information</h3>
<p>When the issue is compression, it refers to the compression of data. Data is being transferred to carry information. Therefore, we might be able to reduce the amount of data to represent a given quantity of information. A parrot in a very populated barber shop in downtown loves to say &quot;Hello&quot; to every new customer that comes in. How would you transmit the words it spells in text most efficiently?</p>
<p><img class="inline" title="Data vs. Information" border="0" alt="image" src="http://blog.burcudogan.com/wp-content/uploads/2009/04/image.png" /> </p>
<p>Statistically hello is the most common word. Representing it in a bit is highly acceptable, instead of transferring 5 characters (5*8 = 40 bits). In the example above, it&#8217;s very clear that statistics say &quot;stranger&quot; is the second word we most likely to hear from parrot and so on. Converting (mapping) the string array into a bit stream saves 94% of bandwidth in this case. <a href="http://en.wikipedia.org/wiki/Huffman_coding">Huffman coding</a>, which is going to remind you the method above, guarantees you to use minimum possible number of bits if you have statistical information of data.</p>
<h3>Image Compression Techniques</h3>
<p>Generally, image compression techniques are separated into two columns:&#160; lossy and lossless compression. Lossy methods takes the advantage of capabilities of <strong>human vision range</strong>, eliminates details and loose information to reduce amount of data. Lossy methods are mostly used for natural images. In lossless compression, encoding process finds a smart way to represent same amount of information in lesser amount of data, just like in the example above with Mr. Parrot. And some may use hybrid models to mix advantages of both sides.<span id="more-201"></span> </p>
<h2>JPEG Compression</h2>
<p><a href="http://blog.burcudogan.com/wp-content/uploads/2009/04/image2.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="image" border="0" alt="image" align="right" src="http://blog.burcudogan.com/wp-content/uploads/2009/04/image-thumb.png" width="300" height="67" /></a>JPEG is a hybrid compression method, optionally can perform as totally lossless. It mainly depends on the fact that correlation between close pixels doesn&#8217;t change much in natural photos. So, we are able to guess closer pixels around if we know the one in the middle. JPEG&#8217;s encoding algorithm is separated into four steps:</p>
<ol>
<li>Blocking the image into little pieces, usually 8&#215;8 pixel blocks – some use 16&#215;16 blocks. Separating images into little pieces will help us the guess the nearby pixels. </li>
<li><strong>Discrete Cosine Transform (DCT):</strong> In &quot;<em>simple</em>&quot; terms, this process generates a bit stream for each block which starts with the average value of the block continuing the details of how pixels change horizontally and vertically. So, as an addition to the guess, we have extra information to fix it. Therefore, DCT is totally lossless. It only represents the same information in other words. Outputs a stream of 64 numerical elements like: 125 34 –32 43 2 21 –43 1 –3 4&#8230; (Smart way to represent information) </li>
<li><strong>Quantization:</strong> Adjusts precision.&#160; This is where we loose information. Output stream may turn into: 125 35 –30 45 0 20 –45 –5 5&#8230; (Human vision range is not that sensitive) </li>
<li><strong>Entropy encoding:</strong> You may encode the stream coming from quantization with Huffman coding to save bandwidth – just like how we did in the parrot example. (Smart way to represent information) </li>
</ol>
<h2>Maps and Compression</h2>
<p>Maps serve images as their <em>primary content.</em> Most of the providers have road, aerial, labelled road, labelled aerial, terrain (<a href="http://maps.google.com/?ie=UTF8&amp;ll=51.727028,5.844727&amp;spn=13.051211,39.550781&amp;t=p&amp;z=5">Google does</a>), bird&#8217;s eye (<a href="http://maps.live.com/default.aspx?v=2&amp;FORM=LMLTCP&amp;cp=skj331gzpckc&amp;style=b&amp;lvl=1&amp;tilt=-90&amp;dir=0&amp;alt=-1000&amp;scene=16378878&amp;phx=0&amp;phy=0&amp;phscl=1&amp;encType=1">Live Search Maps does</a>) and etc. In this section, I&#8217;m going to discuss mostly the <em>aerial imagery</em> and how many bytes they are spreading to share the same amount of information. Both of the providers have road, aerial and aerial (with labels) image sources.</p>
<h3>Google Maps (maps.google.com)</h3>
<p>Google Maps choose to separate vector and natural images. Encode vectors as transparent PNGs and aerial images as JPEGs. And adds vector information as an overlay if user prefer to view the area with labels.</p>
<p><img class="inline" title="Aerial" border="0" alt="Aerial" src="http://blog.burcudogan.com/wp-content/uploads/2009/04/image3.png" width="150" height="150" /> <img class="inline" title="Labels" border="0" alt="Labels" src="http://blog.burcudogan.com/wp-content/uploads/2009/04/image4.png" width="150" height="150" /> <img class="inline" title="Aerial with Labels" border="0" alt="Aerial with Labels" src="http://blog.burcudogan.com/wp-content/uploads/2009/04/image5.png" width="150" height="150" />&#160;<a href="http://blog.burcudogan.com/wp-content/uploads/2009/04/image6.png"><img class="inline" alt="Road Map" src="http://blog.burcudogan.com/wp-content/uploads/2009/04/image-thumb1.png" width="150" height="150" /></a> </p>
<p>Image sizes in the corresponding order are: 27.6KB (JPEG), 13.7KB (PNG), 0KB (overlaid versions of 1st and 2nd image), 25.6KB (PNG). In this case, let&#8217;s count the bytes Google consumes on the following actions:</p>
<ol>
<li>Road imagery views: 25.6KB </li>
<li>A switch to labelled aerial: 27.6KB + 13.7KB = 41.3KB </li>
<li>A switch to aerial without labels: cost free </li>
<li><strong>Total cost</strong> = 25.6KB +&#160; 41.3KB = 66.9KB </li>
</ol>
<p>Google only seems to make an encoding decision depending on the image&#8217;s characteristics, JPEG for aerial, PNG for rest. But unfortunately, this leads to the transmission of repeated information of roads on an aerial switch. Take a look at image 2 and 4 above. </p>
<p>I&#8217;m guessing <strong>most people don&#8217;t tend to switch to aerial soon</strong> until they zoom in to <em>street level</em>. So, instead of pushing them to download two separate images for on road mode, Google Maps may choose this method. HTTP requests are costly. And a dozen of them are more costly than costly. A map control usually has to download 8-12 tiles depending on your screen resolution. Just think of the overhead that those 12 tiles are generating.</p>
<h3>Live Search Maps (maps.live.com)</h3>
<p>We are on the same area, somewhere in the downtown London again with Live Search Maps.</p>
<p><img class="inline" alt="Aerial" src="http://blog.burcudogan.com/wp-content/uploads/2009/04/image7.png" width="150" height="150" /> <a href="http://blog.burcudogan.com/wp-content/uploads/2009/04/image8.png"><img class="inline" alt="Hybrid" src="http://blog.burcudogan.com/wp-content/uploads/2009/04/image-thumb2.png" width="150" height="150" /></a> <img class="inline" title="Road Map" border="0" alt="image" src="http://blog.burcudogan.com/wp-content/uploads/2009/04/image9.png" width="150" height="150" /></p>
<p>Image sizes in the corresponding order are: 28.52KB (JPEG), 29.82KB (JPEG), 25.6KB (PNG). Repeating the same user actions above for a tile:</p>
<ol>
<li>Road imagery views: 25.6KB </li>
<li>A switch to labelled aerial: 29.82KB </li>
<li>A switch to aerial without labels: 28.52KB </li>
<li><strong>Total cost</strong> = 25.6KB + 29.82KB + 28.52KB = 83.94KB </li>
</ol>
<p>If every user were switching between these map modes back and forth on every zoom level, Google Maps would beat LSM with little difference*. Labels on aerial images don&#8217;t looks as sharp as Google&#8217;s, but keeps size in an appropriate level although it is encoded to be a JPEG. If users switches to non-labelled aerial very rarely, for example after pointing an area they are searching, this method might be practical and more efficient than Google&#8217;s overlaying concept. </p>
<p><img class="inline" title="LSM vs. Google Maps" border="0" alt="image" src="http://blog.burcudogan.com/wp-content/uploads/2009/04/image10.png" width="608" height="282" /> </p>
<p>Above, there are 200% zoomed versions of labelled aerial tiles from San Francisco. The left image comes from <a href="http://microsoft.com/virtualearth">Virtual Earth</a> and the other is Google&#8217;s. In my own personal opinion I find Google&#8217;s labels more readable than Virtual Earth&#8217;s, despite being 22-years-old and topping the heap when it comes to sensitivity in vision. </p>
<p>(*) Note: I repeated the process for 100+ random tiles. Ratios don&#8217;t seem to change much.</p>
<h5>Custom tiles?</h5>
<p>What about custom tile integration with Virtual Earth and Google Maps API? Google&#8217;s method allows you to overlay roads on your custom maps (didn&#8217;t check it, but it&#8217;s not a big deal &#8212; they already have isolated labels). </p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/burcudogan?a=nhbxEVtzF2I:3Q0o7d0mY_A:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=nhbxEVtzF2I:3Q0o7d0mY_A:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=nhbxEVtzF2I:3Q0o7d0mY_A:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=nhbxEVtzF2I:3Q0o7d0mY_A:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=nhbxEVtzF2I:3Q0o7d0mY_A:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=nhbxEVtzF2I:3Q0o7d0mY_A:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.burcudogan.com/201/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://blog.burcudogan.com/201/</feedburner:origLink></item>
		<item>
		<title>Would you Like to Throw Exceptions from a Constructor?</title>
		<link>http://feedproxy.google.com/~r/burcudogan/~3/v4WZrb7pjek/</link>
		<comments>http://blog.burcudogan.com/144/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 00:40:33 +0000</pubDate>
		<dc:creator>Burcu Dogan</dc:creator>
				<category><![CDATA[Regular]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[constructors]]></category>
		<category><![CDATA[exceptions]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://blog.burcudogan.com/?p=144</guid>
		<description><![CDATA[Throwing an exception from a constructor has always been an arguable issue between my friends after a few beers of joy. It firstly came to me on an exam where question was asking me to design a class which lets not more than n number of instances to be constructed.
Not using the most straight-forward trick [...]]]></description>
			<content:encoded><![CDATA[<p>Throwing an exception from a constructor has always been an arguable issue between my friends after a few beers of joy. It firstly came to me on an exam where question was asking me to design a class which lets <em>not more than n number of instances to be constructed.</em></p>
<p>Not using the most straight-forward trick to have a private constructor, I decided to invoke an exception from constructor if there exists more than n instances of that particular class. Luckily, I was coding in Java and had the comfort of a managed environment under the belt. My answer wasn’t graded thankfully but this case became a major concern and I decided to make several experiments back in the old days.</p>
<p>According to what I have seen while debugging, Java simply assigns a number of nulls or zeros to all of the fields of the class unless constructor is successfully executed. Additionally, right after an exception is thrown from a constructor, a null reference is returned and the newly created invalid instance starts to wait for the <strong>garbage collector</strong> to pick it up and remove the useless object from memory permanently. In short terms, a new instance is created although platform tends to murder it quickly in silent.</p>
<h2>What about Unmanaged Platforms?</h2>
<p>It was nice to see somebody was taking care of such exceptional situations but what would you do if you were alone? Fault tolerance isn’t just catching all exceptions: (from slides of <a href="http://www.research.att.com/~bs">Bjarne Stroustrup</a>)</p>
<ol>
<li>The program must be <strong>in a valid state</strong> after an exception is caught</li>
<li><em>Resource leaks must be avoided</em></li>
</ol>
<p>This will become a problem where memory management is all up to you. You will have to remove and cleanup resources after an exception has been thrown, otherwise it will cause a leakage in memory and you will have created a zombie object hanging around memory &#8212; attached to the mother thread.</p>
<h2>Cleaning Up the Mess of C++</h2>
<p>An object is not even an object once its constructor finished successfully. So, better try to release resources inside the constructor before you throw an exception. In this case, I&#8217;m always using a <strong>double-exception throwing pattern</strong> that I made up and passionately using it in similar situations I face.</p>
<p>Let&#8217;s ask the complier! Two lines of code is always more representative than 10 lines of words. Here below, I&#8217;ve written a class called &#8220;Foo&#8221;, not functional but dangerous and an exception &#8220;StreamInitException&#8221; was decided to be thrown if there happens a problem while longStreamChar is being initialized. Right after we allocate 10k bytes for longStreamChar, <strong>BOOM</strong>! Someone pushed the wrong button, somebody shut down the database or trouble makers&#8217; spirits are near. Don&#8217;t try to catch it inside the constructor and see what happens. Many orphan kids, once we named them as longStreamChar, are all around and we can&#8217;t even access them.</p>
<pre>#include &lt;iostream&gt;

struct StreamInitException {
    StreamInitException(char * m){ message = m; }
    char * message;
};

class Foo {
    public:
        Foo(){
            try {
                this-&gt;initCharStream();
            } catch(StreamInitException * ex) {
                this-&gt;~Foo(); //release resources
                throw ex; // exception originally thrown by initCharStream
            }
        }

        ~Foo(){
            if(this-&gt;longCharStream)
            delete this-&gt;longCharStream;
        }

        void initCharStream(){
            //create a long char array of 10k
            this-&gt;longCharStream = (char*)malloc(10000);
            throw new StreamInitException("Error occurred during init.");
        }
    private:
        char * longCharStream;
    };

int main(){

    Foo * foo = NULL;

    try{
        foo = new Foo;
    } catch(StreamInitException * ex){
        std::cout &lt;&lt; ex-&gt;message &lt;&lt; std::endl;
    }

    return 0;

}</pre>
<p>Therefore, I&#8217;m handling init related bad moments of the object inside the constructor, deallocate memory etc. and re-throw the same exception finally after I get the hold of the control. Seems acceptable!</p>
<p class="warning">Consequently, <strong>I have a final question</strong>: do you prefer to throw an exception from constructors or search for other workarounds such as assigning the workload to a separate method called Init()?</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/burcudogan?a=v4WZrb7pjek:a4Oy7NnYR3Y:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=v4WZrb7pjek:a4Oy7NnYR3Y:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=v4WZrb7pjek:a4Oy7NnYR3Y:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=v4WZrb7pjek:a4Oy7NnYR3Y:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=v4WZrb7pjek:a4Oy7NnYR3Y:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=v4WZrb7pjek:a4Oy7NnYR3Y:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.burcudogan.com/144/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://blog.burcudogan.com/144/</feedburner:origLink></item>
		<item>
		<title>Domain Name Server Fight is Back!</title>
		<link>http://feedproxy.google.com/~r/burcudogan/~3/ZFPaI9nldr4/</link>
		<comments>http://blog.burcudogan.com/128/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 16:21:00 +0000</pubDate>
		<dc:creator>Burcu Dogan</dc:creator>
				<category><![CDATA[Regular]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[master table]]></category>
		<category><![CDATA[resource records]]></category>

		<guid isPermaLink="false">http://blog.burcudogan.com/?p=128</guid>
		<description><![CDATA[This is the second time I’m facing a horrible situation in 12 years of my active Internet adventure. One or a few DNSes ignore my change requests and keep pointing to the old IP although two weeks has passed after my edits. Those rebel servers cause the half of the routers to use the old [...]]]></description>
			<content:encoded><![CDATA[<p>This is the second time I’m facing a horrible situation in 12 years of my active Internet adventure. One or a few DNSes ignore my change requests and keep pointing to the old IP although two weeks has passed after my edits. Those rebel servers cause the half of the routers to use the old IP address and keep my old end-point&#160; alive recursively. I’m not sure if it’s a <strong>TTL issue</strong> with an <em>A RECORD</em> or an hacking attempt via <strong>DNS injection</strong>. Don’t know the answer yet, because I’m not able to access every name server (naturally) although I can traverse my path and know the evil ones.</p>
<p>Does anybody have a clue what is happening behind? Because straight forward actions like switching to my own name servers may not help me with the issue at this moment. The new changes might come to a&#160; deadlock on same cycle. Is there anybody out there who knows what’s happening?</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/burcudogan?a=ZFPaI9nldr4:OrvY0QoBY-I:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=ZFPaI9nldr4:OrvY0QoBY-I:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=ZFPaI9nldr4:OrvY0QoBY-I:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=ZFPaI9nldr4:OrvY0QoBY-I:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=ZFPaI9nldr4:OrvY0QoBY-I:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=ZFPaI9nldr4:OrvY0QoBY-I:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.burcudogan.com/128/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://blog.burcudogan.com/128/</feedburner:origLink></item>
		<item>
		<title>An Introduction to Fundamental Web Crawling Strategies</title>
		<link>http://feedproxy.google.com/~r/burcudogan/~3/gFDlbP26SB0/</link>
		<comments>http://blog.burcudogan.com/100/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 18:24:21 +0000</pubDate>
		<dc:creator>Burcu Dogan</dc:creator>
				<category><![CDATA[Regular]]></category>
		<category><![CDATA[crawlers]]></category>
		<category><![CDATA[distributed computing]]></category>
		<category><![CDATA[incremental crawling]]></category>
		<category><![CDATA[search engine]]></category>

		<guid isPermaLink="false">http://blog.burcudogan.com/?p=100</guid>
		<description><![CDATA[Generally, any search engine architecture is consisted of four core elements: a crawler, an indexer, a retrieval engine and a user interface interacts with end users. In this post, I’ll make an introduction to crawlers, crawling strategies and the the main challenges search engines face with the growth of the Web.
What is a Web Crawler?
A [...]]]></description>
			<content:encoded><![CDATA[<p>Generally, any search engine architecture is consisted of four core elements: a crawler, an indexer, a retrieval engine and a user interface interacts with end users. In this post, I’ll make an introduction to crawlers, crawling strategies and the the main challenges search engines face with the growth of the Web.</p>
<h2>What is a Web Crawler?</h2>
<p><a href="http://blog.burcudogan.com/wp-content/uploads/2009/03/crawling1.gif"><img title="crawling" class="right" src="http://blog.burcudogan.com/wp-content/uploads/2009/03/crawling-thumb1.gif" border="0" alt="crawling" width="240" height="160" /></a>A web crawler is an automatic web page collector to create a cache/base of local copies of pages found. Initially a crawler starts with a beginning set of known URLs. These known links are also known as <em>seed URLs</em>. Then, crawler extracts the links inside the known documents and responsible to download these newly found pages in some order. In crawling field, there are two major crawler types:</p>
<ol>
<li><strong>Periodic or Snapshot Crawling:</strong> Crawler continues to find new pages until the collection hits a desirable size. Then, periodically it runs the same process and replaces new collection with the existing. There are typically very large intervals <em>between two crawlings</em>. This method doesn’t use any existing knowledge comes from the previous crawls.</li>
<li><strong>Incremental Crawling:</strong> These crawlers keep searching for new links although collection becomes as large as it is desired to be. Old pages are repeatedly visited in a schedule to update the collection. It’s very hard to crawl a large source (such as Web) this way. Documents are needed to be refreshed one by one, also new links should be explored to be handled by the local collection. Web growth function is an exponential one according to the statistics. It means there are even more newly added pages than the updates of the existing documents. We unfortunately have a limited processing power, so it becomes more critical to decide <strong>which page to (re)visit next from the queue</strong>?</li>
</ol>
<p>Figure above shows it is more useful to choose snapshot strategies for large scope search engines. On the other side, if rapid change of documents is guaranteed for a small scale corpus, it’s more effective to use an incremental crawler.</p>
<h2>Scheduling the Download Queue</h2>
<p>Although I stated it is more likely to use a snapshot crawling for large amount of documents, large gaps between updates makes it absolutely <span style="text-decoration: underline;">impractical solution</span> for Web search engines while competitors such as Google explores even <em>the most least significant change in hours</em>. Incremental crawling looks (and actually is) very costly if we cannot predict when a page is updated/removed. Re-downloading the whole Web in short periods is also impossible. But, what if we can guess how often a page changes? What if we can prioritize each URL and schedule our download queue?<span id="more-100"></span></p>
<p>Crawling scheduling methods used in commercial engines are kept as secrets like the formula of Coca-Cola. There are only a few fundamental techniques I’ll share here to give beginners an impression.</p>
<p><strong><a href="http://blog.burcudogan.com/wp-content/uploads/2009/03/crawling2.gif"><img class="right" title="crawling2" src="http://blog.burcudogan.com/wp-content/uploads/2009/03/crawling2-thumb.gif" border="0" alt="crawling2" width="240" height="157" align="right" /></a> Breath-first search:</strong> The easiest but least efficient crawling algorithm. There isn’t a particular sorting process for the download queue. Documents are downloaded in the same order their URLs are found. But all of the links in a level should be crawled before crawler starts to discover another level. On the figure right, links on the seed level document will be downloaded before the links on the level0 documents and so on.</p>
<p><strong>Best-fit search:</strong> This algorithm is currently the most popular search algorithm used in focused crawlers. In best-first search, URLs are not visited in the order they are discovered; instead, some heuristics (usually results from Web analysis algorithms) are used to rank the URLs in the crawling queue and those that are considered more promising to point to relevant pages are visited first. Least important pages have very less change to be visited and continuously put to the back of the queue. Back-link count or partial PageRank have found a large application domain in this field.</p>
<p><strong>Tunnelling</strong>: This method is a good solution to find the most relevant URLs that occurs in a page. Let’s assume we are exploring links in document D, and one of the links in D refers to document C. Some crawlers rank C to check how relevant C is to D. For example, if URLs points to C and D occurs on a page other than these pages, they are most likely to be relevant. Or, if both D and C gives link to an existing page other than D or C, they may be relevant. Documents are scored due to their relevance to the root document and queued according to their rankings.</p>
<h2>Constraints and Principles in Queuing</h2>
<p>A crawler should foremost be polite to the server it is trying to reach. You will most likely to crash or slow your resource if you make thousands of requests in a minute. Queues should be sorted in a way that may not put extra load on the source server. In distributed hierarchies queues should resorted once distribution is completed to avoid <em>unexpected concurrent transactions</em>.</p>
<p>Another problem occurs in <strong>synchronization</strong> of distributed crawlers. If there are two discrete crawling processes are running and crawler1 and crawler2 find same link on different pages, they should communicate to <em>avoid repeated downloads and post-processing</em>.</p>
<p>A large amount of data lies on the Deep Web – a term used for invisible Web, for documents have no direct links point to them from the visible Web. A download queue should be able to give acceptable priority to this discrete set even if link-based statistical data is not available. As a example from practise, Google started to use <a href="https://www.google.com/webmasters/tools">Sitemaps</a> a few years ago to explore hidden content and let authors assign relative priorities to help Google crawlers with <em>predicting the change rates</em>.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/burcudogan?a=gFDlbP26SB0:2mUVD4tSYPA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=gFDlbP26SB0:2mUVD4tSYPA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=gFDlbP26SB0:2mUVD4tSYPA:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=gFDlbP26SB0:2mUVD4tSYPA:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=gFDlbP26SB0:2mUVD4tSYPA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=gFDlbP26SB0:2mUVD4tSYPA:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.burcudogan.com/100/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.burcudogan.com/100/</feedburner:origLink></item>
		<item>
		<title>Functional Programming for Beginners</title>
		<link>http://feedproxy.google.com/~r/burcudogan/~3/IBIINUK1y2U/</link>
		<comments>http://blog.burcudogan.com/46/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 17:29:53 +0000</pubDate>
		<dc:creator>Burcu Dogan</dc:creator>
				<category><![CDATA[Regular]]></category>
		<category><![CDATA[distributed computing]]></category>
		<category><![CDATA[functional programming]]></category>
		<category><![CDATA[lambda calculus]]></category>

		<guid isPermaLink="false">http://blog.burcudogan.com/?p=46</guid>
		<description><![CDATA[Recently, I’m facing many questions about functional programming. Instead of answering everybody one by one, I decided to write a blog post about functional programming. In this article, I’ll try to introduce you the FP concept. If you are interested, I advice you to have a hands-on experience. There are many widely used functional languages [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I’m facing many questions about functional programming. Instead of answering everybody one by one, I decided to write a blog post about functional programming. In this article, I’ll try to introduce you the FP concept. If you are interested, I advice you to have a hands-on experience. There are many widely used functional languages available today: LISP, Haskell, Erlang and F# (new but promising) are a few to name.</p>
<h2>Firstly, a Brief History…</h2>
<p>A long time ago, in 1930s, when the world was stuck in another economical recession, lives of four extra-ordinary mathematicians were crossed in Princeton, NJ.  These men were not interested in the physical world they were living but trying to create their own universe to find answers about limits of <em>computation –</em> a word not heard by many yet. The area they were interested in was called formal systems and their main problem was to answer which problems are solvable if processing power and memory were infinite. One of them were a truly materialist, a slave of questioning and curiosity, a British guy who decided to move to the new world after graduating from Trinity College. Second was a super brain whose Ph.D. dissertation was accepted when he was just 23 years old, nicknamed “Mr. Why”, a close friend of Albert Einstein. The other two were recent Princeton graduates who decided to go for graduate school. Correspondingly, the names of these men were Alan Turing, Kurt Gödel, Alonzo Church and Stephen Kleene. In 1936, Turing extended Gödel’s study on the limits of proof and computation with replacing Gödel&#8217;s universal arithmetic-based formal language with formal devices called Turing machines. At the same time, two young grad students Church and Kleene were designing a universal model of computation which was identical to Turing machines in power. Their formal system were called<em> lambda calculus</em>. Let’s say it in a clearer and less scientific-BS way: they invented a language, lambda calculus, that was capable to be the smallest universal programming language of the whole world.</p>
<h2>Lambda Calculus</h2>
<p>Lambda calculus is the common programming language of the world. The main aim or their inventors was to prove any computable function can be expressed and evaluated using this formulization. In the universe of lambda calculus, the key elements are &lt;name&gt;, &lt;expression&gt; and &lt;application&gt; where,</p>
<p><a href="http://blog.burcudogan.com/wp-content/uploads/2009/03/0411.gif"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="04-1" src="http://blog.burcudogan.com/wp-content/uploads/2009/03/041-thumb1.gif" border="0" alt="04-1" width="437" height="42" /></a></p>
<p>&lt;name&gt; in lambda calculus cannot be associated with different values, therefore it is not called a “variable.” Imagine your favourite iterative programming language don&#8217;t let you change values of the variables by default. Yes, it sounds like a headache at first, but the whole concept is standing on these rules. Now, let’s move on to a <strong>more practical example</strong>, for instance, to an function multiples its input by 2.</p>
<p><a href="http://blog.burcudogan.com/wp-content/uploads/2009/03/0421.gif"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="04-2" src="http://blog.burcudogan.com/wp-content/uploads/2009/03/042-thumb1.gif" border="0" alt="04-2" width="158" height="25" /></a></p>
<p>For great examples, I suggest you to read “<em>A Tutorial Introduction to the Lambda Calculus</em>” by Rojas.<span id="more-46"></span></p>
<h2>Functional Programming Language Primitives</h2>
<p>With no surprise, functional programming languages are artificial languages where the main application is made from a function (or nested functions), a very similar concept to the lambda calculus. In this chapter I’m going to underline most characteristic features (not restrictions) of functional languages.</p>
<p>1. <strong>No sequences of discrete commands</strong>. Traditional programming languages are based around the idea of a variable as a changeable association between a name and values. These languages are said to be imperative because they consist of sequences of commands. On the other hand, functional languages are based on structured function calls. A functional program is an expression consisting of a function call which calls other functions in turn (nested function calls).</p>
<p><a href="http://blog.burcudogan.com/wp-content/uploads/2009/03/0431.gif"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="04-3" src="http://blog.burcudogan.com/wp-content/uploads/2009/03/043-thumb.gif" border="0" alt="04-3" width="417" height="73" /></a></p>
<p>2.<strong> Names may only be associated with a single value</strong>. In iterational languages, the value of a name (variable) can be modified. In functional languages, names are only introduced as the formal parameters of functions and given values by function calls with actual parameters. Once a formal parameter is associated with an actual parameter value there is no way for it to be associated with a new value.</p>
<p>3. <strong>No guaranteed execution order</strong>. Iterational languages executes line by line (if there are no multi-threaded pieces.) In contrast, functional languages don&#8217;t guarantee a thing about execution order. You have to declare the execution order by yourself.</p>
<p><a href="http://blog.burcudogan.com/wp-content/uploads/2009/03/044.gif"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="04-4" src="http://blog.burcudogan.com/wp-content/uploads/2009/03/044-thumb.gif" border="0" alt="04-4" width="476" height="73" /></a></p>
<p>4. <strong>No repetitions of names</strong>. In functional languages, because the same names cannot be reused with different values, nested function calls are used to create new versions of the names for new values. Similarly, because command repetition cannot be used to change the values associated with names, recursive function calls are used to repeatedly create new versions of names associated with new values.</p>
<h2>Advantages of Thinking Differently</h2>
<p>So, why do people need to think differently although we had all of the other rapid development languages off-the-shelf and not worrying about the marginal concepts FP brings? People who were interested in distributed computing somehow knows the answer. Have you even heard about <a href="http://en.wikipedia.org/wiki/Mutual_exclusion">mutual exclusion</a>, racing condition or other problems in distributed/parallel programming? Shared memory is a problem and no matter how hard computer scientists work on methods to lock shared resources during critical area executions, usually communication needed to synchronize these events aren’t even worth to distribute the process. Consequently some engineers come ideas like <a href="http://labs.google.com/papers/mapreduce.html">MapReduce</a> where dependency between distributed tasks are none. MapReduce applies most of the concepts I represented above about functional programming.</p>
<p>Secondly, functional programming is more than programming, it’s a way of thinking. You don’t need design patterns for functional programming because it’s a design pattern as itself. With Java, you have billions of features to run the world but when it comes designing a software system, it causes more shortcuts in brain. On the other hand, functional designs are deterministic.</p>
<p>There are many more such as advantages in unit testing, deploying and updating software. Please keep in mind, functional programming is a tough area to transfer knowledge with a blog post. Every section is this post can be extended with a few thousand words. I recommend you to search, try, read, code, live it to have a complete feeling.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/burcudogan?a=IBIINUK1y2U:E8FrM8uabhI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=IBIINUK1y2U:E8FrM8uabhI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=IBIINUK1y2U:E8FrM8uabhI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=IBIINUK1y2U:E8FrM8uabhI:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=IBIINUK1y2U:E8FrM8uabhI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=IBIINUK1y2U:E8FrM8uabhI:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.burcudogan.com/46/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.burcudogan.com/46/</feedburner:origLink></item>
		<item>
		<title>Continuous Scrolling from a User POV</title>
		<link>http://feedproxy.google.com/~r/burcudogan/~3/bAqd62yRO_A/</link>
		<comments>http://blog.burcudogan.com/28/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 13:54:55 +0000</pubDate>
		<dc:creator>Burcu Dogan</dc:creator>
				<category><![CDATA[Regular]]></category>
		<category><![CDATA[hashtags]]></category>
		<category><![CDATA[live search]]></category>
		<category><![CDATA[scrolling]]></category>
		<category><![CDATA[user experience]]></category>

		<guid isPermaLink="false">http://blog.burcudogan.com/?p=28</guid>
		<description><![CDATA[It was a few months ago when I first saw continuous scrolling template on Yahoo’s UI Design patterns library. It is also called infinite scrolling or infinite page, but no matter how fancy the name they try,  the rating on the library alone was explaining what a user-enemy navigation method it is. At that moment, [...]]]></description>
			<content:encoded><![CDATA[<p>It was a few months ago when I first saw <a href="http://ui-patterns.com/pattern/ContinuousScrolling">continuous scrolling</a> template on Yahoo’s UI Design patterns library. It is also called infinite scrolling or infinite page, but no matter how fancy the name they try,  the rating on the library alone was explaining what a<em> user-enemy</em> navigation method it is. At that moment, page gave me an instant feeling like a random guy posted a page without inner sense and taste because; that behaviour was <strong>absolutely not expected</strong> and against common user experience practices. Unfortunately I was wrong! A few weeks ago, I came across a <a href="http://channel9.msdn.com/shows/StefanIs/StefanIs001/">Live Search feature showcase</a> on Channel 9 discusses the new infinite scrolling on the image search. Wow! Totally without prejudice, was curious and wanted to experience. (Comforting me with an in-mind quote: <em>Anyways,</em> w<em>ho’s using Live Search? Give the guys freedom to try things</em>.)</p>
<p><a href="http://blog.burcudogan.com/wp-content/uploads/2009/03/03livesearch1.png"><img class="right" style="border-bottom: 0px; border-left: 0px; float: right; border-top: 0px; border-right: 0px" title="03-livesearch" src="http://blog.burcudogan.com/wp-content/uploads/2009/03/03livesearch-thumb2.png" border="0" alt="03-livesearch" width="240" height="150" /></a> I searched “Jef Raskin”. A set contains more than 40 pictures I suppose. Therefore, initial scene was very crowded already and before I hit the bottom another 40ish loaded. Everything was starting to be a little bit confusing and page was looking messy. There were no layers or separators between and it was making it harder to scroll back to an image I previously favoured. After 5-6 loads, it became impossible to navigate between older images and the newly loaded sets. As an advantage, human brain is more sensitive to image data. <a href="http://hashtags.org/">Hashtags</a> are using the same approach and in free form text, it is absolutely more scary.</p>
<p>Additionally, how am I going to navigate friends to the right page, what about sharing?</p>
<p><strong>Me:</strong> Hey, look, your old pictures are popping out on a totally irreverent topic. Type in [phrase here], scroll down 3 times, then scroll up approximately 200 pixels, stop, no sorry, scroll down a little bit, scan the heap. There you are. (Instead of sending 4th page’s link.)<br />
<strong>My friend:</strong> Okeeeeeyyyyyyy.</p>
<p>Finally I’m coming to the point. It doesn’t mean you have to mess up like this, if there is nothing new you can find to improve user experience in navigation. I have seen 4-5 other examples lately, is this becoming the new trend? NO!! I want the good old paging back :’) What’s your feedback?</p>
<p><em>Edit:</em> I saw the 8px font above informs you about the range, what a tricky improvement, huh? Plus, images stopped to come after hitting 1000. Did the guys think nobody can scroll down that much insistently?</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/burcudogan?a=bAqd62yRO_A:iJ5e7vZ17wI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=bAqd62yRO_A:iJ5e7vZ17wI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=bAqd62yRO_A:iJ5e7vZ17wI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=bAqd62yRO_A:iJ5e7vZ17wI:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=bAqd62yRO_A:iJ5e7vZ17wI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=bAqd62yRO_A:iJ5e7vZ17wI:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.burcudogan.com/28/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://blog.burcudogan.com/28/</feedburner:origLink></item>
		<item>
		<title>BigTable Concept: Why do the World’s Smartest People Ignore Relational DBs?</title>
		<link>http://feedproxy.google.com/~r/burcudogan/~3/rxhs1q1IY-4/</link>
		<comments>http://blog.burcudogan.com/9/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 11:05:32 +0000</pubDate>
		<dc:creator>Burcu Dogan</dc:creator>
				<category><![CDATA[Regular]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[bigtable]]></category>
		<category><![CDATA[distributed computing]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://blog.burcudogan.com/?p=9</guid>
		<description><![CDATA[In the era of the Internet, the key problem is scalability. As cloud&#8217;s popularity climbs up, we are hearing more about the constraints. So far, I only had time to play with Google&#8217;s App Engine and Microsoft&#8217;s Azure Services Platform. Cloud developers are mainly shocked by the new non-relational databases that cloud services use as [...]]]></description>
			<content:encoded><![CDATA[<p>In the era of the Internet, the key problem is <em>scalability</em>. As cloud&#8217;s popularity climbs up, we are hearing more about the constraints. So far, I only had time to play with Google&#8217;s <a href="http://code.google.com/appengine/">App Engine</a> and Microsoft&#8217;s <a href="http://www.microsoft.com/azure/default.mspx">Azure Services Platform</a>. Cloud developers are mainly shocked by the new <strong>non-relational databases</strong> that cloud services use as the only alternative. Google calls it BigTable and Microsoft finds a new place in its own terminology dictionary for <a href="http://channel9.msdn.com/posts/smarx/Windows-Azure-Blob-Storage/">BLOB</a>. Many start to wonder what the hype about the <a href="http://en.wikipedia.org/wiki/Relational_database">relational databases</a> was over the past 30 years. Foremost, let&#8217;s clear that this is not a replacement, but a more efficient way to store data by eliminating not-that-fundamental super engineered functionality layers of the current relational database management systems. Yes, good news for people makes living by designing super large and highly <a href="http://en.wikipedia.org/wiki/Database_normalization">normalized databases</a> to ensure data integrity.</p>
<p><img class="left alignnone size-full wp-image-17" title="Bigtable Hierarchy" src="http://blog.burcudogan.com/wp-content/uploads/2009/03/02-bigtablehierarchy.gif" alt="Bigtable Hierarchy" width="260" height="174" />On a relational database, everything is in control; you can add constrains to ensure nobody will be able to enter a duplicated row. Or in deletion, you can program DBMS to handle the useless orphan rows. But the best, a relational DBMS is going to pre-process your SQL query before executing to avoid silly performance mistakes you can make. Think of the environment now: constraints over constraints, query execution strategies, high-level of dependence and complex indexing methods. This package works great unless you want to <span style="text-decoration: underline;">distribute the tables</span> to different machines. Can you image joining two tables where tables are distributed over 100.000 nodes? In a Google case, this is the everyday problem (or better, call it an <em>every millisecond issue</em>). Luckily, Google&#8217;s data has characteristics; according to <a href="http://research.google.com/people/jeff/index.html">Jeffrey Dean</a>, they are able to manage constraints DBMSes serve to process data, <strong>on the application level</strong>. Consequently, Google keeps data in a very basic form as &lt;key,value,timestamp&gt; tuples.</p>
<p><img class="left alignnone size-full wp-image-19" title="Bigtable Tablets" src="http://blog.burcudogan.com/wp-content/uploads/2009/03/02-tablets.gif" alt="Bigtable Tablets" width="428" height="89" />BigTable looks like a very large B+ tree. It has 3 levels of hierarchy. All of tables are sorted and those tables are separated into pieces called tablets. First two levels are made of <em>metadata tables</em> to locate you to the right  tablet. Root tablet is not distributed, but with helps of prefetching and extreme caching, it is actually not the bottleneck of the system. Final level tablets points to physical files (managed by Google File System). GFS provides 3 copies for each file on the system, so no matter if a machine is going down, they still have 2 other copies somewhere else. In the 2nd figure, a row of a tablet is illustrated. com.cnn.www is the key in this case and value has three different columns: contents, anchor:cnnsi.com and anchor:my.look.ca. Notice the timestamps, these fields may contain more than one version of entry. In this case, as Google crawler finds updated content on <a href="http://www.cnn.com/">www.cnn.com</a>, a new layer is being added. This enables and leads BigTable to provide a three dimensional data presentation.</p>
<p>In the end of the day, BigTable is not rocket science. It is compact and easy to adopt. It is very straight-forward. Many friends know I came with a very similar concept while designing <em>Rootapi</em> two years ago, those were the times I havent heard of BigTable. Additionally I was saving values as JSON (equality operation was enough in querying) in blocks which were multiples of the sector size of my physical hard drives. IO operations were super fast, JSON based web services were super fast and it was highly distributable, although I couldn&#8217;t find a great environment to explore the severe situations deeply.</p>
<p>As we move on the cloud, this is the way we are going to look at data storage. If you need more technical details, I highly recommend you to take a look at the following references:</p>
<ol>
<li><a href="http://video.google.com/videoplay?docid=7278544055668715642">BigTable: A Distributed Structured Storage System</a></li>
<li><a href="http://labs.google.com/papers/bigtable.html">Bigtable: A Distributed Storage System for Structured Data</a> &#8211; Original publication paper of BigTable, appeared in OSDI&#8217;06.</li>
<li><a href="http://www.youtube.com/watch?v=5Eib_H_zCEY">Google File System</a> An introduction to GFS by Aaron Kimball.</li>
</ol>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/burcudogan?a=rxhs1q1IY-4:c9p4ZpQyXHM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=rxhs1q1IY-4:c9p4ZpQyXHM:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=rxhs1q1IY-4:c9p4ZpQyXHM:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=rxhs1q1IY-4:c9p4ZpQyXHM:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=rxhs1q1IY-4:c9p4ZpQyXHM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=rxhs1q1IY-4:c9p4ZpQyXHM:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.burcudogan.com/9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.burcudogan.com/9/</feedburner:origLink></item>
		<item>
		<title>An Unusual Proclaim: Partial Classes</title>
		<link>http://feedproxy.google.com/~r/burcudogan/~3/ecu2AJ-H_vY/</link>
		<comments>http://blog.burcudogan.com/3/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 19:18:35 +0000</pubDate>
		<dc:creator>Burcu Dogan</dc:creator>
				<category><![CDATA[Regular]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[partial classes]]></category>

		<guid isPermaLink="false">http://blog.burcudogan.com/?p=3</guid>
		<description><![CDATA[When it comes to the myth behind the partial classes (came along with C# 2.0  -  also added to VB.NET, fix me if I am wrong), what usually said is:

Partial classes are great if multiple number of developers need to be working on the same class, or
It helps you to separate generated code from your [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-6 right" title="WinDFS" src="http://blog.burcudogan.com/wp-content/uploads/2009/03/01-windfs.jpg" alt="WinDFS" width="186" height="260" />When it comes to the myth behind the partial classes (came along with C# 2.0  -  also added to VB.NET, fix me if I am wrong), what usually said is:</p>
<ol>
<li>Partial classes are great if multiple number of developers need to be working on the same class, or</li>
<li>It helps you to separate generated code from your development. A typical example is ASP.NET pages or Win Forms applications.</li>
</ol>
<p>These reasons are both true but according to my inner sense; but many overlook the real secret behind portioning of a class. A few weeks ago, I started to code a distributed file system (a virtual one &#8211; <em>highly depends on the existing features of Windows</em>) called <a href="http://burcudogan.com/windfs/">WinDFS</a>, and have to implement a message transmission engine over TCP/IP to serve communication among nodes. I decided to run it by remote objects, so do I created a serializable <strong>Transferable</strong> class that has a member of FileInfo. Both <em>WinDFSClient</em> and <em>WinDFSMaster</em> are referencing to the Remoting project for transmission operations. The straight-forward process flows like this: a client asks for metadata of a file/directory by sending the corresponding command with the entity&#8217;s path and an empty FileInfo element to the master machine. Master searches storage engine fills the FileInfo element with related data and sends it back to the requester node.</p>
<p>Everything is fine and enough up to this point. But what would you do if you want to play more with FileInfo <strong>specifically on clients</strong> &#8211; such as <em>outputting the attributes of an instance of FileInfo as XML</em>? Would it make sense to create a XmlOutputFromFileInfoBlahBlah class and make the solution looks like garbage? No, as long as we are not Christopher Millis.</p>
<p>The most natural way is to extend FileInfo specially for WinDFSClient, note that #1 best resolution has nothing to do with extending the original FileInfo in Remoting. An XML output most probably has nothing in common with other projects. On the other hand, XML outputting sounds like a stand-alone feature but what would we do if we wanted to expand FileInfo with <em>resources WinDFSMaster uses.</em></p>
<p>At this point partial classes are <strong>great design choices</strong>. Well, at least it worked for me. I created a class in WinDFSMaster named FileInfo. Added <a href="http://www.java2s.com/Tutorial/CSharp/0140__Class/Defineandusepartialclass.htm">partial keyword</a> to the class signatures, implemented ToXml into the master and it works like a dream now. Masters are able to use FileInfo.ToXml() while it is totally isolated from other projects. Note that you have to have physical access to the source code of the initial class to take the advantage of this method.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/burcudogan?a=ecu2AJ-H_vY:15mAfXOY0zc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=ecu2AJ-H_vY:15mAfXOY0zc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/burcudogan?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=ecu2AJ-H_vY:15mAfXOY0zc:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=ecu2AJ-H_vY:15mAfXOY0zc:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/burcudogan?a=ecu2AJ-H_vY:15mAfXOY0zc:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/burcudogan?i=ecu2AJ-H_vY:15mAfXOY0zc:F7zBnMyn0Lo" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.burcudogan.com/3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.burcudogan.com/3/</feedburner:origLink></item>
	</channel>
</rss>
