<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tjitjing Blog</title>
	<atom:link href="http://blog.tjitjing.com/index.php/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.tjitjing.com</link>
	<description>This is my blog on technology related things and maybe some other stuff too...</description>
	<lastBuildDate>Sat, 05 Nov 2011 15:47:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Backup or Copy Windows Server 2008 Configuration</title>
		<link>http://blog.tjitjing.com/index.php/2011/11/backup-or-copy-windows-server-2008-configuration.html</link>
		<comments>http://blog.tjitjing.com/index.php/2011/11/backup-or-copy-windows-server-2008-configuration.html#comments</comments>
		<pubDate>Sat, 05 Nov 2011 15:41:34 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[Backup]]></category>
		<category><![CDATA[Windows Server 2008]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Settings]]></category>
		<category><![CDATA[Windows Server]]></category>

		<guid isPermaLink="false">http://blog.tjitjing.com/?p=485</guid>
		<description><![CDATA[In Windows Server 2008 there is a backup tool called Windows Server Backup which however creates huge backup files. I prefer to use a simple command/batch file that copies everything I want to backup, zips it and then uploads it to Amazon S3 (aka &#8220;the cloud&#8221;) I have not been able to find a simple way to [...]]]></description>
			<content:encoded><![CDATA[<p>In Windows Server 2008 there is a backup tool called <a title="Backup Windows Server" href="http://technet.microsoft.com/en-us/library/cc754097(WS.10).aspx" target="_blank">Windows Server Backup</a> which however creates huge backup files. I prefer to use a simple command/batch file that copies everything I want to backup, zips it and then <a title="Amazon S3 Command Line Copy for Windows" href="http://blog.tjitjing.com/index.php/2009/04/amazon-s3-command-line-copy-for-windows.html" target="_blank">uploads it to Amazon S3</a> (aka &#8220;the cloud&#8221;)</p>
<p>I have not been able to find a simple way to copy all of my Windows Server 2008 settings. Theses are the bits and pieces I have found:</p>
<h2>Copy IIS7 Configuration</h2>
<p>To save IIS 7 (Internet Information Services) configuration, copy the config directory %SYSTEMROOT%\System32\inetsrv\config, example:</p>
<pre class="brush: plain; title: ; notranslate">xcopy %SYSTEMROOT%\System32\inetsrv\config c:\backup\iisconfig\ /S/E</pre>
<h2>Windows Advanced Firewall Export Configuration</h2>
<p>To export all the current configurations of your firewall to a file:</p>
<pre class="brush: plain; title: ; notranslate">netsh advfirewall export c:\backup\advfirewall.wfw</pre>
<p>Source: <a title="David Davis" href="http://www.windowsnetworking.com/articles_tutorials/Configure-Windows-2008-Advanced-Firewall-NETSH-CLI.html" target="_blank">David Davis</a></p>
<h2>Export Windows Registry</h2>
<p>To export the Registry, use regedit.exe command line options. Note that export is done in background so you need to allow some time before you are able to access the exported file.</p>
<pre class="brush: plain; title: ; notranslate">regedit /e c:\backup\regbackup.reg</pre>
<p>Source: <a title="Export registry" href="http://www.speedguide.net/articles/how-to-backup-using-batch-files-1547" target="_blank">Speedguide</a></p>
<h2>Network Settings</h2>
<pre class="brush: plain; title: ; notranslate">netsh dump &gt; c:\backup\network-settings-netsh-dump.txt</pre>
<p>Source: <a title="backup windows network" href="http://www.windowsnetworking.com/kbase/windowstips/windows2003/admintips/network/usingnetshtobackupandrestorenetworkconfiguration.html" target="_blank">Chris Sanders</a></p>
<p>&nbsp;</p>
<p><strong>Please note that this method cannot and should not to be compared to a full backup method such as Windows Server Backup.</strong></p>
<p>This method will not allow you to do a full recovery. It will mean installing Windows Server and all software from scratch and then recover the data you have backed up. Meaning an unrecoverable hard drive crash would most likely mean more downtime/recovery time.</p>
<p><strong></strong>The reason I like this method is because it takes less space which allows me to use S3 to save my backups. That means I can fully automate it (scheduled batch script and no need to change any media) and it is off-site (meaning if there is a fire where my server is, my backup is still safe). And I prefer the ease of just getting my files from a zip file if I need to check or recover anything. Besides, it&#8217;s dirt cheap, I pay Amazon S3 a few dollars for a month worth of daily 1GB backups.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tjitjing.com/index.php/2011/11/backup-or-copy-windows-server-2008-configuration.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>8 Quick Steps: Guide to Microsoft Office 365 Exchange Online Free Trial</title>
		<link>http://blog.tjitjing.com/index.php/2011/10/8-quick-steps-guide-to-microsoft-office-365-exchange-online-free-trial.html</link>
		<comments>http://blog.tjitjing.com/index.php/2011/10/8-quick-steps-guide-to-microsoft-office-365-exchange-online-free-trial.html#comments</comments>
		<pubDate>Tue, 11 Oct 2011 16:42:47 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[ActiveSync]]></category>
		<category><![CDATA[Microsoft Exchange]]></category>
		<category><![CDATA[Office 365]]></category>
		<category><![CDATA[Outlook]]></category>
		<category><![CDATA[BPOS]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Exchange Online]]></category>
		<category><![CDATA[Microsoft Online Services]]></category>

		<guid isPermaLink="false">http://blog.tjitjing.com/?p=447</guid>
		<description><![CDATA[This guide tells you how to quickly and easily get started with Exchange Online using a 10 user free trial which can easily be converted to a paid subscription later ($6 per user per month, minimum 1 user) This is how you do it (steps may vary a little bit depending on what country you [...]]]></description>
			<content:encoded><![CDATA[<p><strong>This guide tells you how to quickly and easily get started with Exchange Online using a 10 user free trial which can easily be converted to a paid subscription later ($6 per user per month, minimum 1 user)</strong></p>
<p>This is how you do it (steps may vary a little bit depending on what country you are from)</p>
<ol>
<li>Go to <a href="http://office365.com" target="_blank">Office365.com</a></li>
<li>Click &#8220;Get the trial&#8221;. This will give you a <strong>fully functional free 10 user trial for 30 days</strong>.<br />
So this means one month free and you can test everything before you start paying. When the trial period is up, it is easy to turn it into a paid subscription. No rebate coupon or voucher code needed.</li>
<li>Select the option for &#8220;Professionals and Small businesses&#8221;, this is the &#8220;P1&#8243; plan. For some countries this may already be preselected.<br />
(If you are a larger company select the &#8220;Midsize businesses and enterprises&#8221;, plan &#8220;E3&#8243; but note that pricing, features etc is different from what is covered here)</li>
<li>Fill out the information about yourself to create a Microsoft Online Services ID.<br />
You will have to select an onmicrosoft.com domain name, e.g. mycompany.onmicrosoft.com. <strong>Don&#8217;t worry, you will be able to add your real domain name (or multiple domain names) later</strong>
</li>
<li>You should see a page telling you that Exchange Online, Lync Online and Sharepoint Online is being set up and that it will take a few minutes. Wait for them to finish.
</li>
<li><strong>Add your own Domain</strong>. a) Click Admin in the top navigation. From the Admin page on the left column navigation b) Click Management-Domains, then c) Click Add a Domain. d) Enter your domain name and click the Check Domain button. After domain information is shown e) click Next and you will be taken to a page with instructions how to add a TXT record to your DNS for verifying your domain.
</li>
<li><strong>Add users</strong>.  a) Click Admin in the top navigation. From the Admin page on the left column navigation b) Click Management-Users, then c) Click New + User and follow the instructions.<br />
If you wish, you can make the admin user that was created when you signed up just an <strong>admin account without a paid license</strong>. To do this edit the user and uncheck  &#8220;Microsoft Office 365 Plan P1&#8243; under License.</p>
</li>
<li><strong>Add me as your partner &#8211; optional. Thanks!</strong> a) Click Admin in the top navigation. From the Admin page on the left column navigation b) click Subscriptions-Manage, then c) click your subscription, Microsoft Office 365 Trial (Plan P1). On the far right you will see d) Partner Information, click Add and e) in the box shown enter 1912363 as partner id to use my company XS Tech as partner and click Ok (or if you prefer to use another partner enter their partner id) Thanks.
</li>
<p><strong>Done!</strong>
</ol>
<p><strong>Background</strong><br />
Microsofts cloud offering Office 365 (formerly BPOS) includes among other things Exchange Online, Microsofts hosted email offering.<br />
Exchange Online can be accessed from a browser (<a href="http://www.microsoft.com/exchange/2010/en/my/outlook-web-access.aspx" target="_blank">Outlook Web App</a>), <a href="http://office.microsoft.com/en-us/outlook/" target="_blank">Outlook</a> (Windows), <a href="http://www.microsoft.com/mac/outlook" target="_blank">Entourage or Outlook for Mac</a> or any mobile software supporting ActiveSync, e.g. Android, iPhone, iPad, Windows Phone etc.<br />
I find Exchange Online well priced at just below 50 SEK (US$ 6) per month for a 25GB mailbox with <a href="http://sharepoint.microsoft.com" target="_blank">Sharepoint</a>, <a href="http://office.microsoft.com/en-us/web-apps/" target="_blank">Office Web Apps</a> and <a href="http://lync.microsoft.com/" target="_blank">Lync</a> also included. It is half the price compared to my current Hosted Exchange provider and with over 10 times the storage. Extra plus for me is also that my Hosted Exchange provider is running Exchange 2007 while Office365 is on Exchange 2010. New with the change from BPOS to Office365 is also that you can now signup for only one single user instead of the previous minimum of three.</p>
<p><strong>Browsers</strong><br />
I recommend using Internet Explorer or Firefox with Office 365, Exchange Online and other Office Web Apps. Chrome (currently in release 14) is working most of the time but not always.</p>
<p>Disclosure: My company is a Microsoft partner. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tjitjing.com/index.php/2011/10/8-quick-steps-guide-to-microsoft-office-365-exchange-online-free-trial.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compare and Merge Text Files</title>
		<link>http://blog.tjitjing.com/index.php/2011/09/compare-and-merge-text-files.html</link>
		<comments>http://blog.tjitjing.com/index.php/2011/09/compare-and-merge-text-files.html#comments</comments>
		<pubDate>Wed, 21 Sep 2011 13:41:15 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[Good stuff]]></category>
		<category><![CDATA[Text files]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Windows tools]]></category>

		<guid isPermaLink="false">http://blog.tjitjing.com/?p=443</guid>
		<description><![CDATA[This is more a less a note to myself to remember what the text file comparison tool that I use from time to time is called: WinMerge! It&#8217;s a nice Open Source Windows application where you can easily compare two or more text files to each other and make changes or copy from one file [...]]]></description>
			<content:encoded><![CDATA[<p>This is more a less a note to myself to remember what the text file comparison tool that I use from time to time is called: <a href="http://winmerge.org/" target="_blank">WinMerge</a>! </p>
<p>It&#8217;s a nice Open Source Windows application where you can easily compare two or more text files to each other and make changes or copy from one file to the other while comparing. For example great when comparing to versions of a php file etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tjitjing.com/index.php/2011/09/compare-and-merge-text-files.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automate update of web.config with Microsoft Powershell</title>
		<link>http://blog.tjitjing.com/index.php/2011/08/automate-update-of-web-config-with-microsoft-powershell.html</link>
		<comments>http://blog.tjitjing.com/index.php/2011/08/automate-update-of-web-config-with-microsoft-powershell.html#comments</comments>
		<pubDate>Sat, 27 Aug 2011 13:01:53 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Windows Server 2008]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[web.config]]></category>
		<category><![CDATA[Windows tools]]></category>

		<guid isPermaLink="false">http://blog.tjitjing.com/?p=431</guid>
		<description><![CDATA[I have an ASP.NET web site project that I use for 5-10 web sites. Each has its own directory, setup in IIS and MySQL database, ie they work as independent web sites, only the code base is the same. For updates I have a setup with one Windows command file to copy out any file [...]]]></description>
			<content:encoded><![CDATA[<p>I have an ASP.NET web site project that I use for 5-10 web sites. Each has its own directory, setup in IIS and MySQL database, ie they work as independent web sites, only the code base is the same. For updates I have a setup with one Windows command file to copy out any file changes to the web site directories and another command file that updates the database with any database structure changes. </p>
<p><strong>So far I have made any updates to the web.config files manually but today I finally figured out how to automate this too.</strong></p>
<p>The Windows command tool Powershell has been around for a couple of years but I have not used it before. It was installed with Windows Update some time ago so it should be installed on your machine. To use it simply run powershell.exe from a command prompt. To exit, close the window or type exit.<br />
Powershell can among other things run Powershell script files (file extension .ps1)</p>
<p><strong>This script will show you how to add to and edit multiple web.config files (or any xml file)</strong></p>
<pre class="brush: xml; title: ; notranslate">
# Source: http://blog.tjitjing.com

# Array of files to make changes to, add as many as you like
$filesarray = @(&quot;c:\temp\web.config&quot;,&quot;c:\anotherfile.xml&quot;) 

# Go thru all files
foreach ($filename in $filesarray)
{
	# Get file + cast as xml
	$xml = [xml](get-content $filename)

	# Backup file before making changes
	$backup = $filename + &quot;-&quot; + (get-date).tostring(&quot;yyyy-MM-dd-hh_mm_s&quot;)
	$xml.Save($backup)

	$root = $xml.get_DocumentElement();

	# Add a new node
	$node = $xml.createElement(&quot;mynewnode&quot;)
	$root.&quot;system.web&quot;.appendChild($node)
	$subnode = $xml.createElement(&quot;add&quot;)
	$node.AppendChild($subnode)
	$attribute = $xml.CreateAttribute(&quot;url&quot;)
	$attribute.set_Value(&quot;http://blog.tjitjing.com&quot;)
	$subnode.SetAttributeNode($attribute )

	# Change existing node
	$root.connectionStrings.add.connectionString = &quot;My new connection string&quot;

	# Save
	$xml.Save($filename)
}
</pre>
<p>There are two caveats I ran in to when running my script:</p>
<p>1) You need to always give the path of the file, even if it is in your current directory. To run a file from current directory you need to wite ./</p>
<pre class="brush: vb; title: ; notranslate">
C:\Temp&gt;powershell.exe ./test.ps1
</pre>
<p>Or from within Powershell</p>
<pre class="brush: vb; title: ; notranslate">
PS C:\Temp&gt;./test.ps1
</pre>
<p>2) Powershells execution policy is by default set to Restricted. To avoid getting a message similar to &#8220;File C:\temp\test.ps1 cannot be loaded because the execution of scripts is disabled on this system.&#8221;, you need to run the command <code>Set-ExecutionPolicy RemoteSigned</code> from the powershell prompt. </p>
<p>Some useful links that helped me understand this and get it working:<br />
<a href="http://technet.microsoft.com/en-us/library/ee692944.aspx" target="_blank">Powershell on Microsoft Technet</a><br />
<a href="http://get-powershell.com/post/2008/07/29/Editing-WebConfig-Files-with-PowerShell.aspx" target="_blank">Andy Schneider&#8217;s Blog about Windows PowerShell</a><br />
<a href="http://arcware.net/modifying-web-config-with-powershell/" target="_blank">Blog post by Dave Donaldson</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tjitjing.com/index.php/2011/08/automate-update-of-web-config-with-microsoft-powershell.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Plus invite give away</title>
		<link>http://blog.tjitjing.com/index.php/2011/07/get-google-plus-invite-invitation.html</link>
		<comments>http://blog.tjitjing.com/index.php/2011/07/get-google-plus-invite-invitation.html#comments</comments>
		<pubDate>Wed, 13 Jul 2011 16:43:02 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[Google Plus]]></category>
		<category><![CDATA[invites]]></category>

		<guid isPermaLink="false">http://blog.tjitjing.com/?p=392</guid>
		<description><![CDATA[Would you like an invite to Google Plus, Googles new social network, the &#8220;Facebook and Twitter killer&#8221;? I have a few invitations, post a comment here with your gmail address (currently it seems only gmail accounts are accepted, you should also have filled out your google profile) For Swedish speakers this is another option to [...]]]></description>
			<content:encoded><![CDATA[<p>Would you like an invite to Google Plus, Googles new social network, the &#8220;Facebook and Twitter killer&#8221;?<br />
I have a few invitations, post a comment here with your gmail address (currently it seems only gmail accounts are accepted, you should also have filled out your google profile)</p>
<p>For Swedish speakers this is another option to get a Google+ invitation: <a target="_blank" href="http://www.gratislistan.se/tavling/google-plus-invite-invitation-invite">gratis</a></p>
<p><em>[Edit: As I understand it Google Plus is now open for all gmail accounts. I still have plenty of invites, so comment here if you want one and don't have a gmail email address]</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tjitjing.com/index.php/2011/07/get-google-plus-invite-invitation.html/feed</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>Get root path in ASP.NET without using Tilde ~</title>
		<link>http://blog.tjitjing.com/index.php/2011/03/get-root-path-in-asp-net-without-using-tilde.html</link>
		<comments>http://blog.tjitjing.com/index.php/2011/03/get-root-path-in-asp-net-without-using-tilde.html#comments</comments>
		<pubDate>Mon, 14 Mar 2011 08:33:54 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://blog.tjitjing.com/?p=408</guid>
		<description><![CDATA[As you probably know you can use the tilde sign (~) in ASP.NET to get the relative path of the root of your Web Site or Web Application. But unless using the Link Server Control or similar you may need some code to convert it to a correct url or get the absolute path. Using [...]]]></description>
			<content:encoded><![CDATA[<p>As you probably know you can use the tilde sign (~) in ASP.NET to get the relative path of the root of your Web Site or Web Application. But unless using the Link Server Control or similar you may need some code to convert it to a correct url or get the absolute path.</p>
<p>Using a Server Control &#8211; example using the <a target="_blank" href="http://msdn.microsoft.com/en-us/library/k0b15efk(v=vs.71).aspx">HyperLink Web Server Control</a></p>
<pre class="brush: vb; title: ; notranslate">
MyHyperLink.NavigateUrl = &quot;~/Products/XYZ&quot;
</pre>
<p>Using HttpRuntime.AppDomainAppVirtualPath</p>
<pre class="brush: vb; title: ; notranslate">
strAbsoluteUrl = HttpRuntime.AppDomainAppVirtualPath &amp; &quot;/Products/XYZ&quot;
</pre>
<p>Using VirtualPathUtility.ToAbsolute</p>
<pre class="brush: vb; title: ; notranslate">
strAbsoluteUrl = VirtualPathUtility.ToAbsolute(&quot;~/Products/XYZ&quot;)
</pre>
<p><a target="_blank" href="http://www.mycsharpcorner.com/Post.aspx?postID=45">Thanks to Yousef</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tjitjing.com/index.php/2011/03/get-root-path-in-asp-net-without-using-tilde.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET 4.0: Extra space above Menu in Chrome and Safari using Menu Control</title>
		<link>http://blog.tjitjing.com/index.php/2011/03/asp-net-4-0extra-space-above-menu-in-chrome-and-safari-using-menu-control.html</link>
		<comments>http://blog.tjitjing.com/index.php/2011/03/asp-net-4-0extra-space-above-menu-in-chrome-and-safari-using-menu-control.html#comments</comments>
		<pubDate>Fri, 11 Mar 2011 13:41:47 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.tjitjing.com/?p=390</guid>
		<description><![CDATA[In Visual Studio 2010 when creating a new ASP.NET Web Site or ASP.NET Web Application you get a shell for ASP.NET 4.0 web site with a menu using the ASP.NET 4.0 Menu Control. However in Google Chrome and Safari browsers the menu will show with some extra space above it. It took plenty of googling [...]]]></description>
			<content:encoded><![CDATA[<p>In Visual Studio 2010 when creating a new ASP.NET Web Site or ASP.NET Web Application you get a shell for ASP.NET 4.0 web site with a menu using the ASP.NET 4.0 Menu Control. <strong>However in Google Chrome and Safari browsers the menu will show with some extra space above it.</strong> It took plenty of googling to find the answer since google is filled with solutions for Chrome problems in ASP.NET 2.0.<br />
<strong>Finally &#8211; the solution for .NET Framework 4.0:</strong></p>
<p>Add these lines to the Site.css file (in the Styles folder of your VS 2010 project)</p>
<pre class="brush: css; title: ; notranslate">
/* Fix for extra space above menu in Chrome and Safari */
img[alt='Skip Navigation Links'] {
    display: none;
}
</pre>
<p>An alternative is to add SkipLinkText=&#8221;" to each menu item (have not tested this)</p>
<p>Thanks to <a href="http://stackoverflow.com/questions/4776846/strange-extra-padding-in-chrome-using-standard-vs-2010-template">MattyF</a> for the solution</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tjitjing.com/index.php/2011/03/asp-net-4-0extra-space-above-menu-in-chrome-and-safari-using-menu-control.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Get URL without QueryString in .NET</title>
		<link>http://blog.tjitjing.com/index.php/2011/03/get-url-without-querystring-in-net.html</link>
		<comments>http://blog.tjitjing.com/index.php/2011/03/get-url-without-querystring-in-net.html#comments</comments>
		<pubDate>Wed, 09 Mar 2011 13:08:21 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[VB.NET]]></category>
		<category><![CDATA[Code snippet]]></category>

		<guid isPermaLink="false">http://blog.tjitjing.com/?p=386</guid>
		<description><![CDATA[To get the current Url without the query in VB.NET]]></description>
			<content:encoded><![CDATA[<p>To get the current Url without the query in VB.NET</p>
<pre class="brush: vb; title: ; notranslate">Request.Url.AbsoluteUri.Split(&quot;?&quot;)(0)</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.tjitjing.com/index.php/2011/03/get-url-without-querystring-in-net.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Split text in two columns in VB.NET</title>
		<link>http://blog.tjitjing.com/index.php/2011/02/split-text-in-two-columns-in-vb-net.html</link>
		<comments>http://blog.tjitjing.com/index.php/2011/02/split-text-in-two-columns-in-vb-net.html#comments</comments>
		<pubDate>Sun, 06 Feb 2011 10:32:17 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[VB.NET]]></category>
		<category><![CDATA[ASP.NET Routing]]></category>
		<category><![CDATA[Code snippet]]></category>
		<category><![CDATA[Example]]></category>

		<guid isPermaLink="false">http://blog.tjitjing.com/?p=372</guid>
		<description><![CDATA[This is a function code snippet to split a text in to two or more columns in VB.NET. It is converted from my previous posted: Split text into multiple columns in PHP Parameters: InputString &#8211; String to be split into columns Columns &#8211; Number of columns SplitString &#8211; String to look for to not split [...]]]></description>
			<content:encoded><![CDATA[<p>This is a function code snippet to split a text in to two or more columns in VB.NET.</p>
<p>It is converted from my previous posted: <a href="http://blog.tjitjing.com/index.php/2011/01/split-text-into-multiple-columns-in-php.html">Split text into multiple columns in PHP</a></p>
<p>Parameters:<br />
InputString &#8211; String to be split into columns<br />
Columns &#8211; Number of columns<br />
SplitString &#8211; String to look for to not split midtext etc</p>
<p>Example of how to use:</p>
<pre class="brush: vb; title: ; notranslate">
        Dim strColumns As String() = SplitIntoColumns(strText, 2, &quot;&lt;h2&gt;&quot;)
        strText = &quot;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&quot; &amp; strColumns(0) &amp; &quot;&lt;/td&gt;&lt;td&gt;&quot; &amp; strColumns(1) &amp; &quot;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&quot;
</pre>
<p>Code snippet:</p>
<pre class="brush: vb; title: ; notranslate">
Function SplitIntoColumns(ByVal InputString As String, ByVal Columns As Integer, ByVal SplitString As String) As String()

        ' Source: http://blog.tjitjing.com
        '
        ' Splits a string into x number of columns and returns result as an array of columns
        '
        ' Parameters:
        ' $InputString String to be split into columns
        ' $Columns     Number of columns
        ' $SplitString String to look for to not split midtext etc
        '
        ' Change history:
        ' 2011-02-04/Max    Version 1
        ' 2011-05-16/Max    Version 1.2
        '

        Dim Output() As String
        ReDim Output(0 To Columns - 1)

        ' Find middle of text
        Dim ColLength As Integer = Len(InputString) / Columns

        ' Split into columns
        Dim ColCount As Integer
        Dim Pos As Integer, LastPos As Integer = 0
        For ColCount = 1 To Columns

           ' Find $SplitString, position to cut
            Pos = -1
            If (LastPos + ColLength) &lt; InputString.Length Then
                Pos = InputString.IndexOf(SplitString, LastPos + ColLength)
            End If
            If Pos = -1 Then Pos = InputString.Length

            ' Cut out column
            Output(ColCount - 1) = Mid(InputString, LastPos + 1, Pos - LastPos)

            LastPos = Pos

        Next ColCount

        Return Output

    End Function
</pre>
<p><em>[Edit: Updated function]</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tjitjing.com/index.php/2011/02/split-text-in-two-columns-in-vb-net.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Split text into multiple columns in PHP</title>
		<link>http://blog.tjitjing.com/index.php/2011/01/split-text-into-multiple-columns-in-php.html</link>
		<comments>http://blog.tjitjing.com/index.php/2011/01/split-text-into-multiple-columns-in-php.html#comments</comments>
		<pubDate>Wed, 26 Jan 2011 12:49:04 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Code snippet]]></category>
		<category><![CDATA[Example]]></category>

		<guid isPermaLink="false">http://blog.tjitjing.com/?p=354</guid>
		<description><![CDATA[I made a Swedish shopping directory using affiliate links for a site and wanted to split it into two columns. I wrote the following php function that can be used to split a string in two or more pieces. One parameter is at what character or string you want to split. For example if you [...]]]></description>
			<content:encoded><![CDATA[<p>I made a <a target="_blank" href="http://www.smskungen.se/shopping-guide.php">Swedish shopping directory</a> using affiliate links for a site and wanted to split it into two columns.</p>
<p><strong>I wrote the following php function that can be used to split a string in two or more pieces. </strong>One parameter is at what character or string you want to split. For example if you want to split at a space to not break up words, or split at a period to not split up sentences, at certain html tags such as &lt;h1&gt; to keep headlines and text in same column etc.</p>
<p>The function returns a string array with columns. </p>
<p>Example how to use:</p>
<pre class="brush: php; title: ; notranslate">
	$TextString = &quot;some text to split&quot;)
	$Columns = SplitIntoColumns ($TextString, 2, &quot;&lt;h1&gt;&quot;);
	echo ($Columns[0]);
	echo ($Columns[1]);
</pre>
<p>Function</p>
<pre class="brush: php; title: ; notranslate">
function SplitIntoColumns ($InputString, $Columns, $SplitString) {

	// Source: http://blog.tjitjing.com
	//
	// Splits a string into x number of columns and returns result as an array of columns
	//
	// Parameters:
	// $InputString	String to be split into columns
	// $Columns		Number of columns
	// $SplitString	String to look for to not split midtext etc
	//
	// Change history:
	// 2011-01-25/Max	Version 1
	//

	// Find middle of text
	$ColLength = strlen($InputString)/$Columns;

	// Split into columns
	for($ColCount = 1; $ColCount &lt;= $Columns; $ColCount++) {

		// Find $SplitString, position to cut
		$Pos = strpos($InputString , $SplitString , $LastPos + $ColLength);
		if ($Pos === false) {
			$Pos = strlen($InputString);
		}

		// Cut out column
		$Output[$ColCount - 1] = substr($InputString, $LastPos, $Pos - $LastPos);

		$LastPos = $Pos;

	}

	return $Output;

 }
</pre>
<p><em>[Edit: VB.NET version: <a target="_blank" href="http://blog.tjitjing.com/index.php/2011/02/split-text-in-two-columns-in-vb-net.html">Split text in two columns in VB.NET</a>]</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tjitjing.com/index.php/2011/01/split-text-into-multiple-columns-in-php.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

