<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>SODEVE</title>
	
	<link>http://sodeve.net</link>
	<description>is a software developer&lt;br&gt;in a pursuit of happyness</description>
	<lastBuildDate>Thu, 10 Jun 2010 19:06:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/sodeve" /><feedburner:info uri="sodeve" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by/2.0/</creativeCommons:license><feedburner:emailServiceId>sodeve</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2Fsodeve" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Fsodeve" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2Fsodeve" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/sodeve" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Fsodeve" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Fsodeve" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Fsodeve" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://www.plusmo.com/add?url=http%3A%2F%2Ffeeds.feedburner.com%2Fsodeve" src="http://plusmo.com/res/graphics/fbplusmo.gif">Subscribe with Plusmo</feedburner:feedFlare><feedburner:feedFlare href="http://my.feedlounge.com/external/subscribe?url=http%3A%2F%2Ffeeds.feedburner.com%2Fsodeve" src="http://static.feedlounge.com/buttons/subscribe_0.gif">Subscribe with FeedLounge</feedburner:feedFlare><feedburner:feedFlare href="http://www.thefreedictionary.com/_/hp/AddRSS.aspx?http%3A%2F%2Ffeeds.feedburner.com%2Fsodeve" src="http://img.tfd.com/hp/addToTheFreeDictionary.gif">Subscribe with The Free Dictionary</feedburner:feedFlare><feedburner:feedFlare href="http://www.bitty.com/manual/?contenttype=rssfeed&amp;contentvalue=http%3A%2F%2Ffeeds.feedburner.com%2Fsodeve" src="http://www.bitty.com/img/bittychicklet_91x17.gif">Subscribe with Bitty Browser</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsalloy.com/?rss=http%3A%2F%2Ffeeds.feedburner.com%2Fsodeve" src="http://www.newsalloy.com/subrss3.gif">Subscribe with NewsAlloy</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2Fsodeve" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare href="http://mix.excite.eu/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Fsodeve" src="http://image.excite.co.uk/mix/addtomix.gif">Subscribe with Excite MIX</feedburner:feedFlare><feedburner:feedFlare href="http://www.yourminis.com/subscribe.aspx?u=http%3A%2F%2Ffeeds.feedburner.com%2Fsodeve" src="http://www.yourminis.com/images/addtoyourminisbadge.gif">Subscribe with Yourminis.com</feedburner:feedFlare><feedburner:feedFlare href="http://download.attensa.com/app/get_attensa.html?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Fsodeve" src="http://www.attensa.com/blogs/attensa/WindowsLiveWriter/BadgeredintoBadges_10C02/attensa_feed_button5.gif">Subscribe with Attensa for Outlook</feedburner:feedFlare><feedburner:feedFlare href="http://www.webwag.com/wwgthis.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Fsodeve" src="http://www.webwag.com/images/wwgthis.gif">Subscribe with Webwag</feedburner:feedFlare><feedburner:feedFlare href="http://hub.netomat.net/account/account.autoSubscribe.jspa?urls=http%3A%2F%2Ffeeds.feedburner.com%2Fsodeve" src="http://www.netomat.net/blogger/images/icon_netomat_feedbutton.gif">Subscribe with netomat Hub</feedburner:feedFlare><feedburner:feedFlare href="http://www.dailyrotation.com/index.php?feed=http%3A%2F%2Ffeeds.feedburner.com%2Fsodeve" src="http://www.dailyrotation.com/rss-dr2.gif">Subscribe with Daily Rotation</feedburner:feedFlare><feedburner:feedFlare href="http://www.podcastready.com/oneclick_bookmark.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Fsodeve" src="http://www.podcastready.com/images/podcastready_button.gif">Subscribe with Podcast Ready</feedburner:feedFlare><feedburner:browserFriendly>Dear Reader, Thank You for subscribing to SODEVE.NET Warm Regards, Hardono Arifanto</feedburner:browserFriendly><item>
		<title>Oxford United is Back To Football League</title>
		<link>http://sodeve.net/oxford-united-is-back-to-football-league/</link>
		<comments>http://sodeve.net/oxford-united-is-back-to-football-league/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 19:02:28 +0000</pubDate>
		<dc:creator>Hardono Arifanto</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[football]]></category>

		<guid isPermaLink="false">http://sodeve.net/?p=910</guid>
		<description><![CDATA[Oxford United secured their place back in the Football League after a four-year absence with victory over York at rain-lashed Wembley.
Two goals in the space of five first-half minutes put the U&#8217;s in charge, Matt Green firing them in front from 18 yards with a neat half-volley.
James Constable doubled their lead with a fierce left-foot [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Oxford United secured their place back in the Football League after a four-year absence with victory over York at rain-lashed Wembley.</strong></p>
<p>Two goals in the space of five first-half minutes put the U&#8217;s in charge, Matt Green firing them in front from 18 yards with a neat half-volley.</p>
<p>James Constable doubled their lead with a fierce left-foot drive.</p>
<p>U&#8217;s keeper Ryan Clarke fumbled in Ben Purkiss&#8217;s cross to give York a lifeline only for Alfie Potter to wrap it up.<br />
Given that Oxford finished third in the Blue Square Premier, eight points clear of York, after topping the league for so much of the season, it was perhaps fitting that they went up.</p>
<p>It was certainly a much better experience of the play-offs for U&#8217;s boss Chris Wilder, whose Halifax side lost to Hereford in the 2006 final.</p>
<p><a href="http://news.bbc.co.uk/sport2/hi/football/eng_conf/8673190.stm">Read the complete story</a></p>
<p>I followed the game Live Report on BBC and wanted to post earlier. But too bad no good clips found on YouTube. And now that I found it, I will put it here for me to view over and over <img src='http://sodeve.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  The DVD of the match is coming <a href="http://www.oufc.co.uk/page/News/0,,10342~2061205,00.html">soon</a>.</p>
<p><object width="640" height="385">
<param name="movie" value="http://www.youtube.com/v/QB-MR4hZIlI&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;color1=0x3a3a3a&#038;color2=0x999999"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/QB-MR4hZIlI&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;color1=0x3a3a3a&#038;color2=0x999999" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sodeve?a=-mSFc4VVZkk:NKn6T9wuCJk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sodeve?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=-mSFc4VVZkk:NKn6T9wuCJk:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sodeve?i=-mSFc4VVZkk:NKn6T9wuCJk:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=-mSFc4VVZkk:NKn6T9wuCJk:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/sodeve?i=-mSFc4VVZkk:NKn6T9wuCJk:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=-mSFc4VVZkk:NKn6T9wuCJk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/sodeve?i=-mSFc4VVZkk:NKn6T9wuCJk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=-mSFc4VVZkk:NKn6T9wuCJk:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/sodeve?i=-mSFc4VVZkk:NKn6T9wuCJk:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://sodeve.net/oxford-united-is-back-to-football-league/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Retrieve User’s Name and Email Address From Active Directory</title>
		<link>http://sodeve.net/how-to-retrieve-users-name-and-email-address-from-active-directory/</link>
		<comments>http://sodeve.net/how-to-retrieve-users-name-and-email-address-from-active-directory/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 12:19:36 +0000</pubDate>
		<dc:creator>Hardono Arifanto</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[win2k3]]></category>

		<guid isPermaLink="false">http://sodeve.net/?p=908</guid>
		<description><![CDATA[I needed to retrieve list of active users with email address from Active Directory. After scratching head, and googling for a while, the following page helped me immensely:

How do I get &#8220;lastLogon&#8221; from ActiveDirectory
Howto: (Almost) Everything In Active Directory via C#

Note: You need to include Active DS COM Library in your project references. Your project [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://sodeve.net/how-to-retrieve-users-name-and-email-address-from-active-directory/ad-project/" rel="attachment wp-att-909"><img src="http://sodeve.net/wp-content/uploads/2010/06/ad.project.gif" alt="ad.project" title="ad.project" width="212" height="214" class="alignleft size-full wp-image-909" /></a>I needed to retrieve list of active users with email address from Active Directory. After scratching head, and googling for a while, the following page helped me immensely:</p>
<ul>
<li><a href="http://bytes.com/topic/c-sharp/answers/236021-how-do-i-get-lastlogon-activedirectory">How do I get &#8220;lastLogon&#8221; from ActiveDirectory</a></li>
<li><a href="http://www.codeproject.com/KB/system/everythingInAD.aspx">Howto: (Almost) Everything In Active Directory via C#</a></li>
</ul>
<p>Note: You need to include Active DS COM Library in your project references. Your project references should roughly similar to the picture on the left.</p>
<p>Here are teh codez:</p>
<pre name="code" class="csharp">
using System;
using System.Collections.Generic;
using System.Text;
using System.DirectoryServices;
using System.DirectoryServices.ActiveDirectory;
using System.IO;

namespace ActiveDirectoryQuery
{
    class Program
    {
        static void Main(string[] args)
        {
            DirectorySearcher ds = new DirectorySearcher();
            ds.SearchRoot = new DirectoryEntry("");
            ds.Filter = "objectCategory=user";
            ds.PropertiesToLoad.Add("name");
            ds.PropertiesToLoad.Add("email");
            ds.PropertyNamesOnly = true;
            ds.Sort = new SortOption("name", SortDirection.Ascending);
            SearchResultCollection results = ds.FindAll();

            //Write output
            StreamWriter writer = new StreamWriter(@"c:\ad.output.txt");        

            foreach (SearchResult sr in results)
            {
                DirectoryEntry entry = sr.GetDirectoryEntry();
                if (entry.Properties["name"].Value != null &#038;&#038; entry.Properties["mail"].Value != null &#038;&#038; entry.Properties["accountExpires"].Value != null)
                {
                    //Must Add COM Active DS Library in the reference (ActiveDS.TLB)
                    ActiveDs.LargeInteger li = (ActiveDs.LargeInteger)entry.Properties["accountExpires"].Value;
                    Int64 liTicks = li.HighPart * 0x100000000 + li.LowPart;
                    Int64 curTicks = DateTime.Now.Ticks;

                    //List only those account with no expiration/expired in the future
                    if (liTicks == 0 || liTicks > curTicks)
                    {
                        writer.Write(entry.Properties["name"].Value + ";" + entry.Properties["mail"].Value);
                        writer.WriteLine();
                        writer.Flush();
                    }
                }               

            }
            writer.Close();
        }
    }
}
</pre>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sodeve?a=48EMIOIwf58:jCHClAKzLb0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sodeve?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=48EMIOIwf58:jCHClAKzLb0:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sodeve?i=48EMIOIwf58:jCHClAKzLb0:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=48EMIOIwf58:jCHClAKzLb0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/sodeve?i=48EMIOIwf58:jCHClAKzLb0:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=48EMIOIwf58:jCHClAKzLb0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/sodeve?i=48EMIOIwf58:jCHClAKzLb0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=48EMIOIwf58:jCHClAKzLb0:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/sodeve?i=48EMIOIwf58:jCHClAKzLb0:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://sodeve.net/how-to-retrieve-users-name-and-email-address-from-active-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Execute Oracle Function From NHibernate</title>
		<link>http://sodeve.net/how-to-execute-oracle-function-from-nhibernate/</link>
		<comments>http://sodeve.net/how-to-execute-oracle-function-from-nhibernate/#comments</comments>
		<pubDate>Sat, 10 Apr 2010 19:22:34 +0000</pubDate>
		<dc:creator>Hardono Arifanto</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[NHibernate]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[vb.net]]></category>

		<guid isPermaLink="false">http://sodeve.net/?p=904</guid>
		<description><![CDATA[I am currently doing a project utilizing NHibernate to connect to a legacy Oracle DB. Everything was nice and easy until I hit this problem. I need to retrieve a particular information, but to do this I must connect a number of tables. This means I need to create more persistent classes, more mapping files, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://sodeve.net/how-to-execute-oracle-function-from-nhibernate/nhib-logo04/" rel="attachment wp-att-905"><img src="http://sodeve.net/wp-content/uploads/2010/04/nhib-logo04.gif" alt="NHibernate" title="NHibernate" width="300" height="166" class="alignleft size-full wp-image-905" /></a>I am currently doing a project utilizing NHibernate to connect to a legacy Oracle DB. Everything was nice and easy until I hit this problem. I need to retrieve a particular information, but to do this I must connect a number of tables. This means I need to create more persistent classes, more mapping files, which is sucks because I can actually just execute a stored function and get what I need.</p>
<p>So after scratching my head for quite sometimes, I found out that the solution was quite simple.</p>
<pre name="code" class="vb">
Using sessFact As ISessionFactory = CreateSessionFactory()
   Using sess As ISession = sessFact.OpenSession()
      Using transact As ITransaction = sess.BeginTransaction()
         '....
         Dim con As IDbConnection = sess.Connection
         Dim cmd As IDbCommand = con.CreateCommand()
         sess.Transaction.Enlist(cmd)
         cmd.CommandText = "select MyPackageName.MyFunction(" &#038; myFunctionParam &#038; ") from dual"
         dim objResult as Objetc = cmd.ExecuteScalar()
         '.....
      End Using
   End Using
End Using
</pre>
<p>I know this is not the right way, but I need to make compromise considering that this is a legacy database.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sodeve?a=Xq39bq7NYbM:8eI_6EWvLoI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sodeve?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=Xq39bq7NYbM:8eI_6EWvLoI:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sodeve?i=Xq39bq7NYbM:8eI_6EWvLoI:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=Xq39bq7NYbM:8eI_6EWvLoI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/sodeve?i=Xq39bq7NYbM:8eI_6EWvLoI:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=Xq39bq7NYbM:8eI_6EWvLoI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/sodeve?i=Xq39bq7NYbM:8eI_6EWvLoI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=Xq39bq7NYbM:8eI_6EWvLoI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/sodeve?i=Xq39bq7NYbM:8eI_6EWvLoI:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://sodeve.net/how-to-execute-oracle-function-from-nhibernate/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>LinkedIn should have a better String-truncating Algorithm</title>
		<link>http://sodeve.net/linkedin-should-have-a-better-string-truncating-algorithm/</link>
		<comments>http://sodeve.net/linkedin-should-have-a-better-string-truncating-algorithm/#comments</comments>
		<pubDate>Sat, 03 Apr 2010 18:18:08 +0000</pubDate>
		<dc:creator>Hardono Arifanto</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Laughs]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[failed]]></category>
		<category><![CDATA[networking]]></category>

		<guid isPermaLink="false">http://sodeve.net/?p=902</guid>
		<description><![CDATA[I saw this on my LinkedIn page:

A simple check to the truncated string, whether it ends with a face-blushing word or not, should be sufficient. 
]]></description>
			<content:encoded><![CDATA[<p>I saw this on my <a href="http://sg.linkedin.com/in/hardono">LinkedIn</a> page:<br />
<a href="http://sodeve.net/linkedin-should-have-a-better-string-truncating-algorithm/linkedin-string-failed/" rel="attachment wp-att-903"><img src="http://sodeve.net/wp-content/uploads/2010/04/linkedin-string-failed.png" alt="linkedin-string-failed" title="linkedin-string-failed" width="576" height="106" /></a></p>
<p>A simple check to the truncated string, whether it ends with a face-blushing word or not, should be sufficient. </p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sodeve?a=J0veumlJyeo:vP33dRCVJyg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sodeve?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=J0veumlJyeo:vP33dRCVJyg:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sodeve?i=J0veumlJyeo:vP33dRCVJyg:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=J0veumlJyeo:vP33dRCVJyg:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/sodeve?i=J0veumlJyeo:vP33dRCVJyg:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=J0veumlJyeo:vP33dRCVJyg:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/sodeve?i=J0veumlJyeo:vP33dRCVJyg:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=J0veumlJyeo:vP33dRCVJyg:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/sodeve?i=J0veumlJyeo:vP33dRCVJyg:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://sodeve.net/linkedin-should-have-a-better-string-truncating-algorithm/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>GMail’s April’s Fools</title>
		<link>http://sodeve.net/gmails-aprils-fools/</link>
		<comments>http://sodeve.net/gmails-aprils-fools/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 18:14:09 +0000</pubDate>
		<dc:creator>Hardono Arifanto</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Laughs]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://sodeve.net/?p=900</guid>
		<description><![CDATA[Oh no&#8230;. the vowels are missing from Gmail&#8217;s login page!!!!

]]></description>
			<content:encoded><![CDATA[<p>Oh no&#8230;. the vowels are <a href="http://gmailblog.blogspot.com/2010/04/todays-vowel-outage.html">missing</a> from Gmail&#8217;s login page!!!!<br />
<a href="http://sodeve.net/gmails-aprils-fools/gmail-vowel-fail/" rel="attachment wp-att-901"><img src="http://sodeve.net/wp-content/uploads/2010/04/gmail.vowel_.fail_.png" alt="gmail.vowel.fail" title="gmail.vowel.fail" width="574" height="302" class="alignleft size-full wp-image-901" /></a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sodeve?a=e0aVRWHDNGo:9DWz8iAlY0s:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sodeve?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=e0aVRWHDNGo:9DWz8iAlY0s:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sodeve?i=e0aVRWHDNGo:9DWz8iAlY0s:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=e0aVRWHDNGo:9DWz8iAlY0s:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/sodeve?i=e0aVRWHDNGo:9DWz8iAlY0s:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=e0aVRWHDNGo:9DWz8iAlY0s:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/sodeve?i=e0aVRWHDNGo:9DWz8iAlY0s:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=e0aVRWHDNGo:9DWz8iAlY0s:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/sodeve?i=e0aVRWHDNGo:9DWz8iAlY0s:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://sodeve.net/gmails-aprils-fools/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Go Green with Printer Usage Monitoring Application</title>
		<link>http://sodeve.net/go-green-with-printer-usage-monitoring-application/</link>
		<comments>http://sodeve.net/go-green-with-printer-usage-monitoring-application/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 15:42:13 +0000</pubDate>
		<dc:creator>Hardono Arifanto</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[vb.net]]></category>

		<guid isPermaLink="false">http://sodeve.net/?p=896</guid>
		<description><![CDATA[oes your office is planning to go green? One way to do that is by reducing your office paper consumption. To do that, you can start by encouraging your employees to only print document when it&#8217;s really necessary to do so. Often at times, employees will use company&#8217;s printer to print that cute picture of [...]]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_898" class="wp-caption alignleft" style="width: 310px"><a href="http://sodeve.net/go-green-with-printer-usage-monitoring-application/logogogreen201/" rel="attachment wp-att-898"><img src="http://sodeve.net/wp-content/uploads/2010/03/logoGoGreen201.gif" alt="Go Green" title="Go Green" width="300" height="214" class="size-full wp-image-898" /></a><p class="wp-caption-text">Go Green</p></div>Does your office is planning to go green? One way to do that is by reducing your office paper consumption. To do that, you can start by encouraging your employees to only print document when it&#8217;s really necessary to do so. Often at times, employees will use company&#8217;s printer to print that cute picture of a kitten <img src='http://sodeve.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>To make the &#8216;encouragement&#8217; to have a little more &#8216;muscle&#8217;, you could put announcement in the printing room that says that the printer usage is being monitored. Of course it should not be just a bluff, you could utilise <a href="http://puma.codeplex.com/">PUMA</a> to help you monitor the printer usage.</p>
<p>PUMA is written in VB.NET (.NET 2.0) and SQL Database as the backend. It consist of two parts, the monitoring service (installed on employee&#8217;s PC) and the Management Console (act as the server, in which the monitoring services submit their reports). I have not tried it myself, but I already submit it to management for approval <img src='http://sodeve.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The usage of computer based business application was supposed to reduce the paper consumption. But actually it ends up increasing it by many folds. Hopefully PUMA will help all of us to reduce our office paper consumptions.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sodeve?a=9SjeI_ZBbqY:TcsbRYoakYA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sodeve?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=9SjeI_ZBbqY:TcsbRYoakYA:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sodeve?i=9SjeI_ZBbqY:TcsbRYoakYA:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=9SjeI_ZBbqY:TcsbRYoakYA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/sodeve?i=9SjeI_ZBbqY:TcsbRYoakYA:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=9SjeI_ZBbqY:TcsbRYoakYA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/sodeve?i=9SjeI_ZBbqY:TcsbRYoakYA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=9SjeI_ZBbqY:TcsbRYoakYA:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/sodeve?i=9SjeI_ZBbqY:TcsbRYoakYA:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://sodeve.net/go-green-with-printer-usage-monitoring-application/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Memory Hogger Killer</title>
		<link>http://sodeve.net/memory-hogger-killer/</link>
		<comments>http://sodeve.net/memory-hogger-killer/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 09:10:57 +0000</pubDate>
		<dc:creator>Hardono Arifanto</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[bugs]]></category>

		<guid isPermaLink="false">http://sodeve.net/?p=895</guid>
		<description><![CDATA[I have a program in my server which is a memory hogger. Every time its memory consumption hit certain number, it will stop entertaining users&#8217; request. Which in turn, the users will call me, and ask me to restart that program.
So before I get down and get my hands dirty, I googled for solutions. But [...]]]></description>
			<content:encoded><![CDATA[<p>I have a program in my server which is a memory hogger. Every time its memory consumption hit certain number, it will stop entertaining users&#8217; request. Which in turn, the users will call me, and ask me to restart that program.</p>
<p>So before I get down and get my hands dirty, I googled for solutions. But the closest I can get is:</p>
<ul>
<li><a href="http://www.techmixer.com/free-windows-task-manager-replacement-monitor-windows-process/">Process Monitors.</a></li>
<li><a href="http://www.ghacks.net/2009/08/31/monitor-and-restart-crashed-windows-processes/">Crash restarter</a></li>
</ul>
<p>So I guess I need to write it on my own. Enlighten me please <img src='http://sodeve.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sodeve?a=Y0wZG2wsEEU:nG5EApTANCk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sodeve?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=Y0wZG2wsEEU:nG5EApTANCk:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sodeve?i=Y0wZG2wsEEU:nG5EApTANCk:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=Y0wZG2wsEEU:nG5EApTANCk:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/sodeve?i=Y0wZG2wsEEU:nG5EApTANCk:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=Y0wZG2wsEEU:nG5EApTANCk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/sodeve?i=Y0wZG2wsEEU:nG5EApTANCk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=Y0wZG2wsEEU:nG5EApTANCk:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/sodeve?i=Y0wZG2wsEEU:nG5EApTANCk:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://sodeve.net/memory-hogger-killer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Burn Offline NT Password &amp; Registry Editor to USB Thumbdrive</title>
		<link>http://sodeve.net/how-to-burn-offline-nt-password-registry-editor-to-usb-thumbdrive/</link>
		<comments>http://sodeve.net/how-to-burn-offline-nt-password-registry-editor-to-usb-thumbdrive/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 10:05:10 +0000</pubDate>
		<dc:creator>Hardono Arifanto</dc:creator>
				<category><![CDATA[Operating System]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://sodeve.net/?p=886</guid>
		<description><![CDATA[Forgot your Windows Administrator password? Try this amazing tool: Offline NT Password &#038; Registry Editor. You can download the ISO CD image and burn it to a CD as an emergency CD.
No blank CD? No problem. You can also use thumbdrive and make it bootable. How? read README.TXT inside the ISO CD Image file.
Too lazy [...]]]></description>
			<content:encoded><![CDATA[<p>Forgot your Windows Administrator password? Try this amazing tool: <a href="http://pogostick.net/~pnh/ntpasswd/">Offline NT Password &#038; Registry Editor</a>. You can download the ISO CD image and burn it to a CD as an emergency CD.</p>
<p>No blank CD? No problem. You can also use thumbdrive and make it bootable. How? read README.TXT inside the ISO CD Image file.</p>
<p>Too lazy to read? Well basically it consist of two steps:</p>
<ol>
<li>Copy all files from the ISO CD Image to the thumbdrive</li>
<li>Assuming that your thumbdrive is mounted as drive <strong>F:</strong>, open console/command-prompt and execute this command: <strong>F:\syslinux.exe -ma F:</strong></li>
</ol>
<p>Thank You <a href="mailto:pnh@pogostick.net">pnh@pogostick.net</a>, you saved me today <img src='http://sodeve.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sodeve?a=coD2P-YI5Wk:Df2xREAEyJI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sodeve?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=coD2P-YI5Wk:Df2xREAEyJI:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sodeve?i=coD2P-YI5Wk:Df2xREAEyJI:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=coD2P-YI5Wk:Df2xREAEyJI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/sodeve?i=coD2P-YI5Wk:Df2xREAEyJI:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=coD2P-YI5Wk:Df2xREAEyJI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/sodeve?i=coD2P-YI5Wk:Df2xREAEyJI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=coD2P-YI5Wk:Df2xREAEyJI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/sodeve?i=coD2P-YI5Wk:Df2xREAEyJI:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://sodeve.net/how-to-burn-offline-nt-password-registry-editor-to-usb-thumbdrive/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to Use Jasper Report with ASP.NET</title>
		<link>http://sodeve.net/how-to-use-jasper-report-with-asp-net/</link>
		<comments>http://sodeve.net/how-to-use-jasper-report-with-asp-net/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 09:44:06 +0000</pubDate>
		<dc:creator>Hardono Arifanto</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[jasper-report]]></category>

		<guid isPermaLink="false">http://sodeve.net/?p=884</guid>
		<description><![CDATA[I searched the &#8220;Internets&#8221; (with a grin to GWB), but found nothing. So this post is a placeholder for whatever findings in my future research. 
Bear with me please  
Update: 11-Jan-2009
There&#8217;s a glimmer hope by using direct HTTP post to the Jasper Report&#8217;s web service using techniques described here:

Programmatically generating web service calls
Making raw [...]]]></description>
			<content:encoded><![CDATA[<p>I searched the &#8220;Internets&#8221; (with a grin to GWB), but found nothing. So this post is a placeholder for whatever findings in my future research. </p>
<p>Bear with me please <img src='http://sodeve.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Update: 11-Jan-2009</strong></p>
<p>There&#8217;s a glimmer hope by using direct HTTP post to the Jasper Report&#8217;s web service using techniques described here:</p>
<ul>
<li><a href="http://romiller.com/Default.aspx?tabid=36&#038;EntryID=9">Programmatically generating web service calls</a></li>
<li><a href="http://mikehadlow.blogspot.com/2006/05/making-raw-web-service-calls-with.html">Making raw web service calls with the HttpWebRequest class</a></li>
<li><a href="http://geekswithblogs.net/marcel/archive/2007/03/26/109886.aspx">Invoking Web Service dynamically using HttpWebRequest</a></li>
</ul>
<p>By using above method, we will get the full stream of the response. Now the problem is how to separate the binary data and the text data.</p>
<p><strong>Update: 12-Jan-2009</strong></p>
<p>Found a clue on how to read mixed binary data and text: <a href="http://stackoverflow.com/questions/504500/whats-the-best-way-to-read-mixed-i-e-text-and-binary-data">What’s the best way to read mixed (i.e. text and binary) data</a></p>
<p><strong>Update: 19-Jan-2009</strong><br />
I have successfully use ASP.NET to invoke Jasper Report web service, and obtain the PDF/XLS/CSV file. The solution is now still very crude, I&#8217;m gonna need sometime to clean it up.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sodeve?a=zzlL5-WBsXw:oXiQYkMKg-M:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sodeve?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=zzlL5-WBsXw:oXiQYkMKg-M:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sodeve?i=zzlL5-WBsXw:oXiQYkMKg-M:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=zzlL5-WBsXw:oXiQYkMKg-M:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/sodeve?i=zzlL5-WBsXw:oXiQYkMKg-M:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=zzlL5-WBsXw:oXiQYkMKg-M:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/sodeve?i=zzlL5-WBsXw:oXiQYkMKg-M:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=zzlL5-WBsXw:oXiQYkMKg-M:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/sodeve?i=zzlL5-WBsXw:oXiQYkMKg-M:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://sodeve.net/how-to-use-jasper-report-with-asp-net/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Generate Relative Path</title>
		<link>http://sodeve.net/how-to-generate-relative-path/</link>
		<comments>http://sodeve.net/how-to-generate-relative-path/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 16:35:37 +0000</pubDate>
		<dc:creator>Hardono Arifanto</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[vb.net]]></category>

		<guid isPermaLink="false">http://sodeve.net/?p=879</guid>
		<description><![CDATA[A few months ago I was given a project to maintain a corporate website. This website was previously hosted in a CMS in remote site. When I received the CD containing the project files, it was already in &#8216;offline&#8217; website format. It means all files are now static HTML. I suspect that it generated using [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://sodeve.net/wp-content/uploads/2009/10/console.png" alt="console" title="console" width="200" height="150" class="alignleft size-full wp-image-880" />A few months ago I was given a project to maintain a corporate website. This website was previously hosted in a CMS in remote site. When I received the CD containing the project files, it was already in &#8216;offline&#8217; website format. It means all files are now static HTML. I suspect that it generated using those website downloaders (Offline Explorer, etc.). </p>
<p>The problem with static HTML website is there are many duplicates of information. One news article will show up as many files that located in different folders. It could be under News folder, News Archive folder, Tags folder, etc.</p>
<p>It means my task will become a boring headache, since I will need to add content, add it to the respective folders, and manually update all the linkage regularly. </p>
<p>So I came out with a simple program to help me generating the content, upload the attachment and to update the linkage. This is when I hit the problem. Because most of the time, a news article will contain attachments. The attachments will be stored under Attachments folder, but the pages that linked to that attachment are scattered all over the place. I also need to update the ‘index’ files of each category (Archive by Year, Archive by Tag, Archive by Category, etc.)</p>
<h3>Solution</h3>
<p>Instead of reinventing the wheel, I asked Google to find me the wheel <img src='http://sodeve.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  <a href="http://www.devx.com/tips/Tip/13737" target="_blank">David M. Howard</a> has solved this problem 9 years ago <img src='http://sodeve.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Thank You David!</p>
<p>His solution was written in Java, I just need to convert it to .NET and tweaked it a little without any difficulties.</p>
<h3>Result</h3>
<p>The output of the test program are as follows:</p>
<div style="border:#FFF thin solid; font:'Lucida Console', Monaco, monospace; font-size:14px; padding:10px; background:#000; color:#090">
Home: C:\boot.ini<br />
Remote: C:\WINDOWS\system32\drivers\etc\hosts<br />
Relative Path: WINDOWS\system32\drivers\etc\hosts<br />
<br/><br />
Home: C:\WINDOWS\system32\drivers\etc\hosts<br />
Remote: C:\boot.ini<br />
Relative Path: ..\..\..\..\boot.ini<br />
<br/><br />
Home: C:\WINDOWS\system32\drivers\etc\hosts<br />
Remote: I:\PVSW.LOG<br />
Relative Path: I:\PVSW.LOG
</div>
<p><br/></p>
<h3>Source Code</h3>
<pre name="code" class="vb">
'Filename: MyPath.vb
Imports System.IO
Imports System.Collections

Public Class MyPath
    Public Shared Function getRelativePath(ByVal home As String, ByVal remote As String) As String
        Return getRelativePath(New FileInfo(home), New FileInfo(remote))
    End Function
    Public Shared Function getRelativepath(ByVal home As String, ByRef remote As FileInfo) As String
        Return getRelativepath(New FileInfo(home), remote)
    End Function
    Public Shared Function getRelativePath(ByRef home As FileInfo, ByVal remote As String) As String
        Return getRelativePath(home, New FileInfo(remote))
    End Function

    Public Shared Function getRelativePath(ByRef home As FileInfo, ByRef remote As FileInfo) As String
        Dim homepathList As New ArrayList
        Dim remotePathList As New ArrayList
        Dim result As String = ""

        If ((home.Exists And remote.Exists) Or home.Directory.Exists Or remote.Directory.Exists) Then
            'initialize the paths
            initPathList(home.Directory, homepathList)

            If remote.Attributes = FileAttributes.Directory Then
                initPathList(remote.Directory, remotePathList)
            Else
                initPathList(remote, remotePathList)
            End If

            Dim ihome As Integer = homepathList.Count - 1
            Dim iremote As Integer = remotePathList.Count - 1

            'Do we have common parent
            If Not homepathList(ihome).Equals(remotePathList(iremote)) Then
                Return remote.FullName
            End If

            'remove common parent
            While (ihome >= 0 And iremote >= 0)
                If homepathList(ihome).Equals(remotePathList(iremote)) Then
                    ihome -= 1
                    iremote -= 1
                Else
                    Exit While
                End If
            End While

            'Add relative path
            While ihome >= 0
                result &#038;= ".." &#038; System.IO.Path.DirectorySeparatorChar.ToString()
                ihome -= 1
            End While

            'Combine relative path result with the remote 

            While iremote > 0
                result &#038;= remotePathList(iremote).ToString() &#038; System.IO.Path.DirectorySeparatorChar.ToString()
                iremote -= 1
            End While
            result &#038;= remotePathList(iremote).ToString()
        Else
            If Not home.Exists Then
                Throw New Exception(home.FullName &#038; " is not exist!")
            End If
            If Not remote.Exists Then
                Throw New Exception(remote.FullName &#038; " is not exist!")
            End If
        End If
        Return result
    End Function
    Public Shared Sub initPathList(ByRef f As FileInfo, ByRef ar As ArrayList)
        ar.Add(f.Name)
        initPathList(f.Directory, ar)
    End Sub
    Public Shared Sub initPathList(ByRef dir As DirectoryInfo, ByRef ar As ArrayList)
        ar.Add(dir.Name)
        While Not dir.Parent Is Nothing
            dir = dir.Parent
            ar.Add(dir.Name)
        End While
    End Sub
End Class
</pre>
<pre name="code" class="vb">
'Filename: testMyPath.vb
Imports System.IO

Module Module1

    Sub Main()
        While True
            Console.Write("Home: ")
            Dim homePath As String = Console.ReadLine()
            Console.Write("Remote: ")
            Dim remotePath As String = Console.ReadLine()
            Try
                Console.WriteLine("Relative Path: " &#038; MyIO.MyPath.getRelativePath(homePath, remotePath))
            Catch ex As Exception
                Console.WriteLine("ERROR: " &#038; ex.ToString())
            End Try
            Console.WriteLine()
        End While
    End Sub

End Module
</pre>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/sodeve?a=c0B1p12PtWA:szw9iI6Qyrk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/sodeve?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=c0B1p12PtWA:szw9iI6Qyrk:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/sodeve?i=c0B1p12PtWA:szw9iI6Qyrk:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=c0B1p12PtWA:szw9iI6Qyrk:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/sodeve?i=c0B1p12PtWA:szw9iI6Qyrk:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=c0B1p12PtWA:szw9iI6Qyrk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/sodeve?i=c0B1p12PtWA:szw9iI6Qyrk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/sodeve?a=c0B1p12PtWA:szw9iI6Qyrk:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/sodeve?i=c0B1p12PtWA:szw9iI6Qyrk:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://sodeve.net/how-to-generate-relative-path/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic page generated in 0.589 seconds. --><!-- Cached page generated by WP-Super-Cache on 2010-07-12 13:47:38 --><!-- Compression = gzip -->
