<?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>Rahul Vaidya's Blog &#187; Rahul</title>
	<atom:link href="http://www.rvaidya.com/blog/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rvaidya.com/blog</link>
	<description>Development, Tech, Whatever.</description>
	<lastBuildDate>Wed, 16 Sep 2009 00:33:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Step-by-step quick installation of Redmine + SVN on Windows</title>
		<link>http://www.rvaidya.com/blog/ruby/2009/09/15/step-by-step-quick-installation-of-redmine-svn-on-windows/</link>
		<comments>http://www.rvaidya.com/blog/ruby/2009/09/15/step-by-step-quick-installation-of-redmine-svn-on-windows/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 00:31:11 +0000</pubDate>
		<dc:creator>Rahul</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[mongrel]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[redmine]]></category>
		<category><![CDATA[sqlite]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[tracking]]></category>
		<category><![CDATA[version]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.rvaidya.com/blog/?p=63</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>Through trial and error, I have done a quick setup of Redmine + SVN on Windows.&nbsp; This does not use Apache and WebDAV.&nbsp; The Ruby on Rails webserver, Mongrel, is used, and SVN is accessed through svnserve (svn://).&nbsp; If you need a full deployment of Redmine, with automatic generation of SVN repositories and SVN accounts, this can be a starting point (let me know how you got it to work!).&nbsp; If you want a quick and dirty setup, this may be the only guide you need!</p>
<p>Here are the steps:</p>
<ol style="margin-left: 0.3902in; direction: ltr; margin-top: 0in; margin-bottom: 0in; font-family: Calibri; font-size: 11pt;">
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"> <span style="font-family: Calibri; font-size: 11pt;">Go to </span><a href="http://rubyonrails.org/download" target="_blank"><span style="font-family: Calibri; font-size: 11pt;">http://rubyonrails.org/<wbr></wbr>download</span></a></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"> <span style="font-family: Calibri; font-size: 11pt;">Install Ruby</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Install RubyGems</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Run [ gem install rails ]</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"> <span style="font-family: Calibri; font-size: 11pt;">Run [ gem install mysql      ]<span>&nbsp; </span>(in case we want to use mysql as      db, sqlite is fine though)</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Run [ gem install rake ]</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"> <span style="font-family: Calibri; font-size: 11pt;">Run [ gem install      sqlite3-ruby ]</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Extract redmine (I extracted      to C:\Ruby\redmine-0.8.4)</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Browse to redmine      folder/config</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Copy database.yml.example to      database.yml</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Set database options for      production:</span>
<ol style="margin-left: 0.375in; direction: ltr; margin-top: 0in; margin-bottom: 0in; font-family: Calibri; font-size: 11pt;" type="a">
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"> <span style="font-family: Calibri; font-size: 11pt;">In production:</span>
<ol style="margin-left: 0.375in; direction: ltr; margin-top: 0in; margin-bottom: 0in; font-family: Calibri; font-size: 11pt;" type="i">
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">adapter: sqlite3</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"> <span style="font-family: Calibri; font-size: 11pt;">dbfile: db/prod.db</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">host: localhost</span></li>
</ol>
</li>
</ol>
</li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Get sqlite3.dll from sqlite 3      distribution (<a href="http://www.sqlite.org" target="_blank">http://www.sqlite.org</a>) and put in Ruby/bin directory</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Browse to Redmine directory in command prompt<br />
</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Run [ rake db:migrate      RAILS_ENV="production" ]</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Run [ rake      redmine:load_default_data RAILS_ENV="production" ]</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Run [ gem install mongrel ]</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Run [ gem install      mongrel_service ]</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Run [ mongrel_rails      service::install -N Redmine_Server -D "Redmine Server on      Mongrel" -e "production" ]</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Start service and set to      &#8220;Automatic&#8221;</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Username: admin Password:      admin</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Refer to </span><a href="http://www.redmine.org/wiki/redmine/RedmineInstall" target="_blank"><span style="font-family: Calibri; font-size: 11pt;">http://www.redmine.org/wiki/<wbr></wbr>redmine/RedmineInstall</span></a><span style="font-family: Calibri; font-size: 11pt;"> for SMTP config (If you want      emails generated for tickets, etc.)</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Install CollabNet SVN as      svnservice (WebDAV not needed), svn root C:\svn_repository</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Start service &#8220;CollabNet      Subversion svnserve&#8221;</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Run [ svnadmin create      c:\svn_repository ]</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Uncomment anon-access = read,      auth-access = write, password-db = passwd in svnserve.conf</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Add users to Redmine, have      user change password to whatever they want it to</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Add users to passwd (same      username), all plaintext, so create random passwords for each user and      have them record it (cannot be changed unless requested by admin, and      admin will know what pw is)</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Restart Redmine_Server      service</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Create subfolders for      projects, and trunk/tags/branches for each project</span></li>
<li style="margin-top: 0pt; margin-bottom: 0pt; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Add      svn://localhost/projectname as project root for each project in Redmine</span></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.rvaidya.com/blog/ruby/2009/09/15/step-by-step-quick-installation-of-redmine-svn-on-windows/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Flex Builder and Eclipse 3.5</title>
		<link>http://www.rvaidya.com/blog/flex/2009/09/08/flex-builder-and-eclipse-3-5/</link>
		<comments>http://www.rvaidya.com/blog/flex/2009/09/08/flex-builder-and-eclipse-3-5/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 05:11:39 +0000</pubDate>
		<dc:creator>Rahul</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[3.5]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://www.rvaidya.com/blog/?p=59</guid>
		<description><![CDATA[Here&#8217;s a blog post by a frustrated developer who seems to have found out how to set up the Flex Builder plugin with Eclipse 3.5 (I have tried it and it works!).&#160; Thank you, frustrated developer! http://worldwizards.blogspot.com/2009/08/eclipse-35-and-flex-builder.html From the post: (1) Download and install Eclipse 3.5. I used the J2EE install. (2) Download and run [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a blog post by a frustrated developer who seems to have found out how to set up the Flex Builder plugin with Eclipse 3.5 (I have tried it and it works!).&nbsp; Thank you, frustrated developer!</p>
<p><a href="http://worldwizards.blogspot.com/2009/08/eclipse-35-and-flex-builder.html" target="_blank">http://worldwizards.blogspot.com/2009/08/eclipse-35-and-flex-builder.html</a></p>
<p>From the post:</p>
<p>(1) Download and install Eclipse 3.5.  I used the J2EE install.<br />
(2) Download and run the Flex Builder 3 installer.<br />
(3) Ignore all the warnings that it only supports Eclipse 3.3 and 3.4. Just keep telling it that you know what you are doing and want to install it anyway. It will end with a scary message about failing and suggest you do a manual install from inside of eclipse. <span style="font-weight: bold;">Don&#8217;t do that!</span><br />
(4) Here is the magic, when it is done there will be a file in your eclipse/links directory called<br />
com.adobe.flexbuilder.feature.core.link<br />
Open that file in wordpad and you will see it contains one line:<br />
<span style="font-family: courier new;"><br />
C:/Program Files/Adobe/Flex Builder 3 Plug-in</span></p>
<p>Edit that line so it looks like this:</p>
<p><span style="font-family: courier new;">path=C:/Program Files/Adobe/Flex Builder 3 Plug-in</span></p>
<p>Save the file and start eclipse.  Voilla!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rvaidya.com/blog/flex/2009/09/08/flex-builder-and-eclipse-3-5/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Been a while&#8230;</title>
		<link>http://www.rvaidya.com/blog/uncategorized/2009/09/08/been-a-while/</link>
		<comments>http://www.rvaidya.com/blog/uncategorized/2009/09/08/been-a-while/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 18:46:32 +0000</pubDate>
		<dc:creator>Rahul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.rvaidya.com/blog/?p=55</guid>
		<description><![CDATA[I haven&#8217;t posted on this blog in a while since I haven&#8217;t been doing much development (just graduated from grad school, hadn&#8217;t found a job yet). Well, now that I do have a job, the development blog posts will continue as I find and solve particular developmental problems. Work environment: C# (.NET/ASP), Adobe Flex, possible [...]]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t posted on this blog in a while since I haven&#8217;t been doing much development (just graduated from grad school, hadn&#8217;t found a job yet).  Well, now that I do have a job, the development blog posts will continue as I find and solve particular developmental problems.</p>
<p>Work environment: C# (.NET/ASP), Adobe Flex, possible iPhone application along the way</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rvaidya.com/blog/uncategorized/2009/09/08/been-a-while/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Google Maps Flex API: Refresh TileLayer without refreshing map</title>
		<link>http://www.rvaidya.com/blog/gis/2009/02/27/google-maps-flex-api-refresh-tilelayer-without-refreshing-map/</link>
		<comments>http://www.rvaidya.com/blog/gis/2009/02/27/google-maps-flex-api-refresh-tilelayer-without-refreshing-map/#comments</comments>
		<pubDate>Sat, 28 Feb 2009 06:18:20 +0000</pubDate>
		<dc:creator>Rahul</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[GIS]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[google maps]]></category>
		<category><![CDATA[mapserver]]></category>
		<category><![CDATA[Tile]]></category>

		<guid isPermaLink="false">http://www.rvaidya.com/blog/?p=43</guid>
		<description><![CDATA[This submission is in response to this gmaps-api-flex feature request. This is a hack that provides functionality like what was requested here. So you&#8217;ve added a custom tile layer to your Google Maps app in Flex, which lets you show all your pretty spatial features. Fantastic! If you want to make this tile layer dynamic, [...]]]></description>
			<content:encoded><![CDATA[<p>This submission is in response to <a href="http://code.google.com/p/gmaps-api-issues/issues/detail?id=503" target="_blank">this gmaps-api-flex feature request</a>.  This is a hack that provides functionality like what was requested here.</p>
<p>So you&#8217;ve added a custom tile layer to your Google Maps app in Flex, which lets you show all your pretty spatial features.  Fantastic!  If you want to make this tile layer dynamic, however, you run into a few problems.  The Google Maps Flex API caches tiles that it has loaded from a specific Tile Overlay, so if your data changes, the changes won&#8217;t be reflected on your map immediately.  There have been various hacks that force a refresh of the map, but they don&#8217;t completely meet the requirements set in this feature request.  The attached code here is a hack that tries to mimic the requested functionality, without refreshing the entire map.</p>
<p>After exploring a little, I saw that one way the Flex API differentiates overlays is by the request URL.  If you create an overlay, add it to the map, remove it, create a new overlay with the same URL, and add the new overlay, it will load the tiles from the internal cache.  Now, this functionality can be nice if you&#8217;re switching between two different overlays, and there haven&#8217;t been any changes in the data.  For instance, if an app requests tiles from the following URLs in order:</p>
<p>mapserver.php?X=0&amp;Y=0&amp;Z=0&amp;LAYERS=calicounties</p>
<p>mapserver.php?X=0&amp;Y=0&amp;Z=0&amp;LAYERS=oregcounties</p>
<p>it will load both of these layers properly, and cache them both.  If you then load the calicounties layer, using the same URL string, it&#8217;ll give you back the cached version.</p>
<p>However, if the data has changed, you&#8217;d want to reload the entire layer.  To do this, I have appended a garbage GET variable to the URL.  The requests will now look like:</p>
<p>mapserver.php?X=0&amp;Y=0&amp;Z=0&amp;LAYERS=calicounties&amp;GARBAGE=SDK34K</p>
<p>mapserver.php?X=0&amp;Y=0&amp;Z=0&amp;LAYERS=oregcounties&amp;GARBAGE=SDK34K</p>
<p>Simply change the GARBAGE variable when loading calicounties again and it&#8217;ll load from the source.</p>
<p>The included code implements four events that are dispatched to/listened from the map object:</p>
<ul>
<li>TileLayerRefresh
<ul>
<li>Tell the Tile Layer to refresh (do not change the GARBAGE variable)</li>
</ul>
</li>
<li>TileLayerReload
<ul>
<li>Tell the Tile Layer to reload (change the GARBAGE variable)</li>
</ul>
</li>
<li>TileLayerRefreshed
<ul>
<li>Refresh/Reload completed successfully (all tiles loaded)</li>
<li>Implemented by incrementing a counter whenever Loader instances are created, and decrementing the counter whenever they complete/fail.</li>
</ul>
</li>
<li>TileLayerRefreshError
<ul>
<li>If any loading errors occurred.</li>
</ul>
</li>
</ul>
<p>Note: You need to pass the TileLayer both the TileOverlay that holds it and the Map object, so it can handle refreshing and event dispatch by itself.</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="ActionScript"><div class="devcodeoverflow"><ol><li></li><li><span style="color: #000000; font-weight: bold;">var</span> tileLayer:MapServerTileLayer = <span style="color: #000000; font-weight: bold;">new</span> MapServerTileLayer<span style="color: #66cc66;">&#40;</span>map<span style="color: #66cc66;">&#41;</span>;</li><li><span style="color: #000000; font-weight: bold;">var</span> tileLayerOverlay:TileLayerOverlay = <span style="color: #000000; font-weight: bold;">new</span> TileLayerOverlay<span style="color: #66cc66;">&#40;</span>tileLayer<span style="color: #66cc66;">&#41;</span>;</li><li>tileLayer.<span style="color: #006600;">setOverlay</span><span style="color: #66cc66;">&#40;</span>tileLayerOverlay<span style="color: #66cc66;">&#41;</span>;</li><li>map.<span style="color: #006600;">addOverlay</span><span style="color: #66cc66;">&#40;</span>tileLayerOverlay<span style="color: #66cc66;">&#41;</span>;</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>For an example on using MapServer/PHP MapScript with Google Maps, go to <a href="http://www.rvaidya.com/blog/gis/2009/02/12/mapserver-using-google-maps-with-php-mapscript/" target="_blank">this blog post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rvaidya.com/blog/gis/2009/02/27/google-maps-flex-api-refresh-tilelayer-without-refreshing-map/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Get request headers sent by client in PHP</title>
		<link>http://www.rvaidya.com/blog/php/2009/02/25/get-request-headers-sent-by-client-in-php/</link>
		<comments>http://www.rvaidya.com/blog/php/2009/02/25/get-request-headers-sent-by-client-in-php/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 08:56:31 +0000</pubDate>
		<dc:creator>Rahul</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[request]]></category>

		<guid isPermaLink="false">http://www.rvaidya.com/blog/?p=36</guid>
		<description><![CDATA[A nice little function I found posted by &#8220;lazynitwit&#8221; on BlueHost forums: function getHeaders&#40;&#41;&#123;&#160;&#160;&#160;&#160;$headers = array&#40;&#41;;&#160;&#160;&#160;&#160;foreach &#40;$_SERVER as $k =&#62; $v&#41;&#160;&#160;&#160;&#160;&#123;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if &#40;substr&#40;$k, 0, 5&#41; == &#34;HTTP_&#34;&#41;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#123;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$k = str_replace&#40;'_', ' ', substr&#40;$k, 5&#41;&#41;;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$k = str_replace&#40;' ', '-', ucwords&#40;strtolower&#40;$k&#41;&#41;&#41;;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$headers&#91;$k&#93; = $v;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#125;&#160;&#160;&#160;&#160;&#125;&#160;&#160;&#160;&#160;return $headers;&#125;&#160;&#160; The PHP function getallheaders() only works on Apache, and only if Apache has been installed [...]]]></description>
			<content:encoded><![CDATA[<p>A nice little function I found posted by &#8220;lazynitwit&#8221; on BlueHost forums:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="PHP"><div class="devcodeoverflow"><ol><li><span style="color: #000000; font-weight: bold;">function</span> getHeaders<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></li><li><span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000088;">$headers</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$k</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$v</span><span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$k</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;HTTP_&quot;</span><span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000088;">$k</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'_'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$k</span><span style="color: #339933;">,</span> 5<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000088;">$k</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'-'</span><span style="color: #339933;">,</span> <span style="color: #990000;">ucwords</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$k</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000088;">$headers</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$k</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$v</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #b1b100;">return</span> <span style="color: #000088;">$headers</span><span style="color: #339933;">;</span></li><li><span style="color: #009900;">&#125;</span>&nbsp;&nbsp;</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>The PHP function getallheaders() only works on Apache, and only if Apache has been installed as a module.</p>
<p>It turns out that this information is within the $_SERVER global variable, and can be parsed out.</p>
<p>This code is useful if, for instance, you want to differentiate between user browser requests and requests made through AJAX.  Some of the JavaScript frameworks (jQuery, Prototype, YUI, MooTools) send a special header,</p>
<p>X-Requested-With: XMLHttpRequest</p>
<p>whenever a request is made.  I have put this to use in my <a href="http://www.rvaidya.com/chat?channels=test">phpFreeChat chat box</a> to allow channels to be specified in the URL as GET parameters.</p>
<p>via <a href="http://www.bluehostforum.com/showthread.php?t=1453">request headers  php  &#8211; bluehostforum.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rvaidya.com/blog/php/2009/02/25/get-request-headers-sent-by-client-in-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Wrapper classes for using SQLite on iPhone/Cocoa</title>
		<link>http://www.rvaidya.com/blog/iphone/2009/02/14/wrapper-classes-for-using-sqlite-on-iphonecocoa/</link>
		<comments>http://www.rvaidya.com/blog/iphone/2009/02/14/wrapper-classes-for-using-sqlite-on-iphonecocoa/#comments</comments>
		<pubDate>Sun, 15 Feb 2009 00:28:47 +0000</pubDate>
		<dc:creator>Rahul</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[sqlite]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.rvaidya.com/blog/?p=19</guid>
		<description><![CDATA[Information on using SQLite for local storage on Cocoa isn&#8217;t all that easy to find. The best resource, as always, is Google, and you can find a few tutorials with step by step instructions and code samples on how to use it. Well, here&#8217;s another basic step by step set of instructions, but rather than [...]]]></description>
			<content:encoded><![CDATA[<p>Information on using SQLite for local storage on Cocoa isn&#8217;t all that easy to find.  The best resource, as always, is Google, and you can find a few tutorials with step by step instructions and code samples on how to use it.  Well, here&#8217;s another basic step by step set of instructions, but rather than including code samples, I have written a couple of wrapper classes for creating databases, making queries, and getting results.</p>
<p>Steps:</p>
<p>1: Include the SQLite framework in your project.  It&#8217;s usually located somewhere like &#8220;/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.1.sdk/usr/lib/libsqlite3.0.dylib&#8221; (why is developer in there twice?)</p>
<p>2: Create a base sqlite database file, and modify SQLite.m so that the filename method refers to it.  Place it in your main resource path.  This will be copied out of your bundle into your application&#8217;s Documents directory.  If you need help on creating one of these and managing it, there is a fantastic <a href="https://addons.mozilla.org/en-US/firefox/addon/5817" target="_blank">FireFox extension</a> that does it for you!</p>
<p>3: Add the source files to your project.</p>
<p>Usage can be as simple as:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Objective-C"><div class="devcodeoverflow"><ol><li></li><li>SQLiteResult <span style="color: #002200;">*</span>result <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>SQLite query<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;SELECT * from test;&quot;</span><span style="color: #002200;">&#93;</span>;</li><li><span style="color: #400080;">NSArray</span> <span style="color: #002200;">*</span>row <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>result.rows objectAtIndex<span style="color: #002200;">:</span>0<span style="color: #002200;">&#93;</span>;</li><li><span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>firstValue <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>row objectAtIndex<span style="color: #002200;">:</span>0<span style="color: #002200;">&#93;</span>;</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>NSArray columnNames contains NSStrings of all the names.<br />
NSArray columnTypes contains NSStrings of all the types.<br />
NSArray rows contains NSArrays, where each of these contains NSStrings of all the row values in that row.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rvaidya.com/blog/iphone/2009/02/14/wrapper-classes-for-using-sqlite-on-iphonecocoa/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MapServer: Using Google Maps with PHP MapScript</title>
		<link>http://www.rvaidya.com/blog/gis/2009/02/12/mapserver-using-google-maps-with-php-mapscript/</link>
		<comments>http://www.rvaidya.com/blog/gis/2009/02/12/mapserver-using-google-maps-with-php-mapscript/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 01:17:16 +0000</pubDate>
		<dc:creator>Rahul</dc:creator>
				<category><![CDATA[GIS]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google maps]]></category>
		<category><![CDATA[map]]></category>
		<category><![CDATA[maps]]></category>
		<category><![CDATA[mapscript]]></category>
		<category><![CDATA[mapserver]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Tile]]></category>

		<guid isPermaLink="false">http://www.rvaidya.com/blog/?p=4</guid>
		<description><![CDATA[Generating Google Maps tiles using MapServer is not completely intuitive. For static map applications, a new tile mode has recently been created for MapServer CGI mode ( http://mapserver.org/output/tile_mode.html ). For more dynamic mapping applications, PHP MapScript is an ideal way execute this, as it only requires a very small static component (an initial map file, [...]]]></description>
			<content:encoded><![CDATA[<p>Generating Google Maps tiles using MapServer is not completely intuitive.  For static map applications, a new tile mode has recently been created for MapServer CGI mode ( http://mapserver.org/output/tile_mode.html ).</p>
<p>For more dynamic mapping applications, PHP MapScript is an ideal way execute this, as it only requires a very small static component (an initial map file, which won&#8217;t even be needed when MapServer 5.4 comes).  Included is a short PHP example on how do go about doing this.  The PROJ.4 projection parameters included are for the Google Maps mercator projection.</p>
<p>The sample code includes WGS84 to Google Maps mercator projection as well as the calculation of mercator extents from Google Maps tile indices.</p>
<p>This example has been extended from the previous iteration to include dynamic layer generation and POINT geometry feature symbols via image files.  The $phplayers variable holds layer definitions that have been queried from a database table, obtained using the getLayersForSessionID($sessionID) function.  The table includes layer table name, layer geometrytype layer geometry name, and a symbol definition for the layer.  For point layers, this is an image file (ie. &#8220;image.gif&#8221;), and for polygon and line layers, this is a line color (255 0 0 for red).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rvaidya.com/blog/gis/2009/02/12/mapserver-using-google-maps-with-php-mapscript/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Yo.</title>
		<link>http://www.rvaidya.com/blog/uncategorized/2009/02/12/hello-world/</link>
		<comments>http://www.rvaidya.com/blog/uncategorized/2009/02/12/hello-world/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 00:36:37 +0000</pubDate>
		<dc:creator>Rahul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.rvaidya.com/blog/?p=1</guid>
		<description><![CDATA[Welcome to my blog. Hello.]]></description>
			<content:encoded><![CDATA[<p>Welcome to my blog.  Hello.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rvaidya.com/blog/uncategorized/2009/02/12/hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
