Archives
-
Ajax usage survey among .NET developers
Following the more open-sourcey informal study that was recently advertised on Ajaxian, Simone Chiaretta publishes and analyses the results of his own study that he recently made and that is aimed exclusively at .NET developers. While Richard Monson-Haefel's study is being made for the third consecutive year, which makes for some interesting trend information, Simone's analysis is more directly interesting to us. The differences between the results of both studies for .NET developers also goes a long way showing how such data crucially depends on who you're asking. Case in point, it's pretty clear that the intersection of Ajaxian readers and .NET developers is much more open-source-oriented (not that there's anything wrong with that) than the mainstream .NET developers.
-
D'oh! I guess they didn't think about that one...
Too funny:
http://nldd.lordabdul.net//12.html -
What InterpolationMode and CompositingQuality to use when generating thumbnails via System.Drawing
For some reason I keep writing photo thumbnail generators lately. The last time was this week for an internal app building contest. One thing that I never seriously investigated before was how to optimize the quality of the generated thumbnails. So today I wrote a small benchmark that compares all combinations of InterpolationMode and CompositingQuality values and that measures the time each takes when generating small thumbnail versions of different images.
-
How to build the best fake music instrument set for Guitar Hero and Rock Band
Here's how to build an instrument set with two guitars/basses, a drum set and a mike that will work for Guitar Hero and Rock Band.
-
Does JavaScript need method overloading?
John Resig of Mozilla and jQuery fame has a very interesting post about method overloading in JavsScript. In a nutshell, he proposes a utility function that gives a relatively simple way of overloading a method. The different versions are distinguished by the number of arguments (not their types). Another way of seeing it is that he factors out into a single place code that would usually be at the start of the method. Go check it out, it's a really interesting use of closures. I'll wait until you're done.
-
Arbitrary Criteria Game Review: Portal is as delicious as cake
What a great time to be a gamer. It seems like there is no end in sight to that steady stream of excellent games. We already got Bioshock, Halo 3, the Orange Box, Guitar Hero III, and we're waiting for Rock Band, Mass Effect, all before Christmas. What we lack is time to play them all.
-
JavaScript stack overflow
Here's one that some of you may have seen before, but I thought I'd post it to save some time to those who didn't.
-
Microsoft now in the OpenAjax steering comittee
Thanks to all members who voted. I'm looking forward to working with the other members.
-
.NET framework: now with source code
Scott just announced it:
http://weblogs.asp.net/scottgu/archive/2007/10/03/releasing-the-source-code-for-the-net-framework-libraries.aspx -
JSON-style dictionary parameters in C#?
Eilon has an interesting post about using the new anonymous object initializer syntax in APIs that take dictionaries. The end result looks very much like the JSON parameterized function calls that are very common in many JavaScript frameworks, which shows once more how C# is getting many of the nice features of dynamic languages while remaining statically-typed. While I wouldn't use that just to get named parameters like those frameworks are often doing, it looks well-justified in this context because the parameter it's being used for is actually not predetermined.
-
OpenAjax InteropFest 1.0: Microsoft's entry
Yesterday I got to write our entry in OpenAjax's InteropFest. The goal of this event is to demonstrate how different Ajax libraries can be parts of the OpenAjax ecosystem and interact with each other through the OpenAjax hub. The currently central feature of the hub is to expose a publish/subscribe message bus so that both producers and consumers of events can speak through a third party that is neutral to specific Ajax implementations.
-
Should I use a type attribute on script tags?
I have immense respect for Douglas Crockford, but that doesn't mean I can't disagree with him... Douglas has written on a number of occasions that he prefers plain script tags, with no attributes. The argument goes like this:
"This script block uses the
language
attribute. This was a feature that was introduced by Microsoft in order to support VBScript. Netscape then adopted it to support its own nonstandard deviations. W3C did not adopt thelanguage
attribute, favoring instead atype
attribute which takes a MIME type. Unfortunately, the MIME type was not standardized, so it is sometimes"text/javascript"
or"application/ecmascript"
or something else. Fortunately, all browsers will always choose JavaScript as the default programming language, so it is always best to simply write<script>
. It is smallest, and it works on the most browsers." -
Plastic X-plorer paint job
The guitar Harmonix chose for the Xbox 360 version of Guitar Hero II is not exactly my favorite guitar. The Gibson X-plorer just reminds me too much of german hard-rockers from the eighties... and mullets. Harmonix' plastic rendition of the guitar doesn't look any better than the original of course, and white doesn't help. I've seen things at Toys'R'Us that look less toy-like. I can't do much about the shape but seeing that I had already done a red paint job on my faceplate a while ago, I thought that at least the color had to change.
-
How to build a cross-browser history management system
When we built the history management feature in ASP.NET Futures, we spent considerable time experimenting with the different behaviors of the main browsers out there. The problem with such a feature is that it has to rely on a number of hacks because browser vendors basically never anticipated this need. Now they're thinking about it, so all this may be simplified in a few years, but in the meantime, it's a very complicated feature to build. One of the things that struck me was how little reliable literature is available on the subject. There is a lot of partial information, lots of false or unverified information, but very little that's really comprehensive, reliable and up to date. Good references I found include Brad Neuberg's Really Simple History and Handling Bookmarks and Back Button as well as Mike Stenhouse's Fixing the Back Button and Enabling Bookmarking for Ajax Applications. But it was a lot easier to just experiment directly on the different browsers and verify our theories directly.
-
Is Bioshock perfect game design?
Yes.
-
ASP.NET Ajax in action available
It's my great pleasure to announce the availability of ASP.NET Ajax in action by Alessandro Gallo, a.k.a. Garbin, David Barkol and Rama Vavilala. It's a great resource to anyone working with ASP.NET Ajax and it's been written by some of the best specialists (check out how many forums posts they have on http://forums.asp.net/). It's also been my great honor to write one of the forewords (the other one is by Scott Guthrie, who wrote more than half of the ASP.NET books forewords out there ;).
-
ASP.NET Alerts available with source code on CodePlex
I just finished the migration of the ASP.NET Alerts project to CodePlex.
-
Blog gets new title
I have to admit I've always been a little jealous of blogs that have cool titles or urls. I was also getting tired of the default Community Server skins, which are nice, but that I see a little too often on other people's blogs.
-
Seven deadly sins of game design
There are a few very obvious game design flaws that for some reason still commonly get perpetuated today. They're especially infuriating when found in otherwise good games. The only explanation I could find was artificial lifetime enhancement, which is a bad idea because it can in reality dramatically shorten the lifetime of the game since many gamers just won't want to finish it. Which also means that they won't buy the sequel either.
-
Hierarchical data sources migrated to CodePlex
I just migrated my ObjectHierarchicalDataSource and CompositeHierarchicalDataSource projects from GotDotNet to CodePlex.
-
ScriptDoc 1.0 available
ScriptDoc is a tool that extracts documentation from JavaScript files and packages it into XML files that can be consumed by documentation building tools such as Sandcastle. The 1.0 version is now able to extract documentation from doc comments as well as from the structure of the code itself. It generates a documentation file that uses the same format as C# doc comment files and a reflection file that describes the structure of the object model and that follows the same schema that Sandcastle is using.
-
Outlook pst file repair tool
Yesterday, I was doing some mailbox cleaning after a week away from the office taking care of my family (that now counts one more little girl), and I suddenly got unable to move e-mail from the inbox into folders (a message was telling me the message was already gone even though I was staring at it). Restarting Outlook or even rebooting didn't help. Despite the sleep deprivation, I immediately suspected .pst or .ost file corruption.
-
IE6's main memory leak hot-fixed
I just learned through Ajaxian that IE6's main memory leak has been hot-fixed two weeks ago through Windows Update.
-
PhotoHandler migrated to CodePlex
I just finished migrating my PhotoHandler workspace from GotDotNet to CodePlex. I have got to say that I really like what I'm seeing in CodePlex, from source control tools to the general look and feel of the web site.
-
Why Safari for Windows looks like a Mac application
One thing that really stands out in the Windows version of Safari is that it's exactly identical to the Mac version, almost down to the pixel level. That must have been quite a pain to achieve, and it would probably have been way easier to use the OS for many things. Does Apple really think PC users will go "gee, that Mac UI is really sweet, I think I now have an uncontrollable urge to buy a Mac"? Probably not.
-
Is Safari on Windows a good thing or a bad thing?
The first thing most web developers probably thought this morning when they learned about Safari for Windows was "oh man, yet another browser to test in". And yes, for the moment, that's what it amounts to. Coincidentally, I have spent a good part of last week making the history management in Microsoft Ajax work in Safari 2.0.4. I got it to work fine (after much Apple cursing), so the first thing I tried after I downloaded Safari 3 beta was my history tests. And sure enough, it breaks in new, unexpected ways. History management is pretty much a big hack that is different on about all browsers (Firefox and Opera are the nicest ones here, with predictible, similar behaviors). And sure enough, Safari 3 brings a totally unheard of model. I didn't find a way yet to create a new entry in history from script that doesn't navigate away from the page. None of the old Safari tricks work anymore (they were probably and rightfully considered bugs and were fixed). They weren't replaced by the more rational things that work in Firefox and Opera. Even the iFrame trick that we use on IE doesn't work because Safari now crashes if you try to dynamically add a frame to the DOM. If anybody here found a way to do that, I'd love to hear about it.
-
Photo Album works on Windows Home Server
I was super-excited to learn that Andrew Grant was able to run the Photo Handler unmodified on Windows Home Server. This is actually one more reason for me to put Home Server on my to-buy list. I shoot thousands of pictures a year and only upload the very best on Flickr. But the reason why I enhanced Dmitry's handler to make it my own was that I wanted photo publishing to be as simple and as fast as possible, and a natural part of my workflow. Today I'm using a small web server that I built and that sits in my basement so that I can just dump photos on the server using a simple share but using Home Server for that would just rock. Anyway, if you have a Home Server and want a lightweight way to publish your photos, this is for you:
http://www.andrewgrant.org/2007/06/09/how-to-create-a-windows-home-server-photo-album-in-minutes.html -
Semicolon expected?
If you're seeing a lot of JavaScript errors on web sites today, more accurately on pages that have Google AdSense, well, you're not the only one:
-
Old iPaq and Media Player 11?
This is so frustrating I thought I'd just make a blog post and see if someone has a solution. I have an old HP iPaq of the 1900 series, partnered with my Vista Laptop. I like that old PocketPC because it's fairly slim, easy to program and runs a few nice emulators like the ScummVM (mmmh, Sam & Max...). Anyways, every single freaking time I launch Media Player on the laptop, if the iPaq is docked, I'm getting a dialog box that says "your device is using an outdated driver that is no longer supported by Windows Media Player. For additional assistance, click Web Help." No "don't show this again" checkbox, you have to endure the dialog every single f*#$% time.
-
Surface computing is here
Just amazing. I had seen this at internal Microsoft events and knew that something was cooking, but it's almost here. Not just a cool tech demo anymore but something that launches this winter and can already be used at the New-York Sheraton.
-
Microsoft Ajax events - part 2: exposing events from custom classes
-
The Wiimote doesn't work...
... for anything else than aiming and frantically moving up and down. In other words, slow movements aimed at the screen work well, as do fast, imprecise movements, but anything else is impractical.
-
Microsoft Ajax events - part 1: subscribing
When building Ajax applications, you basically deal with two kinds of events. First, there are DOM events, and second, events from JavaScript objects. This second category is not part of the EcmaScript specs (or of the DOM specs, of course) so each framework needs to define its own pattern to expose events. This makes it more difficult for developers to include components built on different frameworks into a single page, which is one of the problems that OpenAjax tries to solve. I'll get back to this in a future post and show how to integrate Microsoft Ajax events in the OpenAjax hub.
-
What?????
I just don't understand Sony's PR strategy...
http://www.dailymail.co.uk/pages/live/articles/news/news.html?in_article_id=451414&in_page_id=1770&ct=5 -
Woohoo! I'm on TV!
The latest episode of the .NET show is all about ASP.NET Ajax. Brad and Matt first have a really interesting discussion of the history and architecture of ASP.NET Ajax and then you can see me demo-ing UpdatePanel, extenders and localization.
-
PrtSc now useless... or maybe not.
While looking for the character map in the accessory folder of Vista, I found a little gem that I just have to share. Vista now has a Snipping Tool that enables you to capture parts of the screen, highlight and draw on top of it and copy or save the results. Some would say it's about time and that there's about a million freewares that do this already, I'm just happy to have found it right there in Windows. It can even take non-rectangular snips:
-
The format for JavaScript doc comments
Xml documentation annotations are going to drive JavaScript IntelliSense in Visual Studio Orcas (the next version of Visual Studio). For more than a year now, we've been including xml doc comments to all public APIs in the Microsoft Ajax Library (which are a great place to check out some examples of those comments). We also use the doc comments to automatically generate parameter validation code in the debug version of our scripts.
-
How to keep some context attached to a JavaScript event handler?
The problem is the following... You want to attach a handler to a DOM event but you want some information to remain associated with it. Let's say for example that the handler is a method of an object that makes use of the "this" pointer somewhere in its body (as it should, otherwise it should probably be static). As the API to attach a handler just takes a function pointer, and the "this" pointer is determined by the DOM element that triggered the event, it seems difficult to do. The Microsoft Ajax Library (like almost all Ajax libraries, let's be honest) provides an easy way to work around that. If you call:
-
OpenAjax meetings
It was my great pleasure to be at the face to face OpenAjax Alliance meetings for the first time last month. Thanks to the nice people at IBM for hosting them. I really enjoyed the discussions with Alex from Dojo, Gideon from OpenSpot and many others. There were also great demos of OpenAjax-based interoperability.
-
Scott on JSON hijacking
Scott has a great post on how ASP.NET Ajax has built-in mitigations already in place for JSON hijacking attacks:
http://weblogs.asp.net/scottgu/archive/2007/04/04/json-hijacking-and-how-asp-net-ajax-1-0-mitigates-these-attacks.aspx -
ASP.NET Ajax UpdatePanel PDF erratum
I corrected a few remaining errors in our O'Reilly shortcut on UpdatePanel (mainly references to the old Atlas codename). If you already bought it, you can download the new version for free. And if you haven't, what are you waiting for? ;)
-
Microsoft joins OpenAjax
I'm extremely pleased to announce that we're joining OpenAjax today and that I'll represent the company in the organization's meetings starting this Thursday. This is a way for us to ensure that our user community can combine the Microsoft AJAX Library and ASP.NET 2.0 AJAX Extensions with other frameworks, today and in the future. Interoperability in the browser is a hard problem but it opens key Ajax scenarios. An industry-wide organization such as OpenAjax is a great way to ensure this goal is met in the long-term.
-
What are these Foo$Bar$baz functions in the Microsoft Ajax Library files?
If you've looked at the debug version of our JavaScript files, you may have noticed code similar to that:
-
How to manipulate files inside Inetpub/wwwroot all day without being bugged by UAC
A lot has been written about UAC. Some choose to disable it. I chose not to and I'm doing just fine. At least, I don't have to type in my password on every prompt like on some other OS that likes to mock us on TV ;)
-
UpdatePanel PDF updated for ASP.NET Ajax 1.0
The PDF document that I wrote with Matt Gibbs a while ago on UpdatePanel is now up to date and in sync with the RTW (Release to Web) version of the ASP.NET 2.0 Ajax Extensions. It's a 60 page document that teaches how to use the UpdatePanel control to incrementally "ajaxify" an ASP.NET 2.0 web site. The booklet comes with downloadable code samples that are immediately applicable in the real world.
-
What happens when Mozilla, Microsoft and Opera get together under Douglas Crockford's moderation?
A very interesting conference that's available from Yahoo!. Douglas Crockford's introduction is worth the watch in itself but the others also have very interesting things to say.
-
ASP.NET Ajax-aware JavaScript IntelliSense available from the Orcas CTP
This is an absolutely awesome feature. IntelliSense / autocompletion for JavaScript is a difficult problem (because of the dynamic nature of JavaScript) which the Visual Studio team is brilliantly solving. They were able to build an elegant solution to the problem that works reasonably well on plain JavaScript, but really shines when used with ASP.NET Ajax. The type information that we added to our debug scripts through doc comments really helps in making the whole experience seamless.
-
How to work around the access denied cross-domain frame issue in ASP.NET Ajax 1.0
Some users have run into an issue when hosting ASP.NET Ajax applications in a frame or iframe that's in a different domain from the top-level window. If you try to do that and browse to the page using IE, you'll receive an "access denied" error client-side any time a DOM event is raised in the frame. The code that's responsible for that is Sys.UI.getLocation. This is a tricky piece of code that determines the pixel coordinates of a DOM element relative to the top-left corner of the page, so that an absolutely positioned child of the body using these coordinates would exactly cover the element you measured. This is useful for drag & drop, popup scenarios like auto-complete and when an event is raised to get mouse coordinates relative to the event source. This is this last piece that explains the problem. The code in this method is different for each of the browsers that we support because each one of them has its own behavior that cannot be determined as we usually do by dynamically looking at capabilities. You just have to know for example that browser X is not counting an element's scroll position if it's absolutely positioned and a direct child of body (names changed to protect the guilty). That's the kind of problem we had to work around. Luckily, IE has two very handy methods to retrieve this kind of coordinates that enables us to bypass completely a number of bugs that we just couldn't efficiently work around: getClientRects, which gets all rectangles the element occupies on the page, and getBoundingClientRect, which returns a single rectangle that bounds the whole element. In the method that we shipped, we've been using getClientRects and getting the first rectangle because we wanted to have consistent behavior across browsers even if the element is a wrapping element such as a span: in this case, the top-left corner of the element is the top-left corner of the first bounding rectangle, which is different from the top-left corner of the global bounding rectangle:
-
We shipped!
I'm very proud to announce that ASP.NET Ajax 1.0 shipped this morning. This is the result of all the work we've done since the first CTP and of all the very valuable feedback from our early adopters. I can't stress this enough: this product is probably one of the Microsoft products that incorporated the most user feedback. It is also to my knowledge the first time that Microsoft releases the full source code for a supported product (yes, we have full 24x7 support for ten years).