<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>muhuk.com</title>
	<atom:link href="http://www.muhuk.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.muhuk.com</link>
	<description>know thyself</description>
	<lastBuildDate>Thu, 04 Mar 2010 08:49:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Developing Reusable Django Apps: Signals</title>
		<link>http://www.muhuk.com/2010/03/developing-reusable-django-apps-signals/</link>
		<comments>http://www.muhuk.com/2010/03/developing-reusable-django-apps-signals/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 08:49:17 +0000</pubDate>
		<dc:creator>Atamert Ölçgen</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[reusable]]></category>
		<category><![CDATA[signals]]></category>

		<guid isPermaLink="false">http://www.muhuk.com/?p=346</guid>
		<description><![CDATA[I wrote &#8220;signals provide a great way to propagate the events generated from your app&#8221; earlier. I think reusable apps should avoid hardcoding any kind of event handling and send signals instead. App consumers might prefer an email over an on-screen notification. They may even choose to ignore the event silently. A reusable app should [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote &#8220;<a href="http://www.muhuk.com/2010/01/developing-reusable-django-apps/"><em>signals provide a great way to propagate the events generated from your app</em></a>&#8221; earlier. I think reusable apps should avoid hardcoding any kind of event handling and <a href="http://docs.djangoproject.com/en/dev/topics/signals/">send signals</a> instead. App consumers might prefer an email over an on-screen notification. They may even choose to ignore the event silently. A reusable app should give this choice to the consumer.</p>

<p>Taking advantage of signals doesn&#8217;t necessarily mean providing no sane defaults. You can send signals <strong>and</strong> provide default event handling. Here is a couple of ideas how this can be done:</p>

<ul>
<li>Your app can <a href="http://stackoverflow.com/questions/2209159/disconnect-signals-for-models-and-reconnect-in-django/2209804#2209804">check if there are any listeners</a> and connect the default handlers if there is none.</li>
<li>You can ship an auxiliary app that connects default handlers when added to <code>INSTALLED_APPS</code>.</li>
</ul>

<p>I personally prefer the second approach since it&#8217;s simpler and more explicit. I&#8217;m sure there are other ways to implement default handlers for signals.</p>

<h3>Dispatch_uid</h3>

<p>Don&#8217;t forget to assign a unique <code>dispatch_uid</code> for each <code>connect()</code> call. Otherwise your handler can get <a href="http://code.djangoproject.com/wiki/Signals#Helppost_saveseemstobeemittedtwiceforeachsave">connected twice</a>. I would also suggest you to use both module path <strong>and</strong> your handler function&#8217;s name in your <code>dispatch_uid</code>:</p>

<pre><code>"%s.%s" % (os.path.splitext(__file__)[0].replace(os.sep, '.')[1:],
           handler_name)
</code></pre>

<p>Now I should take my own advice and replace hardcoded <code>User.message_set.create()</code>s with signals in <a href="http://github.com/muhuk/django-simple-friends">django-simple-friends</a>.</p>


<p>Related posts:<ol><li><a href='http://www.muhuk.com/2010/01/developing-reusable-django-apps/' rel='bookmark' title='Permanent Link: Developing Reusable Django Apps'>Developing Reusable Django Apps</a></li>
<li><a href='http://www.muhuk.com/2010/01/developing-reusable-django-apps-app-settings/' rel='bookmark' title='Permanent Link: Developing Reusable Django Apps: App Settings'>Developing Reusable Django Apps: App Settings</a></li>
<li><a href='http://www.muhuk.com/2010/01/dynamic-translation-apps-for-django/' rel='bookmark' title='Permanent Link: Dynamic Translation Apps for Django'>Dynamic Translation Apps for Django</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.muhuk.com/2010/03/developing-reusable-django-apps-signals/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Web Site Performance Optimizations</title>
		<link>http://www.muhuk.com/2010/02/web-site-performance-optimizations/</link>
		<comments>http://www.muhuk.com/2010/02/web-site-performance-optimizations/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 12:01:43 +0000</pubDate>
		<dc:creator>Atamert Ölçgen</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.muhuk.com/?p=342</guid>
		<description><![CDATA[Recently I have done some optimizations to make telvee a little faster using django_compressor and making sprites for background images. Good news is substantial changes to development environment and the design wasn&#8217;t required. I&#8217;ll get into details below. But first I&#8217;d like to write about the theory a little bit.

I follow (and read with great [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have done some optimizations to make <a href="http://www.telvee.com">telvee</a> a little faster using <a href="http://github.com/muhuk/django_compressor">django_compressor</a> and making sprites for background images. Good news is substantial changes to development environment and the design wasn&#8217;t required. I&#8217;ll get into details below. But first I&#8217;d like to write about the theory a little bit.</p>

<p>I follow (and read with great interest) Steve Souders&#8217;s blog <a href="http://www.stevesouders.com/blog/">High Performance Web Sites</a>. I must admit I was sceptical about it at first; spriting images, individual different loading behaviours of browsers&#8230; I thought they were <a href="http://en.wikipedia.org/wiki/Program_optimization">premature optimization</a>s. But I realized I was wrong as I continued to read. Steve Souders is an expert on high performance web sites and what he preaches are realistic techniques, backed by test results most of the time. If you are not following, I suggest you add it to your RSS reader.</p>

<h3>Optimization Techniques</h3>

<p>We can explore the techniques in two main categories:</p>

<ol>
<li>Techniques to reduce the data to be transferred.

<ul>
<li><strong>Minifying</strong>: Minification is removing comments and unneeded whitespace in CSS and JavaScript files. Compilers like <a href="developer.yahoo.com/yui/compressor/">YUI Compressor</a> and <a href="code.google.com/closure/">Closure</a> modifies JavaScript code to compress even further, without any changes to the functionality.</li>
<li><strong>Gzipping</strong>: Web browsers accept <a href="http://en.wikipedia.org/wiki/Gzip#Other_uses">gzip</a> encoded content for a long time. I have just compressed a 13 KB text file down to 4 KB. A two thirds compression ratio is not bad at all.</li>
</ul></li>
<li>Techniques to reduce the number of HTTP requests.

<ul>
<li><strong>Combining</strong>: CSS and JavaScript files can be combined together into a single file and therefore a single HTTP request. Gzip may be more efficient on these files. In a similar way background images can be merged into a <a href="http://en.wikipedia.org/wiki/Sprite_%28computer_graphics%29#Application">sprite</a> and then reconstructed again using their coordinates on that sprite.</li>
<li><strong>Data URI&#8217;s</strong>: Images (or other file types) can be embedded into CSS (or JavaScript or HTML) using <a href="http://en.wikipedia.org/wiki/Data_URI_scheme"><code>data: URI</code>&#8217;s</a>. Extra HTTP requests for those resources can be avoided this way.</li>
</ul></li>
</ol>

<p>You might think <em>it&#8217;s fine to perform all these optimizations, but what happens when I want to make some changes to my combined, minified JavaScript file?</em> Instead of applying these techniques blindly, it&#8217;s best to follow a sensible plan for implementing these optimizations:</p>

<ul>
<li>First of all <em>everything that can be automated should be automated</em>. Regarding the example above script files should stay uncombined and uncompressed in the development environment and optimizations should be applied when the application is published. Taking it a step further we can have the application detect changes in those files and update optimized versions automatically. (django&#95;compressor works this way)</li>
<li>I was worried that spriting would complicate managing the design. But I have seen, on the contrary; if images each sprite contain are choosen carefully it makes the process easier. Start combining images that belong to the same design element. Avoid complex arrangements, stick with horizontal or vertical stacking as much as possible. Don&#8217;t forget to leave transparent spaces between items and sprite border. Try to combine images that are loaded on the same page, avoid loading a sprite for only half of it&#8217;s elements. Don&#8217;t force yourself to combine all images, if you follow the guidelines I have mentione they won&#8217;t.</li>
<li>When performing optimizations don&#8217;t forget to use easily available tools. You can use <a href="http://developer.yahoo.com/yslow/">YSlow</a> for general analysis, <a href="http://spriteme.org/">SpriteMe</a> for image combining tips, <a href="http://compressorrater.thruhere.net/">CompressorRater</a> to compare different compilers&#8217; performance on your scripts. I would like to note that Steve Souders is the developer of first two.</li>
</ul>

<h3>Telvee Results</h3>

<p>I didn&#8217;t think about performance at all when I started developing <a href="http://www.telvee.com">telvee</a>. Too many CSS files and too many images were being loaded. Here is what it looked like before optimizations:</p>

<table>
  <tr><th>&nbsp;</th><th># of requests</th><th>load (KB)</th></tr>
  <tr><th>Homepage</th><td>25</td><td>~85</td></tr>
  <tr><th>Cup Detail</th><td>48</td><td>~80</td></tr>
</table>

<p>Then I have installed and configured <a href="http://github.com/muhuk/django_compressor">django_compressor</a>. I used YUI Compressor for both JavaScript and CSS. I have created sprites and modified CSS files manually<sup>1</sup>. Then I deployed these changes and measured again:</p>

<table>
  <tr><th>&nbsp;</th><th># of requests</th><th>load (KB)</th></tr>
  <tr><th>Homepage</th><td>12</td><td>~70 (~160)</td></tr>
  <tr><th>Cup Detail</th><td>14</td><td>~64</td></tr>
</table>

<p>In the load column of Homepage, the number in parens is the actual load. But the design of homepage is changed with this upgrade and a new 90 KB image is being loaded now. So I have accepted 70 KB in my calculations. The result of optimizations are as follows:</p>

<table>
  <tr><th>&nbsp;</th><th># of requests</th><th>load (KB)</th></tr>
  <tr><th>Homepage</th><td>52%</td><td>17%</td></tr>
  <tr><th>Cup Detail</th><td>70%</td><td>19%</td></tr>
</table>

<h3>Django&#95;compressor and Data URI&#8217;s</h3>

<p>Django&#95;compressor, developed by Christian Metts, helps you to apply optmizations I have mentioned above easily to your <a href="http://www.djangoproject.com/">Django</a> projects. You can see my fork <a href="http://github.com/muhuk/django_compressor">here</a> where I have merged some other branches and added a little bit of code myself.</p>

<p>Using <code>compressor.filters.datauri.CssDataUriFilter</code> in <code>data-uri</code> branch of this repository, you can embed linked files within your CSS files. It will only embed files less than or equal to 1024 Bytes (1 KB) by default. You can change this limit by setting <code>COMPRESS_DATA_URI_MIN_SIZE</code> in your <code>settings.py</code>.</p>

<p>There are a couple of things to pay attention when you convert your references to <code>data: URI</code>s. Firstly file contents are <code>base64</code> encoded which means approximately one third increase in size. It&#8217;s up to you to balance between increased bandwidth and reduced request counts<sup>2</sup>. Another thing to watch for is multiple references to the same file will end up embedding the same data many times. The solution to this problem is to reduce all references to one<sup>3</sup> but this might break your CSS arrangement strategy.</p>

<p>Please test django&#95;compressor&#8217;s <code>data: URI</code> support and tell me what you think. If you haven&#8217;t applied optimizations I mentioned above, you should. Thanks to django&#95;compressor they are quite easy to implement on Django projects.</p>

<hr />

<p><strong>1</strong>: I would like to add automatic sprite building/linking support to django&#95;compressor sometime.</p>

<p><strong>2</strong>: With Today&#8217;s modern connections 1~2 KB increase is a good price for 1 less HTTP request..</p>

<p><strong>3</strong>: <a href="http://meiert.com/en/blog/20090401/why-css-needs-no-variables/">http://meiert.com/en/blog/20090401/why-css-needs-no-variables/</a></p>


<p>Related posts:<ol><li><a href='http://www.muhuk.com/2009/05/sad-state-of-web-development-industry-in-turkiye/' rel='bookmark' title='Permanent Link: Sad State of Web Development Industry in Türkiye'>Sad State of Web Development Industry in Türkiye</a></li>
<li><a href='http://www.muhuk.com/2009/03/django-where-should-my-app-live/' rel='bookmark' title='Permanent Link: Django: Where Should My App Live'>Django: Where Should My App Live</a></li>
<li><a href='http://www.muhuk.com/2009/05/django-formfieldset/' rel='bookmark' title='Permanent Link: django-formfieldset'>django-formfieldset</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.muhuk.com/2010/02/web-site-performance-optimizations/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Top 5 Untrends According To Me</title>
		<link>http://www.muhuk.com/2010/02/top-5-untrends-according-to-me/</link>
		<comments>http://www.muhuk.com/2010/02/top-5-untrends-according-to-me/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 15:21:39 +0000</pubDate>
		<dc:creator>Atamert Ölçgen</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[competence]]></category>
		<category><![CDATA[free software]]></category>
		<category><![CDATA[netiquette]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[social media]]></category>

		<guid isPermaLink="false">http://www.muhuk.com/?p=338</guid>
		<description><![CDATA[My dear friend Ochronus posted an article titled Top 5 trends and technologies in software development that got me thinking. My thoughts below. Go check Ochronus&#8217;s blog if you haven&#8217;t, he is the lead developer at Arukereso.hu.

I agree with the suggestions from the original article. Yet, I would like to change the order a little [...]]]></description>
			<content:encoded><![CDATA[<p>My dear friend Ochronus posted an article titled <a href="http://blog.mostof.it/posts/top-5-trends-in-software-development/"><em>Top 5 trends and technologies in software development</em></a> that got me thinking. My thoughts below. Go check Ochronus&#8217;s blog if you haven&#8217;t, he is the lead developer at <a href="http://www.arukereso.hu/">Arukereso.hu</a>.</p>

<p>I agree with the suggestions from the original article. Yet, I would like to change the order a little bit; DVCS and then agile (with lowercase a) and then the rest. None of my points below are cool trends, in fact I can guarantee most of you will find them boring. But I think they are all important. OK, I hope you are all psyched now. Here we go:</p>

<h3>1. Be Careful With The Buzz</h3>

<p>Trends are cool. What could be wrong about following cutting edge stuff? We all want to be <em>up to date</em>, no? I think it&#8217;s good to follow the trends <strong>if</strong> you have the experience and the ability to filter the BS. I know a young developer who was constantly going back and forth between <a href="http://railsenvy.com/2007/9/10/ruby-on-rails-vs-django-commercial-7">Rails/Ruby and Django/Python</a>. I haven&#8217;t heard from him for a while, but he is probably still doing that same dance. Why? Because his considerations were solely based on buzz, not on simple requirements analysis or technical comparisons or personal experience.</p>

<h3>2. Learn And Use An Old-Fashioned <del>Modern</del> Low-Level <del>Scripting</del> Language</h3>

<p>To all the <em>scripting</em> people, like me, out there: you need to have an understanding of what&#8217;s happening under the hood. At the least to appreciate our high-level environments, at the most to become genuinely good programmers. Being a Python person myself, I think the best low-level language to be proficient for me is C. Many other high-level languages have C interfaces. So investing the time to learn C should pay off one way or the other.</p>

<h3>3. Do Less Web Programming</h3>

<p>Aren&#8217;t we doing a lot of web programming these days? Actually I think doing X development exclusively is bad for your programming muscles. Web programming, enterprise work or system scripting, it doesn&#8217;t matter. But web programming happens more than anything else. Maybe some of you have only been playing with it, but there are a huge number of us doing nothing but web programming. This is so sad; both in an individual level and for the community at large.</p>

<h3>4. Learn How To Educate Yourself</h3>

<p>What is a noob? Here is a definition and disambiguation (from newbie):</p>

<blockquote>
  <p>Newbs are those who are new to some task and are very beginner at it, possibly a little overconfident about it, but they are willing to learn and fix their errors to move out of that stage. n00bs, on the other hand, know little and have no will to learn any more. They expect people to do the work for them and then expect to get praised about it, and make up a unique species of their own.</p>
</blockquote>

<p>Make an active effort not to be a noob. Learn <a href="http://catb.org/~esr/faqs/smart-questions.html">how to ask smart questions</a>, <a href="http://www.dtcc.edu/cs/rfc1855.html">how to communicate others</a> and seek help. Being polite is good but actually improving and being a valuable member of the community is much, much better.</p>

<h3>5. Open Source Properly</h3>

<p>It&#8217;s great to open source your project. But please do it properly. There are already too many unmaintained, undocumented projects out there that noone seem to care. Do you really have to add to that? <em>As is</em> argument doesn&#8217;t make much sense today. But if you really have to make an open source dead drop, please at least document the status of your project and your intentions clearly.</p>

<p>I wouldn&#8217;t be surprised if some you think they all are obvious. But if they are so obvious then why are they widely being ignored? Is it because they are under-retweeted, under-reddited and therefore not trendy.</p>


<p>Related posts:<ol><li><a href='http://www.muhuk.com/2009/05/django-formfieldset/' rel='bookmark' title='Permanent Link: django-formfieldset'>django-formfieldset</a></li>
<li><a href='http://www.muhuk.com/2009/04/freedays09-seminar-program/' rel='bookmark' title='Permanent Link: Freedays&#8217;09 Seminar Program'>Freedays&#8217;09 Seminar Program</a></li>
<li><a href='http://www.muhuk.com/2009/05/freedays09-videos/' rel='bookmark' title='Permanent Link: Freedays&#8217;09 Videos'>Freedays&#8217;09 Videos</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.muhuk.com/2010/02/top-5-untrends-according-to-me/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Discrimination</title>
		<link>http://www.muhuk.com/2010/02/discrimination/</link>
		<comments>http://www.muhuk.com/2010/02/discrimination/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 12:50:26 +0000</pubDate>
		<dc:creator>Atamert Ölçgen</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[choices]]></category>
		<category><![CDATA[discrimination]]></category>
		<category><![CDATA[free will]]></category>
		<category><![CDATA[kindness]]></category>
		<category><![CDATA[morality]]></category>

		<guid isPermaLink="false">http://www.muhuk.com/?p=335</guid>
		<description><![CDATA[I have wealthy friends, I have friends who are doing worse than me. Most of my friends are university graduates, some of them barely finished primary school. I don&#8217;t pay too much attention of their attractiveness but some of them ought to be more beautiful than others. Some of my friends speak with a clear, [...]]]></description>
			<content:encoded><![CDATA[<p>I have wealthy friends, I have friends who are doing worse than me. Most of my friends are university graduates, some of them barely finished primary school. I don&#8217;t pay too much attention of their attractiveness but some of them ought to be more beautiful than others. Some of my friends speak with a clear, good accent while others have strong eastern accents. You might find the way they speak funny. But I don&#8217;t. I make friends with people who are streetwise and resourceful. You might call some other friends of mine &#8220;mother&#8217;s darling&#8221;. Of all these things I have mentioned above; none of them factor in how close a friend is to me. I wouldn&#8217;t go so far as to say <em>I don&#8217;t care</em>. But they are definitely not determining factors for my friendships. I don&#8217;t discriminate people based on their social status, education, appearance, etc.</p>

<p>My relationship doesn&#8217;t go very far with somebody who is not a man of his word. My close friends are punctual, reliable and they keep their promises. I don&#8217;t hang out with snobs, envious, scornful people. But the most important qualities I look for in a friend is being cultivated and refined and open minded. I am attracted to people who has a spark in their eyes. You know, the opposite of being a zombie. I make very strong distinctions on these matters. Everybody wants to have nice friends. I&#8217;m a nazi about it. I&#8217;d rather not waste any time on shallow people and their silly affairs.</p>

<p>We live in a society where any and all kinds of discrimination is frowned upon. I call this &#8220;but he is a good guy&#8221; disorder. That <strong>but</strong> clearly indicates there is something <em>not good</em> about that guy, he is not all-good. Scrape any negative attribute off of people. Are we all equally honest? Are we all self-sacrificing and understanding? And then that guy is <strong>actually</strong> a very nice person. Very nice my ass.</p>

<p>Discrimination based on gender or color or whatever superficial feature is bad. Even kindergarden children know that. Not discriminating at all is idiotic at best and bad for the society at worst. You have to make a choice between people, you can&#8217;t be intimate with everybody. You better not base your choice on stupid criteria like coolness or popularity or, god forbid, assertiveness. This is the exact same mistake we make choosing our rulers&#8230; ehm, I mean political representatives.</p>

<p>This is not just about human beings. We need to pick out the good from bad when we are making spending decisions. I have seen <a href="http://amazon.imdb.com/title/tt1286537/">Food, Inc.</a> recently and it talks about this (near the end). Corporations hide behind many layers of obscurity and we don&#8217;t easily see how they are doing their business. To compound that we, as individuals, think ourselves as too small to matter against big companies. But the truth is the only thing we can do happens to be a very powerful way to send them a message. If a company is evil, don&#8217;t buy its product. You can&#8217;t do much else anyway, but this one act should be enough.</p>

<p>So, make a choice. Or not. Choice is yours.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.muhuk.com/2010/02/discrimination/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developing Reusable Django Apps: App Settings</title>
		<link>http://www.muhuk.com/2010/01/developing-reusable-django-apps-app-settings/</link>
		<comments>http://www.muhuk.com/2010/01/developing-reusable-django-apps-app-settings/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 10:09:27 +0000</pubDate>
		<dc:creator>Atamert Ölçgen</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[reusable]]></category>
		<category><![CDATA[settings]]></category>

		<guid isPermaLink="false">http://www.muhuk.com/?p=332</guid>
		<description><![CDATA[Eventually your app will need some sort of configuration. Supplying many parameters to customise your views, template tags and filters to allow template authors easily harness the power of your app and implementing registration pattern are all sensible things to do. But at some point you will need configuration for your app at project level. [...]]]></description>
			<content:encoded><![CDATA[<p>Eventually your app will need some sort of configuration. Supplying many parameters to customise your views, template tags and filters to allow template authors easily harness the power of your app and implementing registration pattern are all sensible things to do. But at some point you will need configuration for your app at project level. Because app level configuration is <del>stupid</del><a href="http://www.youtube.com/watch?v=A-S0tqpPga4">not reusable</a>. Consumers of your app should never have to change its source code. And what better place to put our configuration statements than <code>settings.py</code>? Remember; we want to make things easier for our app&#8217;s consumers, not harder. There is no need to add a new file to the project for a few lines of settings<sup>1</sup>.</p>

<p>We <a href="http://docs.djangoproject.com/en/dev/topics/settings/#using-settings-in-python-code">already know</a> we shouldn&#8217;t import <code>settings.py</code> directly. Instead we import the <code>settings</code> object (much like a singleton) of <a href="http://code.djangoproject.com/browser/django/trunk/django/conf/__init__.py"><code>django.conf</code></a> module:</p>

<pre><code>from django.conf import settings
</code></pre>

<p>Now you can access different configuration options as attributes on this object. But I suggest you to use <a href="http://docs.python.org/library/functions.html#getattr"><code>getattr()</code></a> in order to avoid getting <code>AttributeError</code>s. Also, notice how we <em>didn&#8217;t</em> hardcode the name of the attribute in the second method below:</p>

<pre><code># This is too verbose
try:
    some_setting = settings.SOME_SETTING
except AttributeError:
    some_setting = DEFAULT_VALUE

# Plain and simple
some_setting = getattr(settings, 'SOME_SETTING', DEFAULT_VALUE)
</code></pre>

<p>Instead of requiring consumers to define all your app settings it is better to supply sensible defaults. Also I find it useful to prefix names of app settings within <code>settings.py</code>.</p>

<pre><code># in settings.py
MYAPP_FOO_CHOICES = [('bar', u'Bar'), ('baz', u'Baz')]


# in myapp/models.py
from django.db import models
from django.conf import settings


FOO_CHOICES = getattr(settings, 'MYAPP_FOO_CHOICES', [('quux', u'Quux')])


class FooRecord(models.Model):
    foo = models.CharField(max_length=10, choices=FOO_CHOICES)
</code></pre>

<p>This works fine for simple apps with fewer settings. But it can easily get out of hand when your app grows. An <code>app_settings.py</code> module would help keeping track of configuration by keeping all configuration options in one place:</p>

<pre><code># in myapp/app_settings.py
from django.conf import settings


FOO_CHOICES = getattr(settings, 'MYAPP_FOO_CHOICES', [('quux', u'Quux')])


# in myapp/models.py
from django.db import models
from app_settings import FOO_CHOICES


class FooRecord(models.Model):
    foo = models.CharField(max_length=10, choices=FOO_CHOICES)
</code></pre>

<p>To summarize the points above:</p>

<ul>
<li>Import <code>settings</code> from <code>django.conf</code></li>
<li>Use <code>getattr()</code></li>
<li>Always supply a default value.</li>
<li>Prefix settings you made up in <code>settings.py</code></li>
<li>Use <code>app_settings.py</code> if you have many</li>
</ul>

<hr />

<p><strong>1</strong>: If your configuration is long, say more than 100 lines, you should step back and reconsider. Perhaps you should prefer a strategy similar to <code>django.contrib.sitemaps</code> or <code>django.contrib.syndication</code>.</p>


<p>Related posts:<ol><li><a href='http://www.muhuk.com/2010/01/developing-reusable-django-apps/' rel='bookmark' title='Permanent Link: Developing Reusable Django Apps'>Developing Reusable Django Apps</a></li>
<li><a href='http://www.muhuk.com/2010/03/developing-reusable-django-apps-signals/' rel='bookmark' title='Permanent Link: Developing Reusable Django Apps: Signals'>Developing Reusable Django Apps: Signals</a></li>
<li><a href='http://www.muhuk.com/2009/03/django-where-should-my-app-live/' rel='bookmark' title='Permanent Link: Django: Where Should My App Live'>Django: Where Should My App Live</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.muhuk.com/2010/01/developing-reusable-django-apps-app-settings/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quest For Ultimate Development/Deployment Toolset: Fabric, Pip &amp; Virtualenv</title>
		<link>http://www.muhuk.com/2010/01/quest-for-ultimate-developmentdeployment-toolset-fabric-pip-virtualenv/</link>
		<comments>http://www.muhuk.com/2010/01/quest-for-ultimate-developmentdeployment-toolset-fabric-pip-virtualenv/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 14:34:06 +0000</pubDate>
		<dc:creator>Atamert Ölçgen</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[fabric]]></category>
		<category><![CDATA[pip]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[virtualenv]]></category>

		<guid isPermaLink="false">http://www.muhuk.com/?p=324</guid>
		<description><![CDATA[DISCLAIMER: This post is a summary of my short experience with the tools mentioned. There is no flash news or revolutionary recipes. If you are familiar with them, you will probably find it boring. If you are not, this post might make your introduction less painful.

I stumbled upon this post following my frustration with setuptools [...]]]></description>
			<content:encoded><![CDATA[<p><em><strong>DISCLAIMER</strong>: This post is a summary of my short experience with the tools mentioned. There is no flash news or revolutionary recipes. If you are familiar with them, you will probably find it boring. If you are not, this post might make your introduction less painful.</em></p>

<p>I stumbled upon this <a href="http://clemesha.org/blog/2009/jul/05/modern-python-hacker-tools-virtualenv-fabric-pip/">post</a> following my frustration with <code>setuptools</code> after <code>virtualenv</code>ising <a href="http://www.telvee.com">telvee</a> repository. I have played with <a href="http://www.buildout.org/">buildout</a> to create repeatable deployments before. Don&#8217;t get me wrong, buildout is superb. But I have a few minor issues with it:</p>

<ul>
<li>Buildout can create an interpreter but the isolation from the host system is not a good as virtualenv. (Please correct me if I&#8217;m wrong)</li>
<li>Buildout is a dependency<sup>1</sup> whereas virtualenv is a system-wide tool.</li>
<li>It is, naturally, more work to set it up than a couple of ad-hoc bash scripts.</li>
</ul>

<p>None of these issues make buildout less awesome, I am just not comfortable enough with it. I am considering other alternatives and their strengths and weaknesses.</p>

<h3>Virtualenv</h3>

<p>I am quite comfortable with <a href="http://pypi.python.org/pypi/virtualenv">virtualenv</a>. It creates an isolated Python environment for you. For instance the following command will create an environment inside <code>test</code> directory that doesn&#8217;t have access to packages installed system-wide:</p>

<pre><code>~/$ virtualenv --no-site-packages test
</code></pre>

<p>That is of course when you activate the virtual environment with:</p>

<pre><code>~/$ cd test
~/test/$ source bin/activate
(test)~/test/$
</code></pre>

<p>Note the <code>(test)</code> prefix to your prompt. Any packages you install within this environment will be installed only for itself and won&#8217;t be available system-wide. If you have omitted <code>--no-site-packages</code> argument you could have access to globally installed packages too. When you are done with this virtual environment you can issue <code>deactivate</code> command to return to your normal shell. That&#8217;s basically what virtualenv does.</p>

<p>You can script virtualenv to a certain extend:</p>

<pre><code>#!/usr/bin/env bash

virtualenv $1
cd $1
source bin/activate

echo $PATH
echo $PYTHONPATH
</code></pre>

<p>Or you can create <a href="http://pypi.python.org/pypi/virtualenv#creating-your-own-bootstrap-scripts">bootstrap scripts</a> with virtualenv. Virtualenv doesn&#8217;t provide a clean and powerful enough API here, just a callback and two methods to modify commandline arguments.</p>

<p>Virtualenv is great at what it does. But I think setuptools as a package installer (and it&#8217;s just an installer, not a manager) cripples virtualenv. Good news is newer versions have a commandline argument <code>--distribute</code> that appereantly substitutes <a href="http://packages.python.org/distribute/">distribute</a> for setuptools.</p>

<h3>Pip</h3>

<p>My experiments with <a href="http://pip.openplans.org/">pip</a> went just fine. Except I bumped into <a href="http://stackoverflow.com/questions/1382925/virtualenv-no-site-packages-and-pip-still-finding-global-packages">this problem</a>. Globally installed pip was seeing system-wide packages when used on a virtual environment created with <code>--no-site-packages</code>. Again, good news is it is fixed in the trunk.</p>

<p>I will play with pip more once figure out how to best integrate the these applications.</p>

<h3>Fabric</h3>

<p>I see <a href="http://www.fabfile.org/">fabric</a> as the glue that binds everything together. I have known about it long before, but I never had the chance to experiment. I have read most of the documentation<sup>2</sup> and played with it a little. Basically the following script is an attempt to create a virtual environment and install pip and django on it, much like the shell script above:</p>

<pre><code>from __future__ import with_statement
import os
from fabric.api import *
from fabric import context_managers


def _get_virtualenv_location():
    location = prompt('New location: ', default='../test')
    env.envdir, env.envname = os.path.split(os.path.abspath(location))
    env.envpath = os.path.join(env.envdir, env.envname)
    print('using "%(envname)s" at "%(envdir)s" as virtualenv' % env)


def _virtualenv(command):
    with context_managers.cd(env.envpath):
        result = local('. bin/activate &amp;&amp; ' + command)
    return result


def clone():
    _get_virtualenv_location()
    with context_managers.cd(env.envdir):
        local('virtualenv --no-site-packages --clear %(envname)s' % env)
    print _virtualenv('echo $PATH')
    _virtualenv('easy_install pip')
    print _virtualenv('pip install django==1.1.1')
</code></pre>

<p>It took me a while to figure out how I can issue commands within a virtual environment. Since fabric commands don&#8217;t share state sourcing <code>activate</code> has no effect on subsequent commands. <a href="http://stackoverflow.com/questions/1180411/activate-a-virtualenv-via-fabric-as-deploy-user">This SO entry</a> helped me to write <code>_virtualenv()</code> function. It is kind of ugly making all functions but fab commands private. I think if fab used &#95;&#95;all&#95;&#95; or something similar it would be more <a href="http://www.python.org/dev/peps/pep-0020/">explicit</a>. Also a contrib module for virtualenv would be nice<sup>3</sup>.</p>

<p>Fabric has cool features such as <a href="http://docs.fabfile.org/0.9.0/usage/execution.html#failure-handling">failure handling</a> and <a href="http://docs.fabfile.org/0.9.0/api/contrib/files.html">code/config editing</a>. It is a great tool to create repeatable deployments. It feels great to be coding in python (well, to some extend). Perhaps the resulting code is a little too complex for local operations. I wish I could write a fab command that handles both local and remote deployments. I think it is not unusual to deploy on the same machine in another location. But having to SSH into <code>localhost</code> is weird, don&#8217;t you think?</p>

<p>I am sure there are better ways to accomplish the goal of the script above. Maybe there is an entirely different way to integrage fabric, virtualenv and pip. So, comments and suggestions are welcome as usual.</p>

<p>Maybe I&#8217;ll revisit buildout again as well.</p>

<hr />

<p><strong>1</strong>: You need to bootstrap (install) buildout with each development/deployment site.</p>

<p><strong>2</strong>: About one third of it I think.</p>

<p><strong>3</strong>: I would happily attempt one, once I learn fabric a little better.</p>


<p>Related posts:<ol><li><a href='http://www.muhuk.com/2009/05/sad-state-of-web-development-industry-in-turkiye/' rel='bookmark' title='Permanent Link: Sad State of Web Development Industry in Türkiye'>Sad State of Web Development Industry in Türkiye</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.muhuk.com/2010/01/quest-for-ultimate-developmentdeployment-toolset-fabric-pip-virtualenv/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Developing Reusable Django Apps</title>
		<link>http://www.muhuk.com/2010/01/developing-reusable-django-apps/</link>
		<comments>http://www.muhuk.com/2010/01/developing-reusable-django-apps/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 15:06:40 +0000</pubDate>
		<dc:creator>Atamert Ölçgen</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[reusable]]></category>

		<guid isPermaLink="false">http://www.muhuk.com/?p=320</guid>
		<description><![CDATA[Django app structure is an implementation of seperation of concerns. It is slightly different than what you can find in other MVC frameworks. The stack is split vertically, not horizontally. And then the app is split horizontally within, i.e. models, views, templates etc are in their seperate modules/packages/directories. This vertical splitting allows you to collect [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.muhuk.com/2009/03/django-where-should-my-app-live/">Django app structure</a> is an implementation of <a href="http://en.wikipedia.org/wiki/Separation_of_concerns">seperation of concerns</a>. It is slightly different than what you can find in other MVC frameworks. The stack is split vertically, not horizontally. And then the app is split horizontally within, i.e. models, views, templates etc are in their seperate modules/packages/directories. This vertical splitting allows you to collect all ingredients of one functionality in your <a href="http://www.b-list.org/weblog/2006/sep/10/django-tips-laying-out-application/">project</a> in one place.</p>

<p><a href="http://www.muhuk.com/wp-content/uploads/2010/01/django__developing_reusable_apps_1.png"><img src="http://www.muhuk.com/wp-content/uploads/2010/01/django__developing_reusable_apps_1.png" alt="Framework Structure" title="Framework Structure" width="580" height="350" class="size-full wp-image-318" /></a></p>

<p>I think apps<sup>1</sup> are one of the strong points of Django. A selling point if you like. There is a great ecosystem of apps, you can find an app for almost anything posssible with Python. And Python is kick-ass when it comes to library wealth. But there is another major advantage of apps when they&#8217;re done right; a sane code base. Here is a slide from the <a href="http://jacobian.org/speaking/oscon-2009/oscon/">Django in the Real World</a> presentation by Jacob Kaplan-Moss:</p>

<blockquote>
  <p>The fivefold path</p>
  
  <ul>
  <li>Do one thing, and do it well.</li>
  <li>Don’t be afraid of multiple apps.</li>
  <li>Write for ﬂexibility.</li>
  <li>Build to distribute.</li>
  <li>Extend carefully.</li>
  </ul>
</blockquote>

<p>I will focus on flexibility and interoperability of apps in this post. But before we proceed I would like to emphasize the first bullet point in the slide. Because the scope of your app plays a big role in its flexibility and interoperability. Apps should be small enough to easily understand and integrate (into a project). Many times I have moved away from an otherwise good app because of its many dependencies and/or excessive features. On the other hand apps should be big enough to allow for different configurations and allow extension without modifying their code. <em>Do one thing, and do it well</em>.</p>

<p><a href="http://www.muhuk.com/wp-content/uploads/2010/01/django__developing_reusable_apps_2.png"><img src="http://www.muhuk.com/wp-content/uploads/2010/01/django__developing_reusable_apps_2.png" alt="Scope of an app" title="Scope of an app" width="580" height="200" class="size-full wp-image-319" /></a></p>

<p>Take <a href="http://code.google.com/p/django-tagging/">django-tagging</a> for example; it&#8217;s 1.3 KLOC but it does tagging and nothing else. There are no dependencies other than Django, you can add tags to any model without modifying the model source, a tag can be associated with any type of model and <code>tagging</code> hides the gory details from you&#8230; In short; finding the right size is important. This is why <code>tagging</code> is <strong>the</strong> tagging app for Django.</p>

<h2>Building For Reuse</h2>

<p>General advice is &#8220;<em>even project specific apps should be reusable</em>&#8220;. Slapping the same app onto another project is not the only advantage. In fact it may not be possible if you are not in the habit of upgrading your whole project to recent versions of Django. The main advantage as I have said before is <em>sanity</em>. I prefer Django to other web frameworks/environments because it provides a civilized way of development. Let&#8217;s accept it; web programming is not a particularly interesting, exciting or intellectually rewarding field. You write the same piece of code over and over. And worst of all the challanges you face are actually a result of either the underlying system was designed by morons or you are trying to use it for something it&#8217;s not intended to be used. So it is only natural that web programmers feel they&#8217;re rusting. Django eases the pain. If you stick to certain conventions serenity will follow as well.</p>

<p>Naturally the framework does most of the work regarding app flexibility and interoperability. Take URLs for instance <code>include('myapp.urls')</code> and you are good to go. You don&#8217;t have to bind views one by one. Is it inflexible? Who said <code>urls.py</code> can only contain a hardcoded list of URLs. You can do anything that is possible with Python. You can generate different <code>urlpatterns</code> based on a setting for instance.</p>

<p>It is relatively easy and straightforward to reuse and extend forms and views (both function based and class based). Models are a little harder to get right though. You should always think of the most difficult situation which is you can&#8217;t touch either app&#8217;s code. Registration pattern of <a href="http://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-objects"><code>admin</code></a> app provides a good solution here. You can <code>register</code> a third party model to another third party app in just a few lines.</p>

<p>You don&#8217;t need to write lots of code to get the flexibility and interoperability. Well designed apps make good use of <code>settings.py</code> for example. Why should the project developer wrap a view when a single line assignment would do the job? Supplying good templatetags and template snipplets (includes) is another way to make things easy for app consumers.</p>

<p>Signals provide a great way to propagate the events generated from your app. Even though they are one way<sup>2</sup>, signals are extremely powerful. Any number of observers can connect to a signal and you can send a signal anywhere in your code. Literally. It is even possible your app suppying a signal and then another app sending it<sup>3</sup>.</p>

<p>There are many more ways to tame your app to be reusable. It all starts with your determination and discipline. Just like documentation, testing and maintaining a software generally. I will write more about reusable apps.</p>

<hr />

<p><strong>1</strong>: The word <strong>application</strong> is used both for a <strong>web application</strong> and a <strong>Django application</strong>. To avoid confusion I always use <strong>app</strong> to indicate the latter.</p>

<p><strong>2</strong>: Signals don&#8217;t have return values. But you can use a callback AFAIK.</p>

<p><strong>3</strong>: I can&#8217;t think of an example this would be useful, but still&#8230;</p>


<p>Related posts:<ol><li><a href='http://www.muhuk.com/2010/03/developing-reusable-django-apps-signals/' rel='bookmark' title='Permanent Link: Developing Reusable Django Apps: Signals'>Developing Reusable Django Apps: Signals</a></li>
<li><a href='http://www.muhuk.com/2010/01/developing-reusable-django-apps-app-settings/' rel='bookmark' title='Permanent Link: Developing Reusable Django Apps: App Settings'>Developing Reusable Django Apps: App Settings</a></li>
<li><a href='http://www.muhuk.com/2010/01/dynamic-translation-apps-for-django/' rel='bookmark' title='Permanent Link: Dynamic Translation Apps for Django'>Dynamic Translation Apps for Django</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.muhuk.com/2010/01/developing-reusable-django-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic Translation Apps for Django</title>
		<link>http://www.muhuk.com/2010/01/dynamic-translation-apps-for-django/</link>
		<comments>http://www.muhuk.com/2010/01/dynamic-translation-apps-for-django/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 18:48:59 +0000</pubDate>
		<dc:creator>Atamert Ölçgen</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[translation]]></category>

		<guid isPermaLink="false">http://www.muhuk.com/?p=313</guid>
		<description><![CDATA[When I needed multi-language flatpages and flatblocks for telvee I searched for available Django apps that do dynamic translation. By dynamic translation, I mean translations are entered and stored in the database. As I said I needed to be able to translate both full pages and chunks of text that I can include into another [...]]]></description>
			<content:encoded><![CDATA[<p>When I needed multi-language <code>flatpages</code> and <code>flatblocks</code> for <a href="http://www.telvee.com/">telvee</a> I searched for available Django apps that do dynamic translation. By dynamic translation, I mean translations are entered and stored in the database. As I said I needed to be able to translate both full pages and chunks of text that I can include into another page. I ended up rolling my own, which is without a doubt lesser to some apps below. I will try to imrove it with the good ideas from existing projects and then open source. Meanwhile I would like to share my review of 6 dynamic translation apps with you. I hope someone out there finds it useful.</p>

<h2>Django-multilingual</h2>

<p>One of the few active projects I have reviewed is <a href="http://code.google.com/p/django-multilingual/">django-multilingual</a>. To enable a model for translations you need to create a <code>Translation</code> inner-class and move translatable fields inside. Then a seperate model for those fields is created behind the scenes. Django-multilingual has admin integration and a multi-language flatpages app. Another nice thing about this app is that it&#8217;s using <a href="http://docs.djangoproject.com/en/dev/topics/signals/#topics-signals">signals</a> internally. The API is based on getter and setter methods. For instance you call <code>get_&lt;fieldname&gt;(language_id=None)</code> on your model to get the field value for the active translation. This app has no releases and less than satisfactory API documentation and has tests only on the example project.</p>

<h2>Django-pluggable-model-i18n</h2>

<p><a href="http://code.google.com/p/django-pluggable-model-i18n/">Django-pluggable-model-i18n</a> uses registration pattern of admin app. It creates an extra model for translated fields and stores translations of non-default languages in it. This app has no releases, no tests, no API documentation and it is clearly stated to be <strong>experimental</strong>. I would also like to note the last commit date is May 25, 2009.</p>

<h2>Django-modeltranslation</h2>

<p>Another app that implements registration pattern is <a href="http://code.google.com/p/django-modeltranslation/">django-modeltranslation</a>. The advantage of registration pattern is you don&#8217;t have to modify the code of the 3rd party apps you want to translate dynamically. But the database schema still needs to be modified if you are using django-modeltranslation. Also there is one <code>translations.py</code> for the project. I think one translation definition file per app would be better (just like admin does). Django-modeltranslation has intuitive underscore-language_code API but it is somewhat inconsistent; when you read the unsuffixed field you read the currently active language, when you write you write the default language specified in <code>settings.py</code>. Also the modified model stores some redundant data. For instance if your <code>DEFAULT_LANGUAGE</code> is <code>"ES"</code> both <code>&lt;fieldname&gt;</code> and <code>&lt;fieldname&gt;_es</code> columns will store the same value. Django-modeltranslation has admin integration and a management command to update database schema. Most importantly <strong>this app is the only one which has both tests and a release</strong>. (Unfortunately tests require specific settings to run)</p>

<h2>Transdb</h2>

<p><a href="http://code.google.com/p/transdb/">Transdb</a> takes a completely different approach to dynamic translation problem. It provides two new field types; <code>TransCharField</code> and <code>TransTextField</code>. Then it serializes all your translations within a single column for each field of those. This means <strong>no <code>JOIN</code>s and no extra queries</strong>. Unfortunately transdb doesn&#8217;t implement underscore-language_code API, you need to use <code>get_in_language()</code> and <code>set_in_language()</code> methods. Transdb has default widgets that render one form field for each language. Last commit date is Nov 07, 2008 and there is a release.</p>

<h2>Django-multilingual-model</h2>

<p>This one is not actually an app but just one module with <del>33</del> 42 lines of code. You need to define the model that holds translations manually. This introduces some code redundancy, since you also define which fields get translated in the original model. <a href="http://code.google.com/p/django-multilingual-model/">Django-multilingual-model</a> doesn&#8217;t implement any translation API, so it&#8217;s rather verbose to do anything with it. There are no tests and no releases. I simply don&#8217;t recommend django-multilingual-model for anything serious.</p>

<h2>Django-transmeta</h2>

<p><a href="http://code.google.com/p/django-transmeta/">Django-transmeta</a> stores translations in extra columns it creates in the original field&#8217;s table similar to django-modeltranslation. But you enable translation assigning a metaclass for your model and then add a <code>Meta</code> attribute; this means you can&#8217;t make models in existing apps translatable without modifying their code. Django-transmeta implements underscore-language_code API, has admin integration and a management command to sync database when you add new languages or translatable fields. There are documentation and code examples but no tests or releases. Last commit date it Nov 24, 2009.</p>

<div id="attachment_314" class="wp-caption aligncenter" style="width: 590px"><a href="http://www.muhuk.com/wp-content/uploads/2010/01/dynamic_translation_comparison.png"><img src="http://www.muhuk.com/wp-content/uploads/2010/01/dynamic_translation_comparison.png" alt="Comparison of Dynamic Translation Apps" title="Comparison of Dynamic Translation Apps" width="580" height="400" class="size-full wp-image-314" /></a><p class="wp-caption-text">Comparison of Dynamic Translation Apps</p></div>

<p>Software development is making choices. Would you rather have a clean and stable schema with an extra translations model or avoid extra <code>JOIN</code>s and denormalize translations onto your original model&#8217;s table? Both have advantages and disadvantages. But some choices are not based on trade-offs. Documentation, examples, tests and releases for instance. Also in my opinion underscore-language_code API is way better than any of the alternatives.</p>

<p>Django platform is a very powerful and intuitive one. Many people have moved in last year. This popularity affected app ecosystem as well. But unfortunately a significant number of those apps are half baked fire-and-forget type. I wish 2010 to be the year of a significant increase in software quality of Django apps. I&#8217;ll try to do my part.</p>


<p>Related posts:<ol><li><a href='http://www.muhuk.com/2010/01/developing-reusable-django-apps/' rel='bookmark' title='Permanent Link: Developing Reusable Django Apps'>Developing Reusable Django Apps</a></li>
<li><a href='http://www.muhuk.com/2010/03/developing-reusable-django-apps-signals/' rel='bookmark' title='Permanent Link: Developing Reusable Django Apps: Signals'>Developing Reusable Django Apps: Signals</a></li>
<li><a href='http://www.muhuk.com/2010/01/developing-reusable-django-apps-app-settings/' rel='bookmark' title='Permanent Link: Developing Reusable Django Apps: App Settings'>Developing Reusable Django Apps: App Settings</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.muhuk.com/2010/01/dynamic-translation-apps-for-django/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>ProFORMA: Probabilistic Feature-based On-line Rapid Model Acquisition</title>
		<link>http://www.muhuk.com/2009/11/proforma-probabilistic-feature-based-on-line-rapid-model-acquisition/</link>
		<comments>http://www.muhuk.com/2009/11/proforma-probabilistic-feature-based-on-line-rapid-model-acquisition/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 11:46:43 +0000</pubDate>
		<dc:creator>Atamert Ölçgen</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[3d reconstruction]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[share]]></category>
		<category><![CDATA[video tracking]]></category>

		<guid isPermaLink="false">http://www.muhuk.com/?p=310</guid>
		<description><![CDATA[I came across this amazing research project via @dogacan today. The technology described is a combination of video tracking and image-based reconstruction. Watch the video below, it&#8217;s awesome!



The final model has some minor artifacts (especially in concave sections) but very nice looking otherwise. I wonder how well it handles complex geometries and deep cavities.

They say, [...]]]></description>
			<content:encoded><![CDATA[<p>I came across this <a href="http://mi.eng.cam.ac.uk/~qp202/">amazing research project</a> via <a href="http://twitter.com/dogacan">@dogacan</a> today. The technology described is a combination of <a href="http://en.wikipedia.org/wiki/Video_tracking">video tracking</a> and <a href="http://en.wikipedia.org/wiki/3D_reconstruction">image-based reconstruction</a>. Watch the video below, it&#8217;s awesome!</p>

<p><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/vEOmzjImsVc&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/vEOmzjImsVc&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object></p>

<p>The final model has some minor artifacts (especially in concave sections) but very nice looking otherwise. I wonder how well it handles complex geometries and deep cavities.</p>

<p>They say, in <a href="http://mi.eng.cam.ac.uk/~qp202/">the project page</a>, there will be a Linux-based demo released in a few months. You can leave your e-mail there if you want to get notified.</p>


<p>Related posts:<ol><li><a href='http://www.muhuk.com/2009/10/science-fiction-text-to-movie/' rel='bookmark' title='Permanent Link: Science Fiction: Text-to-Movie'>Science Fiction: Text-to-Movie</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.muhuk.com/2009/11/proforma-probabilistic-feature-based-on-line-rapid-model-acquisition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XING Türkiye Social Media Win</title>
		<link>http://www.muhuk.com/2009/11/xing-turkiye-social-media-win/</link>
		<comments>http://www.muhuk.com/2009/11/xing-turkiye-social-media-win/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 12:41:39 +0000</pubDate>
		<dc:creator>Atamert Ölçgen</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[business]]></category>
		<category><![CDATA[competence]]></category>
		<category><![CDATA[kindness]]></category>
		<category><![CDATA[social media]]></category>
		<category><![CDATA[social network]]></category>

		<guid isPermaLink="false">http://www.muhuk.com/?p=306</guid>
		<description><![CDATA[I had a small issue with XING recently. I had reported this stupid message sent to an unrelated group. I&#8217;ll try to translate a snipplet below:


  I have sent XING two messages to cancel my account, I don&#8217;t want to be a member.
  
  I would like to take advantage of XING&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>I had a small issue with <a href="http://www.xing.com/">XING</a> recently. I had reported this stupid message sent to an unrelated group. I&#8217;ll try to translate a snipplet below:</p>

<blockquote>
  <p>I have sent XING two messages to cancel my account, I don&#8217;t want to be a member.</p>
  
  <p>I would like to take advantage of XING&#8217;s unique potential to bring people together, until they cancel my account, to help homeless children and elders.</p>
</blockquote>

<p>WTF! This was supposed to be a business related group. If anybody and their aunt will spam all 15k members; thank you, but no, thank you. So I did what any responsible user would do and used the report spam thingy.</p>

<p>Here is what I had hoped to happen; my report is stored somewhere. Other people flags this as well. When a critical number is reached a moderator reviews if the message is really spam and takes the appropriate action.</p>

<p>Here is what happened; an hour later or so I got an e-mail. It said &#8220;if you don&#8217;t want to receive messages from this person do yak yak yak&#8221;. King-size WTF.</p>

<ol>
<li>First of all I had already done that. He should have checked if I did before writing an e-mail.</li>
<li>More importantly, he should have checked my profile for a second. It says <code>programmer</code>. So, if I&#8217;m a programmer I am supposed to know a thing or two about these computer thingies, right? Clicking, double-clicking, expertise on check boxes and stuff. Telling me how to block a user is the same thing as saying &#8220;hey muhuk, you&#8217;re an idiot&#8221;. Even if we suppose there are such morons<sup>1</sup>, you still don&#8217;t have to tell it to their face. <strong>If you don&#8217;t have anything useful to say, don&#8217;t say nothing</strong>.</li>
</ol>

<p>As a result, I got pissed of and sent <a href="http://twitter.com/muhuk/statuses/5197560623">this tweet</a>:</p>

<blockquote>
  <p>XING Türkiye Support is clueless. Make sure you know who you&#8217;re e-mailing + take a moment to check if your advice has already been applied.</p>
</blockquote>

<p>This is not the end of the story though. I received an e-mail from <a href="https://www.xing.com/profile/Fusun_Karaman">XING Community Manager</a> yesterday. It was a very polite message containing the acknowledgement of both issues<sup>2</sup>. Nothing out of the ordinary at first sight. But wait, the message mentioned my tweet. In the very beginning. Actually the first word was &#8220;Twitter&#8221;. And it was concluded with something along the lines of &#8220;keep sharing your comments&#8221;.</p>

<p>Well, of course my comments and ideas are worthless. Especially since I&#8217;m not a very active XING user. But don&#8217;t miss the important point here: XING basically, via it&#8217;s community representative, says &#8220;you tweeted a negative tweet about us, but we are cool with that&#8221;. Why is it so important?</p>

<ol>
<li>They seem to be really cool about that. That means they understand social web. Conventional thinking is &#8220;I&#8217;d prefer you told this to me directly&#8221;, &#8220;we could have solved it between you and me&#8221;, &#8220;why do you shout, you make me look bad&#8221;. I have seen supposedly social media aware brands do this. It doesn&#8217;t look good. <strong>Trying to silence people is a horrible idea</strong>.</li>
<li>You can win people easily. Beautiful thing about Internet (and online services in particular) is that no party has too much power over the other. You can&#8217;t intimidate someone because she doesn&#8217;t like your services and writes about it. On the other hand she can&#8217;t do much damage<sup>3</sup>. So <strong>instead of freaking out, try to be nice and convert naysayers to evangelists</strong>.</li>
</ol>

<p>Most of the time complaining customers want to know there is someone who can see things from the right perspective. Someone reasonable, agreeable, fair. Most of the time that&#8217;s all that is needed to turn &#8220;&lt;your brand&gt; sucks&#8221; to &#8220;sh*t happens, no big deal&#8221;. My perception changed from &#8220;clueless&#8221; to &#8220;hmm, I guess that was a misstep of an individual&#8221; to &#8220;wow, appereantly XING Türkiye knows social web very well&#8221;. And all it took was a simple e-mail<sup>4</sup>. It&#8217;s not that difficult.</p>

<p>Kudos to XING for being a good web2.0 citizen.<sup>5</sup></p>

<hr />

<p><strong>1</strong>: I mean programmers who couldn&#8217;t figure out how to use a web GUI. People from other professions might not know these and that&#8217;s not necessarily their problem.</p>

<p><strong>2</strong>: What more could a user/customer hope other than <em>acknowledgement</em>? The message also contained an apology. But, I personally don&#8217;t think brands should apologize to their customers. Especially regarding to freemium services.</p>

<p><strong>3</strong>: This is true even for big players like TechCrunch.</p>

<p><strong>4</strong>: I bet it&#8217;s instantiated from a draft, everybody gets more or less the same message. This makes it even cooler though.</p>

<p><strong>5</strong>: And special thanks for making me feel like a jerk. Just kidding, feelings are for losers. <img src='http://www.muhuk.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>


<p>Related posts:<ol><li><a href='http://www.muhuk.com/2009/05/sad-state-of-web-development-industry-in-turkiye/' rel='bookmark' title='Permanent Link: Sad State of Web Development Industry in Türkiye'>Sad State of Web Development Industry in Türkiye</a></li>
<li><a href='http://www.muhuk.com/2008/09/social-networking-done-right/' rel='bookmark' title='Permanent Link: Social Networking Done Right'>Social Networking Done Right</a></li>
<li><a href='http://www.muhuk.com/2008/12/the-box-method-of-management/' rel='bookmark' title='Permanent Link: The Box Method of Management'>The Box Method of Management</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.muhuk.com/2009/11/xing-turkiye-social-media-win/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
