Tales from the Evil Empire

Bertrand Le Roy's blog

News


Bertrand Le Roy

BoudinFatal's Gamercard

Tales from the Evil Empire - Blogged

Blogs I read

My other stuff

Archives

May 2006 - Posts

New book on UpdatePanel published by O'Reilly

O'Reilly is publishing my book on UpdatePanel. This is a short work (less than 60 pages) I did with Matt Gibbs that is scenario-focused and gives an in-depth look at the UpdatePanel control of ASP.NET "Atlas".

The book is very reasonably priced at $9.99.

Take your information from the source... Feedback welcome.

http://www.oreilly.com/catalog/atlasupc/

Script# brings compile-time and C# niceties to JavaScript development

I'm very excited to finally be able to point to this post of Nikhil's. I've known about this project from the start and am Super-Ultra-Mega-Excited (this expression (c) Andres Sanabria) about it, but until now I had to keep my mouth shut.

JavaScript is in many ways a very powerful language, but it lacks a compile-time (bye bye type checking) and OOP is very unnatural. While some consider it the best language ever, most people who come from C# or Java just go "ugh!" the first time they have to write anything beyond a click event handler with it. Some continue to strongly dislike it even after they've gained expertise with it. I'm not judging, but...

Wouldn't it be nice to keep the power of dynamic scripting languages but with all the niceties of statically typed languages?

Enter Script#, a project Nikhil started on his spare time (how much spare time this guy has has always been a mystery to me).

Watch the screencast:
http://www.nikhilk.net/Content/Video/ScriptSharpIntro.wmv

Read the first blog post:
http://www.nikhilk.net/ScriptSharpIntro.aspx

And tell him what you think.

Tracing XmlHttp requests: an unobtrusive solution

To trace XmlHttp requests in your AJAX application, there are quite a few solutions. There's Fiddler, of course, and there is Nikhil's excellent browser helper. These solutions still have an important drawback: you have to install them and/or configure them.

If you need a quick and unobtrusive solution to trace your network calls from the browser without installing anything, Julien Couvreur developped this fantastic bookmarklet that instruments the XmlHttpRequest object and adds a nice UI to explore the call history. You can view headers and contents for both the request and the response.

XmlHttpDebugging

Here's Julien's blog post:
http://blog.monstuff.com/archives/000291.html

And here's the bookmarklet:
XmlHttpRequest debugging for IE

To install, just right-click the link and select "Add to favorites". Ignore the security warning (allowing a bookmarklet is potentially dangerous as it opens the possibility for the said script to steal any information on the page and send it to a remote server so only do this on bookmarklets you trust).

Once it's installed, navigate to the page you want to trace and select the script from your bookmarks. The script's UI will appear as an overlay that you can drag and drop around your page.

One thing that can be tricky to do is to trace initial calls. To do that, you'll need to reference the XHR-Debugging-IE.js script directly from within your page, preferably at the end of the page so that it's done rendering when the script initializes (which is a little more intrusive but you can't have everything). Look inside the bookmarklet URL to find the actual URL for the script.

This version works on IE but Julien also has an equivalent GreaseMonkey script that works on Firefox.

Don't play this game
And I mean it. It will just eat up all of your free time. It will keep you awake at night and prevent you from doing anything else. For weeks. Or months. Your significant other will hate it.
Just look on the left of this page and compare my number of posts for April and May. Care to guess when I started playing The Game?
Don't start playing this game or you won't stop.
Oblivion
Posted: May 15 2006, 01:23 AM by Bertrand Le Roy | with 7 comment(s)
Filed under:
GeoTagit: a great mashup made with Atlas

Try this:

http://atlas.dotnetslackers.com/Default.aspx

It's the home page for a mashup application based on geotagging made by Alessandro Gallo (known on the ASP.NET forums as Garbin). Alessandro is a very active user on the forums and one of the best specialists of Atlas. Very nicely done.

Posted: May 11 2006, 12:03 PM by Bertrand Le Roy | with no comments
Filed under:
ScriptDoc: document your Atlas classes

When I was talking at the Journées Académiques last week, someone in the audience asked me about documentation tools for Atlas classes. That was a great question, especially as I had such a tool ready...

This application generates documentation for Atlas client script libraries.

It generates XML documentation files that have the same format as C# documentation files and that can be processed by existing tools such as NDoc.

Documentation is generated from the source code of the classes defined in files and namespaces defined in a project file. The project to use is specified
using the project query string parameter. For example, if you have built the project file myProject.xml in the Projects directory, browsing to
default.aspx?project=myProject will generate the file Output/myProject.xml documentation file.

The tool can work in the absence of specific documentation information in the source code but the usefulness of such documentation will be small.
To include real documentation, you can use the /// comments that are familiar to C# developers with one essential difference: the comments have to be
inside of the class or method definition.

Here's an example of class documentation:

Sys.Data.DataView = function() {
   /// <summary>
   ///   DataView filters its input data through a collection of filters.
   ///   It can also paginate and sort data.
   /// </summary>

   // [... actual definition of the class ...]
}


Here's an example of method documentation:

this.getItem = function(index) {
   /// <summary>
   ///   Gets an item in the filtered data by index.
   /// </summary>
   /// <param name="index">The index in the filtered data of the row to return.</param>
   /// <returns>Null if the row was not found.</returns>

   return _filteredTable ? _filteredTable[index] : null;
}


And finally, here's an example of a property's documentation (notice how the
documentation is on the getter only, not on the setter):

this.get_data = function() {
   /// <summary>
   ///   The data that the view will filter.
   /// </summary>

   return _data;
}
this.set_data = function(data) {
   _data = data;
}

To be able to write the output XML file, the application must have write access to the output directory. For this reason and also because I didn't especially look for possible injection attacks, this application should never be exposed publicly on the Internet. I recommend making it only accessible locally.

One more thing: for all this to work, the application must be installed in an Atlas-enabled application. This means the right web.config, Atlas dll and of course the script files that you wish to document.

You can download the tool (source code included) from this workspace:
http://www.gotdotnet.com/workspaces/workspace.aspx?id=5d6cbdb9-c177-40f2-98db-71ec86a467cc
http://www.codeplex.com/scriptdoc

UPDATE: The 1.0 version, which works with ASP.NET Atlas 1.0 and later and produces data that Sandcastle can use can now be found on Codeplex.

More Posts