|
Posted to:
|
I’ve been distracted by a new jQuery plugin that I’m writing. The plugin has certain situations where it sets various background and foreground colors. You can have it set those styles explicitly or you can have it set a CSS class, and let the CSS stylesheet do the work. I’m writing some unit tests to test the former behavior and ran into an annoying quirk. When testing the color value in IE, I’ll get something like #e0e0e0 , but when testing it in FireFox, I get rgb(224, 224, 224) . Here’s a function I wrote that normalizes colors to the hex format. Thus if the specified color string is already hex, it returns the string. If it’s in rgb format, it converts it to hex. function colorToHex(color) { if (color.substr(0, 1) === '#' ) { return...
|
|
Posted to:
|
It’s Christmas day, and yes, I’m partaking in the usual holiday fun such as watching Basketball, hanging out with the family and eating our traditional Alaskan king crab Christmas dinner. But of course it wouldn’t be a complete day without writing a tiny bit of code! Today I’ve been working on improving the UI here and there in Subtext. One common task I run into over and over is using an anchor tag to trigger the hiding of another element such as a DIV . It happens so often that I get pretty tired of hooking up each and very link to the element it must hide. Being the lazy *** that I am, I thought I’d try to come up with a way to do this once and for all with jQuery and a bit of convention. Here’s what I came up with. The following HTML shows...
|
|
Posted to:
|
Just wanted to wish you all a Merry Christmas, Happy Holidays, or a Happy whatever you are celebrating at this time of year. I hope you are spending it well with family and friends! :) As you can see, I’m still hard at work watching the kids on paternity leave. My brother is a drug dealer and the name of the drug is Call of Duty: Modern Warfare 2 for the X-Box 360. I’m totally hooked right now, and I don’t usually get so hooked on games. At least I am managing to still get some fresh air outside and enjoy the weather. Here I’m walking with my wife (taking the photo), my mother, my son, and my brother. Of course, every walk we go on ends up with me lugging my son around. I wouldn’t trade it for anything. :) Technorati Tags: christmas , holidays...
|
|
Posted to:
|
A couple of weeks ago I helped out on a high CPU issue in an ASP.NET application. Problem description Every so often they started seeing very slow response times and in some cases the app didn’t respond at all and at the same time the w3wp.exe process was sitting at very high CPU usage 80-90%. This started happening under high load, and to get the application to start responding again they needed to restart IIS. Debugging the problem They gathered a few memory dumps during the high CPU situation for us to review and when running the sos.dll command ~* e !clrstack (in windbg) to see what all the threads were doing we found that they were all stuck in callstacks similar to this one: OS Thread Id: 0x27dc (124) ESP ...
|
|
Posted to:
|
When we released ASP.NET MVC 2 Beta back in November, I addressed the issue of support for Visual Studio 2010 Beta 2. Unfortunately, because Visual Studio 2010 Beta 2 and ASP.NET MVC 2 Beta share components which are currently not in sync, running ASP.NET MVC 2 Beta on VS10 Beta 2 is not supported. The release candidate for ASP.NET MVC 2 does not change the situation, but I wasn’t as clear as I could have been about what the situation is exactly. In this post, I hope to clear up the confusion (and hopefully not add any more new confusion) and explain what is and isn’t supported and why that’s the case. Part of the confusion may lie in the fact that ASP.NET MVC 2 consists of two components, the runtime and what we call “Tooling”. The runtime...
|
|
Posted to:
|
In the previous post I had described the steps to secure your Windows Azure tokens and get the necessary Visual Studio templates as well as making your web application Azure ready by adding the cloud project and building against it. Once you have tested the Development Fabric, the instances as well as the application, the next step would be to publish it to the Windows Azure platform. Select the “CloudService1” project that you added to the solution, right click and select “Publish” Once you click on “Publish”, if you are connected to the internet, it would try and open up Azure login screen and once you sign in, https://windows.azure.com/Cloud/Provisioning/Default.aspx If you had received the Windows Azure Tokens, and claimed them (as per my...
|
|
Posted to:
|
You can enable ASP.NET tracing either at an Application level or at a page level; see Tip# 77: Did you know… How to enable Page Level Tracing for your ASP.NET pages? for more information. With the tracing enabled, you can view the trace output in a trace...
|
|
Posted to:
|
First, I’ll start with a little disclaimer: this post is not about whether using dynamic is better/worse than static typing. Instead, it’s about making it more convenient to use dynamic if you choose to go that route . Clearly, some people dislike dynamic, as you can see in the comments in that post from Phil Haack , and for the most part, all the key arguments for/against have been made. So anyway, let’s proceed… Recently, a few people have experimented with extending their view pages from ViewPage<dynamic>. The idea is to then be able to access model data using the more convenient dynamic syntax. e.g. check out this thread on StackOverflow, as well as Phil’s post I mention above. One limitation that people are hitting is that you can...
|
|
Posted to:
|
Earlier I had written 2 posts – Taking your Northwind Database to SQL Azure and binding it to an ASP.NET GridView Part I and Part II . I thought, I will complete the series with a post on moving your ASP.NET Application as well to Windows Azure making it a truly cloud based application. Before we start, there are a bunch of things that you would need to do. First and foremost, you would need a Token for Windows Azure. You can request for a free token for Windows Azure from here after providing your Live ID and a few more details. I am not aware of the current time it takes for receiving a token but in the past it used to be 24 hours. Similarly, if you want to have SQL Azure Tokens, you can get it from here and then login to https://sql.azure...
|
|
Posted to:
|
In October we shipped the public Beta 2 release of Visual Studio 2010 and .NET 4. The feedback on the new features in VS 2010 and .NET 4 has been really great. I’ve been working on a blog series about some of them (lots more posts to go!) and have also had a chance to present them to a broad range of audiences – and it has been great hearing the excitement people have about them. At the same time, though, we’ve also received feedback that the performance and virtual memory usage of VS 2010 Beta 2 is not where people need it to be before we ship. We’ve been doing an intensive performance optimization push the last two months that is delivering significant performance and virtual memory usage improvements across the product. ...
|