Observable.Generate Pop Quiz

What would be the output of the following program;

var xs = new int[]{1,2,3};
Observable.Generate(
    xs.GetEnumerator(),    // initial state
    e => e.MoveNext(),    // break condition
    e => e,            // iterate
    e => e.Current        // result selector
).Subscribe(Console.WriteLine);

The program (correctly) outputs;

1

2

3

What about this program? Would the output be the same? If not why not?

var xs = new List<int>{1,2,3};

Observable.Generate( xs.GetEnumerator(), // initial state e => e.MoveNext(), // break condition e => e, // iterate e => e.Current // result selector ).Subscribe(Console.WriteLine);

Stay tuned.

Asus U36SD notebook running Windows 8 developer preview

I’ve just setup a new laptop running Windows 8 & Visual Studio 11 developer preview.

Hardware

Asus U36SD
Intel Core i7
4GB RAM
160GB SSD
1GB NVidia 520M

http://www.asus.com/Notebooks/Superior_Mobility/U36SD/

Installation

It was really easy to get Window 8 up and running. The laptop came with Windows 7 pre installed.

  1. Boot into Windows 7
  2. Download 64 bit developer preview (with developer tools)
  3. Unpack the ISO onto the desktop (I used 7zip)
  4. Run “Setup.exe”
  5. It will ask if you want to check internet for latest version – “Yes”
  6. It will ask what you want to keep – “Nothing”!

In what seemed like less than 5 minutes (I didn’t time it), the machine had rebooted and I was running Windows 8!

Visual Studio 11

It comes pre-installed, so there is nothing to do there.

I’ve create a simple hello world application. I chose to build a “C# metro application”, you are presented with the familiar XAML designer & C# code behind. There is not really much to say here. Visual Studio 11 looks and feels exactly the same as 2010 except there are a bunch of new projects for “Metro applications”. WPF & Silverlight developers won’t have any difficultly slotting into this development environment. Apart from the namespaces everything is very similar.

I’ll post more once I’ve something interesting to talk about…

Follow

Get every new post delivered to your Inbox.