How to trim the datetime in c#?

23. August 2009

Last week I need to write something to compare two datetime at the second level. So I have to trim the datetime part after second. There is the function I used to trim the datetime. 

 

public static DateTime TrimDate(DateTime date, long ticks)
{
    return new DateTime(date.Ticks - date.Ticks % ticks);
}

Examples about how to use the function

DateTime datNewDate = TrimDate(oldDate, TimeSpan.TicksPerSecond); 

Easy! 

 

Programming

Do not play your iphone in the subway!!

20. August 2009

Joke

Xbox Gamer Card Widget for BlogEngine.net

20. August 2009

Paul Tumelty had a post about how to add your gamer card into a post. This is a very good extension for BlogEngine.net. But it only works in the post. So I took his idea and developed a simple widget which allows you add your gamer card into your page like a normal web control. Wink

To install: You just need to copy the GameCard folder into the widgets folder. Add the gamecard control into your page and add your gamer tag.

You can download the file below:

GameCard.Zip (1,702 bytes)

Gaming, Programming , , ,

Integrated Security with SharePoint and Firefox

16. August 2009

SharePoint is great for the Intranet. It works very well with Microsoft IE. But if you are a fan of Firefox, you might find some troubles using SharePoint. The most annoying one is integrated security. If you use IE, the only thing you need to do is adding your sharepoint domain url to the security group Local Intranet in your browser settings. Then you can browse the SharePoint site without entering your user name and password all the time. Do you want to enjoy the same thing by using Firefox? Here are things you need to do: 1. Type about:config in url of firefox 2. Filter for "trusted" and you should have 2 rows of keys such as network*trusted*. 3. In each row add the name of your server. You can seperate multiple values using commas. As an example, my portal URL might be http://mymossserver:90 You shoud add myspsserver as values for those 2 rows. Done. :)

Sharepoint