Passion * Technology * Ruthless Competence

Thursday, May 08, 2008

Debugging IronPython Code in Visual Studio

In case I'm not the last person on the planet to figure this out...

  1. In VS, click on File->Open->Project/Solution or press Ctl-Shift-O
  2. Select ipy.exe from wherever you put it
  3. Right click ipy.exe in Solution Explorer and select Properties
  4. In the Command Arguments box, type "-D" (to generate debug code) and the full path to the script you want to execute. If you want to drop into interactive mode after the script executes, also include a "-i"
  5. Open the script you specified in step 4 and place breakpoints as usual
  6. Run via Debug->Start Debugging or press F5

Thanks Srivatsn for helping me out with this.

Posted By Harry Pierson at 1:58 PM Pacific Daylight Time

Tuesday, May 06, 2008

Deserializing XML with IronPython

Now that I can stream process XML, the next logical step is to deserialize it into some type of object graph. As I said in my last post, there are at least three different DOM-esque options on the .NET platform as well as two in the Python library (xml.dom and xml.minidom)

However, anyone who's ever programmed against the DOM knows just what a major PITA it is.

Instead, you could deserialize the XML into a custom object tree, based on the nodes in the XML stream. In .NET, there are at least two libraries for doing this: the old-school XmlSerializer as well as the new-fangled DataContractSerializer. In these libraries, the PITA comes in defining the static types with all the various custom attribute adornments you need to tell the deserializer how to do it's job. Actually, if you're defining your code first, all those adornments aren't that big a deal. However, if you're starting from the XML, especially XML with lots of different namespaces - like say my RSS feed - defining a static type for this gets old fast.

Of course, if you're not using a statically typed language... ;)

One of the cool aspects of dynamic languages is the ability to easily generate new types on the fly. In Python, you can create a new type by calling the type function. Here's an example of creating a new type for a XML node:

def create_type(node, parent): 
  return type(node.name, (parent,), {'xmlns':node.namespace})

Since I'm working with XML, I wanted to make sure I handled namespaces. Thus, I add the namespace to the class definition (the third parameter in the type function above). This lets me walk up to any arbitrary object created from an XML element and check it's namespace.

I used this dynamic type creation functionality in my xml2py module, which I added to my IronPython SkyDrive folder. It leverages ipypulldom, so make sure you get both. The heart of the module is the xml2py function, which recursively iterates thru the node stream and builds the tree. Attributes and child elements become named attributes on the object, so I can write code that looks like this:

import xml2py 
rss = xml2py.parse('http://feeds.feedburner.com/Devhawk') 
for item in rss.channel.item: 
  print item.title

You see? No screwing around with childNodes or getAttribute here.

The basic processing loop of xml2py creates a new instance of a new type when it encounters a start element tag. It then collects all the attributes and children of that element, and adds them as attributes on the element object, using the name of the type as name of the attribute. If there are multiple children with the same type name, xml2py converts that attribute to a list of values. For example, in an RSS feed, there will be likely be many rss.channel.item elements. In xml2py, the item attribute of the channel object will be a list of item objects.

Since attributes and child elements are getting slotted together, I added a _nodetype attribute on each so I can later tell (if I care) if the value was originally an attribute or element. I haven't written py2xml yet, but that might be important then.

I do one optimization for simple string elements like <foo>bar</foo>. In this case, I create a type that inherits from string (hence the need for the parent parameter in the create_type function above) and contains the string text. It still has the xmlns and _nodetype attributes, so I could write item.title.xmlns (which is empty since RSS is in the default namespace) or item.title._nodetype (which would be XmlNodeType.Element)

It's not much code - about 100 lines of code split evenly between the xml2py function and the _type_factory object. Given that you usually see the same element in an XML stream over an over, I didn't want to create multiple types for the same element. So _type_factory caches types in a dictionary so I can reuse them. One of the cool things is that it's a callable type (i.e. it implements __call__ so I can use the instance like a function. I started by defining a xtype function that didn't cache anything, but then later switched xtype to be a _type_factory instance, but none of my code that called xtype had to change!

One other quick note. If you put xml2py.py and ipypylldom.py in a folder, you can experiment with them by launching "ipy -i xml2py". This runs xml2py.py as a script, but dumps you into the interactive console when you're thru. It will run the little snippet of code above which runs xml2py on my FeedBurner feed, but then you can play around with the rss object and see what it contains. Be sure to check out the xmlns attribute for each object in the rss.channel.link list.

Posted By Harry Pierson at 5:37 PM Pacific Daylight Time

Stream Processing XML in IronPython

When it comes to processing XML, there are two basic approaches - load it all into memory at once or process it a node at a time. In the .NET world where I have spent most of the past ten years, those two models are represented by XmlDocument and XmlReader. There are alternatives to XmlDocument, such as XDocument and XPathDocument, but you get the idea.

Out in non-MSFT land, the same two basic models exist, however the de facto standard for stream based processing is SAX, the Simple API for XML. SAX is supported by many languages, including Python.

Personally, I've never been a fan of SAX's event-driven approach. Pushing events makes total sense for a human driven UI, but I never understood why anyone thought that was a good idea for stream processing XML. I like XmlReader's pull model much better. When you're ready for the next node, just call Read() - no mucking about setting content handlers or handling node processing events.

Luckily, the Python standard library supports both approaches. It provides both a SAX based parser as well as a pull based parser called pulldom. Pulldom doc's are fairly sparse, but Paul Prescod wrote a nice introduction. Here's an example from Paul's site (slightly modified):

from xml.dom import pulldom
nodes = pulldom.parse( "file.xml" ) 
for (event,node) in nodes: 
    if event=="START_ELEMENT" and node.tagName=="table": 
        nodes.expandNode( node )

Actually, I like this better than XmlReader, since it provides the nodes in a list-like construct that appeals to the functional programmer in me. I'd like it even more if Python had a native pattern matching syntax - you know, like F# - but you can get similar results by chaining together conditionals with elif.

However, IronPython doesn't support any of the XML parsing modules from Python's standard library. They're all based on a C-based python module called pyexpat which IronPython can't load. [1] I wanted a pulldom type model, so I decided to wrap XmlReader to provide a similar API and lets me write code like this:

import ipypulldom 
nodes = ipypulldom.parse( "sample.xml" )  
for node in nodes:  
  if node.nodeType==XmlNodeType.Element:  
    print node.xname

There are a few differences from pulldom, but it's basically the same model. I'm using the native .NET type XmlNodeType rather than a string to indicate the node type. Furthermore, I made the node type a property of the node, rather than a separate variable. I also didn't implement expandNode, though doing so would be a fairly straightforward combination of XmlReader.ReadSubtree and XmlDocument.Load.

I stuck the code for ipypulldom up in a new folder on my Skydrive: IronPython Stuff. It's fairly short - only about 45 lines of code. Feel free to use it if you need it.


[1] The FePy project has a .NET port of pyexpat as part of their distribution, so I assume that lets you use the standard pulldom implementation in IPy. FePy looks really cool but I haven't had time to dig into it yet.

Posted By Harry Pierson at 11:21 AM Pacific Daylight Time

Monday, May 05, 2008

Rare Insight Into the IPy Team

An email conversation between two members of the IPy team that you, dear reader, might find amusing.

From: Srivatsn Narayanan
Sent: Friday, May 02, 2008 4:00 PM
Subject: You dont need pinky fingers? :)

http://twitter.com/DevHawk/statuses/802239164


From: Dino Viehland
Sent: Friday, May 02, 2008 11:30 PM

Wow, am I really that loud? :)

This is a response to the idea that no design is complete until you can’t remove anything else without sacrificing the overall goals of the end result.  Is the pinky really necessary?  We can “cut that feature”, right? :)


From: Srivatsn Narayanan
Sent: Friday, May 02, 2008 11:49 PM

If you cut off the pinkie, then the ring finger becomes the pinkie and so iteratively you will have to lose all of them :). If I remember right in Europe, you hold up the pinkie to order beer. So it’s quite important :)


From: Dino Viehland
Sent: Friday, May 02, 2008 11:59 PM

Well I find it hard to argue with ordering beer, but I doubt the pinkie’s original use was to order beer.  Therefore I’d describe this as an abuse of an existing API that might be better served by a new API specifically designed for this purpose.  But I question even if a new API is necessary. 

Drinking beer by definition involves a container in which the beer is consumed from.  Therefore the container it’s self (or the lack thereof) might be able to serve the dual role for both consuming the beer and indicating the need for a refill.  For example when drinking sake I’ve been told it is customary to tip the bottle on its side to indicate the desire for a refill.  Are we really to expect that the Human API exposes every need in a direct fashion?  For example should I have another appendage for “I need more bread sticks” and yet another for “Can I get a refill or on the water?”.  I’d propose the “2 creams no sugar” appendage because that’s the way I take my coffee.

On the other hand the iterative problem does seem to be more relevant – but it presupposes a purpose for the pinky in the first place!  But alas, I admit I’ve just returned from drinking beer, so this may not be the best argument :).


From: Srivatsn Narayanan
Sent: Saturday, May 03, 2008 12:21 AM

The pinkie is like a reserved field/custom field in a API. Every user community can come up with its own use for it but they have to devise the protocol themselves. Apparently different civilizations have. Wikipedia as usual has a list of those. So do you get your “2 creams no sugar” appendage – sure if u can agree on the semantics with the waiter. Seems like a PM call to me :)

PS: What beer did u have? I should try that – seems effective :)


From: Dino Viehland
Sent: Saturday, May 03, 2008 12:26 AM

I hadn’t quite considered it like this but I’d propose an alternate encoding – binary.  With 4 fingers one can communicate up to 16 different which seems to cover most of the listed issues.  Yes 5 gives you up to 32 messages but 16 should be enough for everyone :).

And they were various Hale’s Ales fresh from the brewery.


From: Srivatsn Narayanan
Sent: Saturday, May 03, 2008 12:31 AM

I wouldn’t want to hold up 0010 really (although it won’t be the middle finger anymore) :)


From: Dino Viehland
Sent: Saturday, May 03, 2008 12:40 AM

Ahh, but let’s just call that one reserved – that leaves the end-user with 15 other messages!  Personally I’d suggest we reserve the entire bit – that way we could use other codes like 1010 for future expansion of various standard messages.  Urination seems popular on the pinky list so maybe we’d want to standardize that in the future – we of course need to look at uses of the other fingers before we come to this conclusion.  Users are now left with 8 user-defined messages but that seems plenty.  Also they can then use 1000 or 0001 (depending their endianness, a.k.a. left-handed or right-handed) for the now deprecated pinky-messages.


From: Srivatsn Narayanan
Sent: Saturday, May 03, 2008 12:55 AM

1000, 1100, 1110 and 1111 are actually used for counting numbers 1,2,3,4 :) They are too obvious to be non-standardized. So they are out as well.

That cuts the user messages to 5 (third bit is reserved anyway). Some of the ones left are hard to make as well – try 0101 :)

Posted By Harry Pierson at 11:48 PM Pacific Daylight Time

Friday, May 02, 2008

IronPython 2.0 Beta 2

We pushed out the latest beta of IronPython 2.0 this morning. From the release notes:

We’re pleased to announce the release of IronPython 2.0 Beta 2. In addition to the usual bug fixes (~25 reported on CodePlex and ~50 reported internally), this release has been partially focused on improving the performance of IronPython, in particular startup perf. Another focus of this release was improving upon our traceback support which had regressed quite a bit in 2.0B1 and had largely been broken in the 2.0 Alphas. Our traceback support should now be superior to that of IronPython 1.1!

We’ve also made a minor change to our packaging by adding a Microsoft.Scripting.Core.dll in addition to the Microsoft.Scripting.dll that’s been around since the start of 2.0. We are doing this purely as an architectural layering cleanup. Microsoft.Scripting.Core contains DLR features that are essential to building dynamic languages. Microsoft.Scripting will contain language implementation helpers that can either be re-used (e.g., BigInts) or copied (possibly e.g., the default binder). This process is all about our work to get the DLR architecture right and shouldn’t have any noticeable IronPython impact except that there’s now one more DLL to include in any package.

As a consequence of the new DLL, the deprecated file IronPython2005.sln is broken. This is the last release that will include this .sln file in the source zip file. Of course the Visual Studio 2008 version of this file, IronPython.sln, still builds.

We’d like to thank everyone in the community who reported these: kevgu, oldman, christmas, brucec, scottw, fuzzyman, haibo, Seo Sanghyeon, grizlupo, J. Merrill, perhaps, antont, 05031972, Jason Ferrara, Matt Beckius, and Davy Mitchell.

The full release notes have details about the bugs we fixed. Congrats to the team and thanks again to the community members for their assistance.

Posted By Harry Pierson at 11:45 AM Pacific Daylight Time

Monday, April 28, 2008

Importing Static Methods with IPy

Like .NET, Python uses namespaces to avoid name collisions. However, the semantics are a bit different. If you want to use a type or function from a a given namespace in Python, you have to import it into your current scope. For example, if you want to use the Python datetime built-in module, you would import it into the current scope and use it like this:

import datetime
bush_last_day = datetime.date(2009,1,20)

Notice that when I import a Python module this way, it's scoped into it's namespace, which forces me to use the entire namespace scoped name to access the type. Of course, that gets tedious quickly, so Python provides a way to import a type from a specific namespace into your current scope like this:

from datetime import date
bush_last_day = date(2009,1,20)

With IronPython, you can do import .NET namespaces as well. Here's that same code using the standard .NET DateTime class.

from System import DateTime
bush_last_day = DateTime(2009,1,20)

What I didn't know is that you can import static methods & properties from .NET types into the current scope using the same syntax. Here's an example:

from System.DateTime import Now

if Now >= bush_last_day:
    print 'celebrate'
else:
    print (bush_last_day - Now).Days, 'days left'

Being able to import a static method into the current scope is pretty convenient. Thanks to my teammate Jimmy for cluing me into this IPy feature.

One caveat though: in Python, you can import an entire namespace into your current scope. You can do that with .NET namespaces, but not with .NET types

from datetime import *         # this works
from System import *           # so does this
from System.DateTime import# this doesn't work

Update: Michael Foord pointed out that if you import Now as I describe above, it places a DateTime object representing the time you imported it into local scope, rather than placing the underlying get_Now static method in local scope. So while DateTime.Now always returns a new value, Now never changes. Sounds like an IPy bug to me, but I'll have to circle back with the team to be sure.

Posted By Harry Pierson at 3:09 PM Pacific Daylight Time

Thursday, April 24, 2008

Morning Coffee 164

  • Big news since my last Morning Coffee post was the announcement of Live Mesh. I've been running it for about a month, and I'm really digging it. Make sure you check out the team blog and watch the developer tour video (be on the lookout for IPy about half way thru the video)

ALT.NET

  • I had a great time @ the ALT.NET open space conference last weekend. I was somewhat distracted on Saturday as due to a family communication mixup, I had to bring my son Patrick with me. Jeffrey Palermo shot a cute video of him (3 minutes in) where he explains that he's at the conference "to be with my dad". Having a five year old is a little distracting, but everyone was amazingly cool with having him around. When he gets a little older I have no doubt he'll be attending conferences and leading open sessions.
  • I did a session on F#, but it felt kinda all over the place. I hadn't touched F# in a few months and it showed IMO. Matt Podwysocki was there to help keep the session from devolving into mass chaos. Thanks Matt.
  • My favorite session of the conference was Scott Hanselman's "Are We Innovating?" talk, which I think originated from a question I asked him: There are many examples of large OSS projects in other dev communities that get ported to .NET (NHibernate, NAnt, MonoRail, etc). Can you name one that's gone the other way? I can't.
  • I took Matt's advice and joined the local ALT.NET Seattle group.

DyLang Stuff

  • Martin Maly posts about how dynamic method dispatches are cached in three different layers by the DLR. You shouldn't care about this stuff if you're a DLR language user, but you will certainly care about it if you're a DLR language builder.
  • I'm really excited to see Phil Haack (whom I met F2F @ ALT.NET) is experimenting with IronRuby & ASP.NET MVC. True, I'd rather it was IPy, but his Routes.LoadFromRuby would work with Python with very little code change.
  • Note to self, take a deeper look at Twining, the IPy database DSL by David Seruyange.
  • Daily Michael Foord - Ironclad 0.2 Released. Ironclad is a project to implement Python's C extension API in C# so that IronPython could load standard Python C modules like SciPy and NumPy. So far, they're able to load the bz2 module

Other Stuff

  • Congrats to Brad and Jim for shipping xUnit.net 1.0.
  • Everyone seems to be jumping on the functional C# coding bandwagon. Bart De Smet's series on pattern matching in C# is currently at eight posts. Now Luca Bolognese is in on the action, with three posts so far on functional code in C#. I like how Luca keeps writing that the C# syntax is "not terrible" for functional programming. Again, why suffer thru the "not terrible" syntax when you could be using F# instead? (via Charlie Calvert)
  • I need to take a look at VLinq. Charlie and Scott Hanselman both mentioned it recently.
  • I would like to have been in the conversation with Ted Neward, Neal Ford, Venkat Subramaniam, Don Box and Amanda Silver.
  • I haven't had any time to play with XNA of late, which means the great list of GDC videos Dave Weller posted on the XNA team blog will remain beyond my ability to invest time for now.
  • There's a new drop of Spec# from MS Research. IronRuby is using Spec# heavily as I recall.
Posted By Harry Pierson at 10:53 AM Pacific Daylight Time

Tuesday, April 22, 2008

Morning Coffee 163

Between MVP summit last week, ALT.NET this past weekend and an internal brown-bag presentation yesterday, my unread email and blog posts have piled up. Most of the following is old news, but I wanted to get something out. Especially since I feel a case of Caps Fever coming on that will force - force you understand - me to head home early today.

DyLang Stuff

  • My teammate Srivatsn demonstrates how to make your static C# types act more dynamic in order to interop better with DLR languages. For example, by implementing GetBoundMember and SetMemberAfter, you can support setting arbitrary attributes on a C# class from Python. Cool.
  • Today's Michael Foord link: On Testing: Some Programmers Refuse to Get it. He's responding to a comment by Allen Holub suggesting that having 110k of test code for 30k of production code is "a real indictment of the language" (IronPython). I'm with Michael on this, Holub's suggestion is laughable and worse radically uninformed. I like the way Larry O'Brien (who passed on Holub's comment in the first place) describes the views of tests from inside and outside the agile community. I also like his description of tests as "quality diodes".

Other Stuff

  • Werner Vogels posts about a new Amazon EC2 feature: Persistent local storage. Basically, you can create an empty volume up to a terabyte in size and then mount it to your images as a drive. The objective seems to be able to run relational databases in the images, rather than being limited to S3 and SimpleDB. Kinda interesting, but given Google's announcement last week, I think the shine is off EC2 a bit.
  • This past weekend's Twitter outage has Dave Winer re-thinking the idea of building networks on a single point of failure. While obviously I agree with the concept, I don't agree with his solution that "We need some big infrastructure companies to get into this game". While there are some big blog infrastructures out there, most of that network was built on a massive number of small infrastructures. Why wouldn't the same thing work for microblogging?
Posted By Harry Pierson at 11:27 AM Pacific Daylight Time

Wednesday, April 09, 2008

Morning Coffee 162

  • Another nice thing about the new job: I'm working in the vicinity of some good friends. I was over in building 42 yesterday and made it a point to stop by Pat Helland's office yesterday and spend an hour or so chatting about the new gig. Pat is down the hall from David Hill, whom I worked with on Architecture Strategy. Back in my building, we're down the hall from the VSX folks including my friends Ken Levy and Gareth Jones. I'm sure there are more folks I know around, but hey it's only my second week!
  • I'm a big fan of Carbonite, which I use to back up all the digital media on my home computer. With two little kids, we have lots of digital photos as you might imagine . However, one thing that bugs me about Carbonite is that it doesn't back up video files by default, you have to go in on a folder by folder basis and select "'Back up Video files in this folder" from the context menu. Given how much trouble this "feature" has given me, I imagine less techie folks don't even realize their video files aren't getting backed up. However, I will say the latest version of the Carbonite Software at least makes it easy to find files that aren't backed up. A quick sweep revealed around a dozen folders that had un-backed-up video files in them, which I promptly fixed.
  • The big news yesterday was the new Google App Engine, which looks to give you access to virtualized infrastructure that sounds similar to what GOOG is rumored to use internally. I like Dave Winer's comment that this enables "shrinkwrap net apps that scale that can be deployed by civillians." Given Google's history w/ Python - Python's BDFL Guido van Rossum works there - it's no surprise that Google App Engine (GAE?) runs on Python, though apparently they "look forward to supporting more languages in the future". I'm guessing "more languages" == Ruby, maybe Erlang too.
  • I wonder if/how Google App Engine will affect Ruby on Rails momentum? If there's a significant lag before App Engine supports Ruby, will that drive developers to Python web stacks like Django? (Django is included in "the box" with App Engine)?@ PyCon, I was surprised at the intra-language animosity I observed. I wonder how many Python developers are secretly hoping Google never ships Ruby support. I highly doubt Google would do that - they want to tap the exploding RoR market like everyone else - but I'd bet it would really take the wind out of Rails' sails if they did.
  • Today's Michael Foord Link: Embedding IronPython 2, Examples of the DLR Hosting API. You can read the DLR Hosting spec, but it's pretty out of date so Michael's article helps fill in some of the gaps.
  • Looks like PowerShell has gotten the open source community treatment in a project called Pash. While I'm sure others are excited about PS on Linux or Mac, I'm excited to see PS running on Compact Framework. I wonder if it would work with XNA?
  • Speaking of XNA, XNA Console is a new CodePlex project that provides an IPy console to manipulate your XNA based game on the fly. Python is no stranger to game development - Civ IV for example provided mod capabilities via python. Alas, the compact framework can't run IPy today, so neither can XNA on Xbox. But wouldn't it be cool to hack your game in IPy running on a 360 using the messenger kit? (via IPy URLs)
  • Bart De Smet gets functional, writing type switch and pattern matching in C# 3.0. I guess it works, but it sure is ugly. Why not just use F# and be done with it?
  • Soma announces that the VC++ Feature Pack has shipped. Somewhere, I assume, there is much (some?) rejoicing.
Posted By Harry Pierson at 10:20 AM Pacific Daylight Time

Monday, April 07, 2008

Morning Coffee 161

  • Huge perk of the new job: new hardware. I had to give up my Dell workstation but I got a Lenovo T61p dual core widescreen laptop, an HP dc7800 dual monitor quad core desktop and a Polycom CX700 IP phone. I'm really digging the Lenovo's integrated fingerprint reader - no more password login - but I'm most impressed with their integrated driver management software. Sure beats the heck out of hunting for dozens of updated drivers all over the place like most vendors for you to.
  • Minor downside to all my new toys: I spent most of my first week on the job installing and configuring said new toys.
  • Caps will face the Flyers in the first round of the playoffs which starts Friday. I have a feeling that I'll be feeling poorly Friday around 3pm and have to head home early. :)

DyLang Stuff

  • Apparently, Michael Foord isn't getting enough exposure on this blog. :) He left a comment to remind me to mention the IronPython URLs link blog he writes along with Mark Rees and Seo Sanghyeon.
  • Speaking of Michael, his employer Resolver Systems just launched a new product: Resolver One Quant.
  • Still speaking of Michael, he's quoted in the InternetNews article Python Fans Take Aim at the Enterprise.
  • My teammate Jimmy Schementi posts a preview of his spare time project "Silverlight on Rails". This RoR plugin lets you declaratively specify if you want your RoR controller code to be accessed remotely via AJAX and run on the server or if you want that code to be downloaded to the client and run in SilverLight. Very cool stuff.

Other Stuff

  • Don Syme provides some insight into the F# producization process. There's going to be an update to the "Research release" later this month and a CTP of the "Product release" later this summer (Brian McNamara has the CTP details). I am looking forward to these releases, though I'll probably be too busy w/ IPy to experiment much with them.
  • Speaking of F#, Matt Podwysocki continues his adventures with F# with a look at tuples, records and discriminated unions. Of the three, I find discriminated unions the most interesting since there isn't anything like it in other languages I've used.
  • Gregori and Chris both announce the release of Unity 1.0. Congrats guys! But if I don't have time to hack around with the latest F# release, you can imagine I won't be getting to Unity any time soon...
  • Jeff Atwood recommends you build your application UI first. Furthermore, he does a good job selling the value of paper prototyping as well as introducing the concept of PowerPoint prototyping. Money quote: "You don't want something too powerful."
  • Via LiveSide I discovered James Hamilton's blog. Normally, hardware infrastructure isn't really my bag, but I find his ideas around using ISO standard shipping containers as modular data center building blocks fascinating. For example, check out this post that suggests sticking modular data centers in condos would be cheaper than building data centers!Subscribed.
  • Speaking of ISO, you may have heard Open Office XML was ratified as an ISO standard. Obviously, there was a lot of controversy around this, but Miguel de Icaza lists of what he considers major community wins from the standardization process. Anything that "pushed Microsoft into more open directions" is a good thing IMO.
Posted By Harry Pierson at 9:39 AM Pacific Daylight Time

Wednesday, April 02, 2008

Morning Coffee 160

I took most of last week between jobs and have spent much of this week getting machines setup, access to builds, etc. Furthermore, RSS Bandit ate my feedlist and I am still soldiering on sans mobile phone so I was pretty much unconnected for about a week and a half.

IPy Stuff

  • Laurence Moroney demonstrates how to configure a web site project in VS08 to use Dynamic Silverlight’s development web server Chiron. I looked at turned it into an exported template, but I think the Start Options are stored in the suo file and I’m not sure how to include that in the template. Maybe it could be set w/ a macro or at worst a GAX recipe?
  • If you’re a regular reader, you might as well get used to the name “Michael Foord”. He’s a developer @ Resolver Systems, makers of the IPy based Resolver One app/spreadsheet hybrid I’ve written about before. He’s also the author of the upcoming IronPython in Action book and the maintainer of Planet IronPython and the IronPython Cookbook. I’m going to try very hard to only link to Michael at most once per day. Frankly, that’ll be tough.
  • Today’s Michael Foord Link: Michael turned his PyCon talk on IPy + SL2 into a series of articles entitled IronPython & Silverlight 2 Tutorial with Demos and Downloads.
  • Ken Levy (who now sits just down the hall from me) clued me into the 1.0 release of IronPython Studio, which is a free IDE based on the VS08 Shell for IronPython (based on code from the VS SDK). Big new feature in this release is support for the integrated VS08 Shell, which means it’ll snap into your existing VS08 installation (well, not express) rather than forcing you to install the 300 MB isolated shell.

Other Stuff

  • Caps had a BIG win last night when they needed it most. Now they’re tied with Carolina for the SE division lead, but they lose the tiebreaker so unfortunately, they can’t make the playoffs without help. ‘Canes have to head back home last night to play Tampa Bay, they have to win tonight and Friday to clinch. Loss in either gives the Caps control of their own destiny. Caps are only one game back of Ottawa, Boston and Philly, none of whom have played well down the stretch. It does mean I have to root for the frakking Penguins to beat Philly, twice.
  • Now that I'm in a job where I'll be traveling occasionally, I really appreciated Scott Hanselman's travel tips, though I'm not sure "Don't look like a schlub" is in the cards for me.
  • Unless you’ve been living under a rock, you’re probably aware that Scott Guthrie blogged that the ASP.NET MVC Source Code is available on CodePlex. The project name is “aspnet” not “aspnetmvc” which makes me wonder if they might release the source to more ASP.NET stuff over time.
  • Speaking of Scott Guthrie, today he blogged about unit testing in SilverLight. Jeff Wilcox appears to have the definitive post on the subject, including links to the SilverLight testing framework (it’s included in the SL Controls source code release). He also provides a prebuilt “SilverLight Test” project template for easy download. Personally, I really like the in-browser test runner. I wonder how hard it would be to hook that up to DySL so you could write your tests in IPy? (given that IPy doesn’t have attributes, I’m guessing there’d be at least a bit of work involved in making this happen)
  • Speaking of SilverLight, apparently the next version of Windows Mobile (i.e. 6.1) will support it. Since I'm in the market for a new phone anyway, I'm thinking of getting one of these. Also, it's nice to see a marketing site for WM 6.1 using Silverlight instead of Flash like WM 6.0 marketing site does.(via LiveSide)
  • Ted Neward turns the news that MSFT is releasing XAML under the OSP into a long and fascinating history lesson that is well worth the read. I’m going to skip commenting on it, beyond advising you dear reader to read this if you haven’t already, except to wonder: how many sides does a “Redmondagon” have?

Thursday, March 20, 2008

Morning Coffee 159

As you might expect, these morning coffee posts are going to get more dev focused as well as more IPy focused.

  • One of the cool things we showed @ PyCon was Django running on the latest drop of IronPython. IPy lead developer Dino Viehand posted a blog entry (for the first time in 28 months!) showing the basic Python DB provider for SQL Server he put together. Hopefully, we won't have to wait another two and a half years for Dino's next post.
  • Speaking of IronPython, some of my new teammates pointed me to Michael Foord's Planet IronPython aggregate news site. Michael is IPy developer for Resolver Systems (the cool spreadsheet app hybrid I wrote about @ Lang.NET) and he's working on an IPy book.
  • Still speaking of IPy, Jeff Hardy dropped his first release of NWSGI, an port of Python's Web Service Gateway Interface spec to ASP.NET and IPy. I can't wait to see NWSGI combined Django running on IPy like Dino demoed @ PyCon. Congrats Jeff!
  • Scott Hanselman's post on Twitter reminds me that I recently started twittering myself. I haven't worked it into my daily routine, so it gets updated only occasionally, but after reading Scott's post, I'm thinking it's cooler than it appears on the surface. 
  • In surprising news, Microsoft is going to start collaborating with IBM's Eclipse Foundation, to make it easier to it easier to write apps for Windows in Java. I would think this is a very cool thing, but apparently Ted Neward - who's knowledge of JavaWorld far eclipses (ha ha) my own - thinks "the skin here is just too sensitive" and that this move might cause more controversy between MS and Java. However, he seems to imply the controversy would be between MS & Sun (Eclipse is obviously named as a jab @ Sun) rather than between MS & the Java community.
Posted By Harry Pierson at 10:08 AM Pacific Standard Time

Tuesday, March 18, 2008

Lunchtime Coffee 158

  • My friend (and hopefully my next representative) Darcy Burner is leading a group of congressional challengers in publishing A Responsible Plan To End The War In Iraq. I haven't read the plan itself in detail, but I sure like what I'm hearing about it.
  • Speaking of politics, Obama's speech today "A More Perfect Union" was fantastic.
  • Bioshock is getting a sequel. 'nuff said.
  • There's a new version of FolderShare out and I've got mixed feelings about it. On the one hand, I've been a regular user of FolderShare for a while so it's nice to see it get a face lift. On the other hand, it's been over two years since Microsoft bought FolderShare and we're only just now getting a new version, which is literally nothing more that a face lift - this version introduces no new functionality at all.
  • I was hoping to geek out vicariously via someone else's hacking around with Singularity. Luckily, Matthew Podwysocki provides just such an opportunity.
  • Looks like "Prism" is the new CAB. Glenn Block has two extensive posts covering a project overview and their first drop. I think it's interesting that the Prism team is focused on building a reference implementation, and letting the framework eventually fall out. Reading thru the description, it sounds awesome. However, based on the massive increase of inbox throughput I'm experiencing since I accepted the new job, I can't imagine I'll have time to play with it. Maybe Matthew will start playing with Prism too! (via Sam Gentile - btw, thanks for the kind words on the new job Sam!)
  • Speaking of Sam, he points to a series by Bob Beauchemin entitled LINQ to SQL and Entity Framework: Panacea or evil incarnate? With a title like that, who can resist reading the whole series? Err, I can because LINQ 2 SQL & EF performance just fell off my radar entirely. However I gotta agree with Sam's point that he "can't think of anyone more qualified than Bob" to tackle these questions.
  • Tomas Restrepo blogs his dev environment PS script as well as a PS fortune script. Personally, I use Chris Tavares' vsvars wrapper for PS, though I'll gladly take an "official" PS based dev environment.
  • I wonder if Ted Neward will get jumped for admiring Mort the way Nick Malik did. Given that Ted called himself Mort while Nick compared Mort to agile developers, I'm guess Ted will have to go back to his Vietnam analogy if he wants to create controversy.
  • Speaking of Ted, I agree with his point that conferences are about people. As a python pre-newbie (I figure I'll reach full newbie status by the time I actually start my new job), I spent most of my PyCon time connecting with people rather than trying to learn technical stuff. Also, I love Ted's WHISCEY acronym.
  • Speaking of PyCon, my soon-to-be new teammate Srivatsn Narayanan blogs his thoughts on PyCon. I'll try and get to my PyCon thoughts soon.
Posted By Harry Pierson at 11:49 AM Pacific Standard Time

Monday, March 17, 2008

DLR Resources & Jobs

I'm back home from PyCon, but between digging out my inbox, finishing transition reports and doing my mid-year career discussion I'm a little busy. But I did want to point at a couple of recent posts from the IPy team blog:

Posted By Harry Pierson at 11:25 AM Pacific Standard Time
DevHawk
World Tour 2008
DevDays 2008

Change Congress
Recent Bookmarks
Tags .NET Framework (2) ADO.NET (5) Agile (7) AJAX (3) Architecture (282) Guidance (6) Interop (2) Modelling (61) Patterns (7) Process (4) SOA (93) Web Services (5) ASP.NET (18) Battlestar Galactica (3) BI (2) BizTalk (4) Blogging (113) dasBlog (11) Podcasting (4) BPM (1) C# (5) C++ (3) Capitals (5) CardSpace (3) CLR (2) College Football (10) Comedy Central (1) Community (81) Concurrency (6) Consumer Electronics (1) Database (12) Dependency Injection (2) Development (115) C Plus Plus (1) Embedded (5) Lanugages (36) Media (2) P2P (11) Rotor (1) SharePoint (6) SOP (3) DIY (1) DLR (8) Domain Specific Languages (13) Durable Messaging (5) Dynamic Languages (9) Dynamic Silverlight (1) Education (3) Enterprise 2.0 (1) Entertainment (14) ETech (15) F# (38) Functional Programming (11) Game Development (2) Guidance Automation (3) Hardware (8) HawkEye (3) Hockey (29) Home Electronics (1) Home Network (4) Humor (5) IASA (1) Idempotence (3) infrastructure (5) Instrumentation (4) Integration (2) IronPython (14) IronRuby (3) Java (2) Job (3) LINQ (19) Lost (1) Master Data Management (1) Media 2.0 (6) Microsoft (27) MIX06 (2) Mobile Phone (1) Morning Coffee (165) Object Oriented (4) Office (5) Open Source (4) Open Space (2) Operations (3) Other (135) Art (1) Books (1) Family (30) Games (17) General Geekery (25) Home Theater (1) Movies (22) Music (20) Politics (3) Society (1) Sports (37) Working at MSFT (15) Parsing Expression Grammar (15) patterns & practices (2) Politics (39) PowerPoint (2) PowerShell (28) Presentation (4) Projects (1) HawkWiki (1) Python (3) Quote of the Day (4) Refactoring (1) Research (2) REST (18) Reuse (5) Robotics (1) Rome (5) Ruby (23) Sci-Fi (2) Scripting (4) Security (3) Service Broker (14) SharePoint (2) Silverlight (15) Social Software (1) Software + Services (2) Software Factories (11) Software Industry (1) Spark (1) SQL Server (2) Stephen Colbert (1) TechEd (7) TechEd06 (1) TechRec League (1)