« October 2007 | Main | December 2007 »

November 2007

November 23, 2007

Why I switched to the Zune

Zune 4GB/8GB

I've owned my fair share of iPods in the past (4), and my household is all Mac (and yes, I do work for Microsoft). However, audio players (like phones) are fashion statements.

When I bought a new iPod, I'd gush over the new features of the device. That might have been video (as in my transition from 2nd generation to 5th generation), or size (from my 5th generation to 2nd generation Nano to the Shuffle). But the shininess of that feature wore off fairly quickly since I was, after all, listening to the same music on my new toy fashion statement.

What changed this time around was the Zune Pass. I've long felt that subscription services fit my needs better than pay per track. Each evening this week, I've spent some time discovering new songs and downloading them to my Zune. This gives me an incremental jolt of happiness every single day. And the $15 / month lets my family experience the music that they want (lots of kids music is available via the Zune Pass). Also, the Zune Pass account can be shared across 3 Zunes and 3 PCs.

The Zune client software is beautiful. It uses the same rendering technology that Windows Media Center uses to display its 10-foot UI (which means silky-smooth animated transitions that are very tastefully done). It's lacking in a few areas (I'd really like recommendations built into the client instead of accessed via my browser), but so far I've been able to compensate via visits to allmusic.com.

The new flash-based Zune players are great. The Zune pad interface is better than the non-touch iPods (especially if you want to drop it in your pocket without locking the UI), and the form factor is near-ideal (I can run with one in my pocket without noticing it).

Overall I'm really happy to have made the switch. The lock-in of several hundred songs purchased via iTunes was never a factor since most if not all of those songs are available via the Zune Pass. I'm having fun rebuilding my music library from scratch - and this library is much smaller than my old iTunes library - it's just metadata after all. I'm looking forward to the music industry making a transition to the world of subscriptions.

November 20, 2007

Visual Studio 2008

Visual Studio 2008

Well, lots of other folks beat me to the punch about the announcement, but I was busy installing the product yesterday :) It's a popular product *inside* the company as well, and it took about 5 hours to grab from our internal share ... You can grab trial copies from here, and you can download the free (Express) editions from here.

I want to point out the single most useful feature of VS 2008: the CTRL key. The next time you've got an Intellisense tool tip / drop down obscuring the view of some other thing that you want to see, just press and *hold* the CTRL key. You'll see the obscuring window go translucent so that you can see what's behind. Wonderful feature.

If you want to see the full list of the new C# 2008 key bindings, you can download the poster. If you want even more productive key bindings, make sure you go grab yourself a copy of viemu, which brings vim emulation to VS.

Oh, and you can download my updated vssettings file if you want the minimalist black background that all of the cool kids are using these days.

November 19, 2007

IronRuby Presentations in PDF

Jordan Schwartz

I realized that I published all of my presentations in PPTX format, and that not everyone has PowerPoint handy. Here's they are published as PDF:

Download RubyConf_2007.pdf (2MB)

Download Microsoft_ECS.pdf (2MB)

Download PnP_Summit_Why_Ruby.pdf (2MB)

Enjoy!

DLR Hosting Specs (on Silicon)

DLR Hosting Specification

We're serious about our specs here on the DLR team. Not content with just publishing specs in electronic format, we've committed them to silicon!

Here's a PDF copy of the spec (1MB) of the that we're working on over the next few months. We've done a bunch of rounds of internal review on this spec and we'd love to incorporate your feedback.

You can leave feedback here in the comments, or you can send mail directly to Bill Chiles (billchi) or the DLR alias (dlr) at Microsoft dot com.

November 12, 2007

IronRuby links from South America

Identify me!

I spent some time this morning doing an email interview for the Brazilian Rails community. You can read either the Brazilian version or the English version. Thanks for the quick turnaround, Fabio!

My old friend Tomas Restrepo has written a nice article on the current state of the DLR hosting interfaces. The other Tomas (in my office) is going to be overhauling the DLR hosting interfaces between now and next year, so this story is definitely going to change.

IronRuby in Visual Studio

image

Huw and Dermot have been doing a great job shoring up the IronRuby and Visual Studio story. Check out a video of their prototype WinForms designer for IronRuby in Visual Studio!

November 09, 2007

LOLCODE! on DLR

loldogs and funnyƂ pictures
moar funny pictures

If happiness == productivity, imagine how productive you'll be when you're giggling your *ss off writing this:

HAI
CAN HAS STDIO?
I HAS A FISH ITZ "Yummy"
VISIBLE FISH
VISIBLE "HAI WORLD!"

I HAS A FIB
I HAS A A ITZ 1
I HAS A B ITZ 0

GIMMEH FIB

IM IN YR LOOP
  VISIBLE B

  IZ FIB SMALR 1?
  YARLY
    GTFO
  NOWAI
    VISIBLE "NOWAI"
  KTHX

  I HAS A TEMP ITZ A UP B
  LOL A R B
  LOL B R TEMP

  NERFZ FIB!!
KTHX
KTHXBYE
or this (note how we have extended the language :)
HAI
CAN HAS System?

I HAS A VAR ITZ "Hello"

I HAS A HT ITZ NJU Hashtable ON Collections ON System
NJU ArrayList ON Collections ON System WIT 10
I HAS A ArrayList ITZ NJU ArrayList ON Collections ON System WIT 10

VISIBLE Capacity ON ArrayList

COL Add ON HT WIT 10 AN 10
COL get_Item ON HT WIT 10
COL Concat ON String ON System WIT "Hello " AN "TechEd"

KTHXBYE

Props to the mad l337 hax0r skillz of Martin Maly who, on his plane ride to Spain, implemented LOLCODE on the DLR! Download the sources, and follow the instructions in the readme.txt and you'll be hacking away in no time at all.

In all seriousness (if that's possible when discussing LOLCODE), it's a nice way of seeing how to implement a simple language on top of the DLR. Enjoy!

November 07, 2007

IronRuby Talks

Matz loves Python

Over the past 10 days, I've presented IronRuby to about 1000 people. I gave talks at RubyConf (slides [6.4MB]), the Charlotte Developer's Guild, an internal talk in the Microsoft ECS series (slides [5.4MB]), and a keynote at the Patterns and Practices Summit (slides [5.4MB]).

My favorite talk was probably the ECS talk since I had 1.5 hours to do the talk (for internal folks, the recording has already been posted). There's a fun sequence of slides which compares and contrasts Ruby with C# 3.0. It's striking how C# with its local type inferencing and terse anonymous delegate syntax looks quite similar to Ruby blocks.

The recording for my RubyConf talk should be ready soon; keep an eye on the RubyConf site for an ETA. BTW, Microsoft sponsored the recording of all of the talks at RubyConf this year, yay us :)

November 05, 2007

IronRuby on Silverlight at RubyConf

It's always a fun time at RubyConf. So, when you have a 9:00am talk, what do you do the night before? Well, hack in new features, of course! At 2:30am, Tomas, John and I removed the last grotesque hack from our Silverlight demo (grab the sources from here):

IronRuby in Silverlight Screenshot

This is one of the first (to my knowledge) examples of a code-first Silverlight 1.1 application. Most Silverlight applications that generate UIs do so by creating a XAML string that they feed to the XAML parser. When you have a language as beautiful as Ruby, it's a shame to be creating trees via strings.

Let's look at the code that generates the Storyboard for the 'bounce' effect for the pictures. So instead of this:

<Storyboard x:Name="Timeline1" TargetName="ScaleTransform1">
  <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" 
      Storyboard.TargetProperty="ScaleX">     <SplineDoubleKeyFrame KeyTime="00:00:00.0" Value="0.200"/>     <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="0.935"/>     <SplineDoubleKeyFrame KeyTime="00:00:00.3" Value="0.852"/>     <SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="0.935"/>   </DoubleAnimationUsingKeyFrames>   <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
      Storyboard.TargetProperty="ScaleY">     <SplineDoubleKeyFrame KeyTime="00:00:00.0" Value="0.200"/>     <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="0.935"/>     <SplineDoubleKeyFrame KeyTime="00:00:00.3" Value="0.852"/>     <SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="0.935"/>   </DoubleAnimationUsingKeyFrames> </Storyboard>

You can do:

class BounceAnimation < AnimationBase
  def initialize(scale_transform_element)
    @obj = Wpf.build(Storyboard, :name => random_name,
        :target_name => scale_transform_element) {

      add(DoubleAnimationUsingKeyFrames, :begin_time=>'00:00:00',
        :target_property => "ScaleX") {

        add(SplineDoubleKeyFrame, :key_time => '00:00:00.0', :value => 0.200)
        add(SplineDoubleKeyFrame, :key_time => '00:00:00.2', :value => 0.935)
        add(SplineDoubleKeyFrame, :key_time => '00:00:00.3', :value => 0.852)
        add(SplineDoubleKeyFrame, :key_time => '00:00:00.4', :value => 0.935)
      }

      add(DoubleAnimationUsingKeyFrames, :begin_time=>'00:00:00',
        :target_property => "ScaleY") {

        add(SplineDoubleKeyFrame, :key_time => '00:00:00.0', :value => 0.200)
        add(SplineDoubleKeyFrame, :key_time => '00:00:00.2', :value => 0.935)
        add(SplineDoubleKeyFrame, :key_time => '00:00:00.3', :value => 0.852)
        add(SplineDoubleKeyFrame, :key_time => '00:00:00.4', :value => 0.935)
      }
    }
  end
end

The advantage of the latter is that the animation is a named entity that can be parameterized or composed with other animations. It's also a great example of how far we have come in IronRuby. If you look at SplineDoubleKeyFrame, we need to convert the string '00:00:00.0' to a KeyTime object. We do so by monkey-patching DoubleKeyFrame, which is a base class of SplineDoubleKeyFrame:

class DoubleKeyFrame
  alias_method :old_key_time=, :key_time=
  def key_time=(time_span)
    self.old_key_time = KeyTime.from_time_span(TimeSpan.parse(time_span))
  end
end

I'm overriding the implementation of the key_time property setter with a custom property setter that does the type conversion. The idea is to define type converters at the point in the inheritance hierarchy where the property is introduced; once you've done so, you've modified the behavior across the system.

If you look at the code in Silverlight.rb, you'll see many more examples of these kinds of type converters. In the future, I suspect that the type converters in Silverlight.rb will be generated by reflecting over the WPF APIs in Silverlight. Look for more metaprogramming goodness for Silverlight as both our implementation and Silverlight matures.

Unfortunately, you can't run these bits yet. We're using a private build of Silverlight to run this stuff today. But once we (DLR) sync up with the next CTP of Silverlight, you'll be able to run IronRuby in your browser. Fun times.

Photos

  • www.flickr.com
    This is a Flickr badge showing public photos from John Lam. Make your own badge here.

Recent Comments

Recent Posts

May 2008

Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Blog powered by TypePad