<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Random Noise</title>
	<atom:link href="http://serialize.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://serialize.wordpress.com</link>
	<description>cat /dev/random &#62;&#62; /dev/dsp</description>
	<lastBuildDate>Mon, 14 Nov 2011 18:42:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='serialize.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Random Noise</title>
		<link>http://serialize.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://serialize.wordpress.com/osd.xml" title="Random Noise" />
	<atom:link rel='hub' href='http://serialize.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Blackberry: ContentHandler and ApplicationMenuItem</title>
		<link>http://serialize.wordpress.com/2010/06/30/contenthandler/</link>
		<comments>http://serialize.wordpress.com/2010/06/30/contenthandler/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 02:40:26 +0000</pubDate>
		<dc:creator>Vivek Unune</dc:creator>
				<category><![CDATA[blackberry]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JSR211]]></category>

		<guid isPermaLink="false">http://serialize.wordpress.com/?p=110</guid>
		<description><![CDATA[ContentHandler gives us the ability to register our application, so that our app is invoked automatically when user clicks to open particular type of a file. ContentHandler uses &#8216;Server &#8211; Client&#8217; model. Client requests for processing a file type and Server processes it. All the application-filetype bindings are stored in a Registry, the client must [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serialize.wordpress.com&amp;blog=4194111&amp;post=110&amp;subd=serialize&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>ContentHandler gives us the ability to register our application, so that our app is invoked automatically<br />
when user clicks to open particular type of a file. ContentHandler uses &#8216;Server &#8211; Client&#8217; model.<br />
Client requests for processing a file type and Server processes it. All the application-filetype bindings are<br />
stored in a Registry, the client must query this registry to find out if there are any handlers available for that<br />
file type. Then invoke it.</p>
<p>To make our app a &#8216;Server&#8217;, we need to implement RequestListener. See below for sample implementation of a mp3 file handler.</p>
<p>It is important to register our app. It is recommended to perform/verify registration once during device startup.<br />
You shoud pass an argument say &#8220;startup&#8221; during startup to differentiate from other entry points.<br />
In eclipse this can be configured by editing the App_Descriptor.xml.</p>
<p>Also note that APP_IDs used for registration must be unique and failure to do so will render your app unusable.</p>
<p><pre class="brush: csharp;">
package com.serialize.apps;

public class Mp3Player extends UiApplication implements RequestListener {
	public static final long MY_APP_KEY = 0x4a23b634ab2baf78L;
	public static final String MY_APP_CLASS = Mp3Player.class.getName();
	public static final String MY_APP_ID = &quot;com.serialize.Mp3Player&quot;
	private Invocation pending;
	private ContentHandlerServer server;
	
	public Mp3Player() {
		try {
			this.server = Registry.getServer(MY_APP_CLASS);
			//start listening formp3 invocation requests
			this.server.setListener(this);	
		} catch (ContentHandlerException e) {
		}					
	}

	public static void main(String[] args) {
		// On device startup register our app
		if (args != null &amp;&amp; args.length &gt; 0 &amp;&amp; args[0].equals(&quot;startup&quot;)) {
			ensureRegistration();
		} else {			
			Mp3Player app = new Mp3Player();
			app.enterEventDispatcher();
		}
	}

	private static void ensureRegistration() {
		Object o = RuntimeStore.getRuntimeStore().get(MY_APP_KEY);
		// register only if not done already.
		if (o == null) {
			String[] types = {&quot;audio/mp3&quot;};
			String[] suffixes = {&quot;.mp3&quot;};            
			String[] actions = {ContentHandler.ACTION_OPEN};
			String[] actionNames = {&quot;Open with Mp3Player&quot;}; 
			ActionNameMap[] actionNameMaps = {new ActionNameMap(actions,actionNames,&quot;en&quot;)};


			Registry registry = Registry.getRegistry(MY_APP_CLASS);
		
			try {
				// Register our app as mp3 content handler
				registry.register(MY_APP_CLASS, types ,	suffixes , actions , actionNameMaps, MY_APP_ID, null);

				/* Register Menu Item here */
				new Mp3MenuItem().registerInstance();			
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}
	
	/* Utility method to perform invocation from other classes */
	public synchronized static void invoke(String className, String fileName, byte[] contents) {

		Invocation request = new Invocation();
		request.setID(MY_APP_ID); // request Mp3Player
		request.setURL(fileName);
		request.setData(contents); // set byte array if we have it
		request.setType(&quot;audio/mp3&quot;);

		// we don't care about the response
		request.setResponseRequired(false);

		try {
			Registry registry = Registry.getRegistry(className);
			registry.invoke(request);
		} catch (Exception ex) {
			System.out.println(className + &quot;: Error occured while opening file&quot;);
		}
	}	
	
	public synchronized void invocationRequestNotify(ContentHandlerServer handler) {

		pending = handler.getRequest(false);
		
		if (pending != null) {
			byte[] contents = getContents();
			if (contents != null &amp;&amp; contents.length != 0) {
				// TODO: Implement your Main screen and push it on the stack
				// remember that pushScreen is non blocking
				pushScreen(new Mp3PlayerScreen(contents));
				
				// notify the server that we are handling the invocation
				this.server.finish(pending, Invocation.OK);
			}
			else{
				// Close this instance or else you'll get &quot;previous instance still active&quot;
				// So we stop listening to invocation requests
				System.exit(0);
			}			
		} else {
			// Stop listening to invocation requests
			System.exit(0);
		}			
	}

	// Reads data from the invocation request
	// The invocation may contain associated byte array or URL to a file
	// or it could have associated stream (say network stream).
	private byte[] getContents() {
		InputStream is = null;
		StreamConnection sc = null;
		FileConnection fc = null;
		try {
			String filename = null;
			byte[] data = null;
			synchronized (this) {
			
				filename = pending.getURL();
				
				/* try to get associated byte array */
				if(filename.toLowerCase().indexOf(&quot;mp3&quot;) != -1) {
					data = pending.getData();
				}
				else {
				    // if file name did not end with mp3, don't handle it
					filename = null;
				}
			}
			
			// if we retrieved a byte array
			if (data != null &amp;&amp; data.length &gt; 0) {
				return data;
			} else if (filename != null) {
				
				// this is blocking call. use thread instead [e.g for network connection.]
				Connection conn = pending.open(false);
				
				// if this is a file connection the file is already on our phone
				// remember that a FileConnection is also a StreamConnection, 
				// so check FileConnection first				
				if (conn instanceof FileConnection) {
					fc = (FileConnection) conn;
					is = fc.openInputStream();
					
					return IOUtilities.streamToBytes(is);
				} else {
					sc = (StreamConnection) conn;
					is = sc.openInputStream();
					return IOUtilities.streamToBytes(is);
					// TODO: Save the array to SD Card?
				}

			}
		} catch (Exception ex) {
			System.out.println(&quot;Error occured while reading file.&quot;);
		} finally {
			try {
				if (is != null) {
					is.close();
				}
				if (fc != null) {
					fc.close();
				}
				if (sc != null) {
					sc.close();
				}
			} catch (Exception ex) {

			}
		}
		return new byte[0];
	}
}
</pre></p>
<p><strong>Implementing the ApplicationMenuItem:</strong></p>
<p>Although you may not need to implement a custom context menu item, it is particularly useful when there are<br />
other third party applications already handling the same file type.</p>
<p>ApplicationMenuItem provides an alternate entry point, i.e a way to add a custom menu item when a specific application is running.<br />
For example File Browser or Email app. To do this you have to register your implementation with ApplicationMenuItemRepository,<br />
once registered that instance will be cached in memory until the device is on. But this repository gets wiped out every time the device is rebooted.</p>
<p>So it is a good practice to register once per startup(see above). Now, if you have a UIApplication and it has an icon, user will<br />
start it by selecting it. In this case we have to make sure that we do not register our menu item twice. For this we will have to<br />
use RuntimeStore to save state of our registration.</p>
<p>ApplicationMenuItem construct takes a context, if you are registering this menu item for specific files, mime type of the file type<br />
must be passed as context. This especially important when you are registering your menu item with File Browser.</p>
<p>Important gotcha here is that when you request for an invocation, and the server is not running,<br />
the server will be initialized <em>before</em> the invocation request is made.</p>
<p><pre class="brush: csharp;">
package com.serialize.apps;

public class Mp3MenuItem extends ApplicationMenuItem {
	public static final long MP3_MENU_ITEM_KEY = 0x1a23b6c6ab2b1075L;

	public Mp3MenuItem() {
		/* will only be shown if the file mime type matches the context */ 
		super(&quot;audio/mp3&quot;, 500000); // order is found by trial and error method
	}

	/* This will be menu item text */
	public String toString() {
		return &quot;Open MP3 File&quot;;
	}

	public void registerInstance() {
		/* verify Registration */
		Object o = RuntimeStore.getRuntimeStore().remove(MP3_MENU_ITEM_KEY);
		 if(o == null) {
			ApplicationMenuItemRepository amir = ApplicationMenuItemRepository.getInstance();
			// Gets Mp3Player descriptor, since this method is called from ensureRegistration()
			ApplicationDescriptor ad_startup = ApplicationDescriptor.currentApplicationDescriptor();
			ApplicationDescriptor ad_gui = new ApplicationDescriptor(ad_startup, new String[] {&quot;menuitem_entry&quot;});
			
			/* Register for File Browser */
			amir.addMenuItem(ApplicationMenuItemRepository.MENUITEM_FILE_EXPLORER, this, ad_gui);	 	
			RuntimeStore.getRuntimeStore().put(MP3_MENU_ITEM_KEY, this);
		 }
	}

	/* Mp3Player main() will be called before call to this function */
	public Object run(Object context) {
		if (context != null &amp;&amp; context instanceof String) {
			String inputFile = (String) context;

			// excecution control is automatically passed to Mp3Player.invocationRequestNotify() after this
			Mp3Player.invoke(getClass().getName(), inputFile, null);
		}
		return context;
	}
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/serialize.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/serialize.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/serialize.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/serialize.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/serialize.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/serialize.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/serialize.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/serialize.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/serialize.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/serialize.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/serialize.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/serialize.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/serialize.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/serialize.wordpress.com/110/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serialize.wordpress.com&amp;blog=4194111&amp;post=110&amp;subd=serialize&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://serialize.wordpress.com/2010/06/30/contenthandler/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/54fbdf814723425c6ce3e94aefaad4c1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
		<item>
		<title>MSBuild Task: Solution and Project dependencies</title>
		<link>http://serialize.wordpress.com/2009/12/16/msbuild-task/</link>
		<comments>http://serialize.wordpress.com/2009/12/16/msbuild-task/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 20:50:49 +0000</pubDate>
		<dc:creator>Vivek Unune</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[msbuild]]></category>

		<guid isPermaLink="false">http://serialize.wordpress.com/?p=88</guid>
		<description><![CDATA[Few months ago I needed to use MSbuild to build solution. Sounds simple right? Yeah, but not quite. Somehow, my msbuild failed with project dependency issues. It turns out that MSBuild doesn&#8217;t respect project dependencies in a solution. Google &#8220;msbuild solution dependencies&#8221; and you&#8217;ll find various post complaining about the problem with MSBuild. I modified [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serialize.wordpress.com&amp;blog=4194111&amp;post=88&amp;subd=serialize&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Few months ago I needed to use MSbuild to build solution. Sounds simple right? Yeah, but not quite.<br />
Somehow, my msbuild failed with project dependency issues. It turns out that MSBuild doesn&#8217;t respect project dependencies in a solution. Google &#8220;msbuild solution dependencies&#8221; and you&#8217;ll find various post complaining about the problem with MSBuild.</p>
<p>I modified the MSBuild task found <a href="http://msbuildtasks.tigris.org/source/browse/msbuildtasks/trunk/Source/MSBuild.Community.Tasks/Solution/GetSolutionProjects.cs?revision=321&amp;view=markup">here</a> to get projects in a solution file in dependency order.</p>
<p>You can then call the task to get the projects and compile them in order:<br />
<pre class="brush: xml;">
&lt;Target Name=&quot;BuildProjects&quot;&gt;
		&lt;GetProjecsInOrder Solution=&quot;$(MSBuildProjectDirectory)\MySolution.sln&quot;&gt;
		  &lt;Output ItemName=&quot;ProjectFiles&quot; TaskParameter=&quot;Output&quot;/&gt;
		&lt;/GetProjecsInOrder&gt;

		&lt;MSBuild Projects=&quot;%(ProjectFiles.FullPath)&quot;
				 Targets=&quot;Build&quot;
				 Properties=&quot;Configuration=Release&quot;/&gt;
&lt;/Target&gt;
</pre>		</p>
<p>You can download the modified source from <a href="http://www.esnips.com/doc/8e232db4-21ac-4d93-90dc-2a8bc4db34a8/MSBuildTasks">http://www.esnips.com/doc/8e232db4-21ac-4d93-90dc-2a8bc4db34a8/MSBuildTasks</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/serialize.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/serialize.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/serialize.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/serialize.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/serialize.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/serialize.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/serialize.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/serialize.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/serialize.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/serialize.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/serialize.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/serialize.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/serialize.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/serialize.wordpress.com/88/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serialize.wordpress.com&amp;blog=4194111&amp;post=88&amp;subd=serialize&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://serialize.wordpress.com/2009/12/16/msbuild-task/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/54fbdf814723425c6ce3e94aefaad4c1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
		<item>
		<title>IDataReader GetValue Extension method</title>
		<link>http://serialize.wordpress.com/2009/07/15/idatareader-getvalue-extension-method/</link>
		<comments>http://serialize.wordpress.com/2009/07/15/idatareader-getvalue-extension-method/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 21:27:41 +0000</pubDate>
		<dc:creator>Vivek Unune</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[.NET 3.5]]></category>
		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://serialize.wordpress.com/?p=79</guid>
		<description><![CDATA[It is offten desired to get a value from DataReader using column name with known Type. For example you want to get a string value of column &#8216;first_name&#8217; and int value of column &#8216;account_number&#8217;. The following extension method makes it easy to fetch values from a DataReader using Type and column name: public static class [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serialize.wordpress.com&amp;blog=4194111&amp;post=79&amp;subd=serialize&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It is offten desired to get a value from DataReader using column name with known Type. For example you want to get a string value of column &#8216;first_name&#8217; and int value of column &#8216;account_number&#8217;. The following extension method makes it easy to fetch values from a DataReader using Type and column name:</p>
<pre><span style="font-size:small;"><span style="color:#0000FF;">public</span><span style="color:#000000;"> </span><span style="color:#0000FF;">static</span><span style="color:#000000;"> </span><span style="color:#0000FF;">class</span><span style="color:#000000;"> ReaderHelper
{
    </span><span style="color:#0000FF;">public</span><span style="color:#000000;"> </span><span style="color:#0000FF;">static</span><span style="color:#000000;"> </span><span style="color:#0000FF;">bool</span><span style="color:#000000;"> IsNullableType(Type valueType)
    {
        </span><span style="color:#0000FF;">return</span><span style="color:#000000;"> (valueType.IsGenericType &amp;&amp;
            valueType.GetGenericTypeDefinition().Equals(</span><span style="color:#0000FF;">typeof</span><span style="color:#000000;">(Nullable&lt;&gt;)));
    }

    </span><span style="color:#0000FF;">public</span><span style="color:#000000;"> </span><span style="color:#0000FF;">static</span><span style="color:#000000;"> T GetValue&lt;T&gt;(</span><span style="color:#0000FF;">this</span><span style="color:#000000;"> IDataReader reader, </span><span style="color:#0000FF;">string</span><span style="color:#000000;"> columnName)
    {
        </span><span style="color:#0000FF;">object</span><span style="color:#000000;"> value = reader[columnName];
        Type valueType = </span><span style="color:#0000FF;">typeof</span><span style="color:#000000;">(T);
        </span><span style="color:#0000FF;">if</span><span style="color:#000000;"> (value != DBNull.Value)
        {
            </span><span style="color:#0000FF;">if</span><span style="color:#000000;"> (!IsNullableType(valueType))
            {
                </span><span style="color:#0000FF;">return</span><span style="color:#000000;"> (T)Convert.ChangeType(value, valueType);
            }
            </span><span style="color:#0000FF;">else</span><span style="color:#000000;">
            {
                NullableConverter nc = </span><span style="color:#0000FF;">new</span><span style="color:#000000;"> NullableConverter(valueType);
                </span><span style="color:#0000FF;">return</span><span style="color:#000000;"> (T)Convert.ChangeType(value, nc.UnderlyingType);
            }
        }
        </span><span style="color:#0000FF;">return</span><span style="color:#000000;"> </span><span style="color:#0000FF;">default</span><span style="color:#000000;">(T);
    }
}</span></pre>
<p>It can be used as:</p>
<pre><span style="font-size:small;"><span style="color:#000000;">User GetUser(IDataReader reader)
{
    User user = </span><span style="color:#0000FF;">new</span><span style="color:#000000;"> User();
    user.FirstName = reader.GetValue&lt;</span><span style="color:#0000FF;">string</span><span style="color:#000000;">&gt;(</span><span style="color:#800000;">"first_name"</span><span style="color:#000000;">);
    user.LastName = reader.GetValue&lt;</span><span style="color:#0000FF;">string</span><span style="color:#000000;">&gt;(</span><span style="color:#800000;">"last_name"</span><span style="color:#000000;">);
    user.Email = reader.GetValue&lt;</span><span style="color:#0000FF;">string</span><span style="color:#000000;">&gt;(</span><span style="color:#800000;">"email"</span><span style="color:#000000;">);
    user.AccountNumber = reader.GetValue&lt;</span><span style="color:#0000FF;">int</span><span style="color:#000000;">&gt;(</span><span style="color:#800000;">"account_number"</span><span style="color:#000000;">);
    user.NumberOfVehiclesOwned = reader.GetValue&lt;</span><span style="color:#0000FF;">int?</span><span style="color:#000000;">&gt;(</span><span style="color:#800000;">"vehicle_count"</span><span style="color:#000000;">); </span><span style="color:#008000;">// nullable data field</span><span style="color:#000000;">
    </span><span style="color:#0000FF;">return</span><span style="color:#000000;"> user;
}
</span></span></pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/serialize.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/serialize.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/serialize.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/serialize.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/serialize.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/serialize.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/serialize.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/serialize.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/serialize.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/serialize.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/serialize.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/serialize.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/serialize.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/serialize.wordpress.com/79/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serialize.wordpress.com&amp;blog=4194111&amp;post=79&amp;subd=serialize&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://serialize.wordpress.com/2009/07/15/idatareader-getvalue-extension-method/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/54fbdf814723425c6ce3e94aefaad4c1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
		<item>
		<title>Experiments with OpenWRT and USR5465</title>
		<link>http://serialize.wordpress.com/2008/12/10/experiments-with-openwrt-and-usr5465/</link>
		<comments>http://serialize.wordpress.com/2008/12/10/experiments-with-openwrt-and-usr5465/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 03:28:48 +0000</pubDate>
		<dc:creator>Vivek Unune</dc:creator>
				<category><![CDATA[openwrt]]></category>
		<category><![CDATA[usrobotics]]></category>
		<category><![CDATA[vpnc]]></category>

		<guid isPermaLink="false">http://serialize.wordpress.com/?p=68</guid>
		<description><![CDATA[I recently purchased U.S Robotics USR5465 router. I chose it because it had 4MB flash and 16MB ram; enough to run  linux based distribution for router such as OpenWRT. Out of the box, this router runs linux kernel 2.4 along with busy box. But I was very much interested to run latest kernel (2.6.x) on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serialize.wordpress.com&amp;blog=4194111&amp;post=68&amp;subd=serialize&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently purchased U.S Robotics USR5465 router. I chose it because it had 4MB flash and 16MB ram; enough to run  linux based distribution for router such as OpenWRT. Out of the box, this router runs linux kernel 2.4 along with busy box. But I was very much interested to run latest kernel (2.6.x) on it. With OpenWRT it is easy to create the development environment. Just login to your favorite linux as a non-root and follow few steps mention here. Once you configure your router kernel and run make command. OpenWRT automatically downloads required toochain source and compiles it for your PC.</p>
<p>USR5465 has one serial port and possibly a 12 pin JTAG. So, I brought myself a Nokia DKU-5 cable (SN: WT048000317).  This cable has a usb to serial converter; and it&#8217;s cheap! I cut/removed the phone connector end of the cable. After a little research, I found out that:</p>
<pre>Phone connector Pin#        Wire Color        Signal
            8                 RED              GND
            7                 GREEN            TX
            6                 WHITE            RX
            4                 ORANGE           3.3 OUT  (Not used, do not connect!!)</pre>
<p>After connecting wires to jumper J301, compiling ark3116 kernel module  and using 115200 baud rate with 8-N-1, I was able to connect my laptop to the router. When I restarted the router I saw the boot messages from router. Here is how I connected the wires:</p>
<pre>j301
|o|  ---&gt;   GREEN   (TX)
|o|  ---&gt;   WHITE   (RX)
|o|
|o|  ---&gt;   RED     (GND)

______
o -&gt; Power led

#################################     &lt;--- Motherboard edge</pre>
<p>Another advantage of this router is that it has a USB 2.0 port. To use usb, I had to use revision 13088 and patched it using <a href="http://dongsupark.de/openwrt/kamikaze-r13088-b43ssb-2.6.27.diff" target="_blank">this patch</a></p>
<p>svn checkout -r13088 https://svn.openwrt.org/openwrt/trunk kamikaze<br />
patch -p1 &lt; kamikaze-r13088-b43ssb-2.6.27.diff</p>
<p>I had to change &#8220;BUSWIDTH 2&#8243; to &#8220;BUSWIDTH 1&#8243; in drivers/mtd/maps/bcm47xx-flash.c file in order to get a working image. Otherwise I saw few &#8220;error -5&#8243; lines after booting.</p>
<p>I wasn&#8217;t able to connect to the internet, even after I got the image to boot successfully. I found that the problem was due to incorrect labeling of the WAN and the LAN ports by OpenWRT.  Since I was able to connect to the router using the serial port I changed the VLAN config in /etc/config/network to:</p>
<pre>#### VLAN configuration
config switch eth0
        option vlan0    "0 1 2 3 5*"
        option vlan1    "4 5"</pre>
<p>Only then I was able to get a valid IP address and connect to the internet.</p>
<p>Other than wireless (which didn&#8217;t bother me, as I always use wired connection) everything is now working perfectly. Since this model is not supported by OpenWRT, it doesn&#8217;t know the led configurations and does not recognize the model. So I had to add that info. in diag.c file. gpioctl utility was useful to find out the led and  reset button gpios.</p>
<p>You can download modified diag.c from <a href="http://serialize.files.wordpress.com/2008/12/diagc.doc" target="_blank">here</a>. Once you compile you should see WAN led and USB led litup (need to do some configuration for USB led).</p>
<p>Further I was also able to install VPNC on the router and connect to CISCO VPN without any problem <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  This makes it easier for me when using Vista x64, as cisco doesn&#8217;t provide vpn client for 64bit windows.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/serialize.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/serialize.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/serialize.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/serialize.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/serialize.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/serialize.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/serialize.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/serialize.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/serialize.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/serialize.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/serialize.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/serialize.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/serialize.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/serialize.wordpress.com/68/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serialize.wordpress.com&amp;blog=4194111&amp;post=68&amp;subd=serialize&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://serialize.wordpress.com/2008/12/10/experiments-with-openwrt-and-usr5465/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/54fbdf814723425c6ce3e94aefaad4c1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
		<item>
		<title>Visual Studio 2008 color settings</title>
		<link>http://serialize.wordpress.com/2008/09/27/visual-studio-2008-color-settings/</link>
		<comments>http://serialize.wordpress.com/2008/09/27/visual-studio-2008-color-settings/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 21:14:22 +0000</pubDate>
		<dc:creator>Vivek Unune</dc:creator>
				<category><![CDATA[Misc.]]></category>
		<category><![CDATA[color settings]]></category>
		<category><![CDATA[vs2008]]></category>

		<guid isPermaLink="false">http://serialize.wordpress.com/?p=54</guid>
		<description><![CDATA[I recently switched to &#8220;dark&#8221; vs2008 color scheme since it is easy on eyes. I started with RagnaRok color scheme created by Tomas Restrepo and modified it to my convenience. You can download the modified version from here: RagnaRok-modified.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serialize.wordpress.com&amp;blog=4194111&amp;post=54&amp;subd=serialize&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently switched to &#8220;dark&#8221; vs2008 color scheme since it is easy on eyes.</p>
<p>I started with RagnaRok color scheme created by Tomas Restrepo and modified it to my convenience.</p>
<p>You can download the modified version from here: <a href="http://www.hotlinkfiles.com/files/1891615_pazaw/RagnaRok-Modified.zip" target="_blank">RagnaRok-modified</a>.</p>
<p><a href="http://serialize.files.wordpress.com/2008/09/vs20081.png"><img class="aligncenter size-full wp-image-61" title="vs20081" src="http://serialize.files.wordpress.com/2008/09/vs20081.png?w=700" alt=""   /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/serialize.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/serialize.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/serialize.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/serialize.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/serialize.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/serialize.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/serialize.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/serialize.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/serialize.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/serialize.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/serialize.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/serialize.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/serialize.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/serialize.wordpress.com/54/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serialize.wordpress.com&amp;blog=4194111&amp;post=54&amp;subd=serialize&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://serialize.wordpress.com/2008/09/27/visual-studio-2008-color-settings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/54fbdf814723425c6ce3e94aefaad4c1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>

		<media:content url="http://serialize.files.wordpress.com/2008/09/vs20081.png" medium="image">
			<media:title type="html">vs20081</media:title>
		</media:content>
	</item>
		<item>
		<title>RotateString v2.0</title>
		<link>http://serialize.wordpress.com/2008/09/27/rotatestring-v20/</link>
		<comments>http://serialize.wordpress.com/2008/09/27/rotatestring-v20/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 16:46:57 +0000</pubDate>
		<dc:creator>Vivek Unune</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[stackoverflow]]></category>

		<guid isPermaLink="false">http://serialize.wordpress.com/?p=47</guid>
		<description><![CDATA[I added the ability to rotate string right or left. Here is the code: public enum Direction { Right, Left } string rotateString(string source, int rotationCount, Direction direction) { if (String.IsNullOrEmpty(source) &#124;&#124; rotationCount &#60;= 0) return source; int pivot = 0; List&#60;int&#62; delimiterLocations = new List&#60;int&#62;(); char[] sourceChars = new char; char temp; // Reverse [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serialize.wordpress.com&amp;blog=4194111&amp;post=47&amp;subd=serialize&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I added the ability to rotate string right or left. Here is the code:</p>
<pre><span style="font-size:small;">
<span style="color:#0000ff;">public</span><span style="color:#000000;"> </span><span style="color:#0000ff;">enum</span><span style="color:#000000;"> Direction { Right, Left }

</span><span style="color:#0000ff;">string</span><span style="color:#000000;"> rotateString(</span><span style="color:#0000ff;">string</span><span style="color:#000000;"> source, </span><span style="color:#0000ff;">int</span><span style="color:#000000;"> rotationCount, Direction direction)
{
    </span><span style="color:#0000ff;">if</span><span style="color:#000000;"> (String.IsNullOrEmpty(source) </span><span style="color:#000000;">||</span><span style="color:#000000;"> rotationCount </span><span style="color:#000000;">&lt;=</span><span style="color:#000000;"> </span><span style="color:#800080;">0</span><span style="color:#000000;">)
        </span><span style="color:#0000ff;">return</span><span style="color:#000000;"> source;

    </span><span style="color:#0000ff;">int</span><span style="color:#000000;"> pivot </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#800080;">0</span><span style="color:#000000;">;
    List</span><span style="color:#000000;">&lt;</span><span style="color:#0000ff;">int</span><span style="color:#000000;">&gt;</span><span style="color:#000000;"> delimiterLocations </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000ff;">new</span><span style="color:#000000;"> List</span><span style="color:#000000;">&lt;</span><span style="color:#0000ff;">int</span><span style="color:#000000;">&gt;</span><span style="color:#000000;">();
    </span><span style="color:#0000ff;">char</span><span style="color:#000000;">[] sourceChars </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000ff;">new</span><span style="color:#000000;"> </span><span style="color:#0000ff;">char</span><span style="color:#000000;">;

    </span><span style="color:#0000ff;">char</span><span style="color:#000000;"> temp;
    </span><span style="color:#008000;">//</span><span style="color:#008000;"> Reverse the whole string and
    </span><span style="color:#008000;">//</span><span style="color:#008000;"> save the dilimiter locations</span><span style="color:#008000;">
</span><span style="color:#000000;">    </span><span style="color:#0000ff;">for</span><span style="color:#000000;"> (</span><span style="color:#0000ff;">int</span><span style="color:#000000;"> i </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#800080;">0</span><span style="color:#000000;">; i </span><span style="color:#000000;">&lt;</span><span style="color:#000000;"> source.Length; i</span><span style="color:#000000;">++</span><span style="color:#000000;">)
    {
        sourceChars </span><span style="color:#000000;">=</span><span style="color:#000000;"> source[i];

        </span><span style="color:#0000ff;">if</span><span style="color:#000000;"> (source[i] </span><span style="color:#000000;">==</span><span style="color:#000000;"> </span><span style="color:#800000;">'</span><span style="color:#800000;"> </span><span style="color:#800000;">'</span><span style="color:#000000;">)
            delimiterLocations.Add(source.Length </span><span style="color:#000000;">-</span><span style="color:#000000;"> i </span><span style="color:#000000;">-</span><span style="color:#000000;"> </span><span style="color:#800080;">1</span><span style="color:#000000;">);
    }

    </span><span style="color:#008000;">//</span><span style="color:#008000;"> calculate neededDelimiters mod wordCount
    </span><span style="color:#008000;">//</span><span style="color:#008000;"> (assume words = delimiterCount + 1)</span><span style="color:#008000;">
</span><span style="color:#000000;">    pivot </span><span style="color:#000000;">=</span><span style="color:#000000;"> rotationCount </span><span style="color:#000000;">%</span><span style="color:#000000;"> delimiterLocations.Count;

    </span><span style="color:#0000ff;">if</span><span style="color:#000000;"> (pivot </span><span style="color:#000000;">&gt;</span><span style="color:#000000;"> </span><span style="color:#800080;">0</span><span style="color:#000000;">)
    {
        </span><span style="color:#0000ff;">if</span><span style="color:#000000;"> (direction </span><span style="color:#000000;">==</span><span style="color:#000000;"> Direction.Left)
            pivot </span><span style="color:#000000;">=</span><span style="color:#000000;"> delimiterLocations.Count </span><span style="color:#000000;">-</span><span style="color:#000000;"> pivot;

        pivot </span><span style="color:#000000;">=</span><span style="color:#000000;"> delimiterLocations[delimiterLocations.Count </span><span style="color:#000000;">-</span><span style="color:#000000;"> pivot];
    }
    </span><span style="color:#0000ff;">else</span><span style="color:#000000;">
    { </span><span style="color:#0000ff;">return</span><span style="color:#000000;"> source; }

    </span><span style="color:#008000;">//</span><span style="color:#008000;"> reverse the first part</span><span style="color:#008000;">
</span><span style="color:#000000;">    </span><span style="color:#0000ff;">for</span><span style="color:#000000;"> (</span><span style="color:#0000ff;">int</span><span style="color:#000000;"> i </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#800080;">0</span><span style="color:#000000;">, j </span><span style="color:#000000;">=</span><span style="color:#000000;"> pivot </span><span style="color:#000000;">-</span><span style="color:#000000;"> </span><span style="color:#800080;">1</span><span style="color:#000000;">; i </span><span style="color:#000000;">&lt;=</span><span style="color:#000000;"> j; i</span><span style="color:#000000;">++</span><span style="color:#000000;">, j</span><span style="color:#000000;">--</span><span style="color:#000000;">)
    {
        temp </span><span style="color:#000000;">=</span><span style="color:#000000;"> sourceChars[i];
        sourceChars[i] </span><span style="color:#000000;">=</span><span style="color:#000000;"> sourceChars[j];
        sourceChars[j] </span><span style="color:#000000;">=</span><span style="color:#000000;"> temp;
    }

    </span><span style="color:#008000;">//</span><span style="color:#008000;"> reverse the second part</span><span style="color:#008000;">
</span><span style="color:#000000;">    </span><span style="color:#0000ff;">for</span><span style="color:#000000;"> (</span><span style="color:#0000ff;">int</span><span style="color:#000000;"> i </span><span style="color:#000000;">=</span><span style="color:#000000;"> pivot </span><span style="color:#000000;">+</span><span style="color:#000000;"> </span><span style="color:#800080;">1</span><span style="color:#000000;">, j </span><span style="color:#000000;">=</span><span style="color:#000000;"> sourceChars.Length </span><span style="color:#000000;">-</span><span style="color:#000000;"> </span><span style="color:#800080;">1</span><span style="color:#000000;">;
         i </span><span style="color:#000000;">&lt;=</span><span style="color:#000000;"> j; i</span><span style="color:#000000;">++</span><span style="color:#000000;">, j</span><span style="color:#000000;">--</span><span style="color:#000000;">)
    {
        temp </span><span style="color:#000000;">=</span><span style="color:#000000;"> sourceChars[i];
        sourceChars[i] </span><span style="color:#000000;">=</span><span style="color:#000000;"> sourceChars[j];
        sourceChars[j] </span><span style="color:#000000;">=</span><span style="color:#000000;"> temp;
    }

    </span><span style="color:#0000ff;">return</span><span style="color:#000000;"> </span><span style="color:#0000ff;">new</span><span style="color:#000000;"> </span><span style="color:#0000ff;">string</span><span style="color:#000000;">(sourceChars);
}</span>
</span></pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/serialize.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/serialize.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/serialize.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/serialize.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/serialize.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/serialize.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/serialize.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/serialize.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/serialize.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/serialize.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/serialize.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/serialize.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/serialize.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/serialize.wordpress.com/47/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serialize.wordpress.com&amp;blog=4194111&amp;post=47&amp;subd=serialize&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://serialize.wordpress.com/2008/09/27/rotatestring-v20/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/54fbdf814723425c6ce3e94aefaad4c1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
		<item>
		<title>StackOverflow &#8211; RotateString</title>
		<link>http://serialize.wordpress.com/2008/09/25/stackoverflow-rotatestring/</link>
		<comments>http://serialize.wordpress.com/2008/09/25/stackoverflow-rotatestring/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 05:04:07 +0000</pubDate>
		<dc:creator>Vivek Unune</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[stackoverflow]]></category>

		<guid isPermaLink="false">http://serialize.wordpress.com/?p=25</guid>
		<description><![CDATA[Someone asked the following question on StackOverflow. Before I could post my answer, it was removed. Hmm, so He/She tried to abuse StackOverflow! Anyway, I found that question interesting. The question was to write a function to rotate a string of words. Words are separated by &#8216; &#8216; (space). In the result string, the words [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serialize.wordpress.com&amp;blog=4194111&amp;post=25&amp;subd=serialize&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Someone asked the following question on StackOverflow. Before I could post my answer, it was removed. Hmm, so He/She tried to abuse StackOverflow! Anyway, I found that question interesting.</p>
<p>The question was to write a function to rotate a string of words. Words are separated by &#8216; &#8216; (space). In the result string, the words should remain human readable. The function will also take an integer argument that will specify number of words to rotate.</p>
<p>example:</p>
<p>string source = &#8220;A quick brown fox jumps over the lazy dog.&#8221;</p>
<p>rotateString(source, 3);</p>
<p>Should give:</p>
<p>the lazy dog. A quick brown fox jumps over</p>
<p>Here is my solution:</p>
<pre><span style="font-size:small;"><span style="color:#0000ff;">static</span><span style="color:#000000;"> </span><span style="color:#0000ff;">string</span><span style="color:#000000;"> rotateString(</span><span style="color:#0000ff;">string</span><span style="color:#000000;"> source, </span><span style="color:#0000ff;">int</span><span style="color:#000000;"> rotationCount)
{
    </span><span style="color:#0000ff;">if</span><span style="color:#000000;"> (String.IsNullOrEmpty(source) </span><span style="color:#000000;">||</span><span style="color:#000000;"> rotationCount </span><span style="color:#000000;">&lt;=</span><span style="color:#000000;"> </span><span style="color:#800080;">0</span><span style="color:#000000;">)
        </span><span style="color:#0000ff;">return</span><span style="color:#000000;"> source;

    </span><span style="color:#0000ff;">int</span><span style="color:#000000;"> pivot </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#800080;">0</span><span style="color:#000000;">;
    List</span><span style="color:#000000;">&lt;</span><span style="color:#0000ff;">int</span><span style="color:#000000;">&gt;</span><span style="color:#000000;"> delimiterLocations </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000ff;">new</span><span style="color:#000000;"> List</span><span style="color:#000000;">&lt;</span><span style="color:#0000ff;">int</span><span style="color:#000000;">&gt;</span><span style="color:#000000;">();
    </span><span style="color:#0000ff;">char</span><span style="color:#000000;">[] sourceChars </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000ff;">new</span><span style="color:#000000;"> </span><span style="color:#0000ff;">char</span><span style="color:#000000;">;

    </span><span style="color:#0000ff;">char</span><span style="color:#000000;"> temp;
    </span><span style="color:#008000;">//</span><span style="color:#008000;"> Reverse the whole string and
    </span><span style="color:#008000;">//</span><span style="color:#008000;"> save the dilimiter locations</span><span style="color:#008000;">
</span><span style="color:#000000;">    </span><span style="color:#0000ff;">for</span><span style="color:#000000;"> (</span><span style="color:#0000ff;">int</span><span style="color:#000000;"> i </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#800080;">0</span><span style="color:#000000;">; i </span><span style="color:#000000;">&lt;</span><span style="color:#000000;"> source.Length; i</span><span style="color:#000000;">++</span><span style="color:#000000;">)
    {
        sourceChars </span><span style="color:#000000;">=</span><span style="color:#000000;"> source[i];

        </span><span style="color:#0000ff;">if</span><span style="color:#000000;"> (delimiterLocations.Count </span><span style="color:#000000;">&lt;</span><span style="color:#000000;"> rotationCount </span><span style="color:#000000;">&amp;&amp;</span><span style="color:#000000;"> source[i] </span><span style="color:#000000;">==</span><span style="color:#000000;"> </span><span style="color:#800000;">'</span><span style="color:#800000;"> </span><span style="color:#800000;">'</span><span style="color:#000000;">)
            delimiterLocations.Add(source.Length </span><span style="color:#000000;">-</span><span style="color:#000000;"> i </span><span style="color:#000000;">-</span><span style="color:#000000;"> </span><span style="color:#800080;">1</span><span style="color:#000000;">);

    }

    </span><span style="color:#008000;">//</span><span style="color:#008000;"> calculate neededDelimiters mod wordCount
    </span><span style="color:#008000;">//</span><span style="color:#008000;"> (assume words = delimiterCount + 1)</span><span style="color:#008000;">
</span><span style="color:#000000;">    pivot </span><span style="color:#000000;">=</span><span style="color:#000000;"> rotationCount </span><span style="color:#000000;">%</span><span style="color:#000000;"> (delimiterLocations.Count </span><span style="color:#000000;">+</span><span style="color:#000000;"> </span><span style="color:#800080;">1</span><span style="color:#000000;">);

    </span><span style="color:#0000ff;">if</span><span style="color:#000000;"> (pivot </span><span style="color:#000000;">&gt;</span><span style="color:#000000;"> </span><span style="color:#800080;">0</span><span style="color:#000000;">)
        pivot </span><span style="color:#000000;">=</span><span style="color:#000000;"> delimiterLocations[pivot</span><span style="color:#000000;">-</span><span style="color:#800080;">1</span><span style="color:#000000;">];
    </span><span style="color:#0000ff;">else</span><span style="color:#000000;">
        </span><span style="color:#0000ff;">return</span><span style="color:#000000;"> source;

    </span><span style="color:#008000;">//</span><span style="color:#008000;"> reverse the first part</span><span style="color:#008000;">
</span><span style="color:#000000;">    </span><span style="color:#0000ff;">for</span><span style="color:#000000;"> (</span><span style="color:#0000ff;">int</span><span style="color:#000000;"> i </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#800080;">0</span><span style="color:#000000;">, j </span><span style="color:#000000;">=</span><span style="color:#000000;"> pivot </span><span style="color:#000000;">-</span><span style="color:#000000;"> </span><span style="color:#800080;">1</span><span style="color:#000000;">; i </span><span style="color:#000000;">&lt;=</span><span style="color:#000000;"> j; i</span><span style="color:#000000;">++</span><span style="color:#000000;">, j</span><span style="color:#000000;">--</span><span style="color:#000000;">)
    {
        temp </span><span style="color:#000000;">=</span><span style="color:#000000;"> sourceChars[i];
        sourceChars[i] </span><span style="color:#000000;">=</span><span style="color:#000000;"> sourceChars[j];
        sourceChars[j] </span><span style="color:#000000;">=</span><span style="color:#000000;"> temp;
    }

    </span><span style="color:#008000;">//</span><span style="color:#008000;"> reverse the second part</span><span style="color:#008000;">
</span><span style="color:#000000;">    </span><span style="color:#0000ff;">for</span><span style="color:#000000;"> (</span><span style="color:#0000ff;">int</span><span style="color:#000000;"> i </span><span style="color:#000000;">=</span><span style="color:#000000;"> pivot </span><span style="color:#000000;">+</span><span style="color:#000000;"> </span><span style="color:#800080;">1</span><span style="color:#000000;">, j </span><span style="color:#000000;">=</span><span style="color:#000000;"> sourceChars.Length </span><span style="color:#000000;">-</span><span style="color:#000000;"> </span><span style="color:#800080;">1</span><span style="color:#000000;">;
         i </span><span style="color:#000000;">&lt;=</span><span style="color:#000000;"> j; i</span><span style="color:#000000;">++</span><span style="color:#000000;">, j</span><span style="color:#000000;">--</span><span style="color:#000000;">)
    {
        temp </span><span style="color:#000000;">=</span><span style="color:#000000;"> sourceChars[i];
        sourceChars[i] </span><span style="color:#000000;">=</span><span style="color:#000000;"> sourceChars[j];
        sourceChars[j] </span><span style="color:#000000;">=</span><span style="color:#000000;"> temp;
    }

    </span><span style="color:#0000ff;">return</span><span style="color:#000000;"> </span><span style="color:#0000ff;">new</span><span style="color:#000000;"> </span><span style="color:#0000ff;">string</span><span style="color:#000000;">(sourceChars);
}</span></span></pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/serialize.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/serialize.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/serialize.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/serialize.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/serialize.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/serialize.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/serialize.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/serialize.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/serialize.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/serialize.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/serialize.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/serialize.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/serialize.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/serialize.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serialize.wordpress.com&amp;blog=4194111&amp;post=25&amp;subd=serialize&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://serialize.wordpress.com/2008/09/25/stackoverflow-rotatestring/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/54fbdf814723425c6ce3e94aefaad4c1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
		<item>
		<title>Asus G1S CPU, GPU and Arctic Silver 5</title>
		<link>http://serialize.wordpress.com/2008/06/21/asus-g1s-cpu-gpu-and-arctic-silver-5/</link>
		<comments>http://serialize.wordpress.com/2008/06/21/asus-g1s-cpu-gpu-and-arctic-silver-5/#comments</comments>
		<pubDate>Sat, 21 Jun 2008 04:29:00 +0000</pubDate>
		<dc:creator>Vivek Unune</dc:creator>
				<category><![CDATA[G1S]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[AS5]]></category>
		<category><![CDATA[Asus G1S-A1]]></category>
		<category><![CDATA[CPU]]></category>
		<category><![CDATA[GPU]]></category>
		<category><![CDATA[Thermal Paste]]></category>

		<guid isPermaLink="false">http://serialize.wordpress.com/2008/06/21/asus-g1s-cpu-gpu-and-arctic-silver-5/</guid>
		<description><![CDATA[My laptop usually got very hot and CPU and GPU idle temperatures were in the range of ~75C and ~80C respectively. Its about eight months I bought my laptop and I finally decided to open it up and apply thermal paste to both CPU and GPU. Getting to the CPU was fairly simple just remove [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serialize.wordpress.com&amp;blog=4194111&amp;post=15&amp;subd=serialize&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My laptop usually got very hot and CPU and GPU idle temperatures were in the range of ~75C and ~80C respectively. Its about eight months I bought my laptop and I finally decided to open it up and apply thermal paste to both CPU and GPU.</p>
<p>Getting to the CPU was fairly simple just remove 2+4 screws and apply the thermal paste.</p>
<p>But, getting to the GPU was real pain. So, I decided to write a post to describe it in simple steps and gotchas that I discovered.</p>
<p><span style="color:#999999;">Disclaimer: Opening and applying thermal paste to CPU or GPU will void your laptop&#8217;s warranty! Author assumes absolutely no liability for these opinions nor for any damages that may result from reading and/or implementing following steps.</span></p>
<p>Before starting anything, unplug the power <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  and remove the battery.</p>
<p>1. Remove the keyboard. For this remove the two screws that are labeled &#8216;K&#8217; from the under side of the laptop, then using a small flat(slotted) screw driver, un-clip three plastic holders at the top edge of the keyboard . Then tilt it over and unplug two flat cables and one connector with wires grouped together.</p>
<p>2. Then remove the covers of  the ram and the hard drive compartment. Carefully remove the rams modules and hard drive and keep it a side. If you haven&#8217;t removed CPU compartment cover do it now.<br />
* In the CPU compartment, there is a screw hidden just between the heat sink exhaust and the edge of the laptop. The is covered by the aluminum foil so you have to peel it to remove it.<br />
* Also don&#8217;t forget to remove a screw just beneath the hard drive!</p>
<p>3. Remove 3-4 tiny steel screws from the battery compartment. Then remove the rest of the screws from the laptop base. Also remove six screws from the under side of the hinges. Two hinge covers will come off.</p>
<p>4. Remove screws from backside and remove the lid covering the LCD cables. Carefully remove two screws under this lid. Then unplug the two connectors.</p>
<p>5. Tilt screen to the max and remove two long screws that hold the LCD panel in the grooves. Carefully remove the LCD panel and keep it aside.</p>
<p>6. Now slowly lift the upper cover. It should come off w/o problem. You&#8217;ll get a first look at the motherboard. But you still don&#8217;t see the GPU!!!</p>
<p>7. You have to remove couple more screws and unplug speaker cables and the DVD drive. And volia! you can lift the motherboard and turn it over. And there you&#8217;ll see the other heat sink.</p>
<p>8. Go ahead and remove the screws from the GPU heat sink, unplug the fan power connector and carefully detach the heatsink. You&#8217;ll see that the underside of the GPU heat sink  has a thin aluminum foil that according to me prevents thermal paste short circuiting the connectors on the GPU. There is another reason for doing it this way. During laptop assembly the person gets hardly few minutes to apply the paste and set the heatsink, it is easy to just use the foil to cover the die and apply paste and slap the sink on to it &#8211; quick and dirty huh? But as I told earlier it does prevents thermal paste spreading over the GPU circuitry around the die!</p>
<p>9. Remove the foil and the thermal paste. Observe how excessive paste was used! I used a plastic card to get rid of it and finally cleaned it up with some 90% isopropyl alcohol (picked it from local Wallgreens for $2) and cotton swabs.  The copper heat sink was now smooth and clean like a mirror. The die should be clean as new &#8211; but just to make sure clean it as well using a new cotton swab and alcohol.</p>
<p><a href="http://bp0.blogger.com/_0ObWSMNjJpY/SFybRyX7x1I/AAAAAAAAAsk/T_NqsLsT77Y/s1600-h/HPIM2055.JPG"><img style="display:block;text-align:center;cursor:pointer;margin:0 auto 10px;" src="http://bp0.blogger.com/_0ObWSMNjJpY/SFybRyX7x1I/AAAAAAAAAsk/T_NqsLsT77Y/s400/HPIM2055.JPG" border="0" alt="" /></a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/serialize.wordpress.com/15/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/serialize.wordpress.com/15/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/serialize.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/serialize.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/serialize.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/serialize.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/serialize.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/serialize.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/serialize.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/serialize.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/serialize.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/serialize.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/serialize.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/serialize.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/serialize.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/serialize.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serialize.wordpress.com&amp;blog=4194111&amp;post=15&amp;subd=serialize&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://serialize.wordpress.com/2008/06/21/asus-g1s-cpu-gpu-and-arctic-silver-5/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/54fbdf814723425c6ce3e94aefaad4c1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>

		<media:content url="http://bp0.blogger.com/_0ObWSMNjJpY/SFybRyX7x1I/AAAAAAAAAsk/T_NqsLsT77Y/s400/HPIM2055.JPG" medium="image" />
	</item>
		<item>
		<title>MSI Bootstraper</title>
		<link>http://serialize.wordpress.com/2008/06/01/msi-bootstraper/</link>
		<comments>http://serialize.wordpress.com/2008/06/01/msi-bootstraper/#comments</comments>
		<pubDate>Sun, 01 Jun 2008 02:54:00 +0000</pubDate>
		<dc:creator>Vivek Unune</dc:creator>
				<category><![CDATA[Windows Installer]]></category>
		<category><![CDATA[bootstrapper]]></category>
		<category><![CDATA[MSI]]></category>
		<category><![CDATA[msistuff]]></category>
		<category><![CDATA[WIX]]></category>

		<guid isPermaLink="false">http://serialize.wordpress.com/2008/06/01/msi-bootstraper/</guid>
		<description><![CDATA[Msistuff.exe and Setup.exe are two important binaries are needed to create MSI bootstraper. Unfortunately you need to download the whole Windows SDK to access these binaries. Fortunately there are pre-built msistuff.exe and setup.exe binaries available from WIX examples page: http://sourceforge.net/tracker/?group_id=105970&#38;atid=654188 Download the Bootstraper example from this page.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serialize.wordpress.com&amp;blog=4194111&amp;post=13&amp;subd=serialize&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Msistuff.exe and Setup.exe are two important binaries are needed to create MSI bootstraper. Unfortunately you need to download the whole Windows SDK to access these binaries.</p>
<p>Fortunately there are pre-built msistuff.exe and setup.exe binaries available from WIX examples page:</p>
<p><a href="http://sourceforge.net/tracker/?group_id=105970&amp;atid=654188">http://sourceforge.net/tracker/?group_id=105970&amp;atid=654188</a></p>
<p>Download the Bootstraper example from this page.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/serialize.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/serialize.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/serialize.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/serialize.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/serialize.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/serialize.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/serialize.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/serialize.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/serialize.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/serialize.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/serialize.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/serialize.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/serialize.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/serialize.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/serialize.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/serialize.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serialize.wordpress.com&amp;blog=4194111&amp;post=13&amp;subd=serialize&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://serialize.wordpress.com/2008/06/01/msi-bootstraper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/54fbdf814723425c6ce3e94aefaad4c1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
		<item>
		<title>Right Click to Open Elevated Command prompt in Vista</title>
		<link>http://serialize.wordpress.com/2008/05/25/right-click-to-open-elevated-command-prompt-in-vista/</link>
		<comments>http://serialize.wordpress.com/2008/05/25/right-click-to-open-elevated-command-prompt-in-vista/#comments</comments>
		<pubDate>Sun, 25 May 2008 01:39:00 +0000</pubDate>
		<dc:creator>Vivek Unune</dc:creator>
				<category><![CDATA[Windows Tip]]></category>
		<category><![CDATA[Administrator]]></category>
		<category><![CDATA[cmd.exe]]></category>
		<category><![CDATA[Command]]></category>
		<category><![CDATA[runas]]></category>

		<guid isPermaLink="false">http://serialize.wordpress.com/2008/05/25/right-click-to-open-elevated-command-prompt-in-vista/</guid>
		<description><![CDATA[To open command prompt with administrator privileges by right clicking on a directory in windows explorer: copy the following text and save it in a file with extension .reg. Then right click it and select merge. Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Directory\shell\runas] @=&#8221;Open Admin Command prompt Here&#8221; [HKEY_CLASSES_ROOT\Directory\shell\runas\command] @=&#8221;cmd.exe /s /k pushd \&#8221;%V\&#8221;" Similarly if [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serialize.wordpress.com&amp;blog=4194111&amp;post=12&amp;subd=serialize&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>To open command prompt with administrator privileges by right clicking on a directory in windows explorer: copy the following text and save it in a file with extension .reg. Then right click it and select merge.</p>
<p><span style="font-family:courier new;">Windows Registry Editor Version 5.00</span></p>
<p><span style="font-family:courier new;">[HKEY_CLASSES_ROOT\Directory\shell\runas]</span><br />
<span style="font-family:courier new;">@=&#8221;Open Admin Command prompt Here&#8221;</span></p>
<p><span style="font-family:courier new;">[HKEY_CLASSES_ROOT\Directory\shell\runas\command]</span><br />
<span style="font-family:courier new;">@=&#8221;cmd.exe /s /k pushd \&#8221;%V\&#8221;"</span></p>
<p><span style="font-family:georgia;">Similarly if you need to open Visiual Studio 2008 command prompt with elevated permissions in Vista use this to create the registry file:</span></p>
<p><span style="font-family:courier new;">Windows Registry Editor Version 5.00</span></p>
<p><span style="font-family:courier new;">[HKEY_CLASSES_ROOT\Directory\shell\runas]</span></p>
<p><span style="font-family:courier new;">@=&#8221;Elevated VS 2008 Command Prompt&#8221;</span></p>
<p><span style="font-family:courier new;">[HKEY_CLASSES_ROOT\Directory\shell\runas\command]</span></p>
<p><span style="font-family:courier new;">@=&#8221;cmd.exe /s /k pushd \&#8221;%V\&#8221; &amp;&amp; \&#8221;C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat\&#8221;"</span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/serialize.wordpress.com/12/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/serialize.wordpress.com/12/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/serialize.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/serialize.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/serialize.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/serialize.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/serialize.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/serialize.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/serialize.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/serialize.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/serialize.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/serialize.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/serialize.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/serialize.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/serialize.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/serialize.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serialize.wordpress.com&amp;blog=4194111&amp;post=12&amp;subd=serialize&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://serialize.wordpress.com/2008/05/25/right-click-to-open-elevated-command-prompt-in-vista/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/54fbdf814723425c6ce3e94aefaad4c1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
	</channel>
</rss>
