The May 2009 "Oslo" CTP is available on the Oslo Developer Center! Shawn Wildermuth has done a nice job of summarizing the changes to the M language since the January CTP. Also check out Jeff Pinkston's (aka "Pinky") blog for some existing posts on the changes and more posts on the way.
In addition to updates to M and the Repository, this is the first time Quadrant is being released to the public. I worked on that test team before coming to the M test team so it's great to see those bits in the wild!
Thanks to everyone on the team for their hard work. We eagerly await your comments and questions in the forums.
[UPDATE] Here is an even better link for "what's new" in the SDK.
I’ve recently been doing a lot of work around signed and unsigned assemblies. Someone passed along this great command to me which will recursively check whether or not each assembly at and below the current directory is signed.
for /r %i in (*.exe *.dll) do @sn.exe /q /vf "%i"
This article by Dan Vanderboom is one of the best pieces of writing I’ve seen to explain why Oslo is important. Here are a few quotes, but you should take the time to read the whole thing.
Oslo respects this need for choice by offering support for building both visual and textual DSLs, and recognizes the fluent definition of new formats and languages as the bridge to the next quantum leap in productivity…
That’s one place Oslo provides value. With the ability to define new textual and visual DSLs, rigorous verification and validation in a rich set of tools, the promise of Intellisense, colorization of keywords, operators, constants, and more, the Oslo architects recognize the ability to enhance our development experience in a language-agnostic way, raising the level of abstraction because, as they say, the way to solve any technical problem is to approach it at one higher level of indirection. Unfortunately, this makes Oslo so generalized and abstract that it’s difficult to grasp and therefore to appreciate its immensity. Once you can take a step back and see how it fits in holistically, you’ll see that it has the potential to dramatically transform the landscape of software development…
That’s all well and good for DSLs and language enthusiasts/geeks, but primarily perhaps, Oslo is about the creation, exploration, relation, and execution of models in an interoperable way…
Oslo provides interoperability among models in the same way that SOA provides interoperability among services.
A recent program contest at work challenged us to find as many Pythagorean triples as we could that contained at minimum of one prime. We had about a month to work on it. The first question was whether to write up a quick brute force attempt or to take some time to come up with a more elegant solution but have less time to run it. I of course chose the latter because it’s more fun. Here’s what I ended up doing:
- Find the first N primes
- To do this, I calculate the all the primes from 1 to 10,000,000. This is done with the sieve of Eratosthenes. Those primes are stored in a bitmap. Each prime is represented by a single bit that is either 0 or 1 indicating not prime or prime.
- That bitmap is saved and used throughout the whole prime finding process. I use those primes to calculate the next primes in batches of 10,000,000 (again using a modified sieve of Eratosthenes.)
- The problem is that using one bit for each prime ends up being inefficient because there are a lot of numbers that are not prime. For a n numbers, roughly ln(n) of those numbers are prime. To save space, I implemented a compression scheme. I store the distance from one prime to the next. (Actually I store distance/2 since the distance between primes is always even (except for 2 and 3.)) This algorithm still wastes a lot of space (more on that later), but it’s about twice as good as a bitmap for space usage. Unfortunately it takes a long time to find out if a number is prime.
- For a quicker answer to “is X prime?”, I store bookmarks into the compressed array of primes. So I know that the number at index Y by looking it up in the array of bookmarks.
- The compression array is a series of UInt16. This compression uses less than half the space of a bitmap but could theoretically still be improved. A UInt16 is wasteful for many of the lower numbers. I wanted to implement a dynamic compression scheme that would take a chunk of numbers and decide how many bits to devote to the distance from one prime to the next. The number of bits per distance would vary by compression page. I never got around to this though…
- I calculate as many primes as I could based on the amount of RAM on the machine. After calculating the primes, I wrote the compressed array and the page bookmarks out to disk so that I could quickly restart the program without having to recalculate all the primes!
- Find all the triples that have at least one prime.
- This was mostly brute force. There are two loops: M goes from 1 to sqrt of max prime and N goes from M to sqrt of max prime. For every value of M and N, a triple can be made with these formulas:
- A = 2*m*n
- B=m*m-n*n
- C=m*m+n*n
- 2 is always a factor of A so it is never prime. I just check B and C to see if they are prime. If so then I write the triple out to disk.
- This part took the longest but was easy to multithread. I used the new Parallel Extensions for .NET, and they were fantastically simple to use. The app automatically scales to the number of cores on the machine.
The only other thing to mention is that the command line arguments tell the app to either calculate primes or load them from the disk. The arguments also give a range of M for the app to examine for triples. This allowed it to be split over multiple machines easily. I wrote another small app that took all the output, cleaned it up, and combined it into a single file.
I ended up finding just under a billion triples that have at least one prime number. Since I was the only person who answered that question, I spent approximately 99.9% too much time on it.
You can download the app if you’re really curious to learn more and/or improve it.
Chris Sells is a PM on our team and spent quite a while talking to Carl Franklin on episode #401 of .NET Rocks. It's a great simple (geeky) English explanation of what we're doing.
http://www.dotnetrocks.com/default.aspx?showNum=401
In an introductory programming class, I had a professor who explained CPU cache as sitting in a library and having the book in front of you. RAM was like going to a bookshelf. And hitting the hard drive was like ordering it from a store and waiting for it to come.
While those numbers aren't exactly accurate, it does communicate the importance of keeping your data as close to the processor as possible. I recently came across an interesting study by Diomidis Spinellis that shows the relative speeds of different types of memory.
|
Nominal |
Worst case |
Sustained |
|
Productivity |
| Component |
size |
latency |
throughput |
$1 buys |
(Bytes read / s / $) |
|
|
|
(MB/s) |
|
Worst case |
Best case |
| L1 D cache |
64 KB |
1.4ns |
19022 |
10.7 KB |
7.91·1012 |
2.19·1014 |
| L2 cache |
512 KB |
9.7ns |
5519 |
12.8 KB |
1.35·1012 |
7.61·1013 |
| DDR RAM |
256 MB |
28.5ns |
2541 |
9.48 MB |
3.48·1014 |
2.65·1016 |
| Hard drive |
250 GB |
25.6ms |
67 |
2.91 GB |
1.22·1011 |
2.17·1017 |
If you have small chunks of data, the latency difference is huge. L1 cache is roughly 55,000 times faster than the hard drive. If you're dealing with sustained throughput, hitting L1 cache is 283.9 times faster than going to the hard drive.
Draw your own conclusions here, but keep this in mind when you're writing apps. (Note that the cost of memory is a bit outdated in this chart.)
Microsoft "Oslo" Resources
The World's Take on "Oslo"
- Oslo, Martin Fowler
- Oslo modeling platform: my first impressions...
- Oslo: Remodeling Windows!!!
- Microsoft Azure May Be Too Good To Ignore, James Urquhart
- First Look at Microsoft "Oslo", Arman Kurtagic
- Best PDC session so far : Lap around "Oslo", Dennis van der Stelt
- "M" and MService, Dennis van der Stelt
- "Oslo" repositories and models, Dennis van der Stelt
- "Oslo": Customizing and Extending the Visual Design Experience, Dennis van der Stelt
- Oslo : Building textual DSLs, Dennis van der Stelt
- First Impressions of Oslo, Shawn Wildermuth
- What is "Oslo"? Dennis Doomen
- A Quick Waddle Around Oslo, David Ing
- IntelliPad (IPad): adding commands, Jon Flanders
- Oslo highlight: MGrammar, Armin Sander
- First in-depth look at Microsoft’s Oslo and the “M” modeling language, William Vambenepe
- Sneak Peak at M, Stephen Forte
- "Oslo" Modeling Language Specification, Codename "M" (video)
- Inside "M" with the "Oslo" Team (video)
- Design and Lineage of the "Oslo" Modeling Language, Codename "M" (video)
- Getting Started with "M," the "Oslo" Modeling Language (video)
- "Oslo" Modeling SDK: "M Grammar" -- What is it? (video)
- Getting Started with "M Grammar" (video)
- "Oslo" -- Microsoft's Modeling Platform (video)
- The "Oslo" Modeling Language: "M Grammar" with Paul Vick (video)
- First Look at Quadrant – Oslo's Modeling Tool (video)
- First Look at M – Oslo's Modeling Language (video)
- Oslo Roundup, Mike Walker
- Exploring Oslo's modeling language promises, Esther Schindler
- Microsoft Makes Its Way to Oslo (video), Joe Wilcox
- Microsoft's Ray Ozzie Talks Open Source, Azure and More, Darryl K. Taft
- Microsoft adds 'M' to Open Specification Promise, David Worthington
- Microsoft Delivers Oslo Components, Darryl K. Taft
Now that PDC is in full swing, the Oslo Developer Center has been published. It contains a lot of great information about the whole Oslo platform - the Repository, the M modeling language, and Quadrant. Quadrant is the specific piece that I work on so I've spent most of my time reading through the info they posted about it. Unfortunately there are no Quadrant bits for you to download, but there is a lot of good information.
The tools component within "Oslo" creates a layer where the multiple roles (analyst, architect, developer, IT Manager, etc) within an organization can visually share and collaborate on models, using the specific view of the model suited to their needs. Models can be edited either using the new modeling tools, or can be exposed through the existing familiar tools that the end-user already knows (e.g. Visual Studio, BizTalk, SharePoint, Visio, etc).
A friend needs to change back and forth between a DHCP network and a static IP network. Rather than teach her how to go in and configure the settings manually, I wanted to write her a program that would automate everything.
I found the registry settings that control everything, but after changing them, you need to reboot. There had to be a better way.
I finally stumbled across netsh and it's a lot more powerful than I knew. It turns out, my problem can be solved with a batch file. To set the network interface to use DHCP, run this:
netsh interface ip set address name="Local Area Connection" dhcp
netsh interface ip set dns name="Local Area Connection" dhcp
To flip over to a static IP configuration, use something like this:
netsh interface ip set address name="Local Area Connection" static 192.168.1.12 255.255.255.0 192.168.1.1 1
netsh interface ip set dns name="Loca Area Connection" static 192.168.1.1
The order of address in that command is IPAddress, Subnet Mask, Local Gateway. The address in the second command is the DNS server.
One of the big challenges for me has always been coming up with a short and sweet elevator pitch for our offering, but recently Don Box and Doug Purdy have done just that on their respective blogs.
http://www.pluralsight.com/community/blogs/dbox/archive/2008/09/06/oslo.aspx
http://douglaspurdy.com/2008/09/06/what-is-oslo/
Life is getting exciting around here as we prepare to show the world what we've been working on for the very first time at PDC. Dev, test and PM have been working hard on the bits and the management team has been pouring over the presentations and marketing plan to make sure present the best possible picture of our product. Soon everyone will get a chance to peak behind the door!
Michael Hunter and I headed over to building 40 this week to interview Ivo Manolov, the test manager for Windows Presentation Foundation. Ivo has some great insight on what it takes to be a great tester.
We're trying out these videos on Channel9 instead of just on MSDN Tester Center. Feel free to leave a comment on the video if you have thoughts about the switch.
http://channel9.msdn.com/posts/Charles_Sterling/Ivo-Manolov-Interview-Test-Manager-for-Windows-Presentation-Foundation/
Are you going to PDC this year? Be sure to stop by some of the Connected Systems Division talks to hear about the project I work on. There are plenty of people more qualified than me to give the talks, and that's just fine with me. I'll be hard at work back here in Redmond making sure you have a great experience. We're all very excited to show you what we've been working on!
[List copied from Chris Sells's blog.]
I'll admit that prior to coming to Microsoft, I rarely clicked "Send report to Microsoft" when something would crash, and I never participated in the customer experience improvement option when offered. Now that I'm participating on some teams that deal with servicing the product after it's released, I see how valuable this data really is. They've gotten extremely good at dealing with those crash dumps in the error reports and the usage data from the customer experience improvement program. So please send us that data! It's really useful and will help make our products even better! Even if you think you've submitted the same one before, submitting it again is a pseudo vote for getting it fixed.
I have been meaning to make a post listing out the blogs of some of Microsoft's senior testers, and I was reminded of that task today when I found out that James Whittaker has started blogging. If you're interested in testing, these are great places to see inside the minds of some of the industry's best testers!
James Whittaker
Alan Page
Michael Hunter
Keith Stobie
If you want more from these guys, we are all part of the Tester Center team so you can keep an eye out for articles and videos there too.