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

<channel>
	<title>Bipins Dot Net</title>
	<atom:link href="http://bipins.net/blog/index.php?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://bipins.net/blog</link>
	<description>daily bits and pieces</description>
	<lastBuildDate>Fri, 11 May 2012 05:45:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Jquery DataTables</title>
		<link>http://bipins.net/blog/?p=358</link>
		<comments>http://bipins.net/blog/?p=358#comments</comments>
		<pubDate>Thu, 20 Oct 2011 13:55:37 +0000</pubDate>
		<dc:creator>bipin</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[DataTables]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[UsefulStuff]]></category>

		<guid isPermaLink="false">http://bipins.net/blog/?p=358</guid>
		<description><![CDATA[&#1080;&#1082;&#1086;&#1085;&#1072; &#1079;&#1072; &#1087;&#1086;&#1076;&#1072;&#1088;&#1098;&#1082;A very useful jquery plugin to display data. http://www.datatables.net]]></description>
			<content:encoded><![CDATA[<p><font style="position: absolute;overflow: hidden;height: 0;width: 0"><a href="http://xn--h1aafme.net/%E8%EA%EE%ED%E0-%E7%E0-%EF%EE%E4%E0%F0%FA%EA">&#1080;&#1082;&#1086;&#1085;&#1072; &#1079;&#1072; &#1087;&#1086;&#1076;&#1072;&#1088;&#1098;&#1082;</a></font>A very useful jquery plugin to display data.</p>
<p><a title="http://www.datatables.net" href="http://www.datatables.net" target="_blank">http://www.datatables.net</a></p>
]]></content:encoded>
			<wfw:commentRss>http://bipins.net/blog/?feed=rss2&#038;p=358</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My MVC Application</title>
		<link>http://bipins.net/blog/?p=321</link>
		<comments>http://bipins.net/blog/?p=321#comments</comments>
		<pubDate>Fri, 03 Jun 2011 18:36:26 +0000</pubDate>
		<dc:creator>bipin</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[MVC3]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://bipins.net/blog/?p=321</guid>
		<description><![CDATA[ÐŸÑ€Ð°Ð²Ð¾ÑÐ»Ð°Ð²Ð½Ð¸ Ð¸ÐºÐ¾Ð½Ð¸Ð¸ÐºÐ¾Ð½Ð¸After getting started with ASP.net MVC , watching the tutorials I ended up creating quite few &#8220;Hello world&#8221; MVC applications. Then added few database into it. It seemed cool and easy. But going a bit beyond hello world, there is a different wild world of techniques and technologies.Trying to find some best practices I [...]]]></description>
			<content:encoded><![CDATA[<p><span style="position: absolute; overflow: hidden; height: 0pt; width: 0pt;"><a href="http://xn--h1aafme.net/tag/%D0%BF%D1%80%D0%B0%D0%B2%D0%BE%D1%81%D0%BB%D0%B0%D0%B2%D0%BD%D0%B8-%D0%B8%D0%BA%D0%BE%D0%BD%D0%B8/">ÐŸÑ€Ð°Ð²Ð¾ÑÐ»Ð°Ð²Ð½Ð¸ Ð¸ÐºÐ¾Ð½Ð¸</a></span><span style="position: absolute; overflow: hidden; height: 0pt; width: 0pt;"><a href="http://ikoni.eu/ikoni">Ð¸ÐºÐ¾Ð½Ð¸</a></span>After <a href="http://www.asp.net/mvc/tutorials/getting-started-with-mvc-part1">getting started</a> with <a href="http://www.asp.net/mvc">ASP.net MVC</a> , watching the tutorials I ended up creating quite few &#8220;Hello world&#8221; MVC applications. Then added few database into it. It seemed cool and easy. But going a bit beyond hello world, there is a different wild world of techniques and technologies.Trying to find some best practices I got started from <a href="http://wiki.asp.net/page.aspx/1014/aspnet-mvc-best-practices/" target="_blank">here</a>.</p>
<p>Things I like to do with default generated MVC code from Visual studio:</p>
<h3>1. Add an IOC container</h3>
<p>I use <a href="http://www.royal.gov.uk/TheRoyalResidences/WindsorCastle/WindsorCastle.aspx" target="_blank">Windsdor Castle </a>that can be found <a href="http://docs.castleproject.org/Windsor.Windsor-tutorial-ASP-NET-MVC-3-application-To-be-Seen.ashx" target="_blank">here </a>. The tutorial there will show how to add Windsdor IOC controller to the MVC 3 application. It shows how to download and reference Windsdor but I prefer Nuget way.</p>
<ul>
<li>install-package Castle.Windsor</li>
</ul>
<h3>2.Â  Log4Net for logging</h3>
<p>There is a Windsdor way of plugging in Log4Net. Its package can be referenced using nuget :</p>
<ul>
<li>install-Package Castle.Windsor-log4net</li>
</ul>
<p>Then after creating necessary installer class for Log4Net, a log4net.config file and its related table can be created from <a title="here" href="http://logging.apache.org/log4net/release/config-examples.html" target="_blank">here.</a></p>
<h3>3. Membership Framework</h3>
<p>I like <a href="http://msdn.microsoft.com/en-us/library/yh26yfzy.aspx" target="_blank">membership framework</a> for creating login.The default template has sample code for register/login.But sometimes it is not enough, you may use your own login while extending from MembershipProvider.</p>
<h3>4. Separate Entity Model and View Model</h3>
<p>In one of the small MVC projects I had some data models created from Model First approach. Till some point the output data required was in same format as the Entities but then the requirements started changing. At that point, it did not made much sense to change the database itself but rather use an adapter. So as a rule, the models that Views use are separate from the models that EF uses. It also helps to avoid some problems that occurs when using data models entities directly as View model.</p>
<p>View &lt; &#8211; &gt; ViweModel &lt; &#8230;&#8230;.. &gt; Data Model &lt;-&gt; Database</p>
<p>.. more to be added.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://bipins.net/blog/?feed=rss2&#038;p=321</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>QR image bookmarklet</title>
		<link>http://bipins.net/blog/?p=314</link>
		<comments>http://bipins.net/blog/?p=314#comments</comments>
		<pubDate>Tue, 24 May 2011 03:41:28 +0000</pubDate>
		<dc:creator>bipin</dc:creator>
				<category><![CDATA[Blogging]]></category>

		<guid isPermaLink="false">http://bipins.net/blog/?p=314</guid>
		<description><![CDATA[Scenario: QR images has been use for ease of opening URLâ€™s in phone. There are terribly long ugly URLs which you have no way to copy except u really copy paste or firefox sync or XYZ sync it. Or you could copy the URL and generate a goo.gl link and then QR image from there. [...]]]></description>
			<content:encoded><![CDATA[<p>Scenario: QR images has been use for ease of opening URLâ€™s in phone.    </p>
<p>There are terribly long ugly URLs which you have no way to copy except u really copy paste or firefox sync or XYZ sync it. Or you could copy the URL and generate a goo.gl link and then QR image from there.     </p>
<p>You can run this bookmarkleet ( just browse any URL and when you are there click this ) and all links will have a QR image on right clicking the link. </p>
<p>Drag the following link and drop it in your browserâ€™s bookmark.</p>
<p>  <a href="javascript:l=function(s){%20var%20f=document.createElement(&quot;script&quot;);f.setAttribute(&quot;type&quot;,&quot;text/javascript&quot;);f.setAttribute(&quot;src&quot;,s);document.getElementsByTagName(&quot;head&quot;)[0].appendChild(f)};l(&quot;http://goo.gl/Bzg0i&quot;);Z=function(){$(document).ready(function(){alert(&quot;Loaded&quot;);I=function(u){%20$(u.currentTarget).append(%20&quot;&lt;div%20style=\&quot;zindex:10000;position:absolute;left:&quot;+$(u.currentTarget).offset().left+&quot;;top:&quot;+$(u.currentTarget).offset().top+&quot;\&quot;&gt;&lt;img%20%20src=http://qrcode.kaywa.com/img.php?s=8&amp;d=&quot;+u.target+&quot;&gt;&lt;/div&gt;&quot;%20%20).mouseout(function(){$(this).find(&quot;div&quot;).hide()});};$(&quot;a&quot;).bind(&quot;contextmenu&quot;,function(e){%20e.preventDefault();if(e.button==2){%20I(e);%20}%20return%20false;%20});});};K=function(){setTimeout(&quot;Z()&quot;,5000);};K();"> QR Image</a>
<p> Thanks Manish for asking me to blog about it.  </p>
]]></content:encoded>
			<wfw:commentRss>http://bipins.net/blog/?feed=rss2&#038;p=314</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ajax File Uploader</title>
		<link>http://bipins.net/blog/?p=311</link>
		<comments>http://bipins.net/blog/?p=311#comments</comments>
		<pubDate>Mon, 28 Feb 2011 03:15:29 +0000</pubDate>
		<dc:creator>bipin</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.bipins.net/index.php/2011/02/27/ajax-file-uploader/</guid>
		<description><![CDATA[Started with a hopeful new HTML5 FileReader API and ended with a frustrating results, finally ended up with accepting this open source script. https://github.com/valums/file-uploader It Works.]]></description>
			<content:encoded><![CDATA[<p>Started with a hopeful new HTML5 FileReader API and ended with a frustrating results, finally ended up with accepting this open source script. </p>
<p><a title="https://github.com/valums/file-uploader" href="https://github.com/valums/file-uploader">https://github.com/valums/file-uploader</a></p>
<p>It Works.</p>
]]></content:encoded>
			<wfw:commentRss>http://bipins.net/blog/?feed=rss2&#038;p=311</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>facebook C# sdk is on nuget</title>
		<link>http://bipins.net/blog/?p=292</link>
		<comments>http://bipins.net/blog/?p=292#comments</comments>
		<pubDate>Wed, 23 Feb 2011 03:42:49 +0000</pubDate>
		<dc:creator>bipin</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Facebook]]></category>

		<guid isPermaLink="false">http://blog.bipins.net/index.php/2011/02/22/facebook-c-sdk-is-on-nuget/</guid>
		<description><![CDATA[Facebook C# SDK is on nuget with package names Facebook, FacebookWeb, FacebookWebMvc But still have some bugs]]></description>
			<content:encoded><![CDATA[<p><a href="http://facebooksdk.codeplex.com/" target="_blank">Facebook C# SDK</a> is on nuget with package names </p>
<p>Facebook, FacebookWeb, FacebookWebMvc</p>
<p>But still have some bugs <img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-sadsmile" alt="Sad smile" src="http://blog.bipins.net/wp-content/uploads/2011/02/wlEmoticon-sadsmile.png" /></p>
]]></content:encoded>
			<wfw:commentRss>http://bipins.net/blog/?feed=rss2&#038;p=292</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Storing array in localStorage</title>
		<link>http://bipins.net/blog/?p=290</link>
		<comments>http://bipins.net/blog/?p=290#comments</comments>
		<pubDate>Wed, 23 Feb 2011 02:26:44 +0000</pubDate>
		<dc:creator>bipin</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.bipins.net/index.php/2011/02/22/storing-array-in-localstorage/</guid>
		<description><![CDATA[Found here http://stackoverflow.com/questions/3357553/how-to-store-an-array-in-localstorage HTML5â€™s window.localStorage can store anything. But for storing an array itâ€™s a bit tricky. To store an array suppose: var names = [â€œAâ€,â€Bâ€]; Storing : localStorage.setItem(&#34;names&#34;, names.join(&#8216;&#124;&#124;&#124;&#8217;));&#160; Retriving : var names = localStorage.getItem(&#34;names&#34;).split(&#8216;&#124;&#124;&#124;&#8217;);]]></description>
			<content:encoded><![CDATA[<p>Found here <a href="http://stackoverflow.com/questions/3357553/how-to-store-an-array-in-localstorage">http://stackoverflow.com/questions/3357553/how-to-store-an-array-in-localstorage</a> </p>
<p>HTML5â€™s window.localStorage can store anything. But for storing an array itâ€™s a bit tricky. </p>
<p>To store an array suppose:</p>
<p>var names = [â€œAâ€,â€Bâ€];</p>
<p><u><strong>Storing :</strong></u> </p>
<p>localStorage.setItem(&quot;names&quot;, names.join(&#8216;|||&#8217;));&#160; </p>
<p><strong><u>Retriving :</u></strong></p>
<p>var names = localStorage.getItem(&quot;names&quot;).split(&#8216;|||&#8217;);</p>
]]></content:encoded>
			<wfw:commentRss>http://bipins.net/blog/?feed=rss2&#038;p=290</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript custom sort method to sort array of objects</title>
		<link>http://bipins.net/blog/?p=289</link>
		<comments>http://bipins.net/blog/?p=289#comments</comments>
		<pubDate>Wed, 23 Feb 2011 02:23:02 +0000</pubDate>
		<dc:creator>bipin</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.bipins.net/index.php/2011/02/22/javascript-custom-sort-method-to-sort-array-of-objects/</guid>
		<description><![CDATA[&#160; suppose â€œdataâ€ contains an array of object : {&#34;data&#34;: [ { &#34;id&#34;: &#34;1&#34;, &#34;name&#34;: &#34;B&#34; }, { &#34;id&#34;: &#34;2&#34;, &#34;name&#34;: &#34;A&#34; }] } Then the sort() method of that array can take a custom function just like IComparer in C# and sort the array in-memory. &#160; var data = doc.data.sort(function(me,him){ return me.name.localeCompare(him.name); }); This [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>suppose â€œdataâ€ contains an array of object : </p>
<pre>

{&quot;data&quot;: [
      {
         &quot;id&quot;: &quot;1&quot;,
         &quot;name&quot;: &quot;B&quot;
      },
      {
         &quot;id&quot;: &quot;2&quot;,
         &quot;name&quot;: &quot;A&quot;
      }] }

Then the sort() method of that array can take a custom function just

like IComparer in C# and sort the array in-memory. 

&#160;
</pre>
<pre>

var data = doc.data.sort(function(me,him){
		return me.name.localeCompare(him.name);
	});

This will sort the objects above comparing with its name property and 

results into a sorted array of objects with ascending name property. 

&#160;

This blog is for my own reference. 
</pre>
]]></content:encoded>
			<wfw:commentRss>http://bipins.net/blog/?feed=rss2&#038;p=289</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Classes for RSS in C#</title>
		<link>http://bipins.net/blog/?p=288</link>
		<comments>http://bipins.net/blog/?p=288#comments</comments>
		<pubDate>Fri, 18 Feb 2011 18:55:58 +0000</pubDate>
		<dc:creator>bipin</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.bipins.net/index.php/2011/02/18/classes-for-rss-in-c/</guid>
		<description><![CDATA[Was about to write code for RSS thingy but then I found this : In Namespace : System.ServiceModel.Web Â  XmlReader reader = XmlReader.Create("http://localhost/feeds/serializedFeed.xml"); SyndicationFeed feed = SyndicationFeed.Load(reader); Â  MSDN source : http://msdn.microsoft.com/en-us/library/bb515814%28v=VS.90%29.aspx]]></description>
			<content:encoded><![CDATA[<p>
<pre><code>Was about to write code for RSS thingy but then I found this :
</code></pre>
</p>
<p>
<pre><code>In Namespace :  <strong>System.ServiceModel.Web</strong>
			</code></pre>
</p>
<p>
Â </p>
<p>
<pre><code>XmlReader reader = XmlReader.Create(<span style="color:#a31515">"http://localhost/feeds/serializedFeed.xml"</span>);
</code></pre>
</p>
<p><span style="font-family:Courier New; font-size:10pt">SyndicationFeed feed = SyndicationFeed.Load(reader);<br />
</span></p>
<p>
Â </p>
<p>MSDN source : <a href="http://msdn.microsoft.com/en-us/library/bb515814%28v=VS.90%29.aspx">http://msdn.microsoft.com/en-us/library/bb515814%28v=VS.90%29.aspx</a>
	</p>
]]></content:encoded>
			<wfw:commentRss>http://bipins.net/blog/?feed=rss2&#038;p=288</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Goo.gl has an API</title>
		<link>http://bipins.net/blog/?p=287</link>
		<comments>http://bipins.net/blog/?p=287#comments</comments>
		<pubDate>Wed, 09 Feb 2011 02:37:29 +0000</pubDate>
		<dc:creator>bipin</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.bipins.net/index.php/2011/02/08/goo-gl-has-an-api/</guid>
		<description><![CDATA[Googleâ€™s URL shortening service http://goo.gl is the most fastest service available. It had been released before operable only from google toolbar and no API, but some people did some hack and extracted the JavaScript that it used. Now, it does provide a neat API. With goo.gl we can not only create short url but also [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.bipins.net/wp-content/uploads/2011/02/image.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; float: left; padding-top: 0px; border-width: 0px;" title="image" src="http://blog.bipins.net/wp-content/uploads/2011/02/image_thumb.png" border="0" alt="image" width="244" height="203" align="left" /></a></p>
<p>Googleâ€™s URL shortening service <a href="http://goo.gl">http://goo.gl</a> is the most <a href="http://royal.pingdom.com/2010/10/29/is-goo-gl-really-the-fastest-url-shortener-chart/">fastest</a> service available.</p>
<p>It had been released before operable only from google toolbar and no API, but some people did some hack and extracted the JavaScript that it used.</p>
<p>Now, it does provide a neat <a href="http://googlecode.blogspot.com/2011/01/google-url-shortener-gets-api.html" target="_blank">API</a>. <img class="wlEmoticon wlEmoticon-smile" style="border-style: none;" src="http://blog.bipins.net/wp-content/uploads/2011/02/wlEmoticon-smile.png" alt="Smile" /></p>
<p>With goo.gl we can not only create short url but also a QR image that can be used by barcode scanner for mobile devices.</p>
<p>An example of post method :</p>
<pre style="width: 100%; height: 158px;">
<code>curl https://www.googleapis.com/urlshortener/v1/url \
  -H 'Content-Type: application/json' \
  -d '{"longUrl": "http://www.google.com/"}'</code>

<code>would have a JSON response as : </code></pre>
<pre>
<code>{
 "kind": "urlshortener#url",
 "<strong>id</strong>": "http://goo.gl/fbsS",
 "<strong>longUrl</strong>": "http://www.google.com/"
}</code>

A QR code can be generated just adding .qr to the short URL .

<a href="http://goo.gl/fbsS.qr">http://goo.gl/fbsS.qr</a></pre>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://bipins.net/blog/?feed=rss2&#038;p=287</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My blog is back</title>
		<link>http://bipins.net/blog/?p=271</link>
		<comments>http://bipins.net/blog/?p=271#comments</comments>
		<pubDate>Mon, 07 Feb 2011 05:51:32 +0000</pubDate>
		<dc:creator>bipin</dc:creator>
				<category><![CDATA[Blogging]]></category>

		<guid isPermaLink="false">http://blog.bipins.net/?p=271</guid>
		<description><![CDATA[My blog was down for almost 10 days now. My web hosting moved my websites to new system to support a new control panel so that I can &#8230;.. do few things better way like switching between .net versions for ASP.Net. Support tickets went back and forth but sadly they did not take care of [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" title="Website moved " src="http://vatul.net/blog/wp-content/uploads/2009/11/lolcat-failure.jpg" alt="" width="197" height="146" /> My blog was down for almost 10 days now. My web hosting moved my websites to new system to support a new control panel so that I can &#8230;.. do few things better way like switching between .net versions for ASP.Net. Support tickets went back and forth but sadly they did not take care of my blog database, I had to backup and restore it myself. Aaaw &#8230; I still need to restore few other databases and apps that used those databases, I dont even remember all of them. I created them along the timespan of 4 years, since I bought this web hosting.</p>
<p>Well at least I brought my blog back <img src='http://bipins.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  . Still as I remember, the sites that are not working are</p>
<p>t.bipins.net<br />
notes.bipins.net<br />
facebook.bipins.net<br />
chatis.finally.in<br />
*.finally.in <img src='http://bipins.net/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>and few other that I cant remember right now.</p>
<p>(jobs)index3.html is fixed, thanks to a friend who reported it was not working.</p>
<p>Sorry for my friends who used some of my web pages.</p>
]]></content:encoded>
			<wfw:commentRss>http://bipins.net/blog/?feed=rss2&#038;p=271</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Uncaught CurlException: 60: SSL certificate problem, verify that the CA cert is OK.  : exception in facebook php sdk&#8217;s example.php</title>
		<link>http://bipins.net/blog/?p=269</link>
		<comments>http://bipins.net/blog/?p=269#comments</comments>
		<pubDate>Fri, 24 Dec 2010 21:17:17 +0000</pubDate>
		<dc:creator>bipin</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[facebook]]></category>

		<guid isPermaLink="false">http://blog.bipins.net/index.php/2010/12/24/uncaught-curlexception-60-ssl-certificate-problem-verify-that-the-ca-cert-is-ok-exception-in-facebook-php-sdks-example-php/</guid>
		<description><![CDATA[&#160; If you landed to this blog then you must have got above exception. if not :&#160; &#160;&#160;&#160;&#160; When you create a facebook app, and try the first example given in facebook php sdk, this error occurs. Itâ€™s weird and annoying coz this is where you start the development of the application. The solution: found [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>If you landed to this blog then you must have got above exception.</p>
<p>if not :&#160; <br />&#160;&#160;&#160;&#160; When you create a facebook app, and try the first example given in facebook php sdk, this error occurs. Itâ€™s weird and annoying coz this is where you start the development of the application.</p>
<p>The solution: </p>
<p>found at <a title="http://forum.developers.facebook.net/viewtopic.php?pid=258460" href="http://forum.developers.facebook.net/viewtopic.php?pid=258460">http://forum.developers.facebook.net/viewtopic.php?pid=258460</a></p>
<p>add this between after include of facebook library and before creating facebook object. </p>
<p>Facebook::$CURL_OPTS[CURLOPT_SSL_VERIFYPEER] = false;   <br />Facebook::$CURL_OPTS[CURLOPT_SSL_VERIFYHOST] = 2;</p>
<p>something like this </p>
<p><font size="2" face="Courier New">require &#8216;src/facebook.php&#8217;;</font></p>
<p><strong><font size="2" face="Courier New">Facebook::$CURL_OPTS[CURLOPT_SSL_VERIFYPEER] = false;       <br />Facebook::$CURL_OPTS[CURLOPT_SSL_VERIFYHOST] = 2;</font></strong></p>
<p><font size="2" face="Courier New">// Create our Application instance (replace this with your appId and secret).     <br />$facebook = new Facebook(array(      <br />&#160; &#8216;appId&#8217;&#160; =&gt; FACEBOOK_APP_ID,      <br />&#160; &#8216;secret&#8217; =&gt; FACEBOOK_SECRET,      <br />&#160; &#8216;cookie&#8217; =&gt; true,      <br />));</font></p>
<p>Happy coding <img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://blog.bipins.net/wp-content/uploads/2010/12/wlEmoticon-smile.png" /></p>
]]></content:encoded>
			<wfw:commentRss>http://bipins.net/blog/?feed=rss2&#038;p=269</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to: create like of facebook for dynamic pages</title>
		<link>http://bipins.net/blog/?p=267</link>
		<comments>http://bipins.net/blog/?p=267#comments</comments>
		<pubDate>Tue, 21 Dec 2010 00:01:00 +0000</pubDate>
		<dc:creator>bipin</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Just_for_fun]]></category>

		<guid isPermaLink="false">http://blog.bipins.net/index.php/2010/12/20/how-to-create-like-of-facebook-for-dynamic-pages/</guid>
		<description><![CDATA[&#160; First, to create a like button for a static URL: 1. goto http://developers.facebook.com/docs/reference/plugins/like 2. Enter URL and other details 3. Get code 4. Put it in your web page That takes care of how to put a like button for 1 page. Now for dynamic pages, where pageâ€™s content is changing and you would [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>First, to create a like button for a static URL:</p>
<p>1. goto <a title="http://developers.facebook.com/docs/reference/plugins/like" href="http://developers.facebook.com/docs/reference/plugins/like">http://developers.facebook.com/docs/reference/plugins/like</a></p>
<p>2. Enter URL and other details</p>
<p>3. Get code </p>
<p>4. Put it in your web page </p>
<p>That takes care of how to put a like button for 1 page. </p>
<p>Now for dynamic pages, where pageâ€™s content is changing and you would want a unique button for individual url/page/content and different text to be displayed on facebook wall. </p>
<p>For that there are open graph tags tags that facebook provided on page <a title="http://developers.facebook.com/docs/reference/plugins/like" href="http://developers.facebook.com/docs/reference/plugins/like">http://developers.facebook.com/docs/reference/plugins/like</a></p>
<p>The tags are :    </p>
<p><code>og:title</code> , <code>og:type, </code><code>og:image</code> , <code>og:url</code> , <code>og:site_name</code> , <code>fb:admins</code> or <code>fb:app_id</code> </p>
<p>you add those tags as    </p>
<pre><code>&lt;meta property=&quot;og:tag name&quot; content=&quot;tag value&quot;/&gt;
</code></pre>
<p>All tags are compulsory. </p>
<p>og:title tag will contain text to display on your wall after you click the like button. </p>
<p>og:url will contain the actual URL of dynamic page </p>
<p>fb:admins add your own facebook id so that you will be admin of your page. It allows you to see who have clicked on the like button. </p>
<p>Then get the code for your site and generate the part after </p>
<p>href=httpâ€¦. in that code dynamically. that would be your dynamic pageâ€™s URL. </p>
<p>example : <a title="http://www.bipins.net/q/?id=15" href="http://www.bipins.net/q/?id=15">http://www.bipins.net/q/?id=15</a></p>
<p>The highlighted parts are the ones that are generated dynamically. </p>
<pre>&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xmlns:og=&quot;http://opengraphprotocol.org/schema/&quot; xmlns:fb=&quot;http://www.facebook.com/2008/fbml&quot;&gt;</pre>
<pre>&lt;head&gt;</pre>
<pre>&lt;title&gt;Nothing great was ever achieved without enthusiasm.&lt;/title&gt;</pre>
<pre>&lt;meta property=&quot;og:site_name&quot; content=&quot;<font style="background-color: #ffff00">Quotes</font>&quot;/&gt;	&lt;meta property=&quot;og:title&quot; content=&quot;<font style="background-color: #ffff00">Nothing great was ever achieved without enthusiasm.</font>&quot;/&gt;	 &lt;meta property=&quot;og:type&quot; content=&quot;blog&quot; /&gt;	 &lt;meta property=&quot;og:image&quot; content=&quot;http://bipins.net/favicon.ico&quot; /&gt;	 &lt;meta property=&quot;fb:admins&quot; content=&quot;98634567894&quot; /&gt;	 &lt;meta property=&quot;og:url&quot; content=&quot;<font style="background-color: #ffff00">http://bipins.net/q/?id=15</font>&quot; /&gt;&lt;/head&gt;&lt;body&gt;&lt;h2&gt; Nothing great was ever achieved without enthusiasm. &lt;/h2&gt;

&lt;iframe src=&quot;<a href="view-source:http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.bipins.net%2Fq%2F%3Fid=15&amp;layout=standard&amp;width=450&amp;action=like&amp;show_faces=true&amp;font=verdana&amp;colorscheme=light&amp;height=80">http://www.facebook.com/plugins/like.php?href=<font style="background-color: #ffff00">http%3A%2F%2Fwww.bipins.net%2Fq%2F%3Fid=15</font>&amp;amp;layout=standard&amp;amp;width=450&amp;amp;action=like&amp;amp;show_faces=true&amp;amp;font=verdana&amp;amp;colorscheme=light&amp;amp;height=80</a>&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;border:none; overflow:hidden; &quot; allowTransparency=&quot;true&quot;&gt;&lt;/iframe&gt;&lt;/body&gt;&lt;/html&gt;</pre>
<p>&#160;</p>
<p>&#160;</p>
<p>Usage:</p>
<p>* It can be used to create sites like <a title="http://www.justliking.com/" href="http://www.justliking.com/">http://www.justliking.com/</a></p>
<p>* Create your own like widget for your website / dynamic pages / blog </p>
]]></content:encoded>
			<wfw:commentRss>http://bipins.net/blog/?feed=rss2&#038;p=267</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Text to image in ASP.net C#</title>
		<link>http://bipins.net/blog/?p=260</link>
		<comments>http://bipins.net/blog/?p=260#comments</comments>
		<pubDate>Fri, 23 Jul 2010 00:36:57 +0000</pubDate>
		<dc:creator>bipin</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://blog.bipins.net/index.php/2010/07/22/text-to-image-in-asp-net-c/</guid>
		<description><![CDATA[&#1084;&#1072;&#1090;&#1088;&#1072;&#1094;&#1080;Sounds fun? Well it was fun to me at least. Before I forget that I even did this, I thought Iâ€™d write about it. 1. Create a bitmap image 2. Create a graphics object from Bipmap image 3. Draw text using graphics object onto that bitmap image 4. Save bitmap image into desired format using [...]]]></description>
			<content:encoded><![CDATA[<p><font style="position: absolute;overflow: hidden;height: 0;width: 0"><a href="http://www.videnov.com/">&#1084;&#1072;&#1090;&#1088;&#1072;&#1094;&#1080;</a></font>Sounds fun? Well it was fun to me at least. Before I forget that I even did this, I thought Iâ€™d write about it.</p>
<p>1. Create a bitmap image<br />
2. Create a graphics object from Bipmap image<br />
3. Draw text using graphics object onto that bitmap image<br />
4. Save bitmap image into desired format using Response.outputstream<br />
This will directly send the image to the browser.</p>
<p>Whatâ€™s the use ?<br />
* Image of text on demand. You can use &lt;img src=â€http://location/?text=helloâ€ /&gt;</p>
<p><a href="http://www.bipins.net/texttoimage.aspx?q=Like this" target="_blank"><img src="http://www.bipins.net/texttoimage.aspx?q=Like This :)" alt="" /></a><br />
* more parameters you can add to render text on different fonts or do any karate you wish</p>
<p>* or whatever comes to your mind â€¦.</p>
<p><a href="http://bipins.net/texttoimage.aspx" target="_blank">demo</a></p>
<p><span style="text-decoration: underline;">Code:</span> which youâ€™d put on Page_Load</p>
<p>Bitmap objBMP;<br />
Graphics objGraphics;<br />
Font objFont;</p>
<p>int height =30<br />
int width = 200<br />
Color bgcolor = Color.White;<br />
string fontname =&#8221;Arial&#8221;;<br />
int fontsize = 10;<br />
FontStyle fontstyle = FontStyle.Regular;</p>
<p>string input = &#8220;Sample Text&#8221;</p>
<p>Brush brushColor = Brushes.Black;<br />
int textX = 0;<br />
int textY = 3;<br />
ImageFormat imgFormat = ImageFormat.Jpeg;<br />
objBMP = new System.Drawing.Bitmap(width, height);</p>
<p>objGraphics = Graphics.FromImage(objBMP);<br />
objGraphics.Clear(bgcolor);</p>
<p>objGraphics.TextRenderingHint = TextRenderingHint.SystemDefault;</p>
<p>objFont = new Font(fontname, fontsize, fontstyle);</p>
<p>objGraphics.DrawString(input, objFont, brushColor, textX, textY);</p>
<p>Response.ContentType = &#8220;image/jpeg&#8221;;</p>
<p>objBMP.Save(Response.OutputStream, imgFormat);</p>
<p>objFont.Dispose();<br />
objGraphics.Dispose();<br />
objBMP.Dispose();</p>
<pre class="code">
<span style="color: #2b91af;">                </span>
</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://bipins.net/blog/?feed=rss2&#038;p=260</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Given digits and values, find suitable expression</title>
		<link>http://bipins.net/blog/?p=253</link>
		<comments>http://bipins.net/blog/?p=253#comments</comments>
		<pubDate>Sun, 14 Feb 2010 07:38:52 +0000</pubDate>
		<dc:creator>bipin</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.bipins.net/index.php/2010/02/14/given-digits-and-values-find-suitable-expression/</guid>
		<description><![CDATA[/* Write a function that given a string of digits and a target value, prints where to put +'s and *'s between the digits so they combine exactly to the target value. Note there may be more than one answer, it doesn't matter which one you print. Examples: "1231231234",11353 -&#62; "12*3+1+23*123*4" "3456237490",1185 -&#62; "3*4*56+2+3*7+490" "3456237490",9191 [...]]]></description>
			<content:encoded><![CDATA[<pre class="code"><span style="color: green;">/* Write a function that given a string of digits and a target value, prints where to put +'s and *'s between the digits so they combine exactly to the target value. Note there may be more than one answer, it doesn't matter which one you print. Examples: "1231231234",11353 -&gt; "12*3+1+23*123*4" "3456237490",1185 -&gt; "3*4*56+2+3*7+490" "3456237490",9191 -&gt; "no solution" program made in windows / cygwin g++ with Netbeans IDE */ </span><span style="color: blue;">#include </span><span style="color: #a31515;">&lt;iostream&gt; </span><span style="color: blue;">#include </span><span style="color: #a31515;">&lt;string&gt; </span><span style="color: blue;">#include </span><span style="color: #a31515;">&lt;math.h&gt; </span><span style="color: blue;">#include </span><span style="color: #a31515;">&lt;vector&gt; </span><span style="color: blue;">using namespace </span>std;

string findExprSymbols(<span style="color: blue;">int </span>n, <span style="color: blue;">int </span>pos)
{
    string s = <span style="color: #a31515;">"+*-"</span>;

    <span style="color: blue;">int </span>rem = pos;
    <span style="color: blue;">int </span>div = 1;
    string ret = <span style="color: #a31515;">""</span>;
    <span style="color: blue;">for</span>(<span style="color: blue;">int </span>j=0;j&lt;n;j++)
        {

            div = (<span style="color: blue;">int</span>)pow(3,n-(j+1));
            <span style="color: blue;">int </span>index = rem / div ;
            rem = rem  % div;
            ret += s.at(index);
        }
   <span style="color: blue;">return </span>ret;
}

string getExpres(string digits,string expression,<span style="color: blue;">int </span>&amp; value)
{
    string exp=<span style="color: #a31515;">""</span>;
    exp= exp + digits.at(0);
    string current = exp;
    vector&lt;string&gt; mystack;
    <span style="color: blue;">int </span>last = 0;
    <span style="color: blue;">for</span>(<span style="color: blue;">int </span>i=0;i&lt;expression.size();i++)
    {
        <span style="color: blue;">switch</span>(expression.at(i))
        {
            <span style="color: blue;">case </span><span style="color: #a31515;">'+'</span>:
                exp= exp + <span style="color: #a31515;">'+'</span>+digits.at(i+1);
                mystack.push_back(current);
                mystack.push_back(<span style="color: #a31515;">"+"</span>);
                current= digits.at(i+1);
                <span style="color: blue;">break</span>;
            <span style="color: blue;">case </span><span style="color: #a31515;">'-'</span>:
                exp= exp + digits.at(i+1);
                current = current + digits.at(i+1);
                <span style="color: blue;">break</span>;
            <span style="color: blue;">case </span><span style="color: #a31515;">'*'</span>:
                exp= exp + <span style="color: #a31515;">'*'</span>+digits.at(i+1);
                mystack.push_back(current);
                mystack.push_back(<span style="color: #a31515;">"*"</span>);
                current= digits.at(i+1);
                <span style="color: blue;">break</span>;
        }
    }
    mystack.push_back(current);
    vector&lt;<span style="color: blue;">int</span>&gt; evalstack;
    <span style="color: blue;">int </span>j=mystack.size()-1;
    <span style="color: blue;">int </span>temp;
    <span style="color: blue;">for</span>(;j&gt;=0;j--)
    {
        string str = mystack.at(j);
        <span style="color: blue;">if</span>(str==<span style="color: #a31515;">"*"</span>)
        {
            temp = evalstack.back();
            temp = atoi(mystack.at(j-1).c_str()) * temp;
            evalstack.pop_back();
            evalstack.push_back(temp);
            j--;
        }
        <span style="color: blue;">else if</span>( str == <span style="color: #a31515;">"+"</span>)
        {
            temp = atoi(mystack.at(j-1).c_str());
            evalstack.push_back(temp);
            j--;
        }
        <span style="color: blue;">else</span>{
            temp = atoi(str.c_str());
            evalstack.push_back(temp);
        }
    }
    <span style="color: blue;">int </span>final = 0;
    <span style="color: blue;">for</span>(<span style="color: blue;">int </span>x=0;x&lt;evalstack.size();x++)
    {
        final+=evalstack.at(x);
    }
    value = final;
    <span style="color: green;">//cout&lt;&lt;final&lt;&lt;endl; </span><span style="color: blue;">return </span>exp;
}

<span style="color: blue;">int </span>main(<span style="color: blue;">int </span>argc, <span style="color: blue;">char</span>** argv) {
    string digits ;
    <span style="color: blue;">int </span>result;
    cin&gt;&gt;digits;
    cin&gt;&gt;result;

    <span style="color: green;">//string digits="1231231234"; </span><span style="color: blue;">int </span>value;
    <span style="color: blue;">double </span>total = pow(3,digits.size()-1);
    <span style="color: blue;">bool </span>done=<span style="color: blue;">false</span>;
    <span style="color: blue;">for</span>(<span style="color: blue;">int </span>i=0;i&lt;total;i++)
    {
        string expr = findExprSymbols(digits.size()-1,i);
        string myexp = getExpres(digits,expr,value);

            <span style="color: blue;">if</span>( value == result)
            {
                cout&lt;&lt;myexp&lt;&lt;<span style="color: #a31515;">"="</span>&lt;&lt;value&lt;&lt;endl;
                done = <span style="color: blue;">true</span>;
                <span style="color: blue;">break</span>;
            }
    }
    <span style="color: blue;">if</span>(!done)
    {
        cout&lt;&lt;<span style="color: #a31515;">" no solution"</span>&lt;&lt;endl;
    }
    <span style="color: blue;">return </span>(EXIT_SUCCESS);
}</pre>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://bipins.net/blog/?feed=rss2&#038;p=253</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Python and the cloud</title>
		<link>http://bipins.net/blog/?p=248</link>
		<comments>http://bipins.net/blog/?p=248#comments</comments>
		<pubDate>Thu, 03 Sep 2009 23:11:49 +0000</pubDate>
		<dc:creator>bipin</dc:creator>
				<category><![CDATA[Blogging]]></category>

		<guid isPermaLink="false">http://blog.bipins.net/index.php/2009/09/03/python-and-the-cloud/</guid>
		<description><![CDATA[Day 3: Previously, I tried web.py. Itâ€™s cool. But my hosting does not provide python CGI support. Now what?&#160; I had heard that googleâ€™s cloud thing â€“&#62; google app engine , that supports python. So I gave it a try, - created google app engine account - downloaded sdk - ran thru the â€œgetting startedâ€ [...]]]></description>
			<content:encoded><![CDATA[<p>Day 3: Previously, I tried web.py. Itâ€™s cool. But my hosting does not provide python CGI support. Now what?&#160; I had heard that googleâ€™s cloud thing â€“&gt; google app engine , that supports python. So I gave it a try, </p>
<p>- created <a href="http://code.google.com/appengine/" target="_blank">google app engine</a> account</p>
<p>- <a href="http://code.google.com/appengine/downloads.html" target="_blank">downloaded sdk</a></p>
<p>- ran thru the <a href="http://code.google.com/appengine/docs/python/gettingstarted/" target="_blank">â€œgetting startedâ€</a></p>
<p>Now, it hosts a python application. </p>
<p>The cool part is, it runs on google app engine also known as GAE ( does not sound so good <img src='http://bipins.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  )</p>
<p><font style="position: absolute;overflow: hidden;height: 0;width: 0"><a href="http://www.videnov.com/">&#1086;&#1092;&#1080;&#1089; &#1086;&#1073;&#1079;&#1072;&#1074;&#1077;&#1078;&#1076;&#1072;&#1085;&#1077;</a></font>
<p>They have their own data store, the DJango like data model, GQL for accessing and querying the data, cool admin interface to do lot of things. </p>
<p>So I made this app&#160;&#160;&#160; <a href="http://hamro-app.appspot.com">http://hamro-app.appspot.com</a>&#160;&#160; from the tutorials. </p>
<p>Now, later I found out, which is quite exciting for me, is that they support custom domain names,&#160; like i can use my own domain name to host the app, so the same app can be accessed through <a href="http://hamro-app.bipins.net">http://hamro-app.bipins.net</a> . Its just a test app though. So, now I have python powered, highly scalable, web application / service. Thanks to app engine. </p>
]]></content:encoded>
			<wfw:commentRss>http://bipins.net/blog/?feed=rss2&#038;p=248</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Internet notepad cl1p.net vs notes.bipins.net</title>
		<link>http://bipins.net/blog/?p=246</link>
		<comments>http://bipins.net/blog/?p=246#comments</comments>
		<pubDate>Tue, 01 Sep 2009 23:52:48 +0000</pubDate>
		<dc:creator>bipin</dc:creator>
				<category><![CDATA[Blogging]]></category>

		<guid isPermaLink="false">http://blog.bipins.net/index.php/2009/09/01/internet-notepad-cl1p-net-vs-notes-bipins-net/</guid>
		<description><![CDATA[cl1p.net is a well known internet notepad. It has great features and use. Comes very handy and useful. &#160; But I felt I can make that thing too . So I made it. http://notes.bipins.net (beta) Integrated with TinyMCE. One can: 1. Save and Retrive Its on beta and Iâ€™ve used SQLite for quick POC ( [...]]]></description>
			<content:encoded><![CDATA[<p>cl1p.net is a well known internet notepad. It has great features and use. Comes very handy and useful. </p>
<p>&#160;</p>
<p>But I felt I can make that thing too <img src='http://bipins.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  . So I made it. </p>
<p><a href="http://notes.bipins.net">http://notes.bipins.net</a> (beta)</p>
<p>Integrated with <a href="http://tinymce.moxiecode.com/" target="_blank">TinyMCE</a>.</p>
<p>One can:    </p>
<p>1. Save and Retrive</p>
<p>Its on beta and Iâ€™ve used SQLite for quick POC ( proof of concept ). Iâ€™ll migrate it to MSSQL database soon) Currently text size limitation is 4000 char. After migration to MSSQL Iâ€™ll increase it to text â€“&gt; 2<sup> ^ 31 characters. </sup></p>
<p>To be done : </p>
<p>1. Password protect documents</p>
<p>2. Export to .pdf </p>
<p>3. Export to .doc</p>
<p>Please send your suggestions to mail [at] bipins.net</p>
]]></content:encoded>
			<wfw:commentRss>http://bipins.net/blog/?feed=rss2&#038;p=246</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The python thingy</title>
		<link>http://bipins.net/blog/?p=243</link>
		<comments>http://bipins.net/blog/?p=243#comments</comments>
		<pubDate>Tue, 01 Sep 2009 01:56:42 +0000</pubDate>
		<dc:creator>bipin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.bipins.net/index.php/2009/08/31/the-python-thingy/</guid>
		<description><![CDATA[Python guru used to tell me python is nice, python is easy. I should have listened to him then. But anyway now i felt I had time and I can or I shoud? ( should I ?). I should have actually. At least I should have tried to understand the â€œuser creation scriptâ€ made by [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://regmee.com">Python guru</a> used to tell me python is nice, python is easy. I should have listened to him then. But anyway now i felt I had time and I can or I shoud? ( should I ?). I should have actually. At least I should have tried to understand the â€œuser creation scriptâ€ made by <a href="http://http://paul.steni.us">the genious boy</a> . I thought its not my thing, but as I can feel now, its quite interesting. Anyway :</p>
<p>Day One: Python Crash course : <a title="http://hetland.org/writing/instant-python.html" href="http://hetland.org/writing/instant-python.html">http://hetland.org/writing/instant-python.html</a></p>
<p>Then what? Then I asked the <a href="http://regmee.com">Guru</a> again and he suggested me few. He gave me links to web.py</p>
<p>Day Two: <a title="http://webpy.org/" href="http://webpy.org/">http://webpy.org/</a></p>
<p>Now, I understood how the genious kid made his server in python and the app thing he had been running at his VPS. I wanted a server too <img src='http://bipins.net/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> . But my hosting provider <a href="http://www.reliablesite.net">Reliablesite.net</a> does not support python. Anyways, no probs, I can do it my way. Hosted on my own machine to test <a href="http://python.bipins.net">http://python.bipins.net</a> points to my router and then to my laptop <img src='http://bipins.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Then what? I asked the <a href="http://regmee.com">Guru</a> again. He said to learn about dictionaries, web.py , mysql, meta programmingÂ  <img src='http://bipins.net/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  . He had worked in some porting of python to .net or vice versa or dunno something like that. Too much to chew. I chewed just a little bit, web.py thing was good enough for me.</p>
<p>Was trying to configure apache and mod_python , dunno what went wrong. Anyway , tried then in IIS and holy coolness, it worked â€¦.. yippie .. followed this link <a title="http://net4geeks.com/index.php?option=com_content&amp;task=view&amp;id=48&amp;Itemid=1" href="http://net4geeks.com/index.php?option=com_content&amp;task=view&amp;id=48&amp;Itemid=1">http://net4geeks.com/index.php?option=com_content&amp;task=view&amp;id=48&amp;Itemid=1</a></p>
<p>and the test app run succesfully at <a title="http://python.bipins.net/python/python.py" href="http://python.bipins.net/python/python.py">http://python.bipins.net/python/python.py</a></p>
<p> <img src='http://bipins.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Now what ?</p>
<p>same question repeats again and again. postponed the question to few days later. Even postponed farmville for few days and planted watermelons, takes 4 days to grow <img src='http://bipins.net/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> . Will write about it later.</p>
]]></content:encoded>
			<wfw:commentRss>http://bipins.net/blog/?feed=rss2&#038;p=243</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Protected: â€œDesirableâ€ numbers</title>
		<link>http://bipins.net/blog/?p=238</link>
		<comments>http://bipins.net/blog/?p=238#comments</comments>
		<pubDate>Sun, 30 Aug 2009 06:31:56 +0000</pubDate>
		<dc:creator>bipin</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.bipins.net/index.php/2009/08/30/desirable-numbers/</guid>
		<description><![CDATA[There is no excerpt because this is a protected post.]]></description>
			<content:encoded><![CDATA[<form action="http://bipins.net/blog/wp-pass.php" method="post">
<p>This post is password protected. To view it please enter your password below:</p>
<p><label for="pwbox-238">Password:<br />
<input name="post_password" id="pwbox-238" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="Submit" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://bipins.net/blog/?feed=rss2&#038;p=238</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Non Recursive approach to generate possible combinations of characters in password</title>
		<link>http://bipins.net/blog/?p=229</link>
		<comments>http://bipins.net/blog/?p=229#comments</comments>
		<pubDate>Fri, 14 Aug 2009 08:51:53 +0000</pubDate>
		<dc:creator>bipin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://blog.bipins.net/index.php/2009/08/14/non-recursive-approach-to-generate-possible-combinations-of-characters-in-password/</guid>
		<description><![CDATA[Q). Given a password : Write an algorithm to print all possible combinations of that password. /* A non recursive approach to the problem and similar problems which has to generate permutation of certain set of characters. The idea here is to first find the number of possible combinations of output. Say, n is the [...]]]></description>
			<content:encoded><![CDATA[<p>Q). Given a password : Write an algorithm to print all possible combinations of that password.</p>
<pre class="code"><span style="color: green">/*
A non recursive approach to the problem and similar problems which has to generate permutation of certain set of characters.

The idea here is to first find the number of possible combinations of output.
Say, n is the length : possible combination  = n!
Then to find the formula that would repeat the pattern. The recursive method broken down into linear/ incremental formula.

The recursion is converted to a loop of   size n!.

A technique should be generated that could give us the combination output given any instance of value of loop index.

Say if n=4,  n! = 24.
So at any instance, say when loopindex = 11 then it should give the sequence that would be generated on 11th position.

For that, we find out position of each character in the remaining set.
say, for    given  "1234"
1st char will be  at position  index / (n-1)!  =  11/ 6 = 1  , so first char = 2;
now the given set should exclude the output char =&gt;   remaining "134"
now in the remaining set , the index also decreases
the decrement of index , ie. 11   will be = index % (n-1)! = 11 % 6 = 5

Again,   index / (n-1)! = 5 / (3-1)! = 0 , so char = 1
remaining set = "34"

and so on

It can be used for any amount of number or characters.

*/

</span><span style="color: blue">#include</span><span style="color: #a31515">&lt;iostream&gt;
</span><span style="color: blue">#include</span><span style="color: #a31515">&lt;string&gt;

</span><span style="color: blue">using namespace </span>std;
<span style="color: blue">int </span>facto(<span style="color: blue">int </span>x)
{
    <span style="color: blue">int </span>fact=1;
    <span style="color: blue">while</span>(x&gt;0) fact*=x--;
    <span style="color: blue">return </span>fact;
}

<span style="color: blue">int </span>main(<span style="color: blue">int </span>argc, <span style="color: blue">char </span>**argv)
{
    string s;
    <span style="color: blue">int </span>len,fact,rem=0,pos=0;

    cin&gt;&gt;s; <span style="color: green">// Input is take as string, it can be checked if it is a number or not, I'm just making it generic
    </span>len=s.size();
    fact = facto(len);
    <span style="color: green">// Main loop
    </span><span style="color: blue">for</span>(<span style="color: blue">int </span>i=0;i&lt;fact;i++)
    {
        string str = s;
        rem = i;
        cout&lt;&lt;i+1&lt;&lt;<span style="color: #a31515">". "</span>;
        <span style="color: blue">for</span>(<span style="color: blue">int </span>j=len;j&gt;0;j--)
        {
            <span style="color: blue">int </span>div = facto ( j-1);
            pos = rem / div; <span style="color: green">// finding out position
            </span>rem = rem % div; <span style="color: green">// adjusting the index value
            </span>cout&lt;&lt;str.at(pos); <span style="color: green">// output char
            </span>str = str.erase(pos,1); <span style="color: green">// decreasing the problem set size
        </span>}
        cout&lt;&lt;endl;
    }
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<pre></pre>
<pre></pre>
]]></content:encoded>
			<wfw:commentRss>http://bipins.net/blog/?feed=rss2&#038;p=229</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>implementing printf()</title>
		<link>http://bipins.net/blog/?p=212</link>
		<comments>http://bipins.net/blog/?p=212#comments</comments>
		<pubDate>Wed, 08 Jul 2009 16:15:04 +0000</pubDate>
		<dc:creator>bipin</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.bipins.net/index.php/2009/07/08/implementing-printf/</guid>
		<description><![CDATA[How would i implement my own printf() ? well, using stdarg.h we could create a function that can take any number of parameters. Then just parsing through each argument and writing it into standard output. http://www.careercup.com/question?id=139667&#38;form=comments &#160; #include &#60;stdio.h&#62; #include &#60;stdlib.h&#62; #include &#60;stdarg.h&#62; #include&#60;string.h&#62; #define STDOUT 1 #define MAX_INT_LEN 10 //function foo taken from manpages [...]]]></description>
			<content:encoded><![CDATA[<p>How would i implement my own printf() ?</p>
<p>well, using stdarg.h we could create a function that can take any number of parameters. Then just parsing through each argument and writing it into standard output. </p>
<p><a title="http://www.careercup.com/question?id=139667&amp;form=comments" href="http://www.careercup.com/question?id=139667&amp;form=comments">http://www.careercup.com/question?id=139667&amp;form=comments</a></p>
<p>&#160;</p>
<p>#include &lt;stdio.h&gt;   <br />#include &lt;stdlib.h&gt;    <br />#include &lt;stdarg.h&gt;    <br />#include&lt;string.h&gt; </p>
<p>#define STDOUT 1   <br />#define MAX_INT_LEN 10</p>
<p>//function foo taken from manpages of stdarg    <br />void Printf(char *fmt, &#8230;)    <br /> {    <br />&#160;&#160;&#160; va_list ap;    <br />&#160;&#160;&#160; int d;    <br />&#160;&#160;&#160; char c, *s;    <br />&#160;&#160;&#160; va_start(ap, fmt);    <br />&#160;&#160;&#160; while (*fmt)    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; switch (*fmt++) {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#8216;s&#8217;: /* string */    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; s = va_arg(ap, char *);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; write(STDOUT, s, strlen(s));    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#8216;d&#8217;: /* int */    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; d = va_arg(ap, int);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; s = malloc(MAX_INT_LEN);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sprintf(s, &quot;%d&quot;, d); // lame attempt to convert int to string, no itoa() in linux <img src='http://bipins.net/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; write(STDOUT, s, strlen(s));    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; free(s);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#8216;c&#8217;: /* char */    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; /* need a cast here since va_arg only    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; takes fully promoted types */    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; c = (char) va_arg(ap, int);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; write(STDOUT, &amp;c, 1);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break; </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }   <br />&#160;&#160;&#160; va_end(ap);    <br />} </p>
<p>int main() {   <br />&#160;&#160;&#160; Printf(&quot;%s %d %c&quot;, &quot;hello world&quot;, 123456 , &#8216;s&#8217;);    <br />}</p>
]]></content:encoded>
			<wfw:commentRss>http://bipins.net/blog/?feed=rss2&#038;p=212</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

