<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;CkcCR3s_eCp7ImA9WhRaFE8.&quot;"><id>tag:blogger.com,1999:blog-27937362</id><updated>2012-02-16T11:21:06.540-08:00</updated><category term="Visual Studio" /><category term="Twitter" /><category term="Performance" /><category term="durpal" /><category term="SQL" /><category term="MapReduce" /><category term="AJAX" /><category term="Acrobat" /><category term="Store Procedures" /><category term="struts2" /><category term="??" /><category term="ASP.NET" /><category term="NodeJs" /><category term="MongoDB" /><category term="Visual Studio 2008" /><category term="Chrome" /><category term="CSV Strings" /><category term="Bulk" /><category term="python" /><category term="Null coalescing operator" /><category term="FxCop" /><category term="Multi-Threading" /><category term="windows" /><category term="TFoot" /><category term="JSON" /><category term="eval()" /><category term="InboundLinks" /><category term="Yahoo" /><category term=".NET 2.0" /><category term=".NET 3.5" /><category term="Multiple Rows" /><category term="FireFox" /><category term="Adobe" /><category term="facebook" /><category term="LINQ" /><category term="Social Search" /><category term="Bitwise OR" /><category term="MySQL" /><category term="MSN" /><category term="Javascript" /><category term="Messenger" /><category term="XStream" /><category term="GridView" /><category term="Gmail" /><category term="XML" /><category term="GO" /><category term="Tips" /><category term="SEO Score" /><category term="MS SQL" /><category term="Java" /><category term="API" /><category term="Google" /><category term="Objects" /><category term="CouchDB" /><category term="C#" /><category term="HubSpot" /><category term="SEO" /><category term="XPath" /><category term="Functional Programming" /><category term="Properties" /><category term="SEO Badge" /><category term="unix" /><category term="HTML" /><category term="THead" /><category term="SiteExplorer" /><category term="log4net" /><category term="Website Grader" /><category term="SQLXML" /><category term="schema sync" /><category term="Enum" /><category term="SAAS" /><category term=".NET" /><category term="Erlang" /><title>Mohamed Faramawi Blog</title><subtitle type="html">Declare Mohamed Mustafa Faramawi as Software Engineer</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://mohamedfaramawi.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://mohamedfaramawi.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Mohamed Faramawi</name><uri>https://profiles.google.com/100471942283885376322</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-ukSmQFO8wvU/AAAAAAAAAAI/AAAAAAAAAEg/4QuYlGFllzg/s512-c/photo.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>105</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/MohamedFaramawi" /><feedburner:info uri="mohamedfaramawi" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;CEEDQn8_eip7ImA9WhdWFUg.&quot;"><id>tag:blogger.com,1999:blog-27937362.post-289518292517837617</id><published>2011-09-09T00:17:00.000-07:00</published><updated>2011-09-09T00:17:53.142-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-09T00:17:53.142-07:00</app:edited><title>iPhone 3G/4G tester - online website test emulator with flip</title><content type="html">&lt;div&gt;Test how your website will look when viewed with iPhone&lt;/div&gt;&lt;a href="http://iphonetester.com/"&gt;iPhone 3G/4G tester - online website test emulator with flip&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27937362-289518292517837617?l=mohamedfaramawi.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MohamedFaramawi/~4/P1VXvMdsqEE" height="1" width="1"/&gt;</content><link rel="related" href="http://iphonetester.com/" title="iPhone 3G/4G tester - online website test emulator with flip" /><link rel="replies" type="application/atom+xml" href="http://mohamedfaramawi.blogspot.com/feeds/289518292517837617/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=27937362&amp;postID=289518292517837617" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/289518292517837617?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/289518292517837617?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MohamedFaramawi/~3/P1VXvMdsqEE/iphone-3g4g-tester-online-website-test.html" title="iPhone 3G/4G tester - online website test emulator with flip" /><author><name>Mohamed Faramawi</name><uri>https://profiles.google.com/100471942283885376322</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-ukSmQFO8wvU/AAAAAAAAAAI/AAAAAAAAAEg/4QuYlGFllzg/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://mohamedfaramawi.blogspot.com/2011/09/iphone-3g4g-tester-online-website-test.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU8MQ3wzcSp7ImA9WhdXEEo.&quot;"><id>tag:blogger.com,1999:blog-27937362.post-2025679008964408379</id><published>2011-08-22T21:31:00.000-07:00</published><updated>2011-08-22T21:31:22.289-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-22T21:31:22.289-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="NodeJs" /><title>Implement Inheritance in NodeJs</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I'm learning Nodejs these days , and coming from an OOP background, i tend to get things done closer to how i'm doing there.&lt;br /&gt;
&lt;br /&gt;
So I wanted all my Nodejs objects to inherit from a base object , that provide utilities common to every other thing .. this is in OOP known as inheritance.&lt;br /&gt;
&lt;br /&gt;
In JavaScript world class/inheritance isn't&amp;nbsp;officially&amp;nbsp;a feature of the language, but its doable, for example the following JavaScript method copies the prototype of one object to another,&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:js"&gt;function inherit (parent, descendant) {
                var sConstructor = parent.toString();
		var aMatch = sConstructor.match(/\s*function (.*)\(/);
		if(aMatch != null) {
			descendant.prototype[aMatch[1]] = parent;
		}
		for(var m in parent.prototype) {
			descendant.prototype[m] = parent.prototype[m];
		}
&lt;/pre&gt;The result of this method is, all functions&amp;nbsp;implemented by the parent will now be added to the&amp;nbsp;descendant.&lt;br /&gt;
&lt;br /&gt;
Fine so far, now how to get this done in Nodejs.&lt;br /&gt;
&lt;br /&gt;
NodeJs combine/organize code into what so called "Modules" , and each module should export (the term used by Nodejs) an object that reference the methods defined in the module.&lt;br /&gt;
&lt;br /&gt;
So for example, we will have a module named "baseObject" defined as follows :&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:js"&gt;var util = require('util');
var base = function() {}

base.prototype = {
	asString : function() {
		return util.inspect(this, true, null);
	}
}
module.exports = base;
&lt;/pre&gt;&lt;br /&gt;
&amp;nbsp;This module defined an object called base, that have a single method called "asString()" which simply dumps a string&amp;nbsp;representation&amp;nbsp;of the object using Nodejs "util.inspect" method , and we export this object .&lt;br /&gt;
&lt;br /&gt;
And we have another object called "settings" that also needs to define a method "asString()" to dump the string&amp;nbsp;representation&amp;nbsp;of that object ,&amp;nbsp;defiantly&amp;nbsp;the proper way to do this in Java is to have "settings" inherit from "base" , but how to do so in Nodejs , here is how :&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:js"&gt;var obj = require("./utils/objectUtils.js");// Defines "inherit" method
var base = require("./utils/baseObject.js");// Holds "asString()" method that we want "settings" to inherit it.
var settings = function() {
	this.x=1;
        this.y=2
}
// Inheirt from the base object 
obj.inherit(base,settings);
module.exports = new settings();
&lt;/pre&gt;&lt;br /&gt;
So what did we do is , before we export the module , we called the method "inherit" to copy the prototype of "base" class into "settings" class.&lt;br /&gt;
&lt;br /&gt;
This will result having the following code simply works :&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:js"&gt;var settings=require('./settings.js');
console.log(settings.asString());
&lt;/pre&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27937362-2025679008964408379?l=mohamedfaramawi.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MohamedFaramawi/~4/JyYefTOt2xw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mohamedfaramawi.blogspot.com/feeds/2025679008964408379/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=27937362&amp;postID=2025679008964408379" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/2025679008964408379?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/2025679008964408379?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MohamedFaramawi/~3/JyYefTOt2xw/implement-inheritance-in-nodejs.html" title="Implement Inheritance in NodeJs" /><author><name>Mohamed Faramawi</name><uri>https://profiles.google.com/100471942283885376322</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-ukSmQFO8wvU/AAAAAAAAAAI/AAAAAAAAAEg/4QuYlGFllzg/s512-c/photo.jpg" /></author><thr:total>1</thr:total><georss:featurename>Banha, Qulubiya, Egypt</georss:featurename><georss:point>30.460001500702223 31.18330000000003</georss:point><georss:box>30.385935000702222 31.09223600000003 30.534068000702224 31.27436400000003</georss:box><feedburner:origLink>http://mohamedfaramawi.blogspot.com/2011/08/implement-inheritance-in-nodejs.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08GQHs8cSp7ImA9WhdXEEo.&quot;"><id>tag:blogger.com,1999:blog-27937362.post-7321558143959845102</id><published>2011-08-22T20:57:00.000-07:00</published><updated>2011-08-22T20:57:01.579-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-22T20:57:01.579-07:00</app:edited><title>7 Free E-Books and Tutorials for Learning and Mastering Node.js</title><content type="html">&lt;a href="http://www.readwriteweb.com/hack/2011/04/6-free-e-books-on-nodejs.php"&gt;7 Free E-Books and Tutorials for Learning and Mastering Node.js&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27937362-7321558143959845102?l=mohamedfaramawi.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MohamedFaramawi/~4/BGAwGwgtO3o" height="1" width="1"/&gt;</content><link rel="related" href="http://www.readwriteweb.com/hack/2011/04/6-free-e-books-on-nodejs.php" title="7 Free E-Books and Tutorials for Learning and Mastering Node.js" /><link rel="replies" type="application/atom+xml" href="http://mohamedfaramawi.blogspot.com/feeds/7321558143959845102/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=27937362&amp;postID=7321558143959845102" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/7321558143959845102?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/7321558143959845102?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MohamedFaramawi/~3/BGAwGwgtO3o/7-free-e-books-and-tutorials-for.html" title="7 Free E-Books and Tutorials for Learning and Mastering Node.js" /><author><name>Mohamed Faramawi</name><uri>https://profiles.google.com/100471942283885376322</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-ukSmQFO8wvU/AAAAAAAAAAI/AAAAAAAAAEg/4QuYlGFllzg/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://mohamedfaramawi.blogspot.com/2011/08/7-free-e-books-and-tutorials-for.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkcMSH8_eip7ImA9WhdQGE0.&quot;"><id>tag:blogger.com,1999:blog-27937362.post-7707697303205373984</id><published>2011-08-19T18:34:00.000-07:00</published><updated>2011-08-19T18:34:49.142-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-19T18:34:49.142-07:00</app:edited><title>The Node Beginner Book » A comprehensive Node.js tutorial</title><content type="html">&lt;a href="http://nodebeginner.org/#head4"&gt;The Node Beginner Book » A comprehensive Node.js tutorial&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27937362-7707697303205373984?l=mohamedfaramawi.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MohamedFaramawi/~4/biH4VJTuEvY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mohamedfaramawi.blogspot.com/feeds/7707697303205373984/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=27937362&amp;postID=7707697303205373984" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/7707697303205373984?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/7707697303205373984?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MohamedFaramawi/~3/biH4VJTuEvY/node-beginner-book-comprehensive-nodejs.html" title="The Node Beginner Book » A comprehensive Node.js tutorial" /><author><name>Mohamed Faramawi</name><uri>https://profiles.google.com/100471942283885376322</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-ukSmQFO8wvU/AAAAAAAAAAI/AAAAAAAAAEg/4QuYlGFllzg/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://mohamedfaramawi.blogspot.com/2011/08/node-beginner-book-comprehensive-nodejs.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEYNR3o7eSp7ImA9WhdTF0k.&quot;"><id>tag:blogger.com,1999:blog-27937362.post-4787408625366374144</id><published>2011-07-15T09:09:00.000-07:00</published><updated>2011-07-15T09:09:56.401-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-15T09:09:56.401-07:00</app:edited><title>Nagstamon : Nagios Windows Desktop Integration/ Status Monitor Utility</title><content type="html">Nagstamon is a utility that sets at your system tray in Windows listening for your Nagios alerts , incredibly helpful if you don't want to set looking at your Email all the time.&lt;div&gt;&lt;a href="http://nagstamon.ifw-dresden.de/"&gt;http://nagstamon.ifw-dresden.de/&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27937362-4787408625366374144?l=mohamedfaramawi.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MohamedFaramawi/~4/UZnaURm4R9M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mohamedfaramawi.blogspot.com/feeds/4787408625366374144/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=27937362&amp;postID=4787408625366374144" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/4787408625366374144?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/4787408625366374144?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MohamedFaramawi/~3/UZnaURm4R9M/nagstamon-nagios-windows-desktop.html" title="Nagstamon : Nagios Windows Desktop Integration/ Status Monitor Utility" /><author><name>Mohamed Faramawi</name><uri>https://profiles.google.com/100471942283885376322</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-ukSmQFO8wvU/AAAAAAAAAAI/AAAAAAAAAEg/4QuYlGFllzg/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://mohamedfaramawi.blogspot.com/2011/07/nagstamon-nagios-windows-desktop.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck4GQHo-eip7ImA9WhdTFkQ.&quot;"><id>tag:blogger.com,1999:blog-27937362.post-1540333276183895149</id><published>2011-07-14T17:48:00.000-07:00</published><updated>2011-07-14T17:48:41.452-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-14T17:48:41.452-07:00</app:edited><title>Getting full process name in Linux</title><content type="html">"ps: commands doesn't display the full name of the process with command line run arguments to get over this you can either :&lt;br /&gt;
&lt;br /&gt;
1- Get it from &amp;nbsp;/proc/&lt;pid&gt;/cmdline&lt;/pid&gt;&lt;br /&gt;
2- using either htop (required to be installed) , and scroll horizontally.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27937362-1540333276183895149?l=mohamedfaramawi.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MohamedFaramawi/~4/Cqyh5JNpRig" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mohamedfaramawi.blogspot.com/feeds/1540333276183895149/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=27937362&amp;postID=1540333276183895149" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/1540333276183895149?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/1540333276183895149?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MohamedFaramawi/~3/Cqyh5JNpRig/getting-full-process-name-in-linux.html" title="Getting full process name in Linux" /><author><name>Mohamed Faramawi</name><uri>https://profiles.google.com/100471942283885376322</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-ukSmQFO8wvU/AAAAAAAAAAI/AAAAAAAAAEg/4QuYlGFllzg/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://mohamedfaramawi.blogspot.com/2011/07/getting-full-process-name-in-linux.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEYARn8zeyp7ImA9WhdTFUg.&quot;"><id>tag:blogger.com,1999:blog-27937362.post-4150469990062187115</id><published>2011-07-13T03:15:00.000-07:00</published><updated>2011-07-13T03:15:47.183-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-13T03:15:47.183-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="durpal" /><title>Fixing "Your system or network configuration does not allow Drupal to access web pages" on Windows</title><content type="html">I've installed Durpal for the first time today , and the status report was showing this message&lt;br /&gt;
&lt;br /&gt;
"Your system or network configuration does not allow Drupal to access web pages"&lt;br /&gt;
&lt;br /&gt;
Fixing that requires editing /system32/drivers/etc/hosts to like :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# localhost name resolution is handled within DNS itself.&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;127.0.0.1 &amp;nbsp; &amp;nbsp; &amp;nbsp; localhost&lt;br /&gt;
#&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;::1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; localhost&lt;br /&gt;
&lt;br /&gt;
The default was&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# localhost name resolution is handled within DNS itself.&lt;br /&gt;
#&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;127.0.0.1 &amp;nbsp; &amp;nbsp; &amp;nbsp; localhost&lt;br /&gt;
#&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;::1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; localhost&lt;br /&gt;
&lt;br /&gt;
This also caused the website to sped up dramatically .&lt;br /&gt;
&lt;br /&gt;
For more possible solutions check out&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://drupal.org/node/222454"&gt;http://drupal.org/node/222454&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27937362-4150469990062187115?l=mohamedfaramawi.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MohamedFaramawi/~4/XqKI1mGBt4s" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mohamedfaramawi.blogspot.com/feeds/4150469990062187115/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=27937362&amp;postID=4150469990062187115" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/4150469990062187115?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/4150469990062187115?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MohamedFaramawi/~3/XqKI1mGBt4s/fixing-your-system-or-network.html" title="Fixing &quot;Your system or network configuration does not allow Drupal to access web pages&quot; on Windows" /><author><name>Mohamed Faramawi</name><uri>https://profiles.google.com/100471942283885376322</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-ukSmQFO8wvU/AAAAAAAAAAI/AAAAAAAAAEg/4QuYlGFllzg/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://mohamedfaramawi.blogspot.com/2011/07/fixing-your-system-or-network.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkQAR3Y_eCp7ImA9WhZaGUo.&quot;"><id>tag:blogger.com,1999:blog-27937362.post-6223829071304918516</id><published>2011-07-06T09:39:00.000-07:00</published><updated>2011-07-06T09:39:06.840-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-06T09:39:06.840-07:00</app:edited><title>What is the difference between Git Commit and Git Push</title><content type="html">&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Git Commit , is used to push your changes to your local repository.&lt;/div&gt;&lt;div&gt;Git Push, is used to push changes from your local repository to the remote repositories.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For more understand read, &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href="http://gitready.com/beginner/2009/01/21/pushing-and-pulling.html"&gt;git ready » pushing and pulling&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27937362-6223829071304918516?l=mohamedfaramawi.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MohamedFaramawi/~4/J8_pJbyy1fY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mohamedfaramawi.blogspot.com/feeds/6223829071304918516/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=27937362&amp;postID=6223829071304918516" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/6223829071304918516?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/6223829071304918516?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MohamedFaramawi/~3/J8_pJbyy1fY/what-is-difference-between-git-commit.html" title="What is the difference between Git Commit and Git Push" /><author><name>Mohamed Faramawi</name><uri>https://profiles.google.com/100471942283885376322</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-ukSmQFO8wvU/AAAAAAAAAAI/AAAAAAAAAEg/4QuYlGFllzg/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://mohamedfaramawi.blogspot.com/2011/07/what-is-difference-between-git-commit.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkUFQnk6cCp7ImA9WhZaGU4.&quot;"><id>tag:blogger.com,1999:blog-27937362.post-1556658319008641138</id><published>2011-07-05T22:30:00.000-07:00</published><updated>2011-07-05T22:30:13.718-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-05T22:30:13.718-07:00</app:edited><title>Git, SSH, PuTTY, GitHub, Unfuddle, Getting Them To Work on Windows</title><content type="html">&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href="http://devlicio.us/blogs/sergio_pereira/archive/2009/05/06/git-ssh-putty-github-unfuddle-the-kitchen-sink.aspx"&gt;Git, SSH, PuTTY, GitHub, Unfuddle, the kitchen sink - Sergio Pereira - Devlicio.us - Just the Tasty Bits&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27937362-1556658319008641138?l=mohamedfaramawi.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MohamedFaramawi/~4/BVicE6an3Q8" height="1" width="1"/&gt;</content><link rel="related" href="http://devlicio.us/blogs/sergio_pereira/archive/2009/05/06/git-ssh-putty-github-unfuddle-the-kitchen-sink.aspx" title="Git, SSH, PuTTY, GitHub, Unfuddle, Getting Them To Work on Windows" /><link rel="replies" type="application/atom+xml" href="http://mohamedfaramawi.blogspot.com/feeds/1556658319008641138/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=27937362&amp;postID=1556658319008641138" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/1556658319008641138?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/1556658319008641138?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MohamedFaramawi/~3/BVicE6an3Q8/git-ssh-putty-github-unfuddle-getting.html" title="Git, SSH, PuTTY, GitHub, Unfuddle, Getting Them To Work on Windows" /><author><name>Mohamed Faramawi</name><uri>https://profiles.google.com/100471942283885376322</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-ukSmQFO8wvU/AAAAAAAAAAI/AAAAAAAAAEg/4QuYlGFllzg/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://mohamedfaramawi.blogspot.com/2011/07/git-ssh-putty-github-unfuddle-getting.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkUMQnY8eip7ImA9WhZaGU8.&quot;"><id>tag:blogger.com,1999:blog-27937362.post-8057215814795843002</id><published>2011-07-05T20:51:00.000-07:00</published><updated>2011-07-05T20:51:23.872-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-05T20:51:23.872-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="python" /><title>Installing Both Python 2.5 And Python 2.6 on Windows Box</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&amp;nbsp;I needed to have both &lt;a href="http://www.python.org/download/releases/2.5/"&gt;python 2.5&lt;/a&gt; and &lt;a href="http://www.python.org/download/releases/2.6/"&gt;python 2.6&lt;/a&gt; installed on my development box &amp;nbsp;(windows 7) , both to be used , and to&amp;nbsp;simplify&amp;nbsp;things for my self , i wanted to be able to run from command line&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: #ffe599;"&gt;&lt;span class="Apple-style-span" style="color: #0c343d;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #0c343d;"&gt;python26 xyz.py &amp;nbsp;to run a python script with Python 2.6&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #0c343d;"&gt;python25 xyz.py to run a python script with Python 2.5&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
So here is what i've done :&lt;br /&gt;
1- Installed Python 2.6 , and on the installation wizard i unchecked the "Register Extensions" option.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-kgmyRLKzqGk/ThPZcBvckCI/AAAAAAAAADU/m10mtDVG9co/s1600/PythonInstallation.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-kgmyRLKzqGk/ThPZcBvckCI/AAAAAAAAADU/m10mtDVG9co/s1600/PythonInstallation.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
2- Installed Python 2.5 , and did the same for the "Register Extensions" option.&lt;br /&gt;
&lt;br /&gt;
3- Created a new folder called it "PythonRunner".&lt;br /&gt;
&lt;br /&gt;
4- Added &lt;a href="http://en.wikipedia.org/wiki/Symbolic_link"&gt;Symlinks&lt;/a&gt; for both python 2.6 , and python 2.5 , called them python26, python25.&lt;br /&gt;
&lt;a href="http://technet.microsoft.com/en-us/library/cc753194(WS.10).aspx"&gt;mklink&lt;/a&gt; python26.exe D:\python26\python.exe&lt;br /&gt;
&lt;a href="http://technet.microsoft.com/en-us/library/cc753194(WS.10).aspx"&gt;mklink&lt;/a&gt; python25.exe D:\python25\python.exe&lt;br /&gt;
&lt;br /&gt;
5- Added the folder "PythonRunner" to my system "PATH".&lt;br /&gt;
&lt;br /&gt;
And i'm done, now opening the command line , and typing python25 , opens the python 2.5&amp;nbsp;interpreter, and typing python26 opens the python 2.6 interpreter.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-CVDLQkfZGsM/ThPazLrb87I/AAAAAAAAADY/etgWipTvuCg/s1600/PythonInstallation.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-CVDLQkfZGsM/ThPazLrb87I/AAAAAAAAADY/etgWipTvuCg/s1600/PythonInstallation.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
There might be something else needed to be done, or maybe there is &amp;nbsp;a better way, i'll update this post if any of that happened.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27937362-8057215814795843002?l=mohamedfaramawi.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MohamedFaramawi/~4/RezGLGHudZY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mohamedfaramawi.blogspot.com/feeds/8057215814795843002/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=27937362&amp;postID=8057215814795843002" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/8057215814795843002?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/8057215814795843002?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MohamedFaramawi/~3/RezGLGHudZY/installing-both-python-25-and-python-26.html" title="Installing Both Python 2.5 And Python 2.6 on Windows Box" /><author><name>Mohamed Faramawi</name><uri>https://profiles.google.com/100471942283885376322</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-ukSmQFO8wvU/AAAAAAAAAAI/AAAAAAAAAEg/4QuYlGFllzg/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-kgmyRLKzqGk/ThPZcBvckCI/AAAAAAAAADU/m10mtDVG9co/s72-c/PythonInstallation.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://mohamedfaramawi.blogspot.com/2011/07/installing-both-python-25-and-python-26.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE4HQH0-eCp7ImA9WhZaGU8.&quot;"><id>tag:blogger.com,1999:blog-27937362.post-3404390608806321487</id><published>2011-07-05T20:28:00.000-07:00</published><updated>2011-07-05T20:28:51.350-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-05T20:28:51.350-07:00</app:edited><title>SVN Equivalent Commands in Git</title><content type="html">&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; "&gt;Commands mapping between SVN and Git &lt;/span&gt;&lt;/div&gt;&lt;a href="http://git.or.cz/course/svn.html"&gt;Git - SVN Crash Course&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27937362-3404390608806321487?l=mohamedfaramawi.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MohamedFaramawi/~4/_7MZajpADB8" height="1" width="1"/&gt;</content><link rel="related" href="http://git.or.cz/course/svn.html" title="SVN Equivalent Commands in Git" /><link rel="replies" type="application/atom+xml" href="http://mohamedfaramawi.blogspot.com/feeds/3404390608806321487/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=27937362&amp;postID=3404390608806321487" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/3404390608806321487?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/3404390608806321487?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MohamedFaramawi/~3/_7MZajpADB8/svn-equivalent-commands-in-git.html" title="SVN Equivalent Commands in Git" /><author><name>Mohamed Faramawi</name><uri>https://profiles.google.com/100471942283885376322</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-ukSmQFO8wvU/AAAAAAAAAAI/AAAAAAAAAEg/4QuYlGFllzg/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://mohamedfaramawi.blogspot.com/2011/07/svn-equivalent-commands-in-git.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU4DQ34_cSp7ImA9WhZaFko.&quot;"><id>tag:blogger.com,1999:blog-27937362.post-2168546352422631925</id><published>2011-07-03T00:26:00.000-07:00</published><updated>2011-07-03T00:26:12.049-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-03T00:26:12.049-07:00</app:edited><title>Changing Windows Program Files Directory Path</title><content type="html">&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Great tip for how to change the path of windows program files directory &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href="http://www.intowindows.com/change-default-installation-directory-in-windows-7-vista/"&gt;Change Default Installation Directory In Windows 7 &amp;amp; Vista&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27937362-2168546352422631925?l=mohamedfaramawi.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MohamedFaramawi/~4/4i9Q5AtyW70" height="1" width="1"/&gt;</content><link rel="related" href="http://www.intowindows.com/change-default-installation-directory-in-windows-7-vista/" title="Changing Windows Program Files Directory Path" /><link rel="replies" type="application/atom+xml" href="http://mohamedfaramawi.blogspot.com/feeds/2168546352422631925/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=27937362&amp;postID=2168546352422631925" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/2168546352422631925?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/2168546352422631925?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MohamedFaramawi/~3/4i9Q5AtyW70/changing-windows-program-files.html" title="Changing Windows Program Files Directory Path" /><author><name>Mohamed Faramawi</name><uri>https://profiles.google.com/100471942283885376322</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-ukSmQFO8wvU/AAAAAAAAAAI/AAAAAAAAAEg/4QuYlGFllzg/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://mohamedfaramawi.blogspot.com/2011/07/changing-windows-program-files.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0UAQHs7fSp7ImA9WhZaFUs.&quot;"><id>tag:blogger.com,1999:blog-27937362.post-3366232503945458361</id><published>2011-07-01T06:46:00.000-07:00</published><updated>2011-07-01T18:14:01.505-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-01T18:14:01.505-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MySQL" /><category scheme="http://www.blogger.com/atom/ns#" term="schema sync" /><title>Checking schema differences between two MySQL database</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;My &lt;a href="http://twitter.com/hubspot"&gt;@hubspot&lt;/a&gt;&amp;nbsp;colleague&amp;nbsp;&lt;a href="http://twitter.com/katzj"&gt;@katzj&amp;nbsp;&lt;/a&gt;recently asked me to get one of our QA/Prod MySQL dbs synchornized , he used the MySQL "&lt;a href="http://dev.mysql.com/doc/refman/5.0/en/checksum-table.html"&gt;&lt;b&gt;checksum&lt;/b&gt;&lt;/a&gt;" command&amp;nbsp; to check if there are differences between the QA/Prod MySQL.&lt;br /&gt;
&lt;br /&gt;
The time consuming part is figuring out the differences so you can correct them , luckily someone worked on this area and gave us "&lt;b&gt;&lt;a href="http://schemasync.org/"&gt;Schema Sync&lt;/a&gt;&lt;/b&gt;" , a python script that takes MySQL URL's of 2 MySQL source,target databases, and compares them , the output of the script are 2 SQL files, the first is changes to be applied to the target database to get it synched with the source, second file is a revert of commands you ran from the first output file.&lt;br /&gt;
&lt;br /&gt;
For more info go to&amp;nbsp;&lt;a href="http://schemasync.org/"&gt;http://schemasync.org/&lt;/a&gt;&amp;nbsp;, but there is no much to figure out, its pretty straight forward.&lt;br /&gt;
&lt;br /&gt;
Update :&lt;br /&gt;
If you happened to be using &lt;a href="http://www.toadworld.com/"&gt;Toad&lt;/a&gt; for MySQL you can compare schema between 2 databases, from Toad's menu :&amp;nbsp;Advanced &amp;gt; Schema Compare.&lt;br /&gt;
&lt;br /&gt;
Its much like the "Schema Sync" takes a source and a target , and gives you direct pointer to what the difference is, and a script to fix it (even if the table has data , which is a win over schema sync) , but this is a GUI option if you got a GUI , but if you just have command line, then schema sync is your way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27937362-3366232503945458361?l=mohamedfaramawi.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MohamedFaramawi/~4/CzH9prc81CY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mohamedfaramawi.blogspot.com/feeds/3366232503945458361/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=27937362&amp;postID=3366232503945458361" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/3366232503945458361?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/3366232503945458361?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MohamedFaramawi/~3/CzH9prc81CY/checking-schema-differences-between-two.html" title="Checking schema differences between two MySQL database" /><author><name>Mohamed Faramawi</name><uri>https://profiles.google.com/100471942283885376322</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-ukSmQFO8wvU/AAAAAAAAAAI/AAAAAAAAAEg/4QuYlGFllzg/s512-c/photo.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://mohamedfaramawi.blogspot.com/2011/07/checking-schema-differences-between-two.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEEMRn47fCp7ImA9WhZaEkw.&quot;"><id>tag:blogger.com,1999:blog-27937362.post-6732862028339571511</id><published>2011-06-27T16:18:00.001-07:00</published><updated>2011-06-27T16:18:07.004-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-27T16:18:07.004-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="python" /><title>Collection of python tips and hacks</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Found this nice article containing bunch of Python tips and hacks for your every day python coding&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.siafoo.net/article/52"&gt;http://www.siafoo.net/article/52&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27937362-6732862028339571511?l=mohamedfaramawi.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MohamedFaramawi/~4/qI4N0Vdr3qc" height="1" width="1"/&gt;</content><link rel="related" href="http://www.siafoo.net/article/52" title="Collection of python tips and hacks" /><link rel="replies" type="application/atom+xml" href="http://mohamedfaramawi.blogspot.com/feeds/6732862028339571511/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=27937362&amp;postID=6732862028339571511" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/6732862028339571511?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/6732862028339571511?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MohamedFaramawi/~3/qI4N0Vdr3qc/collection-of-python-tips-and-hacks.html" title="Collection of python tips and hacks" /><author><name>Mohamed Faramawi</name><uri>https://profiles.google.com/100471942283885376322</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-ukSmQFO8wvU/AAAAAAAAAAI/AAAAAAAAAEg/4QuYlGFllzg/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://mohamedfaramawi.blogspot.com/2011/06/collection-of-python-tips-and-hacks.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcERHgyfyp7ImA9WhZUGUk.&quot;"><id>tag:blogger.com,1999:blog-27937362.post-1272943379562987380</id><published>2011-06-12T22:13:00.000-07:00</published><updated>2011-06-12T22:13:25.697-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-12T22:13:25.697-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="python" /><title>Python: Remove items from a list that occur in another list</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&amp;nbsp;&lt;span class="Apple-style-span" style="color: #222222; font-family: Monaco, Consolas, 'Andale Mono', 'DejaVu Sans Mono', monospace; font-size: 13px; line-height: 21px; white-space: pre;"&gt;&amp;gt;&amp;gt;&amp;gt; x = [1, 2, 3, 4, 5, 6, 7, 8]&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #333333; font-family: Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px;"&gt;&lt;pre style="background-attachment: initial; background-clip: initial; background-color: #f7f7f7; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 15px; line-height: 21px; margin-bottom: 24px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 1.5em; padding-left: 1.5em; padding-right: 1.5em; padding-top: 1.5em; vertical-align: baseline;"&gt;&lt;code style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Monaco, Consolas, 'Andale Mono', 'DejaVu Sans Mono', monospace; font-size: 13px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&amp;gt;&amp;gt;&amp;gt; y = [4, 7, 9]
&amp;gt;&amp;gt;&amp;gt; list(set(x) - set(y))
[1, 2, 3, 5, 6, 8]&lt;/code&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27937362-1272943379562987380?l=mohamedfaramawi.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MohamedFaramawi/~4/Q-JWYrYaLas" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mohamedfaramawi.blogspot.com/feeds/1272943379562987380/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=27937362&amp;postID=1272943379562987380" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/1272943379562987380?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/1272943379562987380?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MohamedFaramawi/~3/Q-JWYrYaLas/python-remove-items-from-list-that.html" title="Python: Remove items from a list that occur in another list" /><author><name>Mohamed Faramawi</name><uri>https://profiles.google.com/100471942283885376322</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-ukSmQFO8wvU/AAAAAAAAAAI/AAAAAAAAAEg/4QuYlGFllzg/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://mohamedfaramawi.blogspot.com/2011/06/python-remove-items-from-list-that.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0AMRnw4fip7ImA9WhZUGUk.&quot;"><id>tag:blogger.com,1999:blog-27937362.post-6046775716736982772</id><published>2011-06-12T22:09:00.000-07:00</published><updated>2011-06-12T22:09:47.236-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-12T22:09:47.236-07:00</app:edited><title>My new blogging policy</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;1-You don't need to blog about a super fancy new things, or hard complicated technical problems to solve only, Just blog about every thing, no matter if its trivial , already known to experts, because as long as the internet is&amp;nbsp;available&amp;nbsp;someone at somewhere at sometime might be looking for that simple, trivial thing.&lt;br /&gt;
&lt;br /&gt;
2- If you googled for it , then Blog It.&lt;br /&gt;
&lt;br /&gt;
That's it, share what you know every day , makes you memorize it , and you might be helping someone .&lt;br /&gt;
&lt;br /&gt;
Why i decided to take this path , simple because i'm still a "thank you comments" about posts i posted years ago about what might look simple to experts.. and yeah it feel good when someone thank you about sharing a piece of info.&lt;br /&gt;
&lt;br /&gt;
Ok , starting with the next post , how to&amp;nbsp;subtract&amp;nbsp;2 lists in python &amp;nbsp;... !!&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27937362-6046775716736982772?l=mohamedfaramawi.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MohamedFaramawi/~4/0c4ysfE8AwI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mohamedfaramawi.blogspot.com/feeds/6046775716736982772/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=27937362&amp;postID=6046775716736982772" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/6046775716736982772?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/6046775716736982772?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MohamedFaramawi/~3/0c4ysfE8AwI/my-new-blogging-policy.html" title="My new blogging policy" /><author><name>Mohamed Faramawi</name><uri>https://profiles.google.com/100471942283885376322</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-ukSmQFO8wvU/AAAAAAAAAAI/AAAAAAAAAEg/4QuYlGFllzg/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://mohamedfaramawi.blogspot.com/2011/06/my-new-blogging-policy.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUAHQX85fip7ImA9Wx5QEks.&quot;"><id>tag:blogger.com,1999:blog-27937362.post-1665601808259722125</id><published>2010-08-31T07:08:00.000-07:00</published><updated>2010-08-31T07:08:50.126-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-31T07:08:50.126-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><title>Overriding class methods without inheritance in Java</title><content type="html">So imagine that there is some class , and you want to override a method from that class , but on the same time you do not want to create a new class to inherit from that class, you just want to use the same class, but alter a method definition when that method is used in some context.&lt;br /&gt;
&lt;br /&gt;
For example ,&lt;br /&gt;
We have a class "HtmlTable" and we have "render()" method&amp;nbsp;implemented to print an HTML table .&lt;br /&gt;
&lt;br /&gt;
public class HtmlTable{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;public String toString(){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Normal uses cases for that object is like&lt;br /&gt;
HtmlTable myTable=new HtmlTable();&lt;br /&gt;
myTable.render();&lt;br /&gt;
&lt;br /&gt;
Now suppose we have a special use case that requires us to use "&lt;br /&gt;
&lt;th&gt;" tags when rendering the table as HTML , the way to do so is inheriting from HtmlTable and provide an override to the render() method and use that new object.&lt;br /&gt;
&lt;br /&gt;
public class HtmlTableWithTheadTfoot extends HtmlTable{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;public String render(){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
But this is not the only way, we can achieve the same thing using&amp;nbsp;anonymous inner class as follows ,&lt;br /&gt;
&lt;br /&gt;
HtmlTable myTable=new HtmlTable() { public String render(){}};&lt;br /&gt;
&lt;br /&gt;
In the above statement we've created an&amp;nbsp;anonymous inner class that inherits from HtmlTable and ovrriden the method "render()" only for that instance.&lt;br /&gt;
&lt;br /&gt;
More references about this type of overriding found here,&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://stackoverflow.com/questions/1542410/what-is-this-type-of-method-overriding-called-in-java"&gt;http://stackoverflow.com/questions/1542410/what-is-this-type-of-method-overriding-called-in-java&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/th&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27937362-1665601808259722125?l=mohamedfaramawi.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MohamedFaramawi/~4/lI1RTBwYHYY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mohamedfaramawi.blogspot.com/feeds/1665601808259722125/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=27937362&amp;postID=1665601808259722125" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/1665601808259722125?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/1665601808259722125?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MohamedFaramawi/~3/lI1RTBwYHYY/overriding-class-methods-without.html" title="Overriding class methods without inheritance in Java" /><author><name>Mohamed Faramawi</name><uri>https://profiles.google.com/100471942283885376322</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-ukSmQFO8wvU/AAAAAAAAAAI/AAAAAAAAAEg/4QuYlGFllzg/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://mohamedfaramawi.blogspot.com/2010/08/overriding-class-methods-without.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0UEQXk4eip7ImA9Wx5TGUk.&quot;"><id>tag:blogger.com,1999:blog-27937362.post-989629275959998186</id><published>2010-08-04T11:06:00.000-07:00</published><updated>2010-08-04T11:06:40.732-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-04T11:06:40.732-07:00</app:edited><title>What version of .NET framework do i have ?</title><content type="html">If you end up on forgetting what is the version of the .NET framework currently installed on your machine, you can find out by visiting the following link on using Internet Explorer browser&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.hanselman.com/smallestdotnet/"&gt;http://www.hanselman.com/smallestdotnet/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_Qh2w4BGZ9Ok/TFmsDebBBSI/AAAAAAAAACc/dvN5cCY05GE/s1600/IE.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="459" src="http://2.bp.blogspot.com/_Qh2w4BGZ9Ok/TFmsDebBBSI/AAAAAAAAACc/dvN5cCY05GE/s640/IE.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27937362-989629275959998186?l=mohamedfaramawi.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MohamedFaramawi/~4/ydd7ANI7k8o" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mohamedfaramawi.blogspot.com/feeds/989629275959998186/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=27937362&amp;postID=989629275959998186" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/989629275959998186?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/989629275959998186?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MohamedFaramawi/~3/ydd7ANI7k8o/what-version-of-net-framework-do-i-have.html" title="What version of .NET framework do i have ?" /><author><name>Mohamed Faramawi</name><uri>https://profiles.google.com/100471942283885376322</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-ukSmQFO8wvU/AAAAAAAAAAI/AAAAAAAAAEg/4QuYlGFllzg/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_Qh2w4BGZ9Ok/TFmsDebBBSI/AAAAAAAAACc/dvN5cCY05GE/s72-c/IE.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://mohamedfaramawi.blogspot.com/2010/08/what-version-of-net-framework-do-i-have.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkMNQn0_eyp7ImA9WxFbGUU.&quot;"><id>tag:blogger.com,1999:blog-27937362.post-7733888822292383713</id><published>2010-07-12T17:21:00.000-07:00</published><updated>2010-07-12T17:21:33.343-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-12T17:21:33.343-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><title>Convert Java Date object Long value  to .NET DateTime object</title><content type="html">&lt;span class="Apple-style-span" style="font-family: Consolas, 'Courier New', Courier, monospace; font-size: small; white-space: pre;"&gt;From Java Date Long value to .NET DateTime object :&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Consolas, 'Courier New', Courier, monospace; font-size: small; white-space: pre;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Consolas, 'Courier New', Courier, monospace; font-size: small; white-space: pre;"&gt; DateTime origin = &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Consolas, 'Courier New', Courier, monospace; font-size: small; white-space: pre;"&gt;&lt;span class="kwrd" style="color: blue;"&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Consolas, 'Courier New', Courier, monospace; font-size: small; white-space: pre;"&gt; DateTime(1970, 1, 1, 0, 0, 0, 0);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: tahoma, arial, helvetica, sans-serif; font-size: small;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class="csharpcode" style="background-color: white; color: black; font-family: Consolas, 'Courier New', Courier, monospace; font-size: small; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;"&gt;&lt;span class="kwrd" style="color: blue;"&gt;return&lt;/span&gt; origin.AddSeconds(timestamp);&lt;/pre&gt;&lt;pre class="csharpcode" style="background-color: white; color: black; font-family: Consolas, 'Courier New', Courier, monospace; font-size: small; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;"&gt;&lt;/pre&gt;&lt;pre class="csharpcode" style="background-color: white; color: black; font-family: Consolas, 'Courier New', Courier, monospace; font-size: small; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;"&gt;To convert a .NET DateTime object to Java date Long value :&lt;/pre&gt;&lt;pre class="csharpcode" style="background-color: white; color: black; font-family: Consolas, 'Courier New', Courier, monospace; font-size: small; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;"&gt;&lt;span class="Apple-style-span" style="font-family: tahoma, arial, helvetica, sans-serif; white-space: normal;"&gt;&lt;pre class="csharpcode" style="background-color: white; color: black; font-family: Consolas, 'Courier New', Courier, monospace; font-size: small; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;"&gt;DateTime origin = &lt;span class="kwrd" style="color: blue;"&gt;new&lt;/span&gt; DateTime(1970, 1, 1, 0, 0, 0, 0);
TimeSpan diff = date - origin;
&lt;span class="kwrd" style="color: blue;"&gt;return&lt;/span&gt; Math.Floor(diff.TotalSeconds);&lt;/pre&gt;&lt;pre class="csharpcode" style="background-color: white; color: black; font-family: Consolas, 'Courier New', Courier, monospace; font-size: small; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;"&gt;&lt;/pre&gt;&lt;pre class="csharpcode" style="background-color: white; color: black; font-family: Consolas, 'Courier New', Courier, monospace; font-size: small; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;"&gt;&lt;/pre&gt;&lt;pre class="csharpcode" style="background-color: white; color: black; font-family: Consolas, 'Courier New', Courier, monospace; font-size: small; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;"&gt;To test what you are doing is correct, check it out here , &lt;/pre&gt;&lt;pre class="csharpcode" style="background-color: white; color: black; font-family: Consolas, 'Courier New', Courier, monospace; font-size: small; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;"&gt;&lt;a href="http://www.epochconverter.com/"&gt;http://www.epochconverter.com/&lt;/a&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27937362-7733888822292383713?l=mohamedfaramawi.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MohamedFaramawi/~4/B-2x-yK_AwY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mohamedfaramawi.blogspot.com/feeds/7733888822292383713/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=27937362&amp;postID=7733888822292383713" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/7733888822292383713?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/7733888822292383713?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MohamedFaramawi/~3/B-2x-yK_AwY/convert-java-date-object-long-value-to.html" title="Convert Java Date object Long value  to .NET DateTime object" /><author><name>Mohamed Faramawi</name><uri>https://profiles.google.com/100471942283885376322</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-ukSmQFO8wvU/AAAAAAAAAAI/AAAAAAAAAEg/4QuYlGFllzg/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://mohamedfaramawi.blogspot.com/2010/07/convert-java-date-object-long-value-to.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkAGSHk9fSp7ImA9WhdVFk8.&quot;"><id>tag:blogger.com,1999:blog-27937362.post-2143124205506371730</id><published>2010-03-08T06:21:00.000-08:00</published><updated>2011-09-21T10:05:29.765-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-21T10:05:29.765-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MongoDB" /><category scheme="http://www.blogger.com/atom/ns#" term="CouchDB" /><title>CouchDB vs MongoDB benchmarks for Insert time</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Found the following links for insert time benchmarks for CouchDB and MongoDB&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://debuggable.com/posts/couchdb-insert-benchmarks:4a4365e2-9d04-4170-9f88-2de34834cda3"&gt;CouchDB Insert Benchmarks&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.snailinaturtleneck.com/blog/2009/06/29/couchdb-vs-mongodb-benchmark/"&gt;CouchDB vs. MongoDB Benchmark&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Update 09/21/2011&lt;br /&gt;
&lt;a href="http://kkovacs.eu/cassandra-vs-mongodb-vs-couchdb-vs-redis"&gt;Cassandra vs MongoDB vs CouchDB vs Redis vs Riak vs HBase vs Membase vs Neo4j comparison&lt;/a&gt; &lt;br /&gt;
 &lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27937362-2143124205506371730?l=mohamedfaramawi.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MohamedFaramawi/~4/3-nXpb6NMU0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mohamedfaramawi.blogspot.com/feeds/2143124205506371730/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=27937362&amp;postID=2143124205506371730" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/2143124205506371730?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/2143124205506371730?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MohamedFaramawi/~3/3-nXpb6NMU0/couchdb-vs-mongodb-benchmarks-for.html" title="CouchDB vs MongoDB benchmarks for Insert time" /><author><name>Mohamed Faramawi</name><uri>https://profiles.google.com/100471942283885376322</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-ukSmQFO8wvU/AAAAAAAAAAI/AAAAAAAAAEg/4QuYlGFllzg/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://mohamedfaramawi.blogspot.com/2010/03/couchdb-vs-mongodb-benchmarks-for.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0EGQX8zeip7ImA9WxBUGUg.&quot;"><id>tag:blogger.com,1999:blog-27937362.post-5297535860524249625</id><published>2010-03-07T00:47:00.000-08:00</published><updated>2010-03-07T00:47:00.182-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-07T00:47:00.182-08:00</app:edited><title>"No Computers" day policy</title><content type="html">Last week i was thinking about something that is , i don't really take a weekend, day off, vacation if im using a computer.&lt;br /&gt;
&lt;br /&gt;
I work with computer every day its my only mate, even when i'm thinking this is my day off, or a "not working" time, But computer is what my work all about , how can i consider my self in a time off if i'm still using the thing that i work with every day !.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;I compared my self to other kinds of workers , civil engineers, teachers, doctors, they can get time off from what they work on daily , and i need to do the same.&lt;br /&gt;
&lt;br /&gt;
Getting into that i came up with 2 options :&lt;br /&gt;
1- Have 2 computers, one to be used during work days, it have every thing related to what im working on , and another computer to be used during day offs, weekends, that have nothing related to my work.&lt;br /&gt;
&lt;br /&gt;
2- Don't use a computer completely during weekend, and to check my email i can do that &amp;nbsp;from my cell phone.&lt;br /&gt;
&lt;br /&gt;
I chosen #2 , it sounds more like where i want to be,i tried that yesterday it wasn't easy though, &amp;nbsp;but it happened , my computer was off all the day, i didn't stay at the office (where i work as i work from home) , and done a bunch of stuff , weather was good so i went our running, got out at the night, watched a movie on TV , and i used my cell phone to check my email , thankfully there was nothing serious that needed me to turn my computer on and do work .&lt;br /&gt;
&lt;br /&gt;
It was a good experience and i developed this must follow policy &amp;nbsp;"There must be a day during the weekend where i don't use the computer at all ,calling it a No Computer day ".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27937362-5297535860524249625?l=mohamedfaramawi.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MohamedFaramawi/~4/3Mvze8gBB7U" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mohamedfaramawi.blogspot.com/feeds/5297535860524249625/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=27937362&amp;postID=5297535860524249625" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/5297535860524249625?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/5297535860524249625?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MohamedFaramawi/~3/3Mvze8gBB7U/no-computers-day-policy.html" title="&quot;No Computers&quot; day policy" /><author><name>Mohamed Faramawi</name><uri>https://profiles.google.com/100471942283885376322</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-ukSmQFO8wvU/AAAAAAAAAAI/AAAAAAAAAEg/4QuYlGFllzg/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://mohamedfaramawi.blogspot.com/2010/03/no-computers-day-policy.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkIGQ346cSp7ImA9WxBVFEQ.&quot;"><id>tag:blogger.com,1999:blog-27937362.post-3693713564393871523</id><published>2010-02-18T05:08:00.000-08:00</published><updated>2010-02-18T05:08:42.019-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-18T05:08:42.019-08:00</app:edited><title>Acquired By Oracle</title><content type="html">&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_Qh2w4BGZ9Ok/S30625Tkz_I/AAAAAAAAACU/LzTfa5VET9M/s1600-h/AccuiredByOracle.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="442" src="http://3.bp.blogspot.com/_Qh2w4BGZ9Ok/S30625Tkz_I/AAAAAAAAACU/LzTfa5VET9M/s640/AccuiredByOracle.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;I was looking for something in MySQL docs , and at the bottom of the page found this silly remainder that MySQL is now a property of Oracle !&lt;br /&gt;
&lt;br /&gt;
Well its not that only , www.sun.com now takes you to www.oracle.com , though&amp;nbsp;&lt;a href="http://www.sun.com/software/"&gt;http://www.sun.com/software/&lt;/a&gt;&amp;nbsp;still works ;) , But actually any page that had anything related to sun, will show be now having Oracle badge somewhere on the page , bottom, top, anywhere it doesn't matter as long as it shows that SUN IS ACQUIRED BY ORACLE.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27937362-3693713564393871523?l=mohamedfaramawi.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MohamedFaramawi/~4/IW0WiDtrV5w" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mohamedfaramawi.blogspot.com/feeds/3693713564393871523/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=27937362&amp;postID=3693713564393871523" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/3693713564393871523?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/3693713564393871523?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MohamedFaramawi/~3/IW0WiDtrV5w/acquired-by-oracle.html" title="Acquired By Oracle" /><author><name>Mohamed Faramawi</name><uri>https://profiles.google.com/100471942283885376322</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-ukSmQFO8wvU/AAAAAAAAAAI/AAAAAAAAAEg/4QuYlGFllzg/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_Qh2w4BGZ9Ok/S30625Tkz_I/AAAAAAAAACU/LzTfa5VET9M/s72-c/AccuiredByOracle.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://mohamedfaramawi.blogspot.com/2010/02/acquired-by-oracle.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkQMRHozfCp7ImA9WxBVE0Q.&quot;"><id>tag:blogger.com,1999:blog-27937362.post-4087930122279584415</id><published>2010-02-17T01:19:00.000-08:00</published><updated>2010-02-17T01:19:45.484-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-17T01:19:45.484-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Social Search" /><title>Google Social Search In Action</title><content type="html">I was googeling for something yesterday and when scrolling down through the results i found this &amp;nbsp;near at the bottom&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_Qh2w4BGZ9Ok/S3uvreIw7sI/AAAAAAAAACM/tPvOoeG8jxI/s1600-h/Social.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="331" src="http://3.bp.blogspot.com/_Qh2w4BGZ9Ok/S3uvreIw7sI/AAAAAAAAACM/tPvOoeG8jxI/s640/Social.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Looking at the marked text in the above image "Results from people in your social circle for " , this is something new , googling for it , its turned to be a new feature from google , that is called &lt;a href="http://searchengineland.com/google-social-search-launches-gives-results-from-your-trusted-social-circle-28507"&gt;"Social Search" that allows you to search content added, edited, written by people your trust&lt;/a&gt; !&lt;br /&gt;
&lt;br /&gt;
Looking at how the people i trust socially list is figured out by Google , it turns out to be your gmail contacts, your google reader subscription , google profile, and with the release of &lt;a href="http://buzz.google.com/"&gt;Google Buzz&lt;/a&gt;, it come from your buzz followers/following , this includes people you have on &lt;a href="http://twitter.com/"&gt;Twitter&lt;/a&gt;,&amp;nbsp;&lt;a href="http://www.facebook.com/"&gt;Facebook&lt;/a&gt;,&amp;nbsp;&lt;a href="http://www.flicker.com/"&gt;Flicker&lt;/a&gt; , &lt;a href="http://www.blogger.com/"&gt;Blogger&lt;/a&gt;, if you have these connections added to your Buzz profile , this is all based on Google's &lt;a href="http://code.google.com/apis/socialgraph/"&gt;Social Graph API&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Two things more :&lt;br /&gt;
1- As you guessed , you need to be logged-in to your google account to see this new feature.&lt;br /&gt;
2- Its not avilable yet for&amp;nbsp;international&amp;nbsp;Google domains check , &lt;a href="http://www.google.com/search?hl=en&amp;amp;q=site+grader&amp;amp;btnG=Search&amp;amp;meta=&amp;amp;aq=f&amp;amp;oq="&gt;google.com&lt;/a&gt; vs &lt;a href="http://www.google.com/search?hl=en&amp;amp;q=site+grader&amp;amp;btnG=Search&amp;amp;meta=&amp;amp;aq=f&amp;amp;oq="&gt;www.google.com.eg&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
And a new SSO ( Social Search Optimization) tip : Blog more, tweet more, you will get high ranked in social search results.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27937362-4087930122279584415?l=mohamedfaramawi.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MohamedFaramawi/~4/ea8u7bjWQYo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mohamedfaramawi.blogspot.com/feeds/4087930122279584415/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=27937362&amp;postID=4087930122279584415" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/4087930122279584415?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/4087930122279584415?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MohamedFaramawi/~3/ea8u7bjWQYo/google-social-search-in-action.html" title="Google Social Search In Action" /><author><name>Mohamed Faramawi</name><uri>https://profiles.google.com/100471942283885376322</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-ukSmQFO8wvU/AAAAAAAAAAI/AAAAAAAAAEg/4QuYlGFllzg/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_Qh2w4BGZ9Ok/S3uvreIw7sI/AAAAAAAAACM/tPvOoeG8jxI/s72-c/Social.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://mohamedfaramawi.blogspot.com/2010/02/google-social-search-in-action.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEUNQXszfCp7ImA9WxBWE0o.&quot;"><id>tag:blogger.com,1999:blog-27937362.post-1132588469659123132</id><published>2010-02-05T04:18:00.000-08:00</published><updated>2010-02-05T04:18:10.584-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-05T04:18:10.584-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="struts2" /><title>Returning Stream result using Struts2 REST plug-in</title><content type="html">As this information is fresh on my head, i wanted to document it , &amp;nbsp;If you are using Java &lt;a href="http://struts.apache.org/2.x/"&gt;Struts2&lt;/a&gt; with the &lt;a href="http://struts.apache.org/2.x/docs/rest-plugin.html"&gt;REST plug-in&lt;/a&gt; to build &lt;a href="http://en.wikipedia.org/wiki/Representational_State_Transfer"&gt;RESTFul&lt;/a&gt; web services, and wanted for example provide a RESTFul &amp;nbsp;URL for a binary file (image, excel sheet, anything that is downloadable) , the way to do it is as follows (assuming you want to show an image) :&lt;br /&gt;
&lt;br /&gt;
1- Add the annotation "@Result" to your controller.&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #073763;"&gt;@Result(name = "image", type = "stream",params={"contentType","image/png","bufferSize","1024"})&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #073763;"&gt;public class MyController extends HubSpotObject implements ModelDriven&lt;mymodel&gt;{&lt;/mymodel&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #073763;"&gt;&amp;nbsp;&amp;nbsp;// Controller Implementation&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #073763;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
2-The result annotation takes 3 parameters :&lt;br /&gt;
1- name : &amp;nbsp;This is the name of your result , which will be returned from your controller.&lt;br /&gt;
2- type : &amp;nbsp;The &lt;a href="http://struts.apache.org/2.x/docs/result-types.html"&gt;Struts2 result type&lt;/a&gt; name, in our case its "stream" similar to how we&amp;nbsp;refer&amp;nbsp;to it in the struts.xml.&lt;br /&gt;
3- params : This a list of parameters you want to set for your result , the format is like this "key","value","key","value"..etc.&lt;br /&gt;
In case of our image result, we need to set the "contentType" and "bufferSize", and&amp;nbsp;optionally&amp;nbsp;we can set "inputName" name, but if this is omitted you will need to declare an object of type "InputStream" in your controller and call it "inputStream", or anything else, as the REST will look for any input stream object.&lt;br /&gt;
If you are not using the REST plugin you would this in struts.xml as follows&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #073763;"&gt;&amp;lt;action name="getImage" class="example.ImageAction"&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #073763;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;result name="success" type="stream"&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #073763;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;param name="contentType"&amp;gt;image/png&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #073763;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;param name="inputName"&amp;gt;imageStream&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #073763;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;param name="bufferSize"&amp;gt;1024&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #073763;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/result&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #073763;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;/action&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
So we are just giving our result the same parameters we give in the struts.xml.&lt;br /&gt;
&lt;br /&gt;
3- Inside your controller , you will need to make sure you define an InputStream object and have it read the image you want to show .&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #073763;"&gt;&amp;nbsp;private InputStream inputStream;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
4- Inside your controller "show()" method, you will initialize your InputStream method, and return the result named "image" as we called it when we added the "@Result" annotation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: #073763;"&gt;public HttpHeaders show() {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #073763;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Make sure your input stream is&amp;nbsp;initialized&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #073763;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return new DefaultHttpHeaders("image");&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #073763;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
And thats it, you can now show images using a RESTFul URL , eg "http://my.app.com/profileImages/1"&lt;br /&gt;
&lt;br /&gt;
Quick tips from my recent REST plug-in experiment:&lt;br /&gt;
&lt;br /&gt;
1- If you want to use "string" ids with your URLS , make sure you set the default extension constants in struts.xml to empty , and this way you can have URLS like&amp;nbsp;"http://my.app.com/profileImages/m.mawi" , without doing so, struts was going to use "m" as the ID , and ".mawi" as the result type and throws an exception about there is no handler for the result type ".mawi".&lt;br /&gt;
&lt;br /&gt;
2- You can not use "/" in your IDs , so if you are thinking of passing URLS as your controllers ID's this will fail, as struts REST plug-in will consider whatever comes after the last slash "/" as a method in your controller and will throw an exception telling you there is no method defined&lt;br /&gt;
eg. http://my.app.com/profilerUrl/users.app/profile10 , im not sure if there is a way to disable this&amp;nbsp;behavior.&lt;br /&gt;
&lt;br /&gt;
3- It didn't work for me when i tried to have normal struts actions on the same app as REST struts controllers.&lt;br /&gt;
&lt;br /&gt;
4- The wiki page of the REST plug-in SUX , so google will be your friend here.&lt;br /&gt;
&lt;br /&gt;
5- Make sure you read and get how the &lt;a href="http://struts.apache.org/2.1.6/docs/convention-plugin.html"&gt;Struts 2 Convention plug-in&lt;/a&gt; works.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27937362-1132588469659123132?l=mohamedfaramawi.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MohamedFaramawi/~4/vOTtP1bOPZs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mohamedfaramawi.blogspot.com/feeds/1132588469659123132/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=27937362&amp;postID=1132588469659123132" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/1132588469659123132?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/1132588469659123132?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MohamedFaramawi/~3/vOTtP1bOPZs/returning-stream-result-using-struts2.html" title="Returning Stream result using Struts2 REST plug-in" /><author><name>Mohamed Faramawi</name><uri>https://profiles.google.com/100471942283885376322</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-ukSmQFO8wvU/AAAAAAAAAAI/AAAAAAAAAEg/4QuYlGFllzg/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://mohamedfaramawi.blogspot.com/2010/02/returning-stream-result-using-struts2.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ak8CQn0yfip7ImA9WxBXFU8.&quot;"><id>tag:blogger.com,1999:blog-27937362.post-6495349664782637330</id><published>2010-01-26T10:01:00.000-08:00</published><updated>2010-01-26T10:01:03.396-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-26T10:01:03.396-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="XStream" /><title>XML to object de-serialization will fail if your object changed</title><content type="html">Today i was doing a code cleanup in a project that uses &lt;a href="http://xstream.codehaus.org/"&gt;XStream&lt;/a&gt; for object serialization into XML and de-serialization back into.&lt;br /&gt;
&lt;br /&gt;
I deleted some fields from the object that are not used anymore, and this caused the de-serialization of old serialized objects to fail , because they still contains the removed fields. "&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px;"&gt;com.thoughtworks.xstream.&lt;wbr&gt;&lt;/wbr&gt;mapper.&lt;wbr&gt;&lt;/wbr&gt;CannotResolveClassException&lt;span class="Apple-style-span" style="border-collapse: separate; font-family: 'Times New Roman'; font-size: medium;"&gt;".&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px;"&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; font-family: 'Times New Roman'; font-size: medium;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px;"&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; font-family: 'Times New Roman'; font-size: medium;"&gt;XStream states this problem clearly in their &lt;a href="http://xstream.codehaus.org/faq.html"&gt;FAQs&lt;/a&gt;, and also provide possible fixes for it,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
"&lt;i&gt;If a field is removed from the class, deserializing an old version that contains the field will cause an exception. Leaving the field in place but declaring it as transient will avoid the exception, but XStream will not try to deserialize it.&lt;/i&gt;".&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px;"&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; font-family: 'Times New Roman'; font-size: medium;"&gt;The fix i tried and worked perfectly for me was using a&amp;nbsp;Custom&amp;nbsp;Mapper&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
"&lt;i&gt;implement a custom mapper to ignore unknown fields automatically (see acceptance test CustomMapperTest.testCanBeUsedToOmitUnexpectedElements())&lt;/i&gt;".&lt;br /&gt;
&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px;"&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; font-family: 'Times New Roman'; font-size: medium;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px;"&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; font-family: 'Times New Roman'; font-size: medium;"&gt;I had to grap the source code of XStream to get the test mentioned there, and the fix is simply is adding couple line of code to the XStream object initialization&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #0b5394;"&gt;xstream = new XStream(new DomDriver()){&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px;"&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; font-family: 'Times New Roman'; font-size: medium;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;protected MapperWrapper wrapMapper(MapperWrapper next) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return new MapperWrapper(next) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public boolean shouldSerializeMember(Class definedIn, String fieldName) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return definedIn != Object.class ? super.shouldSerializeMember(definedIn, fieldName) : false;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;};&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;};&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thats it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27937362-6495349664782637330?l=mohamedfaramawi.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MohamedFaramawi/~4/ba95eLHUHn8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mohamedfaramawi.blogspot.com/feeds/6495349664782637330/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=27937362&amp;postID=6495349664782637330" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/6495349664782637330?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27937362/posts/default/6495349664782637330?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MohamedFaramawi/~3/ba95eLHUHn8/xml-to-object-de-serialization-will.html" title="XML to object de-serialization will fail if your object changed" /><author><name>Mohamed Faramawi</name><uri>https://profiles.google.com/100471942283885376322</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-ukSmQFO8wvU/AAAAAAAAAAI/AAAAAAAAAEg/4QuYlGFllzg/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://mohamedfaramawi.blogspot.com/2010/01/xml-to-object-de-serialization-will.html</feedburner:origLink></entry></feed>

