mo.notono.us

Wednesday, July 26, 2006

C#: DateCompiled()

/// <summary>Gets the executing assembly's compile date and time.</summary>
/// <remarks>
/// Assumes that in AssemblyInfo.cs, the version is specified as 1.0.* or the like,
/// with only 2 numbers specified; the next two are generated from the date.
/// version.Build is days since Jan. 1, 2000
/// version.Revision*2 is seconds since local midnight (NEVER daylight saving time)
/// Adapted from code at http://www.thescripts.com/forum/thread226146.html
/// </remarks>
/// <returns>The executing assembly's compile date and time</returns>
public static DateTime DateCompiled()
{
    Version version = Assembly.GetExecutingAssembly().GetName().Version;
    bool isDaylightSavingsTime = TimeZone.CurrentTimeZone.IsDaylightSavingTime(DateTime.Now);
    return new DateTime(2000, 1, 1).
        AddDays(version.Build).
        AddSeconds(version.Revision * 2).
        AddHours(isDaylightSavingsTime ? 1 : 0);
}

Carbonite - unlimited online PC backup for $5/month

Carbonite Online Backup is a (relatively) new offering that Dmitry just told me about.

I'm intrigued by Carbonite's business model. Any time someone offers a flat fee service they must be making a ton of assumptions about average use, and in this case I'm guessing they must be betting on the average PC user having less than 27GB of data

Using S3 as a pricing guideline, and if you spread the cost out over a whole year, AND you figure the average user might need to upload/download the data just twice over a year, then $5/month would allow storing, on average about 27 GB perpetually.

27GB storage per month: 27GB * $0.15/GB-month = $4.05/month
27 GB transferred twice in a year: 27GB * $0.20/GB-transfers * 2 transfers /12 months = $0.90/month
Total costs for Carbonite: $4.05 + $0.90 = $4.95/month

Again, that’s 27 GB of data, not sure how many people have that much data, yet. The average user probably has more like 10-20 GB. Obviously Carbonite must have studied some statistics and must also have made much less wild-ass guesses than mine. I'd say they might be successful - their biggest challenge is most likely going to be to get enough volume to offset their investment in the system and overhead; cost of storage is NOT the issue.



Technorati Tags: , , ,

PC vs Mac Commercial

This is for Andre, who HATES the original ads... (Via Fred Wilson's avc.blogs.com)

Tuesday, July 25, 2006

A Fix() Function in T-SQL

Rob Farley did a nice writeup on how to create A Fix() Function in T-SQL, using TDD concepts to boot.

Final code:

create function dbo.fix(@num float, @digits int) returns float as
begin
  declare @res float
  select @res = case 
    when @num > 0 
      then round(@num,@digits-1-floor(log10(@num))) 
      else round(@num,@digits-1-floor(log10(-@num))) 
    end
  return (@res)
end

Technorati Tags: , ,

Labels:

Monday, July 10, 2006

The Bvich Report: World Cup Final Recap

A rare sports reference on this blog: The Bvich Report: World Cup Final Recap
Soccer players are the biggest pansies I have ever seen in my entire life.

FIFA [should] create a pink card to give to a player who fa[k]es an injury. Not only would they have to miss the next match, but this would also keep track of who are the biggest actors. League leaders in pink cards would have reputations as the biggest pansies in soccer.
Good idea, Bevo...