backup and share files using MozyHome and Dropbox

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

 

MozyHome 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.

Dropbox

 

Dropbox is a new tool, that just got public last week. It’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.

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’t share an entire folder with files inside. i.e When you want to share several photos you can’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.

IIS: Redirection from non-www to www domain

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 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.

Consider the case where we already have a website in IIS called: greataspnetwebsite.com

  • Go to IIS Manager
  • Create a new website that point to the same directory as your existing one
  • Select the newly created website, open the properties box
  • In the option button “When connecting to this resource the content should come from” should be change to “A redirection to a URL
  • Specify the URL http://www.greataspnetwebsite.com
  • Select the check box that says “A permanent redirection for this resource.”

Copy-Clone custom object in C#

This post relates how to Copy/Clone custom object in C# (Deep and Shallow Clone).

In this example I will be having a base class that all my custom object will be inheriting from.

Updates: After quiet some research on the subject i recently found some interesting articles on this subject and wanted to share them on this post.

Object Cloning Using IL in C#

This subject is inspired on a session I followed on the TechDays 2008,
that addressed the fact that IL (Intermediate Language) can be used to clone objects, among other things, and that it’s not evil at all, and it can be pretty performant also.

You only have to see that you don’t overuse it tho, because otherwise the readability of your code is reduced, which is not a good thing for the maintenance.
And wrong usage of reflection (what IL is, or at least uses) can also result in poor performance.

Read more:
http://whizzodev.blogspot.com/2008/03/object-cloning-using-il-in-c.html

C# Class For Making a Deep Copy Clone of an Arbitrary Object

Here is a C# class that can create a deep copy clone of an arbitrary object. The thing that’s special about it is that it should work for any class that extends it, so that you don’t need to re-write a custom clone() function for every child class (as it seems the C# framework creators would like). This does a deep copy so be careful about members that recursively include one another.

Another way of doing this would be to use serialization . . . I just personally thought the reflection package would be more elegant.

Read more:
http://www.thomashapp.com/node/106

C# Object Clone Wars

Cloning C# objects is one of those things that appears easy but is actually quite complicated with many “gotchas.” This article describes the most common ways to clone a C# object.

Shallow vs. Deep Cloning

There are two types of object cloning: shallow and deep. A shallow clone copies the references but not the referenced objects. A deep clone copies the referenced objects as well.

hallow vs Deep Cloning
shallow vs Deep Cloning

Read more:
http://www.csharp411.com/c-object-clone-wars/

Clone C# Object using Serialization and De-serialization (Deep Clone)

In this example i’ll be using Serialization and De-Serialization to make a deep clone of the Person Class.

You must import the following namespaces to start with.
[csharp]
using System;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using System.Runtime.Serialization;
using System.IO;
[/csharp]

Let’s create a base class Person that all our other classes with inherit from. It will contain the following methods:

  • ToXMLString() : Returns an XML version of the current object
  • Deserialize(XmlDocument xml, Type type) : De-serialize the current XMLDocument cast it to the current type
  • Serialize(object o) : Serialize the current object and outputs an XMLDocument
  • Clone(): Runs a Serialization and De-serialization and returns a clone of the current Object

[csharp]
[Serializable()]
public abstract class Person
{
///

/// To XML string.
///

///
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();
}

///

/// Deserializes an xml document back into an object
///

/// The xml data to deserialize /// The type of the object being deserialized /// A deserialized object
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;
}

///

/// Serializes an object into an Xml Document
///

/// The object to serialize /// An Xml Document consisting of said object’s data
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 = ‘ ‘;
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;
}

///

/// Creates a new object that is a copy of the current instance.
///

///
/// A new object that is a copy of this instance.
///

public object Clone()
{
return Deserialize(Serialize(this), this.GetType());
}
}
[/csharp]

Here are sample classes that herits from the abstract base class and clone operation are performed upon them.

[csharp]

public class Clerk: Person
{
private string position;

///

/// Gets or sets the position.
///

/// The position.
public string Position
{
get { return position; }
set { position = value; }
}
}

public class Developer: Person
{
private string skill;

///

/// Gets or sets the skill.
///

/// The skill.
public string Skill
{
get { return skill; }
set { skill= value; }
}
}

[/csharp]

Using clone method.

[csharp]

public void UpdateSkills()
{
IList clerkList = new ArrayList();
IList newClerkList = new ArrayList();

foreach (Clerk clerk in clerkList)
{
newClerkList.Add((Clerk)clerk.Clone());
}
}

[/csharp]

Fatal error: require_once() [function.require]: Failed opening required ‘Text/Diff/Renderer.php’

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 17

Fatal error: require_once() [function.require]: Failed opening required ‘Text/Diff/Renderer.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/wacdesig/public_html/wp-includes/Text/Diff/Renderer/inline.php on line 17

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… fortunately i found out someone that came up with a solution :).

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.

Here is the link to the solution for this problem:http://www.code-styling.de/english/wordpress-26-and-the-textdiff-fatal-errors

I also found another solution for those who don’t want to download the modified WP source file that is proposed in the first solution

Edit the wp-includes/Text/Diff.php, line 52 :
[php]
require_once ABSPATH . WPINC . ‘/Text/Diff/Engine/’ . $engine . ‘.php’;
[/php]

Edit the wp-includes/Text/Diff/Renderer/inline.php, line 17 :
[php]
require_once ABSPATH . WPINC . ‘/Text/Diff/Renderer.php’;
[/php]

Sourceforge.net redesigned home page

While searching for some open source software today, i just bumbed onto a “new”: Streamed and clearer version of sourceforge.net website. It’s quiet nice i may say, when u enter the page, u don’t have a lot of stuff, like the normal one.

It’s a Google like home page i may say, not many actions, but the essentials that are needed is visible. Let’s say is more web 2.0

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.

For those who don’t what sourceforge.net is about here is a part of the description from wikipedia:

SourceForge.net is a source code repository and acts as a centralized location for software developers to control and manage open source software development. SourceForge.net is operated by Sourceforge, Inc. (formerly VA Software) and runs a version of the SourceForge software, forked 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[2] as of 2008, although it does contain many dormant or single-user projects).

SourceForge.net has offered free access to hosting and tools for developers of free software / open source software for several years, and has become well-known within such development communities for these services.

SourceForge.net competes with other providers such as RubyForge, Tigris.org, BountySource, BerliOS, JavaForge and GNU Savannah.

Read more about sourceforge here.

Yahoo! Search BOSS

Yahoo has just opened his search engine to us developer folks, we can now mindle and medle about to improve our search result on our own website. The codename for this open API is BOSS (Build your Own Search Service). As describe in zdnet article: is this a way for Yahoo to try to get some market shares in the search industry on GOOG.

Here is an extract from Yahoo! Search BOSS YDN

BOSS (Build your Own Search Service) is Yahoo!’s open search web services platform. The goal of BOSS is simple: to foster innovation in the search industry. Developers, start-ups, and large Internet companies can use BOSS to build and launch web-scale search products that utilize the entire Yahoo! Search index. BOSS gives you access to Yahoo!’s investments in crawling and indexing, ranking and relevancy algorithms, and powerful infrastructure. By combining your unique assets and ideas with our search technology assets, BOSS is a platform for the next generation of search innovation, serving hundreds of millions of users across the Web.

Yahoo! Search BOSS

I’ll try to experiment a bit on it, to see if i can get to integrate the search on this blog for a small…

Abode Flash is Google and Yahoo Index friendly

Adobe Flash LogoHere we are, the day that many developers, specially Flash developer has been waiting for… their application can now be crawled and indexed by Google and Yahoo search engine this was officially announced by adobe on tuesday: “to enhance search engine indexing of the Flash file format (SWF) and uncover information that is currently undiscoverable by search engines.”

They have been working together with Google and Yahoo for a way to give access to all the information that can be found in Flash application that have been hanging around the web for the some times now.

So what does that mean, in the Web world: Flash developers that have strived to create faboulous flash websites and application, that could only be reached via direct linking, will now be seen in Google and Yahoo search result, WOW this means millions of Flash application links will make their appearance in the day to day searching on GOOG.

From my point of view this is something really good. But what will happen to AJAX application with fancy effects ? will they not be replaced by Flash which is now INDEXABLE 🙂 natively by the web crawler. From what i know from the internal working of flash, their are series of events that are triggered to be able to navigate in an application, so when the crawler will index it, will it be by pages or by scene… What will be the effect of this changes on the Web 2.0 era ?

i’ll make some research to see how it will be working and maybe post back something here. If anyone has extra information or reaction to this post, do not hesitate to post a comment.

Here is an article from ZDNET:

It’s a big day for rich Internet applications. Why? You can now find these newfangled Web applications a lot easier. Google, Yahoo and Adobe have teamed to make Flash file format content easier to find….

Read more

IIS Log Archiving

You need to archive your IIS Log often so as not to get your log folder full with HTTP Logs.

I have been searching for some quick implemented solutions for performing this IIS Log archiving task and found some quiet nice discussions and article about it. Here are the links to the different post and forums that talk about a solution to solve this issue:

http://blogs.thesitedoctor.co.uk/tim/2007/02/10/Automatically+Delete+Old+IIS+Log+Files.aspx

http://www.iislogs.com/ (Tool to automate maintenance of IIS Log)

http://forums.webhostautomation.com/showthread.php?t=5053

http://forums.iis.net/p/1022450/1388469.aspx

On my side i need something with a bit more functionality so, i modified some of the scripts that i could find on the different article related above and came up with a solution that can.

  • Compress each log file found in your websites folder
  • FTP the compressed files on a foreign server ( Keeping historic of your IIS log ) Uses Chillkat Free FTP ActiveX
  • Delete them from your disk afterward

You can launch this process everyday and there will be no log that is older than a specified number of days on your server.

Requirement for this solution to work:

You can download the script here.

See the entire script in the full post.

Continue reading “IIS Log Archiving”

BarCamp Mauritius Session

Logo BarCamp MauritiusThis Saturday i attended the first BarCamp in Mauritius, which was a great initiative from the organizers(Pierre Bernard). Even though some of the persons that should be attending did not come, it was really great and everyone that attended the session was really satisfied by the level of discussion and presentations that took place.

Ubuntu Logo The first presentation was on Ubuntu Linux release performed by Malcolm(hobbyist bater bis). He detailed several aspect of the OS as it is becoming more and more popular for it’s ease of use and growing community support. And the possibilities for anyone to have access to a free operating system that enables any user to perform basic PC operating. With slides showing Firefox 3.0 installed by default on the latest version and Open Office with is a pretty good free alternative to Microsoft Office.

Wordpress LogoThen came the intervention of Vincent(bloggeur solidaire humorist), on how to install, manage and optimize a new WordPress installation. His presentation started with the installation of the WordPress zip file in a virtual directory that is used by his Apache server on a local machine. He created a new database using phpMyAdmin and then finalized the installation explaining the purpose of a good prefix for your WP Tables, which is by default “WP_”. After the installing we shown how to use plugins and widgets to enhance your WP Experience and you pages presentation. There was also a small debate on SEO Optimization on WP and how to enable permalinks or clean links to be better reference by search engine. It was a good introduction to WP and how i can be use to perform day to day blogging on the web.

Open ID MauritiusOpenID Mauritius, this conference was performed by our Organizer Pierre Bernard, who will be the representative of OpenID in Mauritius.