<?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>Rocker &#187; Projects</title>
	<atom:link href="http://www.shishirsharma.com/category/projects/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.shishirsharma.com</link>
	<description>Everything bloggable around Shishir Sharma.</description>
	<lastBuildDate>Fri, 06 Jan 2012 09:47:18 +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>Grab the net with Arduino</title>
		<link>http://www.shishirsharma.com/2011/12/29/grab-the-net-with-arduino/</link>
		<comments>http://www.shishirsharma.com/2011/12/29/grab-the-net-with-arduino/#comments</comments>
		<pubDate>Thu, 29 Dec 2011 12:53:24 +0000</pubDate>
		<dc:creator>Shishir Sharma 'criss'</dc:creator>
				<category><![CDATA[Customization]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Arduino Ethernet Shield]]></category>
		<category><![CDATA[Arduino Html Client]]></category>

		<guid isPermaLink="false">http://www.shishirsharma.com/?p=1114</guid>
		<description><![CDATA[How to access a website with multiple virtual hots from Arduino Ethernet Shield. The problem is if you have used Arduino Ethernet Shield, then you know that you can connect a IP, But if the IP has multiple virtual hosts, &#8230; <a href="http://www.shishirsharma.com/2011/12/29/grab-the-net-with-arduino/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>How to access a website with multiple virtual hots from Arduino Ethernet Shield. The problem is if you have used Arduino Ethernet Shield, then you know that you can connect a IP, But if the IP has multiple virtual hosts, it will only connect to default virtual host. If it is commercial shared VPS, You wont be able to make your site default.</p>
<p>Gist is use of HTTP protocol which allows you to define host in your request on virtual host server. Here are the possible headers.</p>
<p><a href="http://en.wikipedia.org/wiki/List_of_HTTP_headers">http://en.wikipedia.org/wiki/List_of_HTTP_headers</a></p>
<p>You should also provide basic debugging info like &#8220;User-Agent&#8221; etc.</p>
<pre>#include &lt;SPI.h&gt;
#include &lt;Ethernet.h&gt;

// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[]            = {  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[]             = { 192, 168,   6,  30 };

byte server[]         = { ***, ***, 168,  16 }; // Your VPS

// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
Client client(server, 80);

String response = "";

void setup() {
  Ethernet.begin(mac, ip);
  Serial.begin(9600);
  // Give the Ethernet shield a second to initialize
  delay(1000);
  Serial.println("Connecting...");
}

void loop() {
  if (!client.available() &amp;&amp; client.connect()) {
    Serial.println("-- Connected");
    // Make a HTTP request:
    client.println("GET /bot HTTP/1.0");
    client.println("Host: example.com");
    client.println("User-Agent: Arduino/Shishir (mail.mastermind [at] gmail.com)");
    client.println();
  }
  if (client.available()) {
    char c = client.read();
    response.concat(c);
  }
  if(!client.connected()){
    process(response);
    //Serial.print(response);
  }
  if (!client.connected() &amp;&amp; reset == 1) {
    Serial.println("disconnecting.");
    client.stop();
    response = "";
    delay(1000*10);
  }
}
void process(String response) {
  Serial.println(response);
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.shishirsharma.com/2011/12/29/grab-the-net-with-arduino/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>IRB Console with history and logging</title>
		<link>http://www.shishirsharma.com/2011/12/28/irb-console-with-history-and-logging/</link>
		<comments>http://www.shishirsharma.com/2011/12/28/irb-console-with-history-and-logging/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 06:58:52 +0000</pubDate>
		<dc:creator>Shishir Sharma 'criss'</dc:creator>
				<category><![CDATA[Customization]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[IRB]]></category>
		<category><![CDATA[Rails Console]]></category>

		<guid isPermaLink="false">http://www.shishirsharma.com/?p=1098</guid>
		<description><![CDATA[I spend most time with IRB or Rails/console. These are good settings on which I have settled with over the time. These will allow you to have basic logging and IRB history. Just put these in the ~/.irbrc file (If &#8230; <a href="http://www.shishirsharma.com/2011/12/28/irb-console-with-history-and-logging/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I spend most time with IRB or Rails/console. These are good settings on which I have settled with over the time. These will allow you to have basic logging and IRB history. Just put these in the ~/.irbrc file (If file doesn&#8217;t exist then create one).</p>
<pre># -*- Ruby-*-
require 'irb/completion'
require 'irb/ext/save-history'

ARGV.concat [ "--readline",
              "--prompt-mode",
              "simple" ]

# 25 entries in the list
IRB.conf[:SAVE_HISTORY] = 100

# Store results in home directory with specified file name
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-history"

script_console_running = ENV.include?('RAILS_ENV') &amp;&amp; IRB.conf[:LOAD_MODULES] &amp;&amp; IRB.conf[:LOAD_MODULES].include?('console_with_helpers')
rails_running = ENV.include?('RAILS_ENV') &amp;&amp; !(IRB.conf[:LOAD_MODULES] &amp;&amp; IRB.conf[:LOAD_MODULES].include?('console_with_helpers'))
irb_standalone_running = !script_console_running &amp;&amp; !rails_running

if script_console_running
  require 'logger'
  Object.const_set(:RAILS_DEFAULT_LOGGER, Logger.new(STDOUT))
end</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.shishirsharma.com/2011/12/28/irb-console-with-history-and-logging/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Arduino Ethernet Shield and Webclient</title>
		<link>http://www.shishirsharma.com/2011/09/11/arduino-ethernet-shield-and-webclient/</link>
		<comments>http://www.shishirsharma.com/2011/09/11/arduino-ethernet-shield-and-webclient/#comments</comments>
		<pubDate>Sun, 11 Sep 2011 16:21:55 +0000</pubDate>
		<dc:creator>Shishir Sharma 'criss'</dc:creator>
				<category><![CDATA[Ardoino]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Platform]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.shishirsharma.com/?p=1066</guid>
		<description><![CDATA[First thing you do when you get a Ethernet Shield for Arduino (in my case Duemilanove). You will be uploading various example sketches. I was doing the same Ardoino was working flawlessly and then I got stuck in WebClient sketch. I &#8230; <a href="http://www.shishirsharma.com/2011/09/11/arduino-ethernet-shield-and-webclient/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>First thing you do when you get a Ethernet Shield for Arduino (in my case Duemilanove). You will be uploading various example sketches. I was doing the same Ardoino was working flawlessly and then I got stuck in WebClient sketch.</p>
<p>I did all the things I could do.</p>
<ul>
<li>Reset Arduino.</li>
<li>Reset Ethernet Shield.</li>
<li>Change Ethernet cat5 cable to shorter one.</li>
<li>Change Router setting.</li>
<li>Change MAC address in program.</li>
<li>Change last 2 octets of IP 192,168,6,xxx to 192,168,1,xxx.</li>
<li>At last Google about this issue.</li>
</ul>
<p>Point to be noted I was able to run WebServer sketch and it was flawless. So I was sure shield is good.</p>
<p>With a quick google found <a href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1293894412">this</a> thread on http://www.arduino.cc.</p>
<p>Some one said that don&#8217;t connect google <img src='http://www.shishirsharma.com/wp/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . Bingo. Its Google.</p>
<p>Fcuk that.  But WebClient too works flawlessly.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shishirsharma.com/2011/09/11/arduino-ethernet-shield-and-webclient/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spiderzilla</title>
		<link>http://www.shishirsharma.com/2008/09/18/spiderzilla/</link>
		<comments>http://www.shishirsharma.com/2008/09/18/spiderzilla/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 05:42:03 +0000</pubDate>
		<dc:creator>Shishir Sharma 'criss'</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Devlopement]]></category>
		<category><![CDATA[HTTrack Website Copier]]></category>
		<category><![CDATA[SpiderZilla]]></category>
		<category><![CDATA[Techn]]></category>

		<guid isPermaLink="false">http://shishirsharma.com/?p=289</guid>
		<description><![CDATA[We serf net. We do it every day. Now days I (Shishir criss Sharma) have 2Mbps Broad Band Internet connection. But still life needs more. I used to have a slow connection of 56Kbps few months back. Bandwidth was a &#8230; <a href="http://www.shishirsharma.com/2008/09/18/spiderzilla/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We serf net. We do it every day. Now days I (Shishir criss Sharma) have 2Mbps Broad Band Internet connection. But still life needs more.</p>
<p>I used to have a slow connection of 56Kbps few months back. Bandwidth was a big issue at that time (Its still a issue <img src='http://www.shishirsharma.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ). But India is shining we have very cheap Broad Band connection now days.</p>
<p>When i was on 56Kbps i had this habit of making off line cache of useful pages. I usually used the<br />
<a href="http://www.httrack.com/">HTTrack Website Copier</a></p>
<blockquote><p>&#8220;It allows you to download a World Wide website from the Internet to a local directory,building recursively all structures, getting html, images, and other files from the server to your computer. Links are rebuilt relatively so that you can freely browse to the local site (works with any browser). You can mirror several sites together so that you can jump from one to another. You can, also, update an existing mirror site, or resume an interrupted download&#8221;"</p></blockquote>
<p><span id="more-289"></span><br />
SpiderZilla is intended to be a Firefox and Mozilla Suite extension for offline browsing. Basically, it is only a front-end for the open source command line program HTTrack Website Copier.</p>
<p>SpiderZilla is not under active development. The creators have stopped developing it more and updating it for latest version. So i thought why don&#8217;t do it myself. You can find it on my <a href="http://shishirsharma.com/labs">LaBs</a> page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shishirsharma.com/2008/09/18/spiderzilla/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Desktop Calculator</title>
		<link>http://www.shishirsharma.com/2008/08/13/desktop-calculator/</link>
		<comments>http://www.shishirsharma.com/2008/08/13/desktop-calculator/#comments</comments>
		<pubDate>Wed, 13 Aug 2008 06:38:27 +0000</pubDate>
		<dc:creator>Shishir Sharma 'criss'</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Calculator]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[GNU General Public Licence]]></category>
		<category><![CDATA[Standard C++]]></category>

		<guid isPermaLink="false">http://shishirsharma.com/?p=118</guid>
		<description><![CDATA[I always appreciate coding in standard C++. Desktop Calculator is a application coded in Standard C++. It is a application based on the example 6.1 in the book &#8220;The C++ Programming Language&#8221;, Third Edition by Bjarne Stroustrup. Desktop Calculator is &#8230; <a href="http://www.shishirsharma.com/2008/08/13/desktop-calculator/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I always appreciate coding in standard C++. Desktop Calculator is a application coded in Standard C++. It is a application based on the example 6.1 in the book &#8220;The C++ Programming Language&#8221;, Third Edition by <strong>Bjarne Stroustrup</strong>. Desktop Calculator is a GPL software.</p>
<p>To download full code click here.<br />
<span id="more-118"></span><br />
<code></p>
<pre class="brush: cpp">
/*
 *    This file is part of Desktop Calculator.
 *
 *    Desktop Calculator is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    Desktop Calculator is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 * Standard
 *    You should have received a copy of the GNU General Public License
 *    along with Desktop Calculator.  If not, see < http://www.gnu.org/licenses/ >.
 *
 *	   Shishir Sharma criss < mail AT DOMAIN shishirsharma DOT com >
 */
//////////////////////////////////////////////////////////
//                                                      //
//  File name   :   dc                                  //
//  Comments    :   desk calculator                     //
//  Versions    :   Saturday, September 23, 2006        //
//  Coded by    :   Shishir Sharma 'C R I I S'          //
//                  mail.mastermind@gmail.com           //
//                                                      //
//////////////////////////////////////////////////////////

#include <iostream>
#include <string>
#include < map>
#include <cctype>
#include <cmath>

using namespace std;

enum Token_value
{
  FUNCTION, NAME, NUMBER, END,
  PLUS = '+', MINUS = '-', MUL = '*', DIV = '/',
  PRINT = ';', ASSIGIN = '=', LP = '(', RP = ')',
  EXPO = '^', MLP = '[', MRP = ']', COMMA = ','
};

Token_value curr_tok = PRINT;

double number_value;
string string_value;
int no_of_errors;

map < string, double >table;

double error (const string &#038; s);
double message (const string &#038; s);
Token_value get_token ();
double prim (bool get);
double term (bool get);
double expr (bool get);

const char help[] = "DC: Desk Calculetor\n\npress ctrl+Z to quit\n";

int
main (int argc, char *argv[])
{
  // Standard variables
  table["pi"] = 3.1415926535897932385;
  table["e"] = 2.7182818284590452354;
  // Default help message
  message (help);

  // Main loop
  while (cin) {
    get_token ();
    if (curr_tok == END)
      break;
    if (curr_tok == PRINT)
      continue;
    cout < < expr (false) << '\n';
  }

  return no_of_errors;
}

double
message (const string &#038; s)
{
  cout << s << '\n';
  return 0;
}

double
error (const string &#038; s)
{
  no_of_errors++;
  cerr << "Error:" << s << '\n';
  return 1;
}

double
expr (bool get)
{
  double left = term (get);
  for (;;)
    switch (curr_tok) {
    case PLUS:
      {
	left += term (true);
	break;
      }
    case MINUS:
      {
	left -= term (true);
	break;
      }
    default:
      return left;
    }
}

double
term (bool get)
{
  double left = prim (get);
  for (;;)
    switch (curr_tok) {
    case MUL:
      {
	left *= term (true);
	break;
      }
    case DIV:
      {
	if (double d = prim (true)) {
	  left /= d;
	  break;
	}
	return error ("divide by 0");
      }
    case EXPO:
      {
	left = pow (left, prim (true));
	break;
      }
    default:
      return left;
    }
}

double
prim (bool get)
{
  if (get)
    get_token ();

  switch (curr_tok) {
  case MINUS:
    {
      return (-expr (true));
    }
  case NUMBER:
    {
      double v = number_value;
      get_token ();
      return v;
    }
  case NAME:
    {
      //help
      if (string_value == "help" || string_value == "Help"
	  || string_value == "HELP") {
	return message (help);
      }
      else if (string_value == "clear" || string_value == "Clear"
	       || string_value == "CLEAR") {
	cout.flush ();
	return message (help);
      }
      else
	//trignometry functions
      if (string_value == "sin") {
	if (get_token () == LP)
	  return sin (expr (true));
      }
      else if (string_value == "cos") {
	if (get_token () == LP)
	  return cos (expr (true));
      }
      else if (string_value == "tan") {
	if (get_token () == LP)
	  return tan (expr (true));
      }
      else if (string_value == "asin") {
	if (get_token () == LP)
	  return asin (expr (true));
      }
      else if (string_value == "acos") {
	if (get_token () == LP)
	  return acos (expr (true));
      }
      else if (string_value == "atan") {
	if (get_token () == LP)
	  return atan (expr (true));
      }
      // exponential functions
      else if (string_value == "exp") {
	if (get_token () == LP)
	  return exp (expr (true));
      }
      else if (string_value == "log") {
	if (get_token () == LP)
	  return log (expr (true));
      }
      else if (string_value == "log10") {
	if (get_token () == LP)
	  return log10 (expr (true));
      }
      else if (string_value == "sum") {
	get_token ();
	if (curr_tok == LP) {
	  double sum = 0;
	  sum += expr (true);
	  while (curr_tok != RP) {
	    if (curr_tok == COMMA)
	      sum += expr (true);
	  }
	  return sum;
	}
      }
      // new variables
      else {
	double &#038;v = table[string_value];
	if (get_token () == ASSIGIN)
	  v = expr (true);
	return v;
      }
    }
  case LP:
    {
      double e = expr (true);
      if (curr_tok != RP)
	return error ("')' expected");
      get_token ();
      return e;
    }
  default:
    return error ("primary expected");
  }
}

Token_value
get_token ()
{
  char ch;

  do {
    if (!cin.get (ch))
      return curr_tok = END;
  } while (ch != '\n' &#038;&#038; isspace (ch));

  switch (ch) {
  case '\n':
  case ';':
    return curr_tok = PRINT;
  case '^':
  case '*':
  case '/':
  case '+':
  case '-':
  case '(':
  case ')':
  case '[':
  case ']':
  case ',':
  case '=':
    return curr_tok = Token_value (ch);
  case '0':
  case '1':
  case '2':
  case '3':
  case '4':
  case '5':
  case '6':
  case '7':
  case '8':
  case '9':
  case '.':
    cin.putback (ch);
    cin >> number_value;
    return curr_tok = NUMBER;
  default:
    if (isalpha (ch)) {
      string_value = ch;
      while (cin.get (ch) &#038;&#038; isalnum (ch))
	string_value.push_back (ch);
      cin.putback (ch);
      return curr_tok = NAME;
    }
    error ("bad token");
    return curr_tok = PRINT;
  }
}

/* eof */
</cmath></cctype></string></iostream></pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shishirsharma.com/2008/08/13/desktop-calculator/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

