Posts
-
C#/.NET: Safe way to convert UTC time to local time when databinding
After reading Scott Mitchell’s article Using Coordinated Universal Time (UTC) to Store Date/Time Values, I decided to do as he suggest and use UTC for a web application I’m building at work. All in all it is fairly easy to deal with UTC in the .NET Framwork. There is a DateTime.UtcNow you can use instead of the regular DateTime.Now property, and there is a DateTime.ToLocalTime method that will convert your UTC DateTime value to the local server time zone, even taking daylight savings time in to consideration. When converting the other way, the DateTime.ToUniversalTime method is provided.
-
CSS trick: Always show scrollbars
Update 2011: Since Internet Explorer now always just display a vertical scrollbar, all that is needed to force a scrollbar in all other non-IE browsers is this:
html { overflow-y: scroll; }
I worked on a site a few weeks ago where the user wanted visible scrollbars no matter how much space the content takes up on the page. Internet Explorer is happy to oblige, just put in a
overflow: scroll;
in your CSS and your good to go. However, Mozilla Firefox wouldn’t play ball. A bit of Googling revealed Mozillas own implementation:overflow-y: scroll;
So to sum up, add the following CSS code to your site if you want the scrollbars visible at all times:
html { overflow: -moz-scrollbars-vertical; overflow: scroll; }
-
Quake dueling guide
Back in October 2005 when Quake 4 was about to be released I decided to write a guide to dueling in Quake. A few years back I was dueling on a fairly high level (at least by Danish standards) in Quake 3 and besides having some experience to share I also though an article like that would help build a good Quake dueling community in Denmark again, by helping aspiring Quakers get some tools to work on their game and not give up right away.