If there is one thing I don’t like doing – it’s doing the same thing twice or even more! So I was building an application on the side where I need to have a listing that performs a simple countdown. At this point I’ve been lazy and just have it counting down the seconds, but this example would be really easy to update to put a proper countdown of days, hours, minutes, and seconds – and heck if you get really adventurous even weeks, months, and years!
Category: Development
-
JavaScript: Easy Creation of “Countdown Timers”
-
CakePHP Version Comparison with PHP Version Comparison
I’ve seen a few recent blog articles comparing the new version of PHP 5.4 to its predecessors and I thought I should get involved with this a bit as well.
To perform this test, I will layout the conditions I have chosen. I’m trying to keep this as simple as possible. I currently run a Dell Laptop with Windows 7 on it:
Windows NT 6.1 build 7601 (Unknown Windows version Business Edition Service Pack 1) i586
Because I often do a lot of .NET development recently I have PHP running as a CGI under IIS 7.5.
I then created a very simple .NET application that performs 100 requests of the same web page and tracks the response time. These lists of response times are sorted and the highest and lowest responses are dropped. The average is then calculated from this.
-
MVC 3 Routing Example
Below is an excerpt of a chapter from my new book: 20 Recipes for Programming MVC 3.
In today’s heavily fought battles for search engine supremacy, it’s quite difficult to winthe race with a website address that looks like:
http://www.example.com/books/details?id=4.
Using routes, the website can look like:
http://www.example.com/20-recipes-for-mvc3
which provides much more context, both to the user and the search engine.
-
20 Recipes for Programming MVC 3
Yesterday marks the official launch of my second book: 20 Recipes for Programming MVC 3. The book is being published by O’Reilly and is available in both e-book or print edition. I’m quite proud of this book as I’ve feel like my writing style was really able to mature while working with a real editor to bring a great cookbook on ASP.NET’s MVC 3.
The tagline for the book is, Faster, Smarter Web Development and that truly is my goal with all of the recipes in the book. It covers basic material from authentication and emails to more complex features like routing and AJAX – even has an excellent tutorial on converting your website into a mobile site in a few easy steps!
-
ToLower-ToUpper and the CurrentCulture.CultureInfo
I have recently being working on my largest multi-lingual site ever – over 30 languages – in ASP.NET. While implementing it, there have been a lot of bumps and bruises along the way. One of the most recent one was noticing that the ToUpper and ToLower functions in ASP.NET take the CurrentCulture.CultureInfo into consideration.
As you may guess, this is both a blessing and a curse.
When I’m working with text that is to be translated, but should appear upper or lower case this makes perfect sense that the CurrentCulture.CultureInfo should be taking into account. However, be sure you remember this later when you are doing text transformations and text comparisons on words that should NOT be translated (like when using convert date with C#).
At the end of the day, if you don’t want the CurrentCulture.CultureInfo to be used, both functions can be easily overloaded as follows:
String.ToUpper(new CultureInfo(“en”))
String.ToLower(new CultureInfo(“en”))I spent a fair bit of time tracking down why existing code was working perfectly, when suddenly as the team implemented the 8th language, something suddenly started failing. Thank goodness for unit testing to quickly point out that there was a problem – then it was just a matter of understanding it!