h1

Code Retreat Chicago

September 21, 2009

I participated in Code Retreat Chicago this past Saturday. Code Retreats are gatherings of developers who want to practice coding and learn while pairing with others on a given problem.  There have been other Code Retreat events, and this one was organized by Corey Haines and generously hosted by ThoughtWorks.  The format could be summarized as follows:

  1. Find a pair to work with.
  2. Work on a solution to the problem for 45 minutes.
  3. Discuss anything interesting from the 45 minute session with the entire group.
  4. Delete the code you wrote.
  5. Repeat 5 or 6 times

The secret sauce to this format is the selection of a problem that can’t be completely solved during a 45 minute session, and the mandate that all code be deleted after each session.  This frees everyone from any pressure to finish and permits experimentation with different approaches to the problem or development techniques.

The problem we worked on was Conway’s Game of Life.  It was really interesting to see the progression of the groups each session.  Most groups spent the first session exploring how the rules affect each cell in the game.  In retrospect, this wasn’t the best way to define the externally visible behavior of the system, but I think it was the natural place to start to begin to understand the problem domain.

As more sessions were completed, most groups seemed to begin focusing on the behavior of a container or world in which the cells live, and later testing for specific inputs and outputs to a generation or cycle of the game container.  I don’t know if that’s just a natural way to approach this problem, or if the cross-pollination resulting from group discussion and pair swapping led to a collective group thought process.

This Code Retreat was done in Ruby, whereas previous retreats had used Java.  Corey said that Ruby seemed to allow people to get further into the problem.  I’m relatively new to Ruby and still primarily use Java during the day, and I do think Ruby made it easier to bang out some quick ideas than would have been possible in Java.

My experience at Code Retreat reinforced my impression that pairing with others is a great way to learn a lot quickly.  Whether it was a TextMate shortcut, RSpec syntax, a Ruby library class, or a different way of thinking about the design, I learned something from every person I paired with.  And even though I’m pretty new to the Ruby toolset, I think there were a few times I showed my pair something they didn’t know, too.

That said, a Code Retreat is probably not a good way to learn a language, so you should have some baseline ability to use a Code Retreat’s language of choice before attending.

Thanks to Corey and ThoughtWorks for making all this learning possible.  I’d definitely like to attend future retreats and recommend them to anyone looking to practice their coding skills.

Corey took some pictures of the day’s festivities.

h1

Bookmarklets, Twitter, TinyURL, and bit.ly – Lessons Learned

September 10, 2008

When I first started playing with Twitter, I wanted to be able to easily post the link of any page I was reading in a tweet.  That was easy enough when browsing on my computer, but the lack of cut and paste on my iPhone seemed to make it impossible to share pages found while browsing the internet in my pocket.

Then I remembered that bookmarklets can be used to add a lot of functionality to the iPhone.  Surely, I thought, someone has written a bookmarklet to shorten a URL and post it to Twitter.  And I was right, but nothing I found was exactly what I was looking for.

  • TwitThis is dependant on the third party TwitThis.com and requires entering your Twitter name and password into that site.  Non-starter.
  • A post at myopiclunacy was promising, but turned out to require setting up a PHP page on a server.  I was looking for a 100% browser solution.
  • The URL shortening services such as TinyURL, bit.ly, and is.gd all provide stock bookmarklets, but those don’t address the Twitter posting.

C’mon, I thought, I’m not the first guy wanting to Twitter from an iPhone.  Why has no one written a simple bookmarklet that calls the shortening service API for the current URL and then redirects the user to Twitter populating the status textbox with the shortened URL?

As usual, the internet is smarter than me, and there are a few reasons why my dream bookmarklet doesn’t exist.

Twitter Shortens URLs Automatically

As you may have been screaming at me to this point, Twitter already does URL shortening.  Just include your long URL in your tweet, and if it’s longer than a certain number of characters, Twitter calls TinyURL behind the scenes and includes the shortened URL in the tweet that everyone sees.  Knowing that, you can just populate the full URL of the current page to the Twitter status textbox with the following bookmarklet:

javascript:void(location.href='http://twitter.com/home?status='+location.href)

To try it, just create a new browser bookmark and copy the above line as the bookmark location.  And with that bookmark synced to my iPhone, I can easily post a tweet linking to the great site I’m on right now.

However, this solution is not perfect:

  1. TinyURL is the only option.  If you are preferential to bit.ly or is.gd, too bad.
  2. When you visit twitter from an iPhone (and likely any mobile browser), you get redirected to Twitter’s mobile site.  The status text box on the mobile site only allows 140 characters of input.  So if your URL is 80 characters, you only have 60 characters left for the rest of your tweet despite the fact that the URL will eventually be shortened.  And URLs can get a lot longer than 80 characters.
  3. It can be ungainly to type the rest of your twitter post into the mobile site when the input box is already populated with a long URL, especially if you were hoping to add text both before and after the URL.

Bookmarklets Can’t Do That

If no one else was going to write the obvious URL-shortening Twitter bookmarklet, I guessed it was up to me.  I came up with the following, formatted for readability:

javascript:(function(){
var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
if (!xmlhttp && window.createRequest) {
	try {
		xmlhttp = window.createRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
var url = escape(location.href);
 //xmlhttp.open("GET", "http://tinyurl.com/api-create.php?url="+url,true);
 //xmlhttp.open("GET", "http://is.gd/api.php?longurl="+url,true);
 xmlhttp.open("GET", "http://bit.ly/api?url="+url,true);
 xmlhttp.onreadystatechange=function() {
  if (xmlhttp.readyState==4) {
   location.href="http://twitter.com/home?status=" + xmlhttp.responseText
  }
 };
 xmlhttp.send(null)
})()

Everything up to the declaration of the “url” var is boilerplate code to get a browser-appropriate XMLHttpRequest object, which is needed to call the URL shortening service.  Next, we open a connection to the REST API at our URL shortening service of choice.  Then we set a function to be called when the request is complete that redirects us to Twitter with the shortened URL.  Finally, the request is sent.  Awesome, right? 

Too bad it doesn’t work.

If you want to try the bookmarklet, create a new bookmark with the crunched version of the above code (remove the line breaks):

javascript:(function(){var xmlhttp=false;if(!xmlhttp&&typeof XMLHttpRequest!='undefined')
{try{xmlhttp=new XMLHttpRequest();}catch(e){xmlhttp=false;}}
if(!xmlhttp&&window.createRequest){try{xmlhttp=window.createRequest();}
catch(e){xmlhttp=false;}}var url=escape(location.href);
xmlhttp.open("GET","http://bit.ly/api?url="+url,true);
xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){
location.href="http://twitter.com/home?status="+xmlhttp.responseText}};
xmlhttp.send(null)})()

When you click the bookmark, nothing will happen and you’ll see an error in your browser’s javascript error console saying something like “Access to restricted URL denied” or “NS_ERROR_DOM_BAD_URI”.  The problem is that, for security reasons, browsers do not allow the XMLHttpRequest object to open connections to any server other than the one hosting the current page.  What might not be obvious (and wasn’t to me) is that javascript in a bookmarklet is considered part of the current page, so opening a connection to any URL shortening service using my bookmarklet will fail because that service is on a different server than the current page.  (The interesting exception to this is if you are actually on the web site of the URL shortening service.  In fact, the bookmarklet code above does work if you are on bit.ly’s site.)

So I guess that explains why I can’t find the bookmarket I want on the internet anywhere.  At least the next person to try will have this failure story to save their time.

Wait a Minute! That bit.ly Bookmarklet Actually *Is* the Holy Grail

It wasn’t until I starting writing up this post that I took a closer look at the stock bit.ly bookmarklet and said, “What is that javascript doing?”  And to my surprise, it does something genius.  If you want to try it, go to bit.ly and drag the bookmark link to your browser toolbar, or create a new bookmark and add the following code as the location (remove the line breaks):

javascript:var%20e=document.createElement('script');
e.setAttribute('language','javascript');
e.setAttribute('src','http://bit.ly/bookmarklet/load.php');
document.body.appendChild(e);void(0);

It adds a sidebar to the current page with content pulled from bit.ly’s site, and the sidebar includes the shortened URL and links to various services, including Twitter.  I haven’t dug into exactly how it works, but I think it does the URL shortening on the server side and thus avoids the problem I ran into above.  And it works like a charm on my iPhone.  So a tip of the hat to bit.ly.  This is the bookmarklet that I’ll be using.

h1

Microsoft Technology Summit 2008 – Conclusions

September 9, 2008

These dated notes went missing for a while, but have been recovered.  Although their relevance is greatly diminished, I’m posting them anyway for anyone trying to find out what MTS is about.

This is my third post on the Microsoft Technology Summit which I attended on Microsoft’s Redmond campus.  This post contains my overall observations on the summit and Microsoft’s motivations for hosting it.  My summaries of the first two days of sessions can be found here and here.  MTS is a conference of technologists and bloggers invited by Microsoft to hear updates about various Microsoft products and initiatives and to provide feedback. Most of the attendees are experts in technologies and communities that aren’t closely, if at all, associated with Microsoft.  Full disclosure: Microsoft paid for my travel, lodging and food during the summit.

Why did Microsoft do this?
The summit was an interesting beast.  It was a really interesting group of bloggers and developers from all over the world listening and commenting on a set of topics all related to Microsoft technology.  Most of the attendees were not likely to be users of the technology and in fact could be described as critics.

So the big question we all had going in to the summit was “why is Microsoft doing this?”  Sado-masochistic tendencies didn’t seem to be a likely answer.  One common notion led to the IRC back-channel at the summit being set up as #brainwashcamp.  However, I think there were several motivations for holding the summit:
1.  Feedback – I do believe that some folks at Microsoft really do want to hear what the company’s critics have to say in an effort to improve the company.  The summit could be viewed as an effort to compile feedback from non-Microsoft thought leaders and distribute it internally.
2.  Exposing MS leaders to criticism – This summit was my first internal perspective on Microsoft, and one revelation I had was something that should have been obvious beforehand if I had thought about it: Microsoft is a huge company with many different groups and agendas.  A lot of groups do their own thing and the agendas don’t always line up.  I got to wondering if one motivation of the group that organized the summit (Sam Ramji’s Platform Strategy group from what I could tell) was to line up leaders from internal Microsoft teams and then ambush them with the (at times very) critical opinions that would certainly come from the people who had been invited to attend.  Sometimes you don’t listen to differing opinions from those in your family and it takes an outsider to open your eyes to your own faults.
3.  Goodwill generation – It’s hard to hold a broadly negative opinion of an organization once you’ve met some nice people who are a part of it.  I don’t know that the summit could (or did) change anyone’s mind about specific criticisms they had of Microsoft’s technologies and policies, but it’s indisputable that some of the Microsofties are nice, intelligent, honest people who just want to do their job well and improve their company.  I’m sure many people, myself included, left the summit with an opinion of Microsoft that, if not more positive, was at least more nuanced and less monolithic.
4.  BrainwashCamp – It’s impossible to dismiss the idea that on some level, Microsoft would hope that some attendees would leave with a positive opinion of Microsoft’s policies and wanting to use some of their technology.  They probably are not naive enough for that to be the only motivation in holding the summit, but it’s likely that there was some hope that people’s minds could be changed.

People had different attitudes during the summit.  Some were downright snarky and took every opportunity to needle the presenters.  Others were less vocal but clearly disagreed fundamentally with Microsoft’s positions on pretty much everything; they disassociated themselves from presentations as the summit went on.  Some attendees paid attention to the presentations, but didn’t provide much feedback, and some consistently asked questions, offered insights and constructively criticized the presenter’s points.

Of course everyone had their unique perspective.  I talked to Joris Komen who is responsible for rolling out computers to schools in rural Namibia.  His biggest problem with Microsoft is that the only way to get hot fixes for Windows is to have each computer independently run Windows Update and download the patches from Microsoft’s US servers.  Bandwidth costs in rural Namibia are exorbitant, and many areas only have 4Kbps connections.  Patch Tuesday saturates these networks and result in huge bandwidth bills.  Not surprisingly, this kind of issue was not discussed at the summit, but it was a very interesting reminder that not everyone is worried about rich internet applications, social networking, and the latest language features.

Microsoft did request feedback on the summit format, and the most vocal comment was that the summit should be run as a barcamp.  When the group was asked who would attend next year if a barcamp format was used, it was hard to find a hand that wasn’t up.  It would be interesting to know if Microsoft takes that advice for MTS09.

h1

Microsoft Technology Summit 2008 – Day 2

September 9, 2008

These dated notes went missing for a while, but have been recovered.  Although their relevance is greatly diminished, I’m posting them anyway for anyone trying to find out what MTS is about.

This is my second post on the Microsoft Technology Summit which I attended on Microsoft’s Redmond campus.  This post is a summary of the Day 2 sessions.  My post about Day 1 can be found here.  MTS is a conference of technologists and bloggers invited by Microsoft to hear updates about various Microsoft products and initiatives and to provide feedback. Most of the attendees are experts in technologies and communities that aren’t closely, if at all, associated with Microsoft.  Full disclosure: Microsoft paid for my travel, lodging and food during the summit.

Microsoft Open Source Software Lab
Annandeep Pannu, Senior Program Manager for Platform Strategy, gave an introduction to the Microsoft OSS Lab.  The lab’s mission is to foster mutual respect and understanding between MS and OS community such that both act responsibly toward each other.

Recent projects the lab has completed include:
- Windows Media Player 11 Firefox interop
- Silverlight/Moonlight firefox interop
- SQL Server drivers Java/PHP interop
- FastCGI Java/PHP/Python interop
- Firefox on Vista
- SAMBA interop with file and print services

Current projects include:
- Hyper-V Linux interop
- WS-Man compliance tool (system management)
- PHP Pear/ADOB Abstraction (PHP interop)
- ASF Technology Transfer (Apache interop)
- cardspace relying party (Java/PHP/Ruby/C interop)
- HPC Linux/Windows environment (identity integration, file server integration, resource manager interop)

In answer to an attendee’s question, Pannu stated that Microsoft has no plans to port Office apps to Linux.  It is a fundamental belief of the lab that Windows is the best OS.  As such, their efforts will always be focused on letting other systems integrate with Windows, not porting Windows applications to other systems.

IIS7 Product Overview
Bill Staples, Principle Product Unit Manager of the IIS Product Division, went into a lot of detail on the new version of Microsoft’s web server, IIS7.

He was one of the few presenters that didn’t reuse their presentation from the MIX08 conference, instead opting to just demo the product.

Microsoft has been working on IIS7 for five years.  They decided that every IIS7 feature must be built on public APIs in order to have as little of the server built into the kernel.  I’m sure this was motivated by security concerns; the less server code running in the kernel, the fewer potential exploits that would provide kernel access.  To accomplish this, they added a slim request/response API with an extensibility model. All other features are modules that can be added/removed as needed, a la Apache.”  Also borrowing from Apache, the “configuration repository”  for the server is an XML file.

IIS7 is clearly a huge improvement over IIS6, but Staple’s audience grilled him on why they should be excited about this stuff considering Apache has done all of it for a long time.  Staples commented that Apache/Linux is a great solution and that now developers have a similarly modular option on Windows.  Apparently the company position is that Apache doesn’t run on Windows!  IIS7 only runs on Vista and Windows Server 2008.

One differentiator is the GUI admin tool that is built on top of the XML configuration file.  It’s pretty much what you’d expect from a Windows management interface.  All of the configuration can also be done from the command line apparently.  Site specific IIS config can be controlled via an XML web.config file located in the site’s root directory.

As a demo, Staples created a WordPress blog and served it with IIS and the FastCGI module.

Output caching allows dynamic content to be cached for period of time (eg 30 secs).  Staples showed how this dramatically improved IIS/FastCGI/WordPress performance.

By default, sites run in separate processes.  IIS7 will eventually include a new URL rewriting feature which has not yet been publicly released.

IIS7 does include a cool feature called Bandwidth Throttling.  A site can be configured to respond to a request for certain media types with a temporary burst of very high bandwidth for a few seconds, then continue with bandwidth throttled at a percentage (better be >= 100) of the media file bitrate so that the downloading stays just ahead of the media player.  The point is to save bandwidth in the situations where a user only watches the first few seconds of a media clip by avoiding serving the entire clip during that time.  In the event of a network interruption, IIS increases bandwidth allocation.  Does Apache have this capability?

So IIS7 looks great compared to IIS6, and developers and sysadmins who have no choice but to use the Microsoft stack should be excited about it.  Those who use Apache probably don’t have any new motivation to switch, with the possible exception of the bandwidth throttling feature.

The Microsoft Local Software Economy
John Fernandes, Director of International Business Development discussed Microsoft efforts to foster healthy local software economies in international communities.  Local governments have asked Microsoft what they can do to help with the local economies, and this program is the eventual answer.

Local Software Economy Initiative
-builds self-sustaining ecosystems though local partnerships in 70+ countries
-helps governments drive prosperity
-grows competencies of local IT community
-creates new businesses
-focuses on students academics, government, ISVs and startups
-drives long term growth opportunity for partners & MS

Local software Economy Programs
-skills & capacity building
-foster innovation & ICT growth
-enable ICT competitiveness

Microsoft Innovation Centers
- provide environment for innovation
- operated with government, university, industry organizations – not on a MS campus
- 110 MICs in 60+ countries

Fernandes was asked bluntly if Microsoft’s goal in running the innovation centers was to train developers who are dependent on Microsoft technology, or to build a general local software economy that would payoff over the long term.  In other words, are they creating customers now or a market later?  Fernandes said it was the latter.

He took some flak for this from an attendee who said she has been in the training centers and there is nothing being taught except Microsoft products.  On one hand I think it’s unrealistic to criticize Microsoft for donating and teaching their own technology.  What do you expect?  Linux classes?  On the other hand, maybe a conflict of interest is too inherent in the Microsoft-only program, and a better way to work towards the stated goal of long term health of the local software economies would be to donate resources to or co-found a non-profit.

IE8 Product overview
Chris Wilson, Internet Explorer Platform Architect talked about the major changes in IE8.  He first discussed the different consumers of the product, users and developers, and how these groups have different priorities.

Users want predictability, productivity, and power, while developers want productivity, power, and predictability, but those concepts mean different things to each group.

For users, predictability means security, compatibility, and reliability.  New IE8 features to address these needs include:
-the site domain name is highlighted in address bar separately from rest of the URL
-the Manage Add-Ons experience has been improved
-ActiveX components can be installed per-user and per-site without admin rights
-DEP/NX code execution prevention
-users’ sites and apps work in new browser version

Two new big features increase user productivity.  Activities provide a framework for plugins that can do something with data on a web page.  An example would be obtaining a map for an address selected on a page.  Activities are available via right-click and have a category, such as “Map”, that supports hierarchical navigation through the right-click menu.  Activities are defined with the OpenService format.

WebSlices allow a user to subscribe to a specific piece of content on a site.  the WebSlice format is based on hAtom, but extends it.  WebSlices support dynamic content while hAtom only supports static content.  WebSlice subscriptions get added to the Feeds platform.

Predictability for developers has conflicting definitions.  Should IE8 behave like the standard or like IE7?  Of course, this is a quandary of Microsoft’s own making by not supporting the standards as they emerged.  Microsoft considered having sites opt into IE8’s standards support, but they thankfully went the other way.  Instead, IE8 will default rendering according to the standards.  Sites that don’t render correctly in the standards mode can add a <meta> tag directing IE8 to render in IE7 mode.  This will allow them to make a small change to support IE8 if their site doesn’t look right by default, and then convert their site to standard HTML and CSS on their own schedule.  Users will also have an option to switch to IE7 mode for sites that don’t add the meta tag or convert to standards.  When in standards mode, IE8 now passes the ACID2 test.

IE8 also has a new layout engine with the goal of providing developers with predictable layout.  This layout engine has an improved typographic foundation and benefits from having CSS2.1 in hand while being designed – one of the problems with the prior engine.  This clean start is the end of hasLayout.

A few changes are intended to improve performance.  The parallel connection limit is increased from two to six unless the user is on a modem.  Also, there are javascript improvements and the pre-parser doesn’t block at script tags.

Finally, there are some improvements to increase developer productivity including better support for web history in Ajax applications, a debugger, a CSS selector API, and HTML 5 storage.

Dynamic Languages @ Microsoft
John Lam, Senior Program Manager for Visual Studio Managed Languages discussed the Dynamic Language Runtime.  In response to his own rhetorical question asking why Microsoft would support dynamic and open source languages on the .NET runtime, he listed the following reasons:
- increased opportunity to get Microsoft technology used
- clear trend to build stuff on OSS
- developers want freedom to create stuff
- developers want freedom to see the source code

The Microsoft Permissive License got changed to Microsoft Public License(MSPL), and got OSI approval.

The Dynamic Language Runtime(DLR) was refactored from the IronPython implementation. Common code and services that were needed for dynamic languages was extracted into a reusable framework.

Because the DLR is distributed as MSPL, anyone can port to other platforms.  So assemblies can run on Mono without changes.

Microsoft is hoping to have Rails running on the DLR by RailsConf 08.  John demoed Django today, but acknowledged having to make a few changes to the Django source to do so.  He also admitted that both IronRuby and IronPython have performance issues right now.

Microsoft Robotics Studio
Tandy Trower and George Chrysanthakopoulos of R&D Advanced Strategies presented on Microsoft’s robotics development tools, which include a general concurrency and distributed services solution.  Robotics Studio is a development platform for the robotics community supporting a wide variety of users, hardware, and application scenarios.  The tool is free for non-commercial use and $399 for commercial use.

The tool and technology looked cool, but it was the end of a second long day and I’m not a robotics guy so I don’t have much to say about it.  In summary, robots are big, big, big, and Microsoft has an IDE and simulation environment to develop and test robotic control.  If you are into such stuff, it definitely looked like it’s worth checking out.

h1

Microsoft Technology Summit 2008 – Day 1

April 8, 2008

This is the first of multiple posts on the Microsoft Technology Summit which I recently attended on Microsoft’s Redmond campus. This post is a summary of the Day 1 sessions. MTS is a conference of technologists and bloggers invited by Microsoft to hear updates about various Microsoft products and initiatives and to provide feedback. Most of the attendees are experts in technologies and communities that aren’t closely, if at all, associated with Microsoft. Full disclosure: Microsoft paid for my travel, lodging and food during the summit.

Microsoft’s Open Source Strategy
Sam Ramji, Director of Platform Strategy for Microsoft, gave the opening keynote on the role of open source software at Microsoft. It was really more of an opening discussion as he invited and received a lot of interaction from the audience. Ramji stressed that the only way to address differing opinions is to acknowledge them and have a conversation about them. To illustrate the point, he was wearing a Firefox t-shirt, which he said instigated a lot of conversations on the Microsoft campus. The purpose of MTS, then, was to invite Microsoft’s critics and encourage a conversation.

Ramji tried to take the group by surprise by putting up that day’s announcement that Microsoft would be collaborating with the Apache POI project to add support for the Office Open XML format. This was greeted with both positive and cynical reactions, no doubt influenced by the long saga of Microsoft’s attempts(apparently now successful) to get ISO standardization of the OOXML format. The discussion of this announcement didn’t last long, but it really encapsulated a lot of the themes of the greater Microsoft/Open Source discussion. Yes, Microsoft dedicates significant resources to working with open source communities. But they seem to be focused mostly in assisting communities that are supporting interop with MS technology, rather than opening up any core technology or collaborating with the community to create something new. Microsoft’s SAMBA involvement is one example of this trend, and POI is now another.

Ramji summarized the huge growth in open source communities over the past decade and stated that Microsoft has begun to recognize over that period that the growth of both OSS and Microsoft requires that the company start to open up more. As a result, Microsoft’s OSS participation has been transitioning from experimentation, through learning, towards architecting OSS communities. He gave a laundry list of contributions and milestones:

  • working with SAMBA team to support interop
  • hired inventor of Haskell
  • received OSI approval for two OS licenses
  • released Windows Media Player plugin for Firefox
  • made contributions back to the Xen project to improve ability to run Windows
  • contributed to JBoss for optimization and tuning when running on Windows
  • rewrote OEM SQL Server JDBC driver internally to improve stability and performance

Ramji drew an analogy between Microsoft’s relationships to the Internet and Open Source. There was a time when people said that Microsoft had missed the Internet boat and could not recover. Few would say that now regarding Microsoft and the Internet. Ramji says it will be the same with story with Open Source and that Microsoft will be one of the most prolific OSS companies by 2009.

Ramji was an articulate speaker and a class act, despite constant attack from a few squeaky wheels in the group who took every possible opportunity to rip on Microsoft. This discussion was obviously very interesting to the group and probably could have gone on much longer if time had permitted.

Microsoft Research
Next up was Kevin Schofield, General Manager of Microsoft Research who gave an overview of Microsoft’s research group. The research group is apparently entirely independent of the product groups. They try to hire smartest researchers they can find, then don’t tell them what to do. The group’s mission is to:

  • advance the state of the art in chosen areas of computer science and publish the results in research papers
  • transfer the resulting technology to business groups
  • ensure MS has a future

Schofield had a a lot of demos lined up, but he got bogged down responding to repeated suggestions (insistence perhaps) that Microsoft should open up any research, including source code, that was just going to sit on the shelf because it wasn’t ready for productization. Some work is apparently available for download, but the commenters pushed the point that Microsoft is missing an opportunity to work with the community.

Schofield did finally get to some rushed demos:

Worldwide Telescope

  • access to “treasure trove” of astronomy data
  • has earth view too
  • seems a lot like Google Earth/Sky

AniTime(sp?)

  • experiment in best ways to visualize how data sets change over time
  • one method used animation to show trends
  • another used tracks

FacetLens

  • visual representation of data set organized by metadata
  • different filters for different metadata
  • using animation to transition between data views to keep users from getting lost quickly

I feel like we probably missed some other cool demos because Kevin spent a lot of time early on
responding to various vague questions about how MS research compares to other research organizations.

ASP.NET MVC Framework
Scott Guthrie, Corporate VP of .NET Development gave a coding demonstration for the new ASP.NET MVC Framework. This was an impressively low-level presentation from someone at such a high-level management position. That being said, there wasn’t much notable about this session other than some technical details about the framework.

ASP.NET MVC is a new option for ASP.NET that seems to have taken a lot of inspiration from Rails in terms of convention over configuration, although the syntax is more verbose than Ruby allows. MVC can be used for free with the Express editions of MS tools. The demo was in C#, but it works with all other CLR languages such as ruby, python, and javascript. ASP.NET MVC also works on Mono. The ORM component of MVC is LINQ to SQL. The controllers support any view technology including HTML, JSON, Silverlight, etc.

Scott was asked if the CLR will be open sourced? He stated that the CLR interface has been standardized by ISO and ECMA which allows other communities to build open source implementations.

Silverlight
Brad Adams, Principle Group Program Manager of the .NET Platform gave a product review of Silverlight. He described the product as a partial .NET implementation as browser plugin. Microsoft has built implementations in IE, Firefox and safari on Windows and Mac OS X(Intel only). They will provide the IP necessary to implement plugins on other platforms, but they aren’t doing those implementations themselves. Miguel di Icaza of Novell and Mono fame is working on a Linux implementation called Moonlight. Silverlight is also available on Windows Mobile, Nokia, and other mobile platforms will follow, according to Adams.

Silverlight supports HD resolution (720p) video and DVD-like interactive menu capabilities. There is currently no H.264 support, but they are supposedly working on it.

Media is distributed via streaming and can be either live or on-demand. Microsoft will provide free content hosting via Akamai at silverlight.live.com, presumably to get wider adoption.

Adams demoed two sites using Silverlight: The Home Shopping Network and memorabilia.hardrock.com. Both are impressive multi-media experiences.

Adams concluded by answering his own rhetorical question: Why use .NET in the browser? His answer included the following points:

  • multi-language support: c#, vb.net
  • high performance
  • rich UI controls and graphics
  • HTML/DOM integration
  • networking(REST, JSON, WS*)
  • flexible data support with LINQ

The Windows Live Platform
John Richards, Director Windows Live Platform, and Angus Norton, Sr. Director Search, attempted to give a presentation on Windows Live. From the beginning, however, they said they were very open to feedback from the attendees, and boy did they get it.

To start out with, they introduced Windows live as consisting of the following components:

  • LiveID – an identity service, not Passport
  • Silverlight streaming – an infrastructure service
  • Live Spaces and Live Contacts – personal data services
  • IM & presence, Alerts – notifications and messaging services
  • Search, Virtual Earth

The asked how many people had visited dev.live.com, the developer portal for Windows Live. If anyone raised their hand, I missed it. There was audible disbelief even in this group that not a single person cared about it, and blunt suggestions that this was a huge marketing failure if developers had no interest in even checking out how they could provided services for one of the largest users bases (Hotmail) on the internet.

Richards and Norton then demoed www.quicksilver-europe.com, a surfing site that makes heavy use of Silverlight to distribute video of surfing competitions. They were trying to show off a feature integrated into the site that apparently allowed someone watching a video on the site to share the video with a friend who is currently logged into their live.com account so that the two friends could watch the video together and chat about it. There was a collective “huh?” as everyone tried to figure to understand why anyone would ever do this.

At this point the session completely evolved from a presentation to a group discussion that sometimes left Richards and Norton just standing at the front of the room listening. The group questioned the live.com interaction model, and pushed them to use established social networks such as Facebook and open social rather than trying to invent something from scratch. Some commenters felt very strongly that Microsoft was failing to leverage their large user bases on Hotmail and other services and that they should be building a gadget API that could run on other platforms.

LINQ
Anders Hejlsberg, Microsoft Technical Fellow, next gave a product review of LINQ (.NET Language Integrated Query). He opened with the premise that objects are not equivalent to data and that while we use an imperative style of interaction with objetcs, we need a declarative style with data. LINQ provides a declarative syntax for working with data within .NET code.

LINQ can be used to work with several different data representations, including objects, data sets, SQL, entities and XML. Anders did all of his examples in C#, but other .NET languages will have LINQ capabilities. His examples illustrated several new features in C# 3.0 including:

  • Automatic properties – shorthand to avoid coding getters and setters
  • Object and Collection Initializers – follow an instantiation of an object with a list of assignments to its properties
  • LINQ queries
  • Extension methods – static methods that get imported, importing objects seem to have those methods defined
  • Anonymous Types

This session was a bit surreal because Anders was essentially giving a tutorial to a bunch of people who probably had no intention of ever using the technology. He is clearly a brilliant guy and a very good public speaker/presenter. He obviously loves technology and happily answered any questions people had even though they were incredibly basic for his level of expertise. It was like getting your first piano lesson from Beethoven. And I felt a bit guilty that we were wasting his time because we wouldn’t be sitting back down at the piano again.

That being said, although there are probably hundreds of people at Microsoft who could have demoed LINQ, Anders provided a lot of insight into and crystal clear explanation of the implementation that few others probably could have. I was interested to learn that the C# compiler doesn’t really know anything about LINQ queries. Instead, it rewrites the LINQ syntax as method calls to extension methods such as Where() and Select() that take lambdas as parameters. The query itself doesn’t actually run until some piece of code iterates through the result of the LINQ expression.

C# 3.0 also supports expression trees. Code can extract an expression tree from a function, have full access to the syntax tree, modify it, and compile it again. I claim to fully understand how it works, but I think it is the inclusion of expression tree support that allows LINQ expressions to seem to be a strongly typed part of the language, with full tool support and code completion.

Another interesting tidbit was the reason behind the seemingly backwards FROM…WHERE…SELECT syntax. Anders explained that it is necessary for tooling so that an entity defined in the FROM clause (say, Product p) can be used with intellisense in the SELECT clause (p.id, p.name, etc). If the SELECT clause came first in the expression, there couldn’t be any intellisense since a developer would be typing p.name before “p” had been defined.

In my mind, the language level support is what makes LINQ to SQL superior to competing Java technologies such as Hibernate/JPA annotations. It’s very cool to see strong typing in ORM type stuff like this. I wish Java had something analogous. But after hearing Ander’s explanation of how this works, I don’t have much hope that I’ll see it in Java anytime soon because of all the supporting language features such as expression trees that make it possible. It seems like C# is evolving much more quickly than Java can. Having a primary steward of a language (Anders) as opposed to a committee (the JCP) certainly seems to increase the pace of innovation.

Anders closed with a a few brief thoughts on the future of languages. He made the observation that most of the new C# features “are straight out of the functional programming playbook”. He thought that this direction would continue with C# and other languages adding more of the powerful features seen in functional languages.

h1

Give it a REST

March 21, 2008

Brian Sletten gave a nice talk at Tuesday’s CJUG meeting on REST. He focused on the principles behind resource-oriented architectures rather than implementation of RESTful services, although he did go over a few examples of such services.

Some points that I took note of:

  • With the uniform addressing model provided by REST, business models can be mapped to information technology systems without having the mapping be dependent on the technology
  • The addressing model makes it easy to pass a reference to a resource to another system, rather than a copy the resource data
  • REST consists of unlimited nouns(names/URLs of resources), limited verbs (GET, PUT, POST, DELETE), and content types (text/html, image/jpeg, etc)
  • The limited set of actions/verbs means that clients use uniform interaction model for all resources
  • Because GET is intended to be idempotent, any resource can be cached at an intermediate point between the client and server without knowing anything about the resource itself other than it’s URL. In contrast, data returned from a SOAP service can not be cached without the cache having specific knowledge about the service operations.
  • Service description should be different depending on whether it’s being described to a person or to software. When describing to people, a partial URL can return HTML documentation as well as complete URLs which provide a user interface to resources. When describing to software, resource attributes can be used to request a resource’s format definition, such as an XSD schema.
  • URI structure can be designed to be stable over time by using the attributes of the resource that naturally fit into a hierarchy as part of the URI path. Attributes that don’t fit into a hierarchy can be included as querystring parameters.
h1

OMG! Google Calendar Syncs w/ MS Outlook!!!…Disappointment

March 19, 2008

I don’t know when Google released this, but I just noticed yesterday that Google Calendar can now sync with MS Outlook. I got really excited. I use Outlook/Exchange at work, but I manage all my personal calendars, including a shared one with my wife, in Google Calendar. SpanningSync gets the calendars onto my Mac and iPhone. The last step to obtaining the Grand Unified Calendar was the stupid work calendar. I would even be thrilled if Outlook just supported iCal feeds, so imagine what a joyous surpise it was to learn that Google was giving me 2-way sync!

Too bad it doesn’t work.

I first tried a one-way sync from Outlook to gCal and quickly discovered that Google Calendar Sync with MS Outlook is a non-starter for three reasons:

1) It doesn’t sync my meetings. This is a pretty big shortcoming since that’s really all it is supposed to do. Sure, it moved a couple calendar items from Outlook to gCal, but most of them did not sync. I can’t find a definitive pattern about what syncs and what doesn’t. Recurring meetings never synced. Some meetings I created synced, some didn’t. Some meeting requests from others that I accepted synced, some didn’t.

2) The primary Outlook calendar is synced with the primary Google calendar. No. No. No. Google, you give me multiple calendars, and I use them. I don’t want my work meetings polluting the personal calendar that I share with my wife. It’s so obvious that the Outlook calendar should show up as a separate new calendar in gCal that at first I thought the sync wasn’t working at all – where’s the new calendar? It’s ridiculous that it adds the synced items to my existing calendar. I’m flabbergasted. I can’t talk about this anymore.

3) “Maybe if I just let it run overnight it will fix itself.” I really wanted this to work. Unfortunately, when I took a look at Outlook in the morning, there were 30-40 blank calendar items in my Deleted Items folder for *every* time that the sync ran. Do I care about what’s in my Deleted Items? No, not really. But this is yet another sign that this thing is half-baked.

Uninstall. Sorry Google. Let me know when 2.0 is out.

h1

TECHCoffee Regular

March 19, 2008

I was pretty excited a few weeks ago when TECHCoffee announced Season 5. It’s an early morning coding meet-up billed as the hacking equivalent of a running club, with the assumption that a couple of productive early morning hours a week can make the difference in that project you’re too tired to work on at night.

It was a timely announcement for me because I wanted to devote some time to a small project that wasn’t getting anywhere. So far so good; I’ve been a regular every week (although admittedly I’m not usually there by the 6:30 AM start time).

I’m working on a Java parser for a hated, ancient banking file format, BAI2, that I’ve had the displeasure of working with a few times in my day job. It’s not a sexy project, but I will open-source it as soon as it’s functional in the hopes of saving the next poor slob who has to parse BAI2 from some major headaches. I also want a more flexible parser to work with in case that next poor slob turns out to be me.

The only problem with TECHCoffee is figuring out what beverage to purchase from our coffee shop host since I gave up caffeine completely a while ago.