17/10/2008

Generic Self Inherited List

What do you think about this fully legal .Net class name:

public class DynaSeries : List { }

Hmmmm a class that inherits a generic list of itself.

Strange.

Over and Out

22/07/2008

C#: Some useful String Manipulation Functions

String Starts or Ends With Sequence of Characters

This method returns a boolean value if the initial string either starts with or ends with the sought after string (startOrEndsWithTest).

private bool StringStartsOrEndsWith(string initialString,
string startOrEndsWithTest)
{
if (initialString.StartsWith(startOrEndsWithTest)) return true;
int intCheckLen = startOrEndsWithTest.Length;
if (initialString.Length >= intCheckLen)
return (initialString.Substring(initialString.Length -
intCheckLen, intCheckLen) == startOrEndsWithTest);

return false;
}

String Insert Before Search String Method

The following method inserts a string (textToBeInserted) before a search string (insertBeforeText) located in the initial string (initialString).

private string StringInsertBefore(string initialString,
string insertBeforeText, string textToBeInserted)
{
int intPos = initialString.IndexOf(insertBeforeText);
if (intPos == -1) return initialString;
return String.Concat(initialString.Substring(0, intPos),
textToBeInserted,
initialString.Substring(intPos, initialString.Length - (intPos)));
}

String Insert After Search String Method

The following method inserts a string (textToBeInserted) after a search string (insertBeforeText) located in the initial string (initialString).

private string StringInsertAfter(string initialString,
string insertAfterText, string textToBeInserted)
{
int intPos = initialString.IndexOf(insertAfterText);
if (intPos == -1) return initialString;
int insertAfterTextLen = insertAfterText.Length;
return String.Concat(initialString.Substring(0, intPos + insertAfterTextLen),
textToBeInserted,
initialString.Substring(intPos + insertAfterTextLen,
initialString.Length - (intPos + insertAfterTextLen)));
}

03/06/2008

Google: People will pay for web content, says Google

At WAN 2008 Nikesh Arora, the President of Google Europe, Middle East, Africa and VP of UK operations stated the rise of paid news content on the web.

He even goes as far as to predict the demise of the blogosphere and the continued dependence on internet based commodities (mashable mapping, messaging etc. products).

Y0u can read the article here.

This is especially scary as we move the public internet increasingly over private pipes. Will ISPs start charging tolls to content providers to serve paid content? Will we see a CableTV model deployed here with carriers, broadcasters and content holders?

Google is bold in saying this. If I only have content purchased from Toronto Star, TSN, and ESPN - Why in the world would I need search.

Over and Out