<?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>The Discussion Delegate</title>
	<atom:link href="http://vxtindia.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://vxtindia.com/blog</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 10 Mar 2010 15:23:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>When you get some time off make some wallpapers!</title>
		<link>http://vxtindia.com/blog/when-you-get-some-time-off-make-some-wallpapers/</link>
		<comments>http://vxtindia.com/blog/when-you-get-some-time-off-make-some-wallpapers/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 15:14:44 +0000</pubDate>
		<dc:creator>abhinit</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[image editor]]></category>
		<category><![CDATA[pixelmator]]></category>
		<category><![CDATA[vxtindia]]></category>
		<category><![CDATA[wallpapers]]></category>

		<guid isPermaLink="false">http://vxtindia.com/blog/?p=137</guid>
		<description><![CDATA[Between frantic coding sessions, making sense of emails, staring at the screen and chasing tyrannosauruses around the Office I get sometime off. When that happens, I launch Pixelmator, make sure no one around is paying any attention, and make wallpapers.
Here are some of them. Most of them took a few minutes to make. No, really!!
PS: [...]]]></description>
			<content:encoded><![CDATA[<p>Between frantic coding sessions, making sense of emails, staring at the screen and chasing tyrannosauruses around the Office I get sometime off. When that happens, I launch Pixelmator, make sure no one around is paying any attention, and make wallpapers.</p>
<p>Here are some of them. Most of them took a few minutes to make. No, really!!</p>

<a href='http://vxtindia.com/blog/when-you-get-some-time-off-make-some-wallpapers/index/' title='index'><img width="150" height="150" src="http://vxtindia.com/blog/wp-content/uploads/2010/03/index-150x150.png" class="attachment-thumbnail" alt="" title="index" /></a>
<a href='http://vxtindia.com/blog/when-you-get-some-time-off-make-some-wallpapers/something/' title='something'><img width="150" height="150" src="http://vxtindia.com/blog/wp-content/uploads/2010/03/something-150x150.png" class="attachment-thumbnail" alt="" title="something" /></a>
<a href='http://vxtindia.com/blog/when-you-get-some-time-off-make-some-wallpapers/something2/' title='something2'><img width="150" height="150" src="http://vxtindia.com/blog/wp-content/uploads/2010/03/something2-150x150.png" class="attachment-thumbnail" alt="" title="something2" /></a>
<a href='http://vxtindia.com/blog/when-you-get-some-time-off-make-some-wallpapers/vixie/' title='vixie'><img width="150" height="150" src="http://vxtindia.com/blog/wp-content/uploads/2010/03/vixie-150x150.png" class="attachment-thumbnail" alt="" title="vixie" /></a>
<a href='http://vxtindia.com/blog/when-you-get-some-time-off-make-some-wallpapers/vxtnew/' title='vxtNew'><img width="150" height="150" src="http://vxtindia.com/blog/wp-content/uploads/2010/03/vxtNew-150x150.png" class="attachment-thumbnail" alt="" title="vxtNew" /></a>
<a href='http://vxtindia.com/blog/when-you-get-some-time-off-make-some-wallpapers/untitledlevel4/' title='Untitledlevel4'><img width="150" height="150" src="http://vxtindia.com/blog/wp-content/uploads/2010/03/Untitledlevel4-150x150.png" class="attachment-thumbnail" alt="" title="Untitledlevel4" /></a>

<p>PS: Pixelmator is an awesome image editor.</p>
<img src="http://vxtindia.com/blog/?ak_action=api_record_view&id=137&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://vxtindia.com/blog/when-you-get-some-time-off-make-some-wallpapers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add a login form on your WP Theme</title>
		<link>http://vxtindia.com/blog/add-a-login-form-on-your-wordpress-theme/</link>
		<comments>http://vxtindia.com/blog/add-a-login-form-on-your-wordpress-theme/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 10:44:44 +0000</pubDate>
		<dc:creator>sribanta</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://vxtindia.com/blog/?p=128</guid>
		<description><![CDATA[When working with custom Wordpress sites, it is sometimes required to add a login form to one of the pages. Being wordpress, it is quite simple to do so.
For example, on your blog sidebar or on a page template just copy  below code and enjoy!!
&#60;?php if ( !(current_user_can('level_0')) ) { ?&#62;
&#160;&#160; &#60;h2&#62;Login&#60;/h2&#62;
&#160;&#160; &#60;form action="&#60;?php echo [...]]]></description>
			<content:encoded><![CDATA[<p>When working with custom Wordpress sites, it is sometimes required to add a login form to one of the pages. Being wordpress, it is quite simple to do so.</p>
<p>For example, on your blog sidebar or on a page template just copy  below code and enjoy!!</p>
<p><code>&lt;?php if ( !(current_user_can('level_0')) ) { ?&gt;<br />
&nbsp;&nbsp; &lt;h2&gt;Login&lt;/h2&gt;<br />
&nbsp;&nbsp; &lt;form action="&lt;?php echo get_option('home'); ?&gt;/wp-login.php" method="post"&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp; &lt;input type="text" name="log" id="log" value="&lt;?php echo wp_specialchars(stripslashes($user_login), 1) ?&gt;" size="20" /&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp; &lt;input type="password" name="pwd" id="pwd" size="20? /&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp; &lt;input type="submit" name="submit" value="Send" /&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp; &lt;p&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &lt;label for="rememberme"&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &lt;input name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /&gt;Remember me<br />
&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &lt;/label&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &lt;input type="hidden" name="redirect_to" value="&lt;?php echo $_SERVER['REQUEST_URI']; ?&gt;" /&gt;<br />
&nbsp;&nbsp; &nbsp;&nbsp; &lt;/p&gt;<br />
&nbsp;&nbsp; &lt;/form&gt;<br />
&nbsp;&nbsp; &lt;a href="&lt;?php echo get_option('home'); ?&gt;/wp-login.php?action=lostpassword"&gt;Recover password&lt;/a&gt;<br />
&lt;?php } else { ?&gt;<br />
&nbsp;&nbsp; &lt;h2&gt;Logout&lt;/h2&gt;<br />
&nbsp;&nbsp; &lt;a href="&lt;?php echo wp_logout_url(urlencode($_SERVER['REQUEST_URI'])); ?&gt;"&gt;logout&lt;/a&gt;&lt;br /&gt;<br />
&nbsp;&nbsp; &lt;a href="&lt;?php echo get_option('home'); ?&gt;/wp-admin"&gt;admin&lt;/a&gt;<br />
&lt;?php } ?&gt;</code></p>
<img src="http://vxtindia.com/blog/?ak_action=api_record_view&id=128&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://vxtindia.com/blog/add-a-login-form-on-your-wordpress-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open up your Mac Mini!</title>
		<link>http://vxtindia.com/blog/open-up-your-mac-mini/</link>
		<comments>http://vxtindia.com/blog/open-up-your-mac-mini/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 19:59:01 +0000</pubDate>
		<dc:creator>Sudhanshu</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[mac-mini]]></category>

		<guid isPermaLink="false">http://vxtindia.com/blog/?p=121</guid>
		<description><![CDATA[Among the many joys of running your own company, a certainly interesting one is the ability to open up stuff once the hardware stops working.
A weird accident yesterday left our Mac Mini a little zonked out and it just refused to power up. When there was no hope left that we would see it working [...]]]></description>
			<content:encoded><![CDATA[<p>Among the many joys of running your own company, a certainly interesting one is the ability to open up stuff once the hardware stops working.</p>
<p>A weird accident yesterday left our Mac Mini a little zonked out and it just refused to power up. When there was no hope left that we would see it working anytime soon (The Apple Store takes 4 days to update an OS, this would have certainly taken up a month to fix), we decided to open this thing up. I realize that a hundred thousand people have done this before, but this was certainly the first time we opened up the little monster.</p>
<p>Here is what it look like, once you open it up. <img src="http://vxtindia.com/blog/wp-content/uploads/2010/02/IMG099.jpg" alt="" title="IMG099" width="640" height="480" class="alignleft size-full wp-image-122" /> <img src="http://vxtindia.com/blog/wp-content/uploads/2010/02/IMG100.jpg" alt="" title="IMG100" width="640" height="480" class="alignleft size-full wp-image-123" /></p>
<p>Not that any good came of it though (we&#8217;re looking for somebody who can fix it now!), but we were able to appreciate the inner beauty of tiny piece of hardware evolved by Apple. Maybe it will provide the inspiration for us to do something that has never been done before.</p>
<img src="http://vxtindia.com/blog/?ak_action=api_record_view&id=121&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://vxtindia.com/blog/open-up-your-mac-mini/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Push Notifications in your iPhone App using PHP and Ubuntu</title>
		<link>http://vxtindia.com/blog/push-notifications-for-your-iphone-app-with-php-and-ubuntu/</link>
		<comments>http://vxtindia.com/blog/push-notifications-for-your-iphone-app-with-php-and-ubuntu/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 13:43:26 +0000</pubDate>
		<dc:creator>Sudhanshu</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apns]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[push notifications]]></category>

		<guid isPermaLink="false">http://vxtindia.com/blog/?p=99</guid>
		<description><![CDATA[Push Notifications have been around for quite some time now, but when we started on it, we found out that we were unable to find all the information about creating a demo in one place. After a few hours, we were able to get it to work. Here is what we did.
Basically, the code on [...]]]></description>
			<content:encoded><![CDATA[<p>Push Notifications have been around for quite some time now, but when we started on it, we found out that we were unable to find all the information about creating a demo in one place. After a few hours, we were able to get it to work. Here is what we did.</p>
<p>Basically, the code on your server needs to talk to the <u>Apple Push Notification Service (APNS)</u> to send the messages, and the APNS then delivers them to your phone. <u>We will only provide the code level details</u> here to help you carry out the same on your server.</p>
<h2>Basic Idea</h2>
<p>You need to do the following to get your application to send push notifications</p>
<blockquote><p>1. Make your application accept Push Notifications<br />
2. Create a SSL certificate for your server which will allow it to talk to the APNS<br />
3. Create the payload for each message to be send to the APNS<br />
4. Send all the payloads one by one to the APNS
</p></blockquote>
<p>Even if you have already been into iPhone development for sometime, you might not be aware of the <strong>&#8216;DevToken&#8217;</strong>. This is a <em>uniquely generated token</em> for your iPhone application on a particular phone. It can keep changing over time for a particular phone as well, but it is the unique id that will help you send a message to a particular application on a particular phone.</p>
<p>This is what it looks like on our phone</p>
<blockquote><p>4d3d32e4 c1beebd2 f3a6bc85 3f7d12b9 abc156b4 26818ecf 9673a712 85e01adc</p></blockquote>
<p>This is what you need to do to get your device token.</p>
<p><code>// Delegation methods<br />
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {<br />
&nbsp;<br />
&nbsp;&nbsp;//RegisteringforRemoteNotifications<br />
&nbsp;&nbsp;NSLog(@"%@ \n %@", deviceToken, [[NSString alloc] initWithData:deviceToken encoding:NSUTF8StringEncoding]);<br />
&nbsp;<br />
}<br />
</code></p>
<h2>Getting the certificates in place</h2>
<p>Reach for your mac and start doing the following</p>
<p>1. Login to the <a href="http://developer.apple.com/iphone/manage/overview/index.action">iPhone Developer Connection Portal</a> and click on <em>App Ids</em>.</p>
<p>2. Create an AppId for your application witouth a wildcard. It should be something like this : </p>
<blockquote><p>com.vxtindia.PushSample</p></blockquote>
<p>3. Click configure and then go ahead and create a <em>certificate for Push Notifications</em>.<sup>[<a href='#reference1'>1</a>]</sup>. Download it once it has been created.</p>
<p>4. Import the newly created certificate into your keychain by double clicking it.</p>
<p>5. Launch <em><strong>&#8216;Keychain Assistant&#8217;</strong></em> and filter it by the Certificate&#8217;s category. There you should see a <strong><em>&#8216;Apple Development Push Services&#8217;</em></strong> option. Expand it, right click on it and click on &#8216;Export &#8230;&#8217; and save this as apns-dev-cert.p12 . Also download the private key as <em>apns-dev-key.p12</em></p>
<p>6. Copy the file <em>apns-dev-cert.p12</em> to your server in the folder where you will put the rest of your PHP code.</p>
<p>7. Now run the following code on the server<br />
<code>openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12<br />
openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12<br />
</code></p>
<p>We are running everything from a server running <em>Ubuntu-9.04</em>. Here we had to remove the passphrase, which can be done as follows<br />
<code>openssl rsa -in apns-dev-key.pem -out apns-dev-key-noenc.pem</code></p>
<p>Finally, combine the two to get your apns-dev.pem file<br />
<code>cat apns-dev-cert.pem apns-dev-key-noenc.pem > apns-dev.pem</code></p>
<p>8. You need to create a payload and send it to the APNS server. You can use the following code to do so<br />
<code>// Create a stream to the server<br />
$streamContext = stream_context_create();<br />
stream_context_set_option($streamContext, 'ssl', 'local_cert', 'apns-dev.pem');<br />
&nbsp;<br />
$apns = stream_socket_client('ssl://gateway.sandbox.push.apple.com:2195, $error, $errorString, 60, STREAM_CLIENT_CONNECT, $streamContext);<br />
&nbsp;<br />
// You can access the errors using the variables $error and $errorString<br />
$message = 'You have just pushed data via APNS';<br />
&nbsp;<br />
// Now we need to create JSON which can be sent to APNS<br />
$load = array( 'aps' => array( 'alert' => $message, 'badge' => 1, 'sound' => 'default'));<br />
$payload = json_encode($load);<br />
&nbsp;<br />
// The payload needs to be packed before it can be sent<br />
$apnsMessage = chr(0) . chr(0) . chr(32) . pack('H*', str_replace(' ', '', $token)) . chr(0) . chr(strlen($payload)) . $payload;<br />
&nbsp;<br />
// Write the payload to the APNS<br />
fwrite($apns, $apnsMessage);<br />
echo "just wrote " . $payload;<br />
&nbsp;<br />
// Close the connection<br />
fclose($apns);<br />
</code></p>
<p>9. Great work! You have just pushed a message to the APNS which will now be delivered to a phone running your application.</p>
<p>10. <strong>(Optional)</strong> Apple also provides a Feedback service (which doesn&#8217;t do anything that you would expect). This service tells you when was the last time that APNS failed to find your application on a specific phone. When this happens, you need to stop sending updates to that Device Token.</p>
<p>To assist you in your endeavors, here is the code to help you read this data<br />
<code>$streamContext = stream_context_create();<br />
stream_context_set_option($streamContext, 'ssl', 'local_cert', 'apns-dev.pem');<br />
&nbsp;<br />
$apns = stream_socket_client('ssl://feedback.sandbox.push.apple.com:2196', $error, $errorString, 60, STREAM_CLIENT_CONNECT, $streamContext);<br />
&nbsp;<br />
if($apns) {<br />
&nbsp;&nbsp;while ($data = fread($apns, 38)) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;$feedback = unpack("N1timestamp/n1length/H*devtoken", $data);<br />
&nbsp;&nbsp;&nbsp;&nbsp;echo "Sent message at " . date("r", $feedback['timestamp']) . " with length " . $feedback['length'] . " to token " . $feedback['devtoken'];<br />
&nbsp;&nbsp;}<br />
&nbsp;&nbsp;fclose($fp);<br />
}<br />
</code></p>
<p>That&#8217;s it. You are now officially a pro at push notifications!</p>
<p>References :<br />
1. <a name='reference1' href="http://developer.apple.com/iphone/prerelease/library/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ProvisioningDevelopment/ProvisioningDevelopment.html#//apple_ref/doc/uid/TP40008194-CH104-SW4">Apple&#8217;s Documentation</a><br />
2. <a rel="nofollow" href="http://blog.boxedice.com/2009/07/10/how-to-build-an-apple-push-notification-provider-server-tutorial/">BoxedIce</a></p>
<img src="http://vxtindia.com/blog/?ak_action=api_record_view&id=99&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://vxtindia.com/blog/push-notifications-for-your-iphone-app-with-php-and-ubuntu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ConnectingIndia has a new address</title>
		<link>http://vxtindia.com/blog/connectingindia-has-a-new-address/</link>
		<comments>http://vxtindia.com/blog/connectingindia-has-a-new-address/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 06:57:45 +0000</pubDate>
		<dc:creator>Sudhanshu</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[connecting-india]]></category>
		<category><![CDATA[initiatives]]></category>
		<category><![CDATA[ngo]]></category>
		<category><![CDATA[portfolio]]></category>
		<category><![CDATA[pune]]></category>
		<category><![CDATA[suicide prevention]]></category>
		<category><![CDATA[website]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.vxtindia.com/?p=94</guid>
		<description><![CDATA[
Connecting India is a Pune based NGO dedicated to suicide prevention in youth. Its team of dedicated volunteers and concerned citizens are dedicated to serve the community through its various programs, seminars and especially through its Suicide Prevention Helpline to support individuals dealing with emotional stress.
Connecting India was starting a number of new initiatives and [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="nofollow" href="http://connectingindia.org" target="_blank"><img class="size-full wp-image-95" title="connectingindia" src="http://vxtindia.com/blog/wp-content/uploads/2009/06/connectingindia1.jpg" alt="Connecting India" width="570" height="400" /></a></p>
<blockquote><p><a rel="nofollow" href="http://connectingindia.org" target="_blank">Connecting India</a> is a <em>Pune based NGO</em> dedicated to <strong>suicide prevention</strong> in youth. Its team of dedicated volunteers and concerned citizens are dedicated to serve the community through its various programs, seminars and especially through its <strong>Suicide Prevention Helpline</strong> to support individuals dealing with emotional stress.</p></blockquote>
<p>Connecting India was starting a number of new initiatives and <em>wanted a new website which would reflect the dynamism in the organization</em>. We working in collaboration with <a rel="nofollow" href="http://stradicate.com" target="_blank">Stradicate</a> to help create the new design and interface. Stradicate worked on the design and we developed and hosted the website.</p>
<p>If you would like to <em>make a difference</em>, and you are above 21 years of age, please get in touch with Connecting India on +91-20-26333044. Their helpline operates from 2pm to 8pm and they also provide training to volunteers who qualify for the program.</p>
<p>If you are an NGO and are <em>looking for a similar solution</em>, do get in touch with us.</p>
<img src="http://vxtindia.com/blog/?ak_action=api_record_view&id=94&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://vxtindia.com/blog/connectingindia-has-a-new-address/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Another iPhone application reaches the App Store</title>
		<link>http://vxtindia.com/blog/another-iphone-application-reaches-the-app-store/</link>
		<comments>http://vxtindia.com/blog/another-iphone-application-reaches-the-app-store/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 12:22:40 +0000</pubDate>
		<dc:creator>Sudhanshu</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[appstore]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[portfolio]]></category>

		<guid isPermaLink="false">http://blog.vxtindia.com/?p=88</guid>
		<description><![CDATA[
Our second iPhone application is now live at the App Store. We worked with Iterating on this one, and after a few months of hard work, it has finally reached the AppStore.
More details are available on the Iterating Blog and it can also be seen on the App Store.
Even though the app is free, the [...]]]></description>
			<content:encoded><![CDATA[<p><a rel='nofollow' href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=312332699&#038;mt=8"><img src="http://vxtindia.com/blog/wp-content/uploads/2009/06/fruition-on-app-store1.gif" alt="fruition-on-app-store" title="fruition-on-app-store" width="261" height="190" class="alignleft size-full wp-image-90" /></a></p>
<p>Our <em>second </em>iPhone application is now live at the App Store. We worked with <a href='http://iterating.net/' rel='nofollow'><strong>Iterating</strong></a> on this one, and after a few months of hard work, it has finally reached the AppStore.</p>
<p>More details are available on the <a href='http://user-experience.iterating.net/2009/06/itunes-now-hosts-fruition-iphone-application/'>Iterating <em>Blog</em></a> and it can also be seen on the <a rel='nofollow' href='http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=312332699&#038;mt=8' rel='nofollow'>App Store</a>.</p>
<p>Even though the app is free, the only catch is that you need to <em>own a few vineyards</em> to actually use this application!</p>
<img src="http://vxtindia.com/blog/?ak_action=api_record_view&id=88&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://vxtindia.com/blog/another-iphone-application-reaches-the-app-store/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get emails from SVN on commit</title>
		<link>http://vxtindia.com/blog/get-emails-from-svn-on-commit/</link>
		<comments>http://vxtindia.com/blog/get-emails-from-svn-on-commit/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 09:44:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[post-commit]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.vxtindia.com/?p=71</guid>
		<description><![CDATA[We have been using SVN for a couple of years for all of our projects. Initially we were hosting them at Springloops.com for almost a year, when we decided to start hosting them on our own server.
It all sounded really good, till we realized that code reviews became a real problem. Springloops had a stunning [...]]]></description>
			<content:encoded><![CDATA[<p>We have been using <strong>SVN</strong> for a couple of years for all of our projects. Initially we were hosting them at <a rel="nofollow" href="http://springloops.com">Springloops.com</a> for almost a year, when we decided to start hosting them on our own server.</p>
<p>It all sounded really good, till we realized that code reviews became a real problem. Springloops had a <em>stunning</em> interface to compare the <em>diffs</em> and get all the related information, which we really missed.</p>
<p>So we decided to use the <strong>post-commit hooks</strong> in SVN to email us as soon as a commit was made.</p>
<p>If you would like to implement the same for your server, here is a quick and dirty guide on how to do that.</p>
<p>First, the details about our server</p>
<p><code># svn --version<br />
svn, version 1.5.1 (r32289)<br />
compiled Jul 31 2008, 09:45:20<br />
</code></p>
<p><code># lsb_release -a<br />
No LSB modules are available.<br />
Distributor ID: Ubuntu<br />
Description:    Ubuntu 8.10<br />
Release:        8.10<br />
Codename:       intrepid<br />
</code></p>
<p><em>Okay</em>, so let us get started. The first thing that you should know is that inside your repository, SVN creates a folder called <em>hooks</em>. This folder initially contains template files for all the hooks that can be called via SVN. The hook that we are after today, is called <strong>post-commit.tmpl</strong></p>
<p>Since our language of preference is <em>PHP</em>, we decided to call a php script as soon as a commit was done on that repository. Here is how we did it</p>
<p><code># cd /path/to/repo/hooks<br />
# mv post-commit.tmpl post-commit<br />
# chmod 755 post-commit<br />
# vi post-commit<br />
</code></p>
<p>The post-commit file contains the following</p>
<p><code>#!/bin/sh<br />
<br />
REPOS="$1"<br />
REV="$2"<br />
<br />
php /svn/scripts/postCommitHook.php $REPOS $REV<br />
</code></p>
<p>The above steps can also be <strong>automated</strong> by writing another php script which would copy all our hooks from a base directory into the respective directories in the repositories. <em>Here is what our script looks like</em></p>
<p><code> $hooks_dir = '/svn/hooks/';<br />
 $repos_dir = '/svn/svn.localhost/';<br />
 $repo_hook_dir = $repos_dir . '__REPO__/hooks/';<br />
 <br />
 if($hooks = opendir($hooks_dir)) {<br />
&nbsp; while(($hook = readdir($hooks)) !== false) {<br />
&nbsp;&nbsp; $unwanted = array('.', '..');<br />
&nbsp;&nbsp; if(!in_array($hook, $unwanted)) {<br />
&nbsp;&nbsp;&nbsp; if($repos = opendir($repos_dir)) {<br />
&nbsp;&nbsp;&nbsp;&nbsp; while(($repo = readdir($repos)) !== false) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(!in_array($repo, $unwanted) &#038;&#038; is_dir(repoPath($repo))) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(!copy($hooks_dir . $hook, repoPath($repo) . $hook)) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo "Could not copy " . $hooks_dir . $hook . " to " . repoPath($repo) . "\n";<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(!chmod(repoPath($repo) . $hook, 0755)) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo "Could not chmod " . repoPath($repo) . $repo . "\n";<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp; closedir($hooks);<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp; }<br />
&nbsp; }<br />
&nbsp; closedir($hooks);<br />
}<br />
<br />
function repoPath($repo) {<br />
&nbsp; global $repo_hook_dir;<br />
&nbsp; return str_replace('__REPO__', $repo, $repo_hook_dir);<br />
}<br />
</code></p>
<p>Finally, we need to create the file <strong>postCommitHook.php</strong> which will find out all the relevant information and mail you the details. We have used <em>svnlook </em>and <em>phpmailer </em>to get all the information. Here is what our postCommitHook.php looks like</p>
<p><code>function getRepoName($repo) {<br />
&nbsp; return strtoupper(str_replace('/', '', str_replace('/svn/svn.localhost/', '', $repo)));<br />
}<br />
<br />
require_once('phpmail/class.phpmailer.php');<br />
<br />
$repository = isset($argv[1]) ? $argv[1] : '';<br />
$revision = isset($argv[2]) ? $argv[2] : '';<br />
<br />
$author = strtoupper(exec('svnlook author ' . $repository));<br />
$changed = exec('svnlook changed ' . $repository);<br />
$comments = exec('svnlook log ' . $repository);<br />
<br />
$diff = '';<br />
$fp = popen('svnlook diff ' . $repository, "r");<br />
while(!feof($fp)) {<br />
&nbsp; $diff .= fread($fp, 1024);<br />
&nbsp; flush();<br />
}<br />
pclose($fp);<br />
<br />
$body = "Hi,\n\n$author has just committed revision $revision in " . getRepoName($repository) . "  and said \n\n$comments.\n\n\n\nThe following files have changed :\n\n$changed \n\n\n\nThe changelog is given below $diff";<br />
<br />
$mail = new PHPMailer();<br />
$mail->From = 'svn@localhost';<br />
$mail->FromName = 'SVN Server';<br />
$mail->AddAddress('repo.admin@localhost', 'Repo Admin');<br />
<br />
$mail->Subject = 'SVN Commit - ' . getRepoName($repository) . ' - Revision ' . $revision;<br />
$mail->Body = $body;<br />
<br />
if(!$mail->Send()) {<br />
&nbsp; echo "Error sending: " . $mail->ErrorInfo;;<br />
}<br />
</code></p>
<p><em>And that is it!</em></p>
<p>Once the scripts are in place, just run copyHooks.php once and then whenever anybody commits on any of your repositories, you will get an elaborate email with the diff.</p>
<img src="http://vxtindia.com/blog/?ak_action=api_record_view&id=71&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://vxtindia.com/blog/get-emails-from-svn-on-commit/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fixing the performance issues</title>
		<link>http://vxtindia.com/blog/fixing-the-performance-issues/</link>
		<comments>http://vxtindia.com/blog/fixing-the-performance-issues/#comments</comments>
		<pubDate>Sat, 30 May 2009 06:43:14 +0000</pubDate>
		<dc:creator>Sudhanshu</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[webkit]]></category>

		<guid isPermaLink="false">http://blog.vxtindia.com/?p=68</guid>
		<description><![CDATA[While iterating through the archives of Daring Fireball, I came across an interesting policy from the WebKit team.
The way to make a program faster is to never let it get slower.
We have a zero-tolerance policy for performance regressions. If a patch lands that regresses performance according to our benchmarks, then the person responsible must either [...]]]></description>
			<content:encoded><![CDATA[<p>While iterating through the archives of Daring Fireball, I came across an interesting policy from the WebKit team.</p>
<blockquote><p>The way to make a program faster is to never let it get slower.</p>
<p>We have a zero-tolerance policy for performance regressions. If a patch lands that regresses performance according to our benchmarks, then the person responsible must either back the patch out of the tree or drop everything immediately and fix the regression.</p>
<p>Common excuses people give when they regress performance are, “But the new way is cleaner!” or “The new way is more correct.” We don’t care. No performance regressions are allowed, regardless of the reason. There is no justification for regressing performance. None.</p></blockquote>
<p>I hope someday the Firefox dev-team working on Linux also gets to fixing their performance issues. There is not one decent web browser for Linux and I don&#8217;t see any company coming out with anything interesting with it.</p>
<img src="http://vxtindia.com/blog/?ak_action=api_record_view&id=68&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://vxtindia.com/blog/fixing-the-performance-issues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- This site's performance optimized by W3 Total Cache. Dramatically improve the speed and reliability of your blog!

Learn more about our WordPress Plugins: http://www.w3-edge.com/wordpress-plugins/


Served from: vxtindia.com @ 2010-03-11 02:48:25 -->