<?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:atom="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Technology Blog</title><link>http://mohtasham.info/blog/</link><description>A Blog For Technology, Programming and Linux</description><language>en-us</language><lastBuildDate>Sun, 26 Feb 2012 07:26:50 -0000</lastBuildDate><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/mohtasham/Whnn" /><feedburner:info uri="mohtasham/whnn" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><title>How to get Google Plus Invites</title><link>http://feedproxy.google.com/~r/mohtasham/Whnn/~3/ZtHNymClOT4/</link><description>&lt;p&gt;I just wanted to share my Google Plus invites to public. Simply click on the following link and you should be set:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://plus.google.com/_/notifications/ngemlink?path=%2F%3Fgpinv%3DhBfoPz01TKE%3AWlQAsBrmhMo"&gt;Get Google Plus Invites&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/6_mA69eqNQph_vzZn4QKpCxZ-Sw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6_mA69eqNQph_vzZn4QKpCxZ-Sw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/6_mA69eqNQph_vzZn4QKpCxZ-Sw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6_mA69eqNQph_vzZn4QKpCxZ-Sw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mohtasham/Whnn/~4/ZtHNymClOT4" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://mohtasham.info/article/how-to-get-google-plus-invite/</guid><feedburner:origLink>http://mohtasham.info/article/how-to-get-google-plus-invite/</feedburner:origLink></item><item><title>Block Selecting, The Killer Feature of Vim</title><link>http://feedproxy.google.com/~r/mohtasham/Whnn/~3/_FxhewoopXw/</link><description>&lt;p&gt;
Without any doubts Vim is one of the best and most efficient text editors, which comes with a lot of features.&lt;/p&gt;

&lt;p&gt;
The block selecting feature of Vim is one of the many features Vim has to offer that you cannot find in most GUI based text editors as far as I know. You can use Ctrl+v to select a block of text. Using this feature not only you can remove a block of text, but also to add certain text to the selected block. For example, suppose you need to remove "django", "HTTPSS", and "webint" from all 6 lines of the following piece of code and replace them by "django_new".
&lt;/p&gt;


&lt;pre class="brush: py"&gt;
from django.http import HttpResponseRedirect
from HTTPSS.core.mail import send_mail
from django.core import serializers
from webint.http import Http404
from django.http import HttpResponse
&lt;/pre&gt;

&lt;p&gt;
All you have to do is to place the cursor on line 1, column 6, and press Ctrl+v and select your block. By pressing x, you can delete that block from your code. In order to add "django_new" to every single line of that block, again you have to go to line 1, column 6, press Ctrl+v, select that block you want to add your new word to, press "I" and type your new word (in this case "django_new") and finally press Escape to see the magic. If you want to add a new word to the end of a selected block, you can press "A" after selecting the block instead of "I".
&lt;/p&gt;

&lt;p&gt;
To me this is the killer feature of Vim that I haven't seen in other text editors, yet. I just thought someone would probably find this technique useful. Please let me know what other features of Vim you find interesting by commenting on this article.
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Vsb8Pnxdzlel7SObNuUExHhd718/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Vsb8Pnxdzlel7SObNuUExHhd718/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Vsb8Pnxdzlel7SObNuUExHhd718/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Vsb8Pnxdzlel7SObNuUExHhd718/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mohtasham/Whnn/~4/_FxhewoopXw" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://mohtasham.info/article/block-selecting-killer-feature-vim/</guid><feedburner:origLink>http://mohtasham.info/article/block-selecting-killer-feature-vim/</feedburner:origLink></item><item><title>How to Make a Quick Django Website For Mobile</title><link>http://feedproxy.google.com/~r/mohtasham/Whnn/~3/jpxfetH7n80/</link><description>&lt;p&gt;
I was really bored at the Christmas night, so I decided to create the mobile version of my Django based weblog real quick. 
&lt;/p&gt;

&lt;p&gt;
First I added a mobile detector middleware to the list of my middlewares on settings. I grabbed a nice middle ware from &lt;a href="http://djangosnippets.org/snippets/2001/"&gt;here&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
Then I created new templates for the mobile version. I could easily use my current templates with doing a few hacks here and there, but I wanted to make my mobile templates using html5 and CSS3 only. &lt;a href="http://net.tutsplus.com/tutorials/html-css-techniques/html-5-and-css-3-the-techniques-youll-soon-be-using/"&gt;Here&lt;/a&gt; is a nice &lt;a href="http://net.tutsplus.com/tutorials/html-css-techniques/html-5-and-css-3-the-techniques-youll-soon-be-using/"&gt;article&lt;/a&gt; on that.
&lt;/p&gt;

&lt;p&gt;One thing you really have to pay attention when making your html templates is the use of a meta tag called &lt;strong&gt;viewprint&lt;/strong&gt;. If you use this meta tag on your page, users won't need to zoom in to read the content, as everything should be big enough to be read.
&lt;/p&gt;

&lt;pre class="brush: html"&gt;
&lt;meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=yes"/&gt;
&lt;/pre&gt;

&lt;p&gt;
Using the content attribute you can specify the width of the page. You can use any number you like, but I recommend using device-width, as it makes the width of your page the same as user's device. All the other attributes are self-explanatory and are optional.
&lt;/p&gt;

&lt;p&gt;
If you're using a non-mobile browser, you won't be able to see this page on mobile, unless you change your browser agent. However, the following mobile page can be viewed using regular browsers if you're interested to see how the html looks like.
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://mohtasham.info/resume-mobile/"&gt;http://mohtasham.info/resume-mobile/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I took three screenshots of my website using the Android emulator:&lt;/p&gt;

&lt;p&gt;
&lt;img src="/site_media/pictures/home.jpg" width="280" alt="home"/&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;img src="/site_media/pictures/blog.jpg" width="280" alt="blog"/&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;img src="/site_media/pictures/blog2.jpg" width="280" alt="blog2"/&gt;
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/SJgBqR8LJzi4M6MzrsgqtwEC_tk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SJgBqR8LJzi4M6MzrsgqtwEC_tk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/SJgBqR8LJzi4M6MzrsgqtwEC_tk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SJgBqR8LJzi4M6MzrsgqtwEC_tk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mohtasham/Whnn/~4/jpxfetH7n80" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://mohtasham.info/article/how-make-quick-django-website-mobile/</guid><feedburner:origLink>http://mohtasham.info/article/how-make-quick-django-website-mobile/</feedburner:origLink></item><item><title>Google Chrome OS, Useful or Useless?</title><link>http://feedproxy.google.com/~r/mohtasham/Whnn/~3/STFhOiquvt4/</link><description>&lt;p&gt;
A few days ago Comcast did a favor for me and stopped transferring network packets from the Internet to my house. This frustrating moment of my life lasted for quite a few hours. Fortunately, I had some unwatched movies on my computer to catch up with. 
&lt;/p&gt;

&lt;p&gt;
After Comcast started to feed me fresh packets from Google, Youtube, my website, and many other APPROPRIATE websites, I started to think about what I would be doing if I had a Google Chrome OS? Would I be even able to log in to my computer? I guess not.  
&lt;/p&gt;

&lt;p&gt;
You can find high speed Internet in almost every household in advanced countries. With the appearance of 3G and 4G networks, you can stay online anywhere you go. However, I don't think Internet availability at home is anywhere near that of electricity. Because of that, I doubt that anyone at home will use Google Chrome OS as their main computer.
&lt;/p&gt;

&lt;p&gt;
Then I thought about the use of Google Chrome OS in enterprise. What would happen to a Chrome OS powered enterprise if the Internet is not working? Are employees going to take the day off? It may seem that this issue makes Chrome OS the worst possible choice for enterprise; however, one should keep in mind that most enterprises' functionality heavily depends on the Internet. Having no active connection to the internet equals a big disaster for them, regardless of their choice of operating system. 
&lt;/p&gt;

&lt;p&gt;
I think Chrome OS could be used in certain enterprises due to its low price in comparison to Windows and Mac computers. However, in order to become a major player in enterprise, it needs to stand out from other more flexible Linux operating systems that are available for free. 
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ZXe4kqLZ5V0iup3iCKf76AtmFv0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ZXe4kqLZ5V0iup3iCKf76AtmFv0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ZXe4kqLZ5V0iup3iCKf76AtmFv0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ZXe4kqLZ5V0iup3iCKf76AtmFv0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mohtasham/Whnn/~4/STFhOiquvt4" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://mohtasham.info/article/google-chrome-os-useful-or-useless/</guid><feedburner:origLink>http://mohtasham.info/article/google-chrome-os-useful-or-useless/</feedburner:origLink></item><item><title>Using Custom Fonts in CSS</title><link>http://feedproxy.google.com/~r/mohtasham/Whnn/~3/0-cVa8vnnvI/</link><description>&lt;p&gt;
There are many browsers under different platforms that one can use to connect to the Internet. In order to make a web application compatible with all platforms, one is limited to only use common techniques that are supported by all clients.
&lt;/p&gt;

&lt;p&gt;
Fonts are one of the properties that vary in different operating systems. In order to dictate a client to use a certain font, you can use the following method:
&lt;/p&gt;

&lt;pre class="brush: css"&gt;
@font-face {
font-family: Bellerose;
     src: url(path-to-your-special-font/Bellerose.ttf);
}

p {
     font-family: Bellerose;
}
&lt;/pre&gt;

&lt;p&gt;
Using @font-face you can describe the properties of your desired font. font-family lets you define a custom name for your fonts, while src is the source of your font. 
&lt;/p&gt;

&lt;p&gt;
Note that, clients have to download this font in order to display elements whose font-family properties are assigned to this custom font. Depending on the size of the font, your page load will slow down, however, it is a perfect way of replacing images in menus and logos. 
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/AJPifud4-LpmmJJiAKVhOQBLjBw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AJPifud4-LpmmJJiAKVhOQBLjBw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/AJPifud4-LpmmJJiAKVhOQBLjBw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AJPifud4-LpmmJJiAKVhOQBLjBw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mohtasham/Whnn/~4/0-cVa8vnnvI" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://mohtasham.info/article/using-custom-fonts-css/</guid><feedburner:origLink>http://mohtasham.info/article/using-custom-fonts-css/</feedburner:origLink></item><item><title>My Thoughts on Ubuntu 10.10</title><link>http://feedproxy.google.com/~r/mohtasham/Whnn/~3/m9eeoFko27g/</link><description>&lt;p&gt;Ubuntu 10.10 was finally released on 10/10/10 as promised. I did a system upgrade on my 5 years old Dell Latitude laptop from 10.04 and did a fresh installation of it on my friend's Gateway Netbook.&lt;/p&gt;

&lt;p&gt;
I have been using Ubuntu since Ubuntu 6.10 on my Dell laptop. My impression of 10.10 was pretty much like my other impressions on every new versions of Ubuntu. The best thing I like about this version and 10.04 version which didn't exist on previous versions is the default theme. I have to admit that Ubuntu team did a great job on creating the default theme. I am even trying to make my Arch Linux desktop computer look similar to Ubuntu's default interface.
&lt;/p&gt;

&lt;p&gt;I was not that much impressed by the new Software Center, as I usually install everything on command line (That's the only way of doing it on Arch). However, my friend who is using a Linux based operating system for the first time, is very happy about it. Creating a software center like that is a huge step towards making Ubuntu, an operating system for average users.&lt;/p&gt;

&lt;p&gt;
Ubuntu one music store and online storage services are other nice feature of Ubuntu which has been existing since Ubuntu 10.04. I heard Canonical is even trying to make a windows client for those services. But I guess making it available for other distributions should have a higher priority. I'm not sure about other distros, but I'm almost sure that there's no official package for those services on Arch repository. 
&lt;/p&gt;

&lt;p&gt;
The netbook edition is now the default graphical environment for netbooks. It was the first time I used the netbook edition and I really like the idea. However, I think this environment is not mature enough, yet. It is not as user friendly as I was expecting and has performance issue compared to the desktop edition of gnome. I recommend using the desktop environment for now till the next version, when this environment becomes more mature. 
&lt;/p&gt;

&lt;p&gt;
One thing I didn't like about the new Ubuntu is the lack of multi touch support on my friend's Netbook. Multi touch support is disabled by default and you cannot enable it. The bad thing about it is that when you try to use multi touch, the mouse pointer gets crazy and goes to random places. 
&lt;/p&gt;

&lt;p&gt;
One thing I wasn't expecting from Ubuntu was the efficient power management. I had read about the new improvement on power management on new Kernel, but I wasn't expecting it to be this efficient. My friend's Netbook can work for 8 hours, which is pretty much the same amount as the default Windows 7. 
&lt;/p&gt;

&lt;p&gt;
I am overally satisfied with Ubuntu 10.10 for the 7 days I have been using it. Ubuntu will be the operating system of my choice if I get a new computer. I strongly recommend upgrading to 10.10 version, if you haven't already done it. 

&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/zXW6eAxWmxNg_KGH4Fu_MkCszmw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zXW6eAxWmxNg_KGH4Fu_MkCszmw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/zXW6eAxWmxNg_KGH4Fu_MkCszmw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zXW6eAxWmxNg_KGH4Fu_MkCszmw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mohtasham/Whnn/~4/m9eeoFko27g" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://mohtasham.info/article/my-thoughts-ubuntu-1010/</guid><feedburner:origLink>http://mohtasham.info/article/my-thoughts-ubuntu-1010/</feedburner:origLink></item><item><title>Future of Skype on Android in Danger</title><link>http://feedproxy.google.com/~r/mohtasham/Whnn/~3/Hj-lj3IMO8U/</link><description>&lt;p&gt;
With no doubts, Skype provides the best VoIP service in the market. Their quality of voice and video conferencing is amazing. They have come up with interesting features such as Skype In and Skype Out. They also have a relatively good support for Linux desktop. With all that said, Skype has been my favorite VoIP provider for 6 years. However, I'm not sure if I keep using it as much as I did before, because of their limited mobile versions.
&lt;/p&gt;

&lt;p&gt;
Like any other major company, Skype has developed the mobile version of its software for various smartphones. As an Android user, I was very excited when I found out that there's an Android app called Skype Lite in the market. My huge excitement changed to a major disappointment when I found out you cannot use Wi-Fi when using Skype Lite on Android. Using Skype over 3G doesn't make sense at all to me. The whole point of using Skype is to take advantage of its excellent voice quality, which is only guaranteed on a high speed Wi-Fi network.
&lt;/p&gt;

&lt;p&gt;
As Google came up with the new feature to make free phone calls directly from Gmail(synced with Google Voice), it is very predictable that they will release the Android version in future as well.
&lt;/p&gt;

&lt;p&gt;
If Skype doesn't enable the Wi-Fi option for Android users any time soon, it's going to lose its market share to Google, because of well integration of GV on Android phones. Enabling the Wi-Fi option not only increases the competition in VoIP industry, but also makes Verizon and other providers to reduce their rates to satisfy their customers. 
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/EIxj-kTlP3StEUweKDU8AwqcmMA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EIxj-kTlP3StEUweKDU8AwqcmMA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/EIxj-kTlP3StEUweKDU8AwqcmMA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EIxj-kTlP3StEUweKDU8AwqcmMA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mohtasham/Whnn/~4/Hj-lj3IMO8U" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://mohtasham.info/article/future-skype-android-danger/</guid><feedburner:origLink>http://mohtasham.info/article/future-skype-android-danger/</feedburner:origLink></item><item><title>Moonlight vs Flash - on Linux Support</title><link>http://feedproxy.google.com/~r/mohtasham/Whnn/~3/fBKBAsG57Kk/</link><description>&lt;p&gt;
Microsoft Silverlight is the biggest competitor of Adobe Flash. One of the biggest advantages of Flash over Silverlight was its Linux support. But things are getting changed now. The &lt;a href="http://www.go-mono.com/moonlight/"&gt;Moonlight&lt;/a&gt; is the open source project that tries to implement MS Silverlight on Linux. Even though Moonlight doesn't provide a full support of Silverlight, however, it's been doing a great job on that recently.
&lt;/p&gt;

&lt;p&gt;
I always had to switch back to Windows to watch my favorite club games which was broadcasted only on Silverlight. I had moonlight plugin installed on Firefox, but for some reason it didn't show anything. Today I just went to that website on Firefox and noticed it was asking me to install a new plugin for it. I installed the new Moonlight plugin for Firefox and all of a sudden I was able to watch my game on my Arch Linux which means I don't need to switch to Windows anymore.
&lt;/p&gt;

&lt;p&gt;
You can watch Flash videos on Linux, too. But the reason I am very disappointed with them is their lack of support for 64 bit architectures on their newest products. They &lt;a href="http://labs.adobe.com/technologies/flashplayer10/64bit.html"&gt;stopped&lt;/a&gt; developing Flash for Linux on 64 bit architectures a while ago, which left 64 bit Linux users with an insecure Flash installed on their computers that freezes on full screen mode occasionally. 

&lt;/p&gt;

&lt;p&gt;
The good news about Flash I found out today, is that they have developed a new Flash player for 64 bit architectures for all operating systems called &lt;a href="http://labs.adobe.com/technologies/flashplayer10/"&gt;Square&lt;/a&gt;. I really hope it does a good job, because Moonlight still requires EULA for Audio codecs. 
&lt;/p&gt;

&lt;p&gt;
With Adobe providing better support for 64 bit architecture and Silverlight providing better support for Linux, we have to see a healthy competition in future between two of them. However, if Moonlight really wants to compete with Adobe, they have to get rid of the EULA ASAP.
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/GAQLj1xraD3jqgIAd17BEpA9MJs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/GAQLj1xraD3jqgIAd17BEpA9MJs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/GAQLj1xraD3jqgIAd17BEpA9MJs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/GAQLj1xraD3jqgIAd17BEpA9MJs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mohtasham/Whnn/~4/fBKBAsG57Kk" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://mohtasham.info/article/moonlight-support-linux-vs-flash/</guid><feedburner:origLink>http://mohtasham.info/article/moonlight-support-linux-vs-flash/</feedburner:origLink></item><item><title>4 Reasons Why Digg V4 Sucks</title><link>http://feedproxy.google.com/~r/mohtasham/Whnn/~3/kbbXTs9cgUc/</link><description>&lt;!--e751bd054be946808f681f8ab0d33ba8--&gt;
&lt;p&gt;
The new &lt;a href="http://digg.com"&gt;Digg&lt;/a&gt; has been around for couple of days. There are a lot of major changes in the new version and as any other website that go under changes, it received a lot of criticism from users. I always get excited when a website, software, or any other thing comes with new features, but the story is completely different with the new &lt;a href="http://digg.com"&gt;Digg&lt;/a&gt; and I wished I could still use the older version.
&lt;/p&gt;

&lt;p&gt;Here are 5 reasons why I think the new &lt;a href="http://digg.com"&gt;Digg&lt;/a&gt; sucks:&lt;/p&gt;

&lt;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;h3&gt;1. Goodbye to content submitted by users&lt;/h3&gt;
The whole point of Digg was for users to submit their stories so that other people could find obscure, but interesting content on the internet. In the new Digg, you see many links from major websites such as &lt;a href="http://www.engadget.com/"&gt;engadget&lt;/a&gt;, &lt;a href="http://mashable.com/"&gt;mashable&lt;/a&gt;, etc. If anyone wants to read stories from major websites, they can either go to those websites directly or subscribe to their feeds.
&lt;/li&gt;

&lt;li&gt;
&lt;h3&gt;2. Nothing works&lt;/h3&gt;
I have tried many times to Digg a story up, to write a comment, or to load comments with no luck. What were those engineers doing in the testing stage? Digg's QA team sucks big time.
&lt;/li&gt;

&lt;li&gt;
&lt;h3&gt;3. Subcategories are gone&lt;/h3&gt;
I am a big fan of the Linux, and programming sections under technology category. Sometimes I just want to see Linux related stories and don't really care about how to jailbreak iPhone 4. They seriously have to get those sub categories back.
&lt;/li&gt;

&lt;li&gt;
&lt;h3&gt;4. The Android App is not functioning anymore&lt;/h3&gt;
I don't know what they did to their APIs, but I'm damn sure that the new changes made their Android App unusable as well. Let me know if you saw any content on your Android app.
&lt;/li&gt;
&lt;/ul&gt;

&lt;/p&gt;

&lt;p&gt;
I am a big &lt;a href="http://digg.com"&gt;Digg&lt;/a&gt; fan, but I'm switching to &lt;a href="http://reddit.com"&gt;Reddit&lt;/a&gt; for now till they fix above issues.
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/9H4mjQnsqdjiC9WBVlsossSt0h0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9H4mjQnsqdjiC9WBVlsossSt0h0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/9H4mjQnsqdjiC9WBVlsossSt0h0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9H4mjQnsqdjiC9WBVlsossSt0h0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mohtasham/Whnn/~4/kbbXTs9cgUc" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://mohtasham.info/article/4-reasons-why-digg-v4-sucks/</guid><feedburner:origLink>http://mohtasham.info/article/4-reasons-why-digg-v4-sucks/</feedburner:origLink></item><item><title>Android 2.2 (Froyo) on Motorola Droid Review</title><link>http://feedproxy.google.com/~r/mohtasham/Whnn/~3/Rw35V-tSR4A/</link><description>&lt;p&gt;
I was waiting for Verizon to upgrade the original Motorola Droid phones to Android 2.2.  I was aware that I could do that by rooting my phone, but I didn't really need any of rooting features. All I cared about is stability and performance, so I didn't touch my phone. &lt;p&gt;

&lt;p&gt;
Finally a few days ago Verizon upgraded my Droid to Android 2.2. I was very excited about it and immediately installed &lt;a href="http://code.google.com/p/chrometophone/"&gt;Chrome-To-Phone&lt;/a&gt; app on it. This app is a very cool one, like most other Apps from Google. 
&lt;/p&gt;

&lt;h3&gt;Pros:&lt;/h3&gt;

&lt;p&gt;
The best thing I noticed about it was the overall speed improvement of the entire phone. Every app opens instantly on my Droid now. The next good thing is the ability of installing apps on SD Card which enables users to have more apps on their phones. 
&lt;/p&gt;

&lt;h3&gt;Cons:&lt;/h3&gt;
&lt;p&gt;
Froyo has a lot of nice features, but it has a major problem. It uses a lot of resources which leads to faster battery discharge. Every time I kill running apps, I get a lot of free space. But upon using an app, those background tasks start working again. I don't even need the majority of them, such as corporate calendar. 
&lt;/p&gt;

&lt;p&gt;
One of the most disappointing feature of Froyo is lack of support for Persian, Arabic, or other similar languages. I was really expecting Froyo to support Persian, but Google really disappointed me. Froyo only shows disconnected Persian letters instead of Squares in previous versions. Hopefully Google will fix this issue in future. 
&lt;/p&gt;

&lt;h3&gt;Conclusions:&lt;/h3&gt;
&lt;p&gt;
Froyo comes with a lot of pros and cons, but I tried to cover the major ones only. The overall improvement in speed is neutralized by the high battery usage of the phone. With all that said, I recommend using Android 2.2 because of its cool minor features compared to previous versions.
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/M7LQ9HWHfYdRrHHDzFgWYMGOKmE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/M7LQ9HWHfYdRrHHDzFgWYMGOKmE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/M7LQ9HWHfYdRrHHDzFgWYMGOKmE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/M7LQ9HWHfYdRrHHDzFgWYMGOKmE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mohtasham/Whnn/~4/Rw35V-tSR4A" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://mohtasham.info/article/android-22-froyo-motorola-droid-review/</guid><feedburner:origLink>http://mohtasham.info/article/android-22-froyo-motorola-droid-review/</feedburner:origLink></item><item><title>5 tips and tricks to speed up your bash experience</title><link>http://feedproxy.google.com/~r/mohtasham/Whnn/~3/rEFhyJZ1oMk/</link><description>&lt;p&gt;
Sometimes performing certain tasks on command line could be time consuming. This article introduces you to five tricks that can speed up your experience with bash. This article is mostly for new Linux users, but experienced users may find some of them interesting.
&lt;/p&gt;

&lt;ol&gt;
     &lt;li&gt; &lt;strong&gt;Executing commands in history using Ctrl+r&lt;/strong&gt;&lt;br/&gt;
          Just press Ctrl+R and start typing a command that you executed a while ago. It will automatically shows you the exact command.&lt;br/&gt;
          &lt;strong&gt;Example:&lt;/strong&gt;&lt;br/&gt;
          If you have used a long command to create a backup of your database using mysqldump command and you need to executed it again, all you need to do is to press Ctrl+R and type "dump". Your full command will appear. Now you can press enter to execute the command again. 

     &lt;/li&gt;

     &lt;li&gt; &lt;strong&gt;Clearing your command using Ctrl+u &lt;/strong&gt;&lt;br/&gt;
     Sometimes you're writing a long command, but instead of executing it, you want to clear it. You can press Ctrl+u to do so. This command is particularly useful when you enter a wrong password and want to start writing it from the beginning.
     &lt;/li&gt; 

     &lt;li&gt; &lt;strong&gt;Finding a keyword using / in man page &lt;/strong&gt;&lt;br/&gt;
     You have probably seen a lot of long man pages. Sometimes you're looking for certain keywords in them. Just press / and start typing your search and press enter. Pressing n will take you to the next occurrence of that keyword and N will take you back. This feature is similar to that of vim.
     &lt;/li&gt;           

       &lt;li&gt; &lt;strong&gt;Creating a multiple hierarchy directory using mkdir -p option &lt;/strong&gt;&lt;br/&gt;
         You can create a directory using mkdir. However, if the directory you're creating is going to be in a directory hierarchy that doesn't exist, instead of creating every single of them you can make them all at once using mkdir -p option.&lt;br/&gt;
     &lt;strong&gt;Example:&lt;/strong&gt;&lt;br/&gt;
     mkdir dir1/dir2/dir3/dir4 &lt;br/&gt;
     This command will create dir1, dir2, dir3 if they don't exist before it creates dir4. Hopefully, you won't create each of such directories using a separate command from now on.
     &lt;/li&gt; 

     &lt;li&gt; &lt;strong&gt;Running a command on multiple files using for loop.&lt;/strong&gt;&lt;br/&gt;
          Suppose you have more than 100 files in a directory and you need to do something with all of them. You can use the for loop command to perform an action on them. The syntax is the following:&lt;br/&gt;
&lt;strong&gt;     for file in directory; do command $file any-extra-parameter-if-necessary; done
&lt;/strong&gt;     &lt;strong&gt;Example:&lt;/strong&gt;&lt;br/&gt;
     Suppose you have a few hundred pictures in a directory and you need to reduce their size by half. Instead of opening them one by one using your favorite image editor, you can issue the following command to convert all the jpg files in pics directory:&lt;br/&gt;
&lt;strong&gt;     for file in pics/*.jpg; do convert -resize 50% $file; done&lt;br/&gt;
&lt;/strong&gt;
     &lt;/li&gt; 
&lt;/ol&gt;

&lt;!--01429577638a4e0ea6cc814a1cfdbdd2--&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/NSfTqSmHqGQVqsqcOPt8BETuNuo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NSfTqSmHqGQVqsqcOPt8BETuNuo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/NSfTqSmHqGQVqsqcOPt8BETuNuo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NSfTqSmHqGQVqsqcOPt8BETuNuo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mohtasham/Whnn/~4/rEFhyJZ1oMk" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://mohtasham.info/article/5-tips-and-tricks-speed-your-bash-experience/</guid><feedburner:origLink>http://mohtasham.info/article/5-tips-and-tricks-speed-your-bash-experience/</feedburner:origLink></item><item><title>Google Voice At Its Finest</title><link>http://feedproxy.google.com/~r/mohtasham/Whnn/~3/Scj1MKk0lLI/</link><description>&lt;p&gt;
I receive daily calls from recruiters. The other day one of the recruiters left me a voice message which really shocked me for a moment. 
&lt;/p&gt;

&lt;p&gt;
Click on the picture to see it in original size.
&lt;/p&gt;

&lt;p&gt;
&lt;a href="http://mohtasham.info/site_media/pictures/google_voice.jpg"&gt;&lt;img width="500" src="http://mohtasham.info/site_media/pictures/google_voice.jpg" alt="Google Voice At its finest" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/3-UL6tbaLIYFMGBxaJrcPw_Kfvc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3-UL6tbaLIYFMGBxaJrcPw_Kfvc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/3-UL6tbaLIYFMGBxaJrcPw_Kfvc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3-UL6tbaLIYFMGBxaJrcPw_Kfvc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mohtasham/Whnn/~4/Scj1MKk0lLI" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://mohtasham.info/article/google-voice-its-finest/</guid><feedburner:origLink>http://mohtasham.info/article/google-voice-its-finest/</feedburner:origLink></item><item><title>Top 4 Android Apps for Linux Lovers</title><link>http://feedproxy.google.com/~r/mohtasham/Whnn/~3/4Iv1tZetL7k/</link><description>&lt;p&gt;
Android is getting more popular everyday as you hear new android powered smartphones coming to market more than ever. Since Android is made on top of Linux kernel it is very popular among Linux lovers. There are many useful and interesting apps on the market, but not all of them are as interesting as the following apps for Linux enthusiasts:
&lt;/p&gt;

&lt;h3&gt;&lt;a href="http://www.androlib.com/android.application.info-lamatricexiste-network-zizt.aspx"&gt;4. Network Discovery&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;
As the name stats, this app is a network discovery tool. This app can be the &lt;a href="http://nmap.org/"&gt;nmap&lt;/a&gt; of your phone. It can discover all the available computers on your network and scan their open ports.
&lt;/p&gt;
&lt;h4&gt;Pros:&lt;/h4&gt;
&lt;p&gt;
Simple and straightforward design.
&lt;/p&gt;
&lt;p&gt;
&lt;h4&gt;Cons:&lt;/h4&gt; 
&lt;p&gt;Having a few more options such as scanning ephemeral ports would be nice. I still wish I could have &lt;a href="http://nmap.org/"&gt;nmap&lt;/a&gt; on my phone though.
&lt;/p&gt;



&lt;h3&gt;&lt;a href="http://h0lger.de/android-amarok2-remote/"&gt;3. Amarok2 Remote&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;
We all know that iPhone users can remotely control iTune on their desktop computers using their iPhones. &lt;a href="http://amarok.kde.org/"&gt;Amarok&lt;/a&gt;, the most popular music player on Linux, provides the same functionality in a slightly different manner. 
&lt;/p&gt;
&lt;h4&gt;Pros:&lt;/h4&gt;
&lt;p&gt;
Easy plugin setup on your computer. Extremely fast. Ability of skipping forward and rewind in a song is also very great. 
&lt;/p&gt;
&lt;h4&gt;Cons:&lt;/h4&gt; 
&lt;p&gt;
None.
&lt;/p&gt;



&lt;h3&gt;&lt;a href="http://code.google.com/p/azilink/"&gt;2. AziLink&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;
AziLink is a USB tethering application for your android phones. You won't find it on android market, but you can go &lt;a href="http://www.humans-enabled.com/2009/12/how-to-tether-your-verizon-droid-as.html"&gt;here&lt;/a&gt; to read the instruction of installing it on your phone and getting it work on&lt;a href="http://www.ubuntu.com"&gt;Ubuntu&lt;/a&gt;.
&lt;/p&gt;
&lt;h4&gt;Pros:&lt;/h4&gt;
&lt;p&gt;
Great functionality. 
&lt;/p&gt;
&lt;h4&gt;Cons:&lt;/h4&gt; 
&lt;p&gt;
Hard to setup.
&lt;/p&gt;



&lt;h3&gt;&lt;a href="http://code.google.com/p/connectbot/"&gt;1. ConnectBot&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;
For Linux lovers there's nothing sexier than having SSH access to remote machines. According to the project's website "ConnectBot is a Secure Shell client for the Android platform. Its ultimate goal is to create a secure connection through which you can use a shell on a remote machine and transfer files back and forth to your phone.".
&lt;/p&gt;
&lt;h4&gt;Pros:&lt;/h4&gt;
&lt;p&gt;
Lots of configuration options. Shortcut keys.
&lt;/p&gt;
&lt;h4&gt;Cons:&lt;/h4&gt; 
&lt;p&gt;
None
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/vvpLCKJ-uEqlb6-ewVSLtC9vdqo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vvpLCKJ-uEqlb6-ewVSLtC9vdqo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/vvpLCKJ-uEqlb6-ewVSLtC9vdqo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vvpLCKJ-uEqlb6-ewVSLtC9vdqo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mohtasham/Whnn/~4/4Iv1tZetL7k" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://mohtasham.info/article/top-4-android-apps-linux-lovers/</guid><feedburner:origLink>http://mohtasham.info/article/top-4-android-apps-linux-lovers/</feedburner:origLink></item><item><title>Surfing The Web Through SSH on Windows</title><link>http://feedproxy.google.com/~r/mohtasham/Whnn/~3/m-MUcX1ds_w/</link><description>&lt;p&gt;
Sometimes you're using the Internet on an untrusted network, or sometimes your Internet provider won't let you access certain websites, just like what the Iranian and Chinese governments do. The simplest solution to bypass those restrictions and surf the web safely is to use SSH. However, &lt;strong&gt;this method is only possible if you have access to a remote machine, running SSH server. &lt;/strong&gt;
&lt;/p&gt;

&lt;p&gt;
First thing you need to do is to &lt;a href="http://www.google.com/search?sourceid=chrome&amp;ie=UTF-8&amp;q=how+to+install+ssh+server+linux"&gt;install&lt;/a&gt; SSH server on a linux machine and create a user that can access that machine remotely.
&lt;/p&gt;

&lt;p&gt;
Next you have to forward SSH port to your machine in your router configuration. Since different routers have different configuration system, you need to &lt;a href="http://www.google.com/search?hl=en&amp;safe=off&amp;q=router+port+forwarding+ssh&amp;aq=f&amp;aqi=g1&amp;aql=&amp;oq=&amp;gs_rfai="&gt;figure that out&lt;/a&gt; by yourself.
&lt;/p&gt;

&lt;p&gt;
Once you're done with SSH port forwarding, you need to find out about your public IP address. You can easily find it by going to &lt;a href="http://www.whatismyip.com"&gt;www.whatismyip.com&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
To make sure it's working try to access it from your Linux server by issuing the following command:
&lt;li class='code'&gt;ssh username@ip-address-you-found-from-whatismyip.com&lt;/li&gt;
&lt;/p&gt;

&lt;p&gt;
Once you were able to connect to your computer through the public IP, it's time to configure the windows client. First thing you need is to install &lt;a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html"&gt;putty&lt;/a&gt;. After you installed putty, run it. Enter the public IP address you found earlier and the port of your SSH server (The default is 22).
&lt;/p&gt;

&lt;p&gt;
Then on the left panel click on SSH and then Tunnels. Then write a port number inside  source port such as 9090. Leave the destination port empty and make sure to check dynamic and auto option right below it. Press Add. Now you should see the D9090 on the list.
&lt;/p&gt;

&lt;p&gt;
Go back to session by clicking on it on the left panel. Enter a name for your session and save it. Then double click on the recently created session. A black screen will pop out and will ask you for your login name. Enter the login name assigned to you on the SSH server. Then enter your password. Note that in Unix/Linux environment when you enter passwords, you won't see anything happening (No * when you type your password). For the first time, putty will warn you about possible security issues, which you need to ignore and continue. 
&lt;/p&gt;

&lt;p&gt;
Welcome to remote Linux machine. In order to make sure if you're connected to the remote server, write &lt;li class="code"&gt;w&lt;/li&gt; and make sure it returns your login name.
&lt;/p&gt;

&lt;p&gt;
Right now, you're connected to remote machine through a SSH tunnel. Now we need to tell our apps to use this tunnel. That is, we open &lt;a href="http://www.mozilla.com/en-US/firefox/firefox.html"&gt;Firefox&lt;/a&gt;. Then from the tools menu, go to option -&gt; general and then click on connection settings. Select manual proxy configuration and enter the following information in corresponding fields:
&lt;/p&gt;

&lt;p&gt;
&lt;li class="code"&gt;SOCKS Host: 127.0.0.1&lt;/li&gt;
&lt;li class="code"&gt;Port: 9090&lt;/li&gt;
&lt;li class="code"&gt;No Proxy For: localhost, 127.0.0.1&lt;/li&gt;
&lt;/p&gt;

&lt;p&gt;
Once you entered those information try to go to &lt;a href="http://www.whatismyip.com"&gt;www.whatismyip.com&lt;/a&gt;. If you've configured everything correctly, you should be able to see the same IP address you tried to connect to remote machine.
&lt;/p&gt;

&lt;p&gt;
Surfing the web using this method is not as fast as surfing it directly. However, it will provide you additional security if you don't trust your network. It can also be used to visit websites that are restricted by your ISP. 
&lt;/p&gt;
&lt;p&gt;
Note that some advanced routers have built in SSH server. If you happen to own one of them, you don't need to install SSH server on a Linux machine or do the port forwarding part.
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/TPyKtzIp5FgIpM6jQNGlwsDGUpM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/TPyKtzIp5FgIpM6jQNGlwsDGUpM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/TPyKtzIp5FgIpM6jQNGlwsDGUpM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/TPyKtzIp5FgIpM6jQNGlwsDGUpM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mohtasham/Whnn/~4/m-MUcX1ds_w" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://mohtasham.info/article/surfing-web-through-ssh-windows/</guid><feedburner:origLink>http://mohtasham.info/article/surfing-web-through-ssh-windows/</feedburner:origLink></item><item><title>Serializing Foreign Key in Django Model</title><link>http://feedproxy.google.com/~r/mohtasham/Whnn/~3/ycH1rchYm6M/</link><description>&lt;p&gt;
Django comes with a powerful serialization mechanism to convert your models to XML, JSON, YAML, and even python objects. However, the default serializer won't serialize the entire fields of another model if a foreign key field is pointing to it.
&lt;/p&gt;

&lt;p&gt;
Django 1.2 introduced &lt;a href="http://docs.djangoproject.com/en/dev/topics/serialization/#natural-keys"&gt;natural keys&lt;/a&gt; to address this issue, but if you cannot change your foreign key class like the default User authentication class, you won't have any option but do create a subclass of Serializer module and override handle_fk_field method in it. 
&lt;/p&gt;

&lt;p&gt;
The following is an example of overriding handle_fk_field method for serializing the username field instead of user_field field.
&lt;/p&gt;

&lt;pre class="brush: py"&gt;
# Serializing ForeignKey in Django

class SerializersUser(Serializer):
     def handle_fk_field(self, obj, field):
     """
     Called to handle a ForeignKey (we need to treat them slightly
     differently from regular fields).
     """
         self._start_relational_field(field)
         related = getattr(obj, field.name)
         if related is not None:
             if self.use_natural_keys and hasattr(related, 'natural_key'):
                 # If related object has a natural key, use it
                 related = related.natural_key()
                 # Iterable natural keys are rolled out as subelements
                 for key_value in related:
                     self.xml.startElement("natural", {})
                     self.xml.characters(smart_unicode(key_value))
                     self.xml.endElement("natural")
             else:
                 if field.rel.field_name == related._meta.pk.name:
                     # Obtain username field instead of the PK field.
                     related = getattr(related, "username")
                 else:
                     # Related to remote object via other field
                     related = getattr(related, field.rel.field_name)
                 self.xml.characters(smart_unicode(related))
         else:
             self.xml.addQuickElement("None")
         self.xml.endElement("field")
&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ruAr8-vVAp0r_btXM-dTNCL3Xyc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ruAr8-vVAp0r_btXM-dTNCL3Xyc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ruAr8-vVAp0r_btXM-dTNCL3Xyc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ruAr8-vVAp0r_btXM-dTNCL3Xyc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/mohtasham/Whnn/~4/ycH1rchYm6M" height="1" width="1"/&gt;</description><guid isPermaLink="false">http://mohtasham.info/article/serializing-foreign-key-django-model/</guid><feedburner:origLink>http://mohtasham.info/article/serializing-foreign-key-django-model/</feedburner:origLink></item></channel></rss>

