The Headphone Effect

I don’t have any solid statistics but I can be fairly confident and say today most of the music is listened to by iPods or other MP3 players (as opposed to Home HiFi or other devices). And that means most of today’s music is listened to by headphones/earphones.

Taking this and applying some evolutionary theory (or Memtics) to it, I think it means songs that sound better in headphones/earphones are doing better than the ones that don’t. Thus if you want to make a music that has a better chance of getting to the top of the charts, make it sound good in headphones: Focus on higher pitch tones rather than base and frequencies that get distorted in the average headphones/earphones!

Meritocracy in Silicon Valley

Evan Williams , the founder of Twitter has made his millions in Blogger. He is very well connected in Silicon Valley and Web 2.0 ecosystem. I also admit that Twitter can be a useful tool: Integrating it with other social networking websites like Facebook or even personal blogs can have good uses.

Everyday there are tens of new websites popping up on the internet providing different services: From URL shrinkers to Corporate collaboration tools. Now if each one of them had the problems Twitter has had for the past couple of months, it would have been dean in the water. Very dead indeed.

It was revealed recently that Twitter has only 1.5 million users. It might sound a lot but compared to many other websites, it is not a lot at all.

I guess Mr. Williams should be very lucky to have such good friends in the media to fan his hype so feverishly so he can manage to increase the number of the users of his service like that.

Parse free text to names

This code is a C# port of this VB code that parses free text into a person’s name. The result includes Title, Pedigree, First name, Middle name, Last name and Degree.

I’ve used this code in iContact (Google contacts for Windows)


using System;
using System.Collections.Generic;
using System.Text;

namespace DataLoad.iContact.WinClient
{
public class NameParser
{
private string _title;

public string Title
{
get
{
return _title;
}
}

private string _firstName;

public string FirstName
{
get
{
return _firstName;
}
}

private string _middleName;

public string MiddleName
{
get
{
return _middleName;
}
}

private string _lastName;

public string LastName
{
get
{
return _lastName;
}
}

private string _pedigree;

public string Pedigree
{
get
{
return _pedigree;
}
}

private string _degree;

public string Degree
{
get
{
return _degree;
}
}

private string[] _titles = new string[] {"Mr.", "Mrs.", "Ms.", "Dr.", "Miss", "Sir" , "Madam", "Mayor", "President"};

private string[] _pedigrees = new string[] {"Jr.", "Sr.", "III", "IV", "VIII", "IX", "XIII"};

private bool IsIn(string text, string[] values, bool caseSensitive)
{
foreach (string v in values)
{
StringComparison compType = StringComparison.InvariantCulture;

if (!caseSensitive)
{
compType = StringComparison.InvariantCultureIgnoreCase;
}

if (text.Equals(v, compType))
{
return true;
}
}

return false;
}

private string CutWord(string text, out string remainder)
{
int p = text.IndexOf(’ ‘);

if (p != -1)
{
remainder = text.Substring(p).Trim();
return text.Substring(0, p).Trim();
}

remainder = string.Empty;
return text;
}

private string CutLastWord(string text, out string remainder)
{
int p = text.LastIndexOf(’ ‘);

if (p != -1)
{
remainder = text.Substring(0, p).Trim();
return text.Substring(p).Trim();
}

remainder = string.Empty;
return text;
}

public NameParser(string text)
{
// title
string word = CutWord(text, out text);
if (IsIn(word, _titles, false))
{
_title = word;
}
else
{
text = string.Format("{0} {1}", word, text);
}

// degree
int p = text.IndexOf(’,');
if (p != -1)
{
_degree = text.Substring(p + 1).Trim();
text = text.Substring(0, p).Trim();
}

// pedigree
word = CutWord(text, out text);
if (IsIn(word, _pedigrees, false))
{
_pedigree = word;
}
else
{
text = string.Format("{0} {1}", word, text);
}

// rest
_lastName = CutLastWord(text, out text);
_firstName = CutWord(text, out text);
_middleName = text.Trim();
}
}
}