<?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"
	>

<channel>
	<title>Wacdesigns &#124; Technology, Web 2.0 and Life</title>
	<atom:link href="http://www.wacdesigns.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wacdesigns.com</link>
	<description>Technology, Web 2.0, Design and Life in Mauritius</description>
	<pubDate>Mon, 06 Oct 2008 07:00:34 +0000</pubDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
			<item>
		<title>Merge pdf files using C#</title>
		<link>http://www.wacdesigns.com/2008/10/03/merge-pdf-files-using-c/</link>
		<comments>http://www.wacdesigns.com/2008/10/03/merge-pdf-files-using-c/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 16:00:08 +0000</pubDate>
		<dc:creator>jf</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[C#]]></category>

		<category><![CDATA[Work]]></category>

		<category><![CDATA[Itextsharp]]></category>

		<category><![CDATA[PDF]]></category>

		<guid isPermaLink="false">http://www.wacdesigns.com/?p=151</guid>
		<description><![CDATA[Recently I had to create an assembly component using C# to merge multiple PDF files into one file. The specification was pretty straight forward:
1) Merge two of more PDF document into a single output PDF File.
2) Used on an ASP.NET Page
After a few minutes of GOOG, I came up to this &#8220;ITextSharp&#8221;
iText# (iTextSharp) is a [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had to create an assembly component using C# to merge multiple PDF files into one file. The specification was pretty straight forward:<br />
1) Merge two of more PDF document into a single output PDF File.<br />
2) Used on an ASP.NET Page</p>
<p>After a few minutes of GOOG, I came up to this &#8220;<a title="ITextSharp" href="http://sourceforge.net/projects/itextsharp/" target="_blank">ITextSharp</a>&#8221;</p>
<blockquote><p>iText# (iTextSharp) is a port of the iText open source java library written entirely in C# for the .NET platform. iText# is a library that allows you to generate PDF files on the fly. It is implemented as an assembly.</p></blockquote>
<p><em>It must be noted that the assembly is coded and compiled using the .NET Framework 1.1. You might want to migrate to the version 2.0 or 3.5 of the .NET Framework. </em></p>
<p>With a some more research on PDF merging. I was able to create a class that will make use of the ITextSharp assembly and perform as the merge pdf operation as needed.<br />
<br />
Here is the code:<br />
<span id="more-151"></span></p>
<pre name="code" class="c-sharp">

using iTextSharp.text;
using iTextSharp.text.pdf;

public class MergeEx
{
#region Fields
private string sourcefolder;
private string destinationfile;
private IList fileList = new ArrayList();
#endregion

#region Public Methods
/// &lt;summary&gt;
/// Add a new file, together with a given docname to the fileList and namelist collection
/// &lt;/summary&gt;
/// &lt;param name=&quot;filepath&quot;&gt;&lt;/param&gt;
public void AddFile(string pathnname)
{
fileList.Add(pathnname);
}

/// &lt;summary&gt;
/// Generate the merged PDF
/// &lt;/summary&gt;
public void Execute()
{
MergeDocs();
}
#endregion

#region Private Methods
/// &lt;summary&gt;
/// Merges the Docs and renders the destinationFile
/// &lt;/summary&gt;
/// &lt;param name=&quot;destinationFile&quot;&gt;&lt;/param&gt;
/// &lt;param name=&quot;filePath&quot;&gt;&lt;/param&gt;
private void MergeDocs()
{

//Step 1: Create a Docuement-Object
Document document = new Document();
try
{
//Step 2: we create a writer that listens to the document
PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(destinationfile, FileMode.Create));

//Step 3: Open the document
document.Open();

PdfContentByte cb = writer.DirectContent;
PdfImportedPage page;

int n = 0;
int rotation = 0;

//Loops for each file that has been listed
foreach (string filename in fileList)
{
//The current file path
string filePath = sourcefolder + filename;

// we create a reader for the document
PdfReader reader = new PdfReader(filePath);

//Gets the number of pages to process
n = reader.NumberOfPages;

int i = 0;
while (i &lt; n)
{
i++;
document.SetPageSize(reader.GetPageSizeWithRotation(1));
document.NewPage();

//Insert to Destination on the first page
if (i == 1)
{
Chunk fileRef = new Chunk(&quot; &quot;);
fileRef.SetLocalDestination(filename);
document.Add(fileRef);
}

page = writer.GetImportedPage(reader, i);
rotation = reader.GetPageRotation(i);
if (rotation == 90 || rotation == 270)
{
cb.AddTemplate(page, 0, -1f, 1f, 0, 0, reader.GetPageSizeWithRotation(i).Height);
}
else
{
cb.AddTemplate(page, 1f, 0, 0, 1f, 0, 0);
}
}
}
}
catch (Exception e) { throw e; }
finally { document.Close(); }
}
#endregion

#region Properties
/// &lt;summary&gt;
/// Gets or Sets the SourceFolder
/// &lt;/summary&gt;
public string SourceFolder
{
get { return sourcefolder; }
set {sourcefolder = value; }
}

/// &lt;summary&gt;
/// Gets or Sets the DestinationFile
/// &lt;/summary&gt;
public string DestinationFile
{
get { return destinationfile; }
set { destinationfile = value; }
}
#endregion
}
</pre>
<p>To use the MergeEx class:<br />
1) Initialize the class<br />
2) Set the SourceFolder and DestinationFile properties<br />
3) Using the AddFile method, add the source file names that need to be merged (Filename only since the SourceFolder has already been set)<br />
4) Call the Execute Method</p>
<p>If everything works fine you will find your Merged PDF Document at your stated destination file.</p>
<p>The code is pretty much self decribed. If there is any question, i can always be contacted via this post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wacdesigns.com/2008/10/03/merge-pdf-files-using-c/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SEO: Bounce rate of a website</title>
		<link>http://www.wacdesigns.com/2008/09/22/seo-bounce-rate-of-a-website/</link>
		<comments>http://www.wacdesigns.com/2008/09/22/seo-bounce-rate-of-a-website/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 15:55:00 +0000</pubDate>
		<dc:creator>jf</dc:creator>
		
		<category><![CDATA[Internet Articles]]></category>

		<category><![CDATA[SEO]]></category>

		<category><![CDATA[Search Engine]]></category>

		<category><![CDATA[Web]]></category>

		<category><![CDATA[Analytics]]></category>

		<category><![CDATA[Bounce Rate]]></category>

		<guid isPermaLink="false">http://www.wacdesigns.com/2008/09/22/seo-bounce-rate-of-a-website/</guid>
		<description><![CDATA[
Why is my bounce rate so high ?

Definition: A bounce occurs when a person leaves your website after reaching your entry page. The above cases can be considered equally as bounces from your website.
1) Visitor enters your site and press back immediately (before or even after the page has loaded)
2) Visitor waits for the page [...]]]></description>
			<content:encoded><![CDATA[<p><strong><em></em></strong></p>
<h3>Why is my bounce rate so high ?</h3>
<p><img src="http://s3.amazonaws.com:80/0MA9W84DQNJ4QTT686G2_MyBlogUploads/Photo/3573944_242afda7be.jpg" alt="" /></p>
<p>Definition: A bounce occurs when a person leaves your website after reaching your entry page. The above cases can be considered equally as bounces from your website.</p>
<p>1) Visitor enters your site and press back immediately (before or even after the page has loaded)</p>
<p>2) Visitor waits for the page to load stays on this page for some time and then press back or navigate on another site. ( In this case the visitor might have found the information and then chose to navigate elsewhere to either find some supplementary information. Or it could be that he/she might not have found it but just read some pieces to see what is there, a third case could be the persons did not like the: website, content or colors on the site and went away.)</p>
<p>Therefore there seems to be considerable number of aspects to take into consideration to get a more precise question about “<em>Why is my bounce rate so high ?</em>”. There isn’t any straight forward answer to this question, but there are many questions that can lead to possible solutions:</p>
<p>When you ask your questions about bounce rate here are the different questions that might come to your mind.</p>
<p><span style="text-decoration: underline;">Why is my bounce rate so high ?</span></p>
<p><strong>User Interface<br />
</strong>Is my layout/presentation/design attractive to visitors ?<br />
Does my pages load slowly ?<br />
Do my page have appropriate ads ? Are these ads <em>non-aggressive</em> towards the user ?<br />
Is your page browser friendly ? (Can be views at any resolution with any browser the same way)</p>
<p><strong>Content</strong></p>
<p>Does  the user find what they are looking for ? ( High bounce rate and high time on site visits)<br />
Is there enough information to show to the user ? Do I display enough or too much ?<br />
From keywords analysis are the entry keyword valid for the content that the entry page ?</p>
<p>These are few questions, and there are much more that can come across when you want to decrease the bounce rate of your website. Personally I think that depending on your audience your bounce rate will always vary. There will be always accidental clicks (people make mistakes).</p>
<p>As mentioned on Bounce Rate article on Wikipedia: Taking the example of news site, which have all their information on the first page itself. People might just scan the page and then exit to another website. <em>News website might just be off having 80% bounce rate</em> with a satisfied visitor who was able to have what he came for. From this point of view: Informative website will most likely have high bounce rate compared to E-Commerce one’s for example where you must navigate on several page to be able to perform a checkout.<br />
</p>
<p>A word of conclusion:</p>
<blockquote><p><em>Source </em><a href="http://en.wikipedia.org/wiki/Bounce_Rate" target="_blank"><em>Wikipedia</em></a><em>: </em><br />
<a href="http://en.wikipedia.org/wiki/Google.com">Google.com</a> analytics specialist Avinash Kaushik has stated:</p>
<p>&#8220;It is really hard to get a bounce rate under 20%, anything over 35% is cause for concern, 50% (above) is worrying.&#8221;<a href="http://en.wikipedia.org/wiki/Bounce_Rate#cite_note-3"></a></p></blockquote>
<p>References and useful links:<br />
<a title="http://en.wikipedia.org/wiki/Bounce_Rate" href="http://en.wikipedia.org/wiki/Bounce_Rate">http://en.wikipedia.org/wiki/Bounce_Rate</a></p>
<p><a title="http://www.google.com/support/analytics/bin/answer.py?hl=en&amp;answer=81986" href="http://www.google.com/support/analytics/bin/answer.py?hl=en&amp;answer=81986">http://www.google.com/support/analytics/bin/answer.py?hl=en&amp;answer=81986</a></p>
<p><a title="http://newsletter.blizzardinternet.com/how-high-is-your-bounce-rate/2006/02/09/" href="http://newsletter.blizzardinternet.com/how-high-is-your-bounce-rate/2006/02/09/">http://newsletter.blizzardinternet.com/how-high-is-your-bounce-rate/2006/02/09/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wacdesigns.com/2008/09/22/seo-bounce-rate-of-a-website/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Windows Live Writer</title>
		<link>http://www.wacdesigns.com/2008/09/19/windows-live-writer/</link>
		<comments>http://www.wacdesigns.com/2008/09/19/windows-live-writer/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 15:33:00 +0000</pubDate>
		<dc:creator>jf</dc:creator>
		
		<category><![CDATA[Bloggers]]></category>

		<category><![CDATA[Software]]></category>

		<category><![CDATA[Web]]></category>

		<category><![CDATA[Blog]]></category>

		<category><![CDATA[Windows Live Writer]]></category>

		<guid isPermaLink="false">http://www.wacdesigns.com/2008/09/19/windows-live-writer/</guid>
		<description><![CDATA[It’s been not nearly a year since I last used Windows Live Writer, there seems to have been a lot of enhancement and changes compared to the first version that i have tried up. Today, I&#8217;ll be giving a try to the beta version (Build 14.0.5025.904). The setup was quiet easy and straight forward, warning [...]]]></description>
			<content:encoded><![CDATA[<p>It’s been not nearly a year since I last used Windows Live Writer, there seems to have been a lot of enhancement and changes compared to the first version that i have tried up. Today, I&#8217;ll be giving a try to the beta version (Build 14.0.5025.904). The setup was quiet easy and straight forward, warning me that I must enable XML-RPC on my blog before I can continue.</p>
<p>The first thing I installed is the <a href="http://www.codeplex.com/s3browser" target="_blank">S3 Object plug-in</a>, to be able to upload images directly to my Amazon S3 account and use them on this post.</p>
<p><img src="http://s3.amazonaws.com:80/0MA9W84DQNJ4QTT686G2_MyBlogUploads/Photo/WindowsLiveWriterMain.JPG" alt="" width="561" height="480" /></p>
<p>This image comes from my S3 bucket.</p>
<p>There are many feature such as the Insert Map: Let’s try it out and point out Mauritius for example <img src='http://www.wacdesigns.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div id="scid:84E294D0-71C9-4bd0-A0FE-95764E0368D9:0564affd-941e-4eb5-9b97-d138d39f7d94" class="wlWriterEditableSmartContent" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"><a id="map-1458b467-ce72-4bbc-b6ae-5ac342dc9e9e" title="Click to view this map on Live.com" href="http://maps.live.com/default.aspx?v=2&amp;cp=-20.01295~57.57085&amp;lvl=14&amp;style=a&amp;sp=aN.-20.01553_57.57196_Where%2520I%2520Live%2520%253a)_This%2520is%2520where%2520i%2520live..._http%253a%252f%252fwww.wacdesigns.com%252f2006%252f10%252f18%252fphotos-of-mauritius%252f_http%253a%252f%252fwww.wacdesigns.com%252fwp-content%252fuploads%252f2006%252f10%252fWindowsLiveWriter%252fPhotosofMauritius%25255fB17E%252fPicture%252520-%252520Grand-Bay%252520009%25255B3%25255D.jpg&amp;mkt=en-us&amp;FORM=LLWR"><img src="http://www.wacdesigns.com/wp-content/uploads/2008/09/map6cf1c9909681.jpg" alt="Where i live." width="416" height="312" /></a><br />
<label style="font-size:.8em;" for="map-1458b467-ce72-4bbc-b6ae-5ac342dc9e9e">Where i live.</label></div>
<p>Nice. <span style="text-decoration: line-through;">I have also created a Marker (Push Pin).</span> Which does not seem to appear, When you create a map on Windows Live Messenger, it&#8217;s not the actual map that appears but an image with a link to the actual map&#8230; <img src='http://www.wacdesigns.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>Some other comment: There is to a problem, when there are connection cuts. The application just hangs during an operation. It was the case for my first post. Hope that is will be happen.</p>
<p>Conclusion a very nice and elaborated tool for blogging. I’ll will be trying it for a fews days and will send some feedback on this post. Or create a new one if need be.</p>
<p><br />
My previous article to Windows Live Writer can be found <a title="Windows Live Writer Beta" href="http://www.wacdesigns.com/2006/10/13/windows-live-writer-beta/" target="_blank">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wacdesigns.com/2008/09/19/windows-live-writer/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Random pictures: Karate or Kung Fu Lessons ?</title>
		<link>http://www.wacdesigns.com/2008/09/19/random-pictures-karate-or-kung-fu-lessons-2/</link>
		<comments>http://www.wacdesigns.com/2008/09/19/random-pictures-karate-or-kung-fu-lessons-2/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 03:00:00 +0000</pubDate>
		<dc:creator>jf</dc:creator>
		
		<category><![CDATA[Cool Stuff]]></category>

		<category><![CDATA[Photo]]></category>

		<category><![CDATA[Fun]]></category>

		<guid isPermaLink="false">http://www.wacdesigns.com/2008/09/18/random-pictures-karate-or-kung-fu-lessons-2/</guid>
		<description><![CDATA[These two seems to be in need of some bucks.. HELP THEM !!!
 
Post your comments for the karate girl here.
&#160;
Post your comments for the kung fu guy here.

]]></description>
			<content:encoded><![CDATA[<p>These two seems to be in need of some bucks.. HELP THEM !!!</p>
<p><a href="http://www.flickr.com/photos/cmatta/30604498/" target="_blank"><img src="http://farm1.static.flickr.com/23/30604498_04c218e680.jpg" /></a> </p>
<p>Post your comments for the karate girl <a href="http://www.flickr.com/photos/cmatta/30604498/" target="_blank">here</a>.</p>
<p><a href="http://flickr.com/photos/boojee/29776608/" target="_blank"><img src="http://farm1.static.flickr.com/21/29776608_6a6b104940.jpg" /></a>&#160;</p>
<p>Post your comments for the kung fu guy <a href="http://flickr.com/photos/boojee/29776608/" target="_blank">here</a>.</p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wacdesigns.com/2008/09/19/random-pictures-karate-or-kung-fu-lessons-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>backup and share files using MozyHome and Dropbox</title>
		<link>http://www.wacdesigns.com/2008/09/18/backup-and-share-files-using-mozyhome-and-dropbox/</link>
		<comments>http://www.wacdesigns.com/2008/09/18/backup-and-share-files-using-mozyhome-and-dropbox/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 16:00:17 +0000</pubDate>
		<dc:creator>jf</dc:creator>
		
		<category><![CDATA[Software]]></category>

		<category><![CDATA[Tech]]></category>

		<category><![CDATA[Web]]></category>

		<category><![CDATA[Backup]]></category>

		<category><![CDATA[Dropbox]]></category>

		<category><![CDATA[Mozy]]></category>

		<category><![CDATA[Storage]]></category>

		<category><![CDATA[Web 2.0]]></category>

		<guid isPermaLink="false">http://www.wacdesigns.com/?p=130</guid>
		<description><![CDATA[If you are wondering what are the choices you have to make share and backup your files, you might easily be able to find hundreds of alternative on the web today. Each one with their different features and technologies.
I came across 2 free tools that i use for my backup and file sharing:

MozyHome Remote Backup

&#160;

MozyHome [...]]]></description>
			<content:encoded><![CDATA[<p>If you are wondering what are the choices you have to make share and backup your files, you might easily be able to find hundreds of alternative on the web today. Each one with their different features and technologies.</p>
<p>I came across 2 free tools that i use for my backup and file sharing:</p>
<p>
<h2><a title="MozyHome Remote Backup" href="http://mozy.com/home" target="_blank">MozyHome Remote Backup</a></h2>
</p>
<p>&nbsp;</p>
<p><img class="size-medium wp-image-132 alignnone" title="mozyhome" src="http://www.wacdesigns.com/wp-content/uploads/2008/09/mozyhome-300x116.jpg" alt="" width="300" height="116" /></p>
<p><strong>MozyHome </strong>is a small application that runs on background and backups any folder that you configure it to. It will encrypt and then upload your files to your 2 GB free space. You have several tools to enable you to them restore any lost files. Nice for uploading document, project files. You have also the paid version with unlimited space.</p>
<p>
<h2><a title="Dropbox" href="http://www.getdropbox.com" target="_blank">Dropbox</a></h2>
</p>
<p>&nbsp;</p>
<p><img class="alignnone size-medium wp-image-131" title="dropbox" src="http://www.wacdesigns.com/wp-content/uploads/2008/09/dropbox-300x154.jpg" alt="" width="300" height="154" /></p>
<p>Dropbox is a new tool, that just got public last week. It&#8217;s similar to Mozybackup with 2 GB free space and the posibility of backup your files. With some extra features such as file sharing and automatic sync. Personally I use it to share files only. Since your files need to be in the DropDox folder (Similar concept and LiveMSN sharing folder) to be able to share.</p>
<p>It also allows sharing of files and give you a nice public URL that you can easily send to the person you want to share your files with. The only lacking features i might see here, is that you can&#8217;t share an entire folder with files inside. i.e When you want to share several photos you can&#8217;t directly get a link to the folder. You must share it with someone that already has Dropbox. A feature that would enable a link to a zip version of an entire folder could be nice.<br />
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wacdesigns.com/2008/09/18/backup-and-share-files-using-mozyhome-and-dropbox/feed/</wfw:commentRss>
		</item>
		<item>
		<title>IIS: Redirection from non-www to www domain</title>
		<link>http://www.wacdesigns.com/2008/08/08/iis-redirection-from-non-www-to-www-domain/</link>
		<comments>http://www.wacdesigns.com/2008/08/08/iis-redirection-from-non-www-to-www-domain/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 02:00:42 +0000</pubDate>
		<dc:creator>jf</dc:creator>
		
		<category><![CDATA[Cool Stuff]]></category>

		<category><![CDATA[Hosting]]></category>

		<category><![CDATA[SEO]]></category>

		<category><![CDATA[Web]]></category>

		<category><![CDATA[IIS]]></category>

		<guid isPermaLink="false">http://www.wacdesigns.com/?p=121</guid>
		<description><![CDATA[The problem today, is that we have a great asp.net website but search engines are indexing the http://greataspnetwebsite.com instead of http://www.greataspnetwebsite.com, this is commonly seen on the web and there are several ways to archive a good result for making the non-www to www domain. This redirection should be a 301 Permanently Moved, otherwise you [...]]]></description>
			<content:encoded><![CDATA[<p>The problem today, is that we have a great asp.net website but search engines are indexing the <a href="#">http://greataspnetwebsite.com</a> instead of <a href="#">http://www.greataspnetwebsite.com</a>, this is commonly seen on the web and there are several ways to archive a good result for making the non-www to www domain. This redirection should be a <strong>301 Permanently Moved</strong>, otherwise you will might lose your search engine indexed page or become duplicate content for your non-www and www domain. Here are easy steps how to archive a quick and clean Permanent Redirection using IIS.</p>
<p>Consider the case where we already have a website in IIS called: greataspnetwebsite.com</p>
<ul>
<li>Go to IIS Manager</li>
<li>Create a new website that point to the same directory as your existing one</li>
<li>Select the newly created website, open the properties box</li>
<li>In the option button <span style="color: black;">&#8220;When connecting to this resource the      content should come from&#8221; should be </span>change to &#8220;<span style="color: black;">A redirection to a URL</span>&#8220;</li>
<li>Specify the URL http://www.greataspnetwebsite.com</li>
<li>Select the check box <span style="color: black;">that      says &#8220;A permanent redirection for this resource.&#8221; </span></li>
</ul>
<p><a href="http://www.wacdesigns.com/wp-content/uploads/2008/08/iisredirectionsetting.jpg"><img class="alignnone size-full wp-image-123" title="iis redirection setting" src="http://www.wacdesigns.com/wp-content/uploads/2008/08/iisredirectionsetting.jpg" alt="" width="430" height="211" /></a><br />
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wacdesigns.com/2008/08/08/iis-redirection-from-non-www-to-www-domain/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Copy-Clone custom object in C#</title>
		<link>http://www.wacdesigns.com/2008/08/05/copy-clone-custom-object-in-c/</link>
		<comments>http://www.wacdesigns.com/2008/08/05/copy-clone-custom-object-in-c/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 02:00:53 +0000</pubDate>
		<dc:creator>jf</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://www.wacdesigns.com/?p=83</guid>
		<description><![CDATA[This example shows you how to Copy/Clone custom object in C#.
In this example I will be having a base class that all my custom object will be inheriting from.
You must import the following namespaces to start with.


using System;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using System.Runtime.Serialization;
using System.IO;

Let&#8217;s create a base class Person that all our other classes with inherit [...]]]></description>
			<content:encoded><![CDATA[<p>This example shows you how to Copy/Clone custom object in C#.</p>
<p>In this example I will be having a base class that all my custom object will be inheriting from.</p>
<p>You must import the following namespaces to start with.</p>
<pre name="code" class="c-sharp">

using System;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using System.Runtime.Serialization;
using System.IO;
</pre>
<p>Let&#8217;s create a base class <strong>Person </strong>that all our other classes with inherit from. It will contain the following methods:</p>
<ul>
<li>ToXMLString() : Returns an XML version of the current object</li>
<li>Deserialize(XmlDocument xml, Type type) : De-serialize the current XMLDocument cast it to the current type</li>
<li>Serialize(object o) : Serialize the current object and outputs an XMLDocument</li>
<li>Clone(): Runs a Serialization and De-serialization and returns a clone of the current Object</li>
</ul>
<pre name="code" class="c-sharp">

[Serializable()]
public abstract class Person
{
/// &lt;summary&gt;
/// To XML string.
/// &lt;/summary&gt;
/// &lt;returns&gt;&lt;/returns&gt;
public string ToXMLString()
{
XmlSerializer serializer = new XmlSerializer(this.GetType());
MemoryStream dataStream = new MemoryStream();
XmlTextWriter writer = new XmlTextWriter(dataStream, Encoding.UTF8);
serializer.Serialize(dataStream, this);
return writer.ToString();
}

/// &lt;summary&gt;
/// Deserializes an xml document back into an object
/// &lt;/summary&gt;
/// &lt;param name=&quot;xml&quot;&gt;The xml data to deserialize&lt;/param&gt;
/// &lt;param name=&quot;type&quot;&gt;The type of the object being deserialized&lt;/param&gt;
/// &lt;returns&gt;A deserialized object&lt;/returns&gt;
public static object Deserialize(XmlDocument xml, Type type)
{
XmlSerializer s = new XmlSerializer(type);
string xmlString = xml.OuterXml.ToString();
byte[] buffer = ASCIIEncoding.UTF8.GetBytes(xmlString);
MemoryStream ms = new MemoryStream(buffer);
XmlReader reader = new XmlTextReader(ms);
Exception caught = null;

try
{
object o = s.Deserialize(reader);
return o;
}

catch (Exception e)
{
caught = e;
}
finally
{
reader.Close();

if (caught != null)
throw caught;
}
return null;
}

/// &lt;summary&gt;
/// Serializes an object into an Xml Document
/// &lt;/summary&gt;
/// &lt;param name=&quot;o&quot;&gt;The object to serialize&lt;/param&gt;
/// &lt;returns&gt;An Xml Document consisting of said object&#039;s data&lt;/returns&gt;
public static XmlDocument Serialize(object o)
{
XmlSerializer s = new XmlSerializer(o.GetType());

MemoryStream ms = new MemoryStream();
XmlTextWriter writer = new XmlTextWriter(ms, new UTF8Encoding());
writer.Formatting = Formatting.Indented;
writer.IndentChar = &#039; &#039;;
writer.Indentation = 5;
Exception caught = null;

try
{
s.Serialize(writer, o);
XmlDocument xml = new XmlDocument();
string xmlString = ASCIIEncoding.UTF8.GetString(ms.ToArray());
xml.LoadXml(xmlString);
return xml;
}
catch (Exception e)
{
caught = e;
}
finally
{
writer.Close();
ms.Close();

if (caught != null)
throw caught;
}
return null;
}

/// &lt;summary&gt;
/// Creates a new object that is a copy of the current instance.
/// &lt;/summary&gt;
/// &lt;returns&gt;
/// A new object that is a copy of this instance.
/// &lt;/returns&gt;
public object Clone()
{
return Deserialize(Serialize(this), this.GetType());
}
}
</pre>
<p>Here are sample classes that herits from the abstract base class and clone operation are performed upon them.</p>
<pre name="code" class="c-sharp">

public class Clerk: Person
{
private string position;

/// &lt;summary&gt;
/// Gets or sets the position.
/// &lt;/summary&gt;
/// &lt;value&gt;The position.&lt;/value&gt;
public string Position
{
get { return position; }
set { position = value; }
}
}

public class Developer: Person
{
private string skill;

/// &lt;summary&gt;
/// Gets or sets the skill.
/// &lt;/summary&gt;
/// &lt;value&gt;The skill.&lt;/value&gt;
public string Skill
{
get { return skill; }
set { skill= value; }
}
}
</pre>
<p>Using clone method.</p>
<pre name="code" class="c-sharp">

public void UpdateSkills()
{
IList&lt;Clerk&gt; clerkList = new ArrayList();
IList&lt;Clerk&gt; newClerkList = new ArrayList();

foreach (Clerk clerk in clerkList)
{
newClerkList.Add((Clerk)clerk.Clone());
}
}
</pre>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wacdesigns.com/2008/08/05/copy-clone-custom-object-in-c/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ASP.NET: HyperLink and Label without Id attribute</title>
		<link>http://www.wacdesigns.com/2008/08/04/aspnet-hyperlink-and-label-without-id-attributes/</link>
		<comments>http://www.wacdesigns.com/2008/08/04/aspnet-hyperlink-and-label-without-id-attributes/#comments</comments>
		<pubDate>Mon, 04 Aug 2008 02:00:54 +0000</pubDate>
		<dc:creator>jf</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[C#]]></category>

		<category><![CDATA[SEO]]></category>

		<category><![CDATA[Software]]></category>

		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.wacdesigns.com/?p=98</guid>
		<description><![CDATA[Today, I&#8217;ll talk a bit about how ASP.NET handles HTML rendering of controls such as &#60;asp:HyperLink&#62; and &#60;asp:Label&#62;.  If you have developed using ASP.NET you must have noticed that when an &#60;asp:Hyperlink&#62; or &#60;asp:Label&#62; is rendered you will find something like that:

&#60;html&#62;

&#60;a id=&#34;ctl00_ContentPlaceHolder1_rptShoppingCart_ctl00_lnkGotoCheckout&#34; href=&#34;#&#34; class=&#34;someCss&#34;&#62;delete&#60;/a&#62;

&#60;/html&#62;

From an ASP.NET point of view, this is fine, since all [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I&#8217;ll talk a bit about how ASP.NET handles HTML rendering of controls such as &lt;asp:HyperLink&gt; and &lt;asp:Label&gt;.  If you have developed using ASP.NET you must have noticed that when an &lt;asp:Hyperlink&gt; or &lt;asp:Label&gt; is rendered you will find something like that:</p>
<pre name="code" class="html">
&lt;html&gt;

&lt;a id=&quot;ctl00_ContentPlaceHolder1_rptShoppingCart_ctl00_lnkGotoCheckout&quot; href=&quot;#&quot; class=&quot;someCss&quot;&gt;delete&lt;/a&gt;

&lt;/html&gt;
</pre>
<p>From an ASP.NET point of view, this is fine, since all object rendered should be identified uniquely on the client side. But many a time these are useless, since these hyperlinks are not used to trigger any server side events. Thus the id attributes just takes up a lot of space on your HTML and Page Size when you have many links like that. If you don&#8217;t want to have those, here is a solution I came up with, you can create custom server controls that inherits from the control that you want to remove the id attribute tag from.</p>
<p>Here is sample of the code that i used to remove the id attribute from the Hyperlink Control, without basically removing all the features provided by the Hyperlink control such as being able to handle Resource files for globalization.</p>
<pre name="code" class="c-sharp">
[ToolboxData(&quot;&lt;{0}:HyperLinkEx runat=server&gt;&lt;/{0}:HyperLinkEx&gt;&quot;)]
public class HyperLinkEx: System.Web.UI.WebControls.HyperLink
{
private string rel;

/// &lt;summary&gt;
/// Gets or sets the rel.
/// &lt;/summary&gt;
/// &lt;value&gt;The rel.&lt;/value&gt;
public string Rel
{
get { return rel; }
set { rel = value; }
}

/// &lt;summary&gt;
/// Renders the control to the specified HTML writer.
/// &lt;/summary&gt;
/// &lt;param name=&quot;writer&quot;&gt;The &lt;see cref=&quot;T:System.Web.UI.HtmlTextWriter&quot;&gt;&lt;/see&gt; object that receives the control content.&lt;/param&gt;
protected override void Render(HtmlTextWriter writer)
{
StringBuilder sb = new StringBuilder();

sb.Append(&quot;&lt;a&quot;);

if (this.NavigateUrl.StartsWith(&quot;~&quot;))
this.NavigateUrl = ResolveClientUrl(this.NavigateUrl);
sb.Append(&quot; href=\&quot;&quot; + this.NavigateUrl + &quot;\&quot;&quot;);

if (!string.IsNullOrEmpty(rel)) sb.Append(&quot; rel=\&quot;&quot; + rel + &quot;\&quot;&quot;);
if (!string.IsNullOrEmpty(this.CssClass)) sb.Append(&quot; class=\&quot;&quot; + this.CssClass + &quot;\&quot;&quot;);
if (!string.IsNullOrEmpty(this.Target)) sb.Append(&quot; target=\&quot;&quot; + this.Target + &quot;\&quot;&quot;);
if (this.Attributes[&quot;onclick&quot;] != null) sb.Append(&quot; onclick=\&quot;&quot; + this.Attributes[&quot;onclick&quot;] + &quot;\&quot;&quot;);

sb.Append(&quot;&gt;&quot;);

if (!string.IsNullOrEmpty(this.ImageUrl)) //Some image were found
{
if (this.ImageUrl.StartsWith(&quot;~&quot;))
this.ImageUrl = ResolveClientUrl(this.ImageUrl);
sb.Append(&quot;&lt;img src=\&quot;&quot; + this.ImageUrl + &quot;\&quot; alt=\&quot;&quot; + this.Text + &quot;\&quot; title=\&quot;&quot; + this.Text + &quot;\&quot; border=\&quot;0\&quot; /&gt;&quot;);
}
else
{
sb.Append(this.Text);
}

sb.Append(&quot;&lt;/a&gt;&quot;);
writer.Write(sb.ToString());
}

}
</pre>
<p>In this source code, i have overridden the render method of the control and outputted a cleaner HTML anchor with no Id attributes. I have also added support for ImageURL attribute of the hyperlink server control, thus maintaining the most of the asp:Hyperlink features.</p>
<p>I have also created a tiny library with some controls: &lt;asp:HyperLink&gt;, &lt;asp:Label&gt;, &lt;asp:Image&gt; which i think are the controls that need not have the id attribute in every scenario.</p>
<p>You can find it for download under GNU Public Licence <a href="http://www.wacdesigns.com/wp-content/uploads/2008/08/Wacdesigns.Web.CustomControls.zip" target="_blank">here</a>.<br />
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wacdesigns.com/2008/08/04/aspnet-hyperlink-and-label-without-id-attributes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fatal error: require_once() [function.require]: Failed opening required &#8216;Text/Diff/Renderer.php&#8217;</title>
		<link>http://www.wacdesigns.com/2008/08/02/fatal-error-require_once-functionrequire-failed-opening-required-textdiffrendererphp/</link>
		<comments>http://www.wacdesigns.com/2008/08/02/fatal-error-require_once-functionrequire-failed-opening-required-textdiffrendererphp/#comments</comments>
		<pubDate>Sat, 02 Aug 2008 18:24:34 +0000</pubDate>
		<dc:creator>jf</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[Bug]]></category>

		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.wacdesigns.com/?p=99</guid>
		<description><![CDATA[Was just trying to view one of my post that i modified once after being published and bumbed up with a page with these error messages:
Warning:  ini_set() has been disabled for security reasons in /home/wacdesig/public_html/wp-includes/pluggable.php on line 1517
Warning:  require_once(Text/Diff/Renderer.php) [function.require-once]: failed to open stream: No such file or directory in /home/wacdesig/public_html/wp-includes/Text/Diff/Renderer/inline.php on line [...]]]></description>
			<content:encoded><![CDATA[<p>Was just trying to view one of my post that i modified once after being published and bumbed up with a page with these error messages:</p>
<p><strong>Warning</strong>:  ini_set() has been disabled for security reasons in <strong>/home/wacdesig/public_html/wp-includes/pluggable.php</strong> on line <strong>1517</strong></p>
<p><strong>Warning</strong>:  require_once(Text/Diff/Renderer.php) [function.require-once]: failed to open stream: No such file or directory in <strong>/home/wacdesig/public_html/wp-includes/Text/Diff/Renderer/inline.php</strong> on line <strong>17</strong></p>
<p><strong>Fatal error</strong>:  require_once() [function.require]: Failed opening required &#8216;Text/Diff/Renderer.php&#8217; (include_path=&#8217;.:/usr/lib/php:/usr/local/lib/php&#8217;) in <strong>/home/wacdesig/public_html/wp-includes/Text/Diff/Renderer/inline.php</strong> on line <strong>17</strong></p>
<p>Apparently this is due to my hosting provider that have disabled the use the the PHP function ini_set(). Great !!! how do i edit post that i have edited before&#8230; fortunately i found out someone that came up with a solution :).</p>
<p>Please note that this issue is only for WP 2.6 and is cause by the new Revision module that allows you to view a revision of your post before it was edited.</p>
<p>Here is the link to the solution for this problem:<a href="http://www.code-styling.de/english/wordpress-26-and-the-textdiff-fatal-errors" target="_blank">http://www.code-styling.de/english/wordpress-26-and-the-textdiff-fatal-errors</a></p>
<p>I also found another solution for those who don&#8217;t want to download the modified WP source file that is proposed in the first solution</p>
<p>Edit the <strong>wp-includes/Text/Diff.php</strong>, line 52 :</p>
<pre name="code" class="php">

require_once ABSPATH . WPINC . &#039;/Text/Diff/Engine/&#039; . $engine . &#039;.php&#039;;
</pre>
<p>Edit the <strong>wp-includes/Text/Diff/Renderer/inline.php</strong>, line 17 :</p>
<pre name="code" class="php">

require_once ABSPATH . WPINC . &#039;/Text/Diff/Renderer.php&#039;;
</pre>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wacdesigns.com/2008/08/02/fatal-error-require_once-functionrequire-failed-opening-required-textdiffrendererphp/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Sourceforge.net redesigned home page</title>
		<link>http://www.wacdesigns.com/2008/07/24/sourceforgenet-redesigned-home-page/</link>
		<comments>http://www.wacdesigns.com/2008/07/24/sourceforgenet-redesigned-home-page/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 09:32:14 +0000</pubDate>
		<dc:creator>jf</dc:creator>
		
		<category><![CDATA[Cool Sites]]></category>

		<category><![CDATA[Web]]></category>

		<category><![CDATA[open source]]></category>

		<category><![CDATA[sourceforge]]></category>

		<category><![CDATA[Web 2.0]]></category>

		<guid isPermaLink="false">http://www.wacdesigns.com/?p=93</guid>
		<description><![CDATA[While searching for some open source software today, i just bumbed onto a &#8220;new&#8221;: Streamed and clearer version of sourceforge.net website. It&#8217;s quiet nice i may say, when u enter the page, u don&#8217;t have a lot of stuff, like the normal one.
It&#8217;s a Google like home page i may say, not many actions, but [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.wacdesigns.com/wp-content/uploads/2008/07/sourceforge.jpg"><img class="alignleft size-thumbnail wp-image-94" title="sourceforge" src="http://www.wacdesigns.com/wp-content/uploads/2008/07/sourceforge-150x150.jpg" alt="" width="150" height="150" /></a>While searching for some open source software today, i just bumbed onto a &#8220;new&#8221;: Streamed and clearer version of <a title="SourceForge" href="http://sourceforge.net/?abmode=1" target="_blank">sourceforge.net</a> website. It&#8217;s quiet nice i may say, when u enter the page, u don&#8217;t have a lot of stuff, like the normal one.</p>
<p>It&#8217;s a Google like home page i may say, not many actions, but the essentials that are needed is visible. Let&#8217;s say is more web 2.0</p>
<p>The bright orange is a bit too flashy and takes up too much of the screen i may think. It could have been a bit smaller.</p>
<p>For those who don&#8217;t what sourceforge.net is about here is a part of the description from wikipedia:</p>
<blockquote><p><strong>SourceForge.net</strong> is a <a title="Source code repository" href="http://en.wikipedia.org/wiki/Source_code_repository" target="_blank">source code repository</a> and acts as a centralized location for software developers to control and manage open source software development. SourceForge.net is operated by <a title="Sourceforge, Inc." href="http://en.wikipedia.org/wiki/Sourceforge%2C_Inc." target="_blank">Sourceforge, Inc.</a> (formerly VA Software) and runs a version of the <a title="SourceForge Enterprise Edition" href="http://en.wikipedia.org/wiki/SourceForge_Enterprise_Edition" target="_blank">SourceForge</a> software, <a title="Fork (software development)" href="http://en.wikipedia.org/wiki/Fork_%28software_development%29" target="_blank">forked</a> from the last open-source version available. A large number of open source projects are hosted on the site (it had reached 178,832 projects and 1,861,990 registered users<sup id="cite_ref-1" class="reference"><a href="http://en.wikipedia.org/wiki/SourceForge#cite_note-1" target="_blank">[2]</a></sup> as of 2008, although it does contain many dormant or single-user projects).</p>
<p>SourceForge.net has offered free access to hosting and tools for developers of <a title="Free software" href="http://en.wikipedia.org/wiki/Free_software" target="_blank">free software</a> / <a title="Open source software" href="http://en.wikipedia.org/wiki/Open_source_software" target="_blank">open source software</a> for several years, and has become well-known within such development communities for these services.</p>
<p>SourceForge.net competes with other providers such as <a title="RubyForge" href="http://en.wikipedia.org/wiki/RubyForge" target="_blank">RubyForge</a>, <a title="Tigris.org" href="http://en.wikipedia.org/wiki/Tigris.org" target="_blank">Tigris.org</a>, <a title="BountySource" href="http://en.wikipedia.org/wiki/BountySource" target="_blank">BountySource</a>, <a title="BerliOS" href="http://en.wikipedia.org/wiki/BerliOS" target="_blank">BerliOS</a>, <a title="JavaForge" href="http://en.wikipedia.org/wiki/JavaForge" target="_blank">JavaForge</a> and <a title="GNU Savannah" href="http://en.wikipedia.org/wiki/GNU_Savannah" target="_blank">GNU Savannah</a>.</p>
<p>Read more about sourceforge <a title="Wikipedia  Sourceforge" href="http://en.wikipedia.org/wiki/SourceForge" target="_blank">here</a>.</p></blockquote>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wacdesigns.com/2008/07/24/sourceforgenet-redesigned-home-page/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
