Planet IronPython

January 22, 2012

The Voidspace Techie Blog

Callable object with state using generators

It's often convenient to create callable objects that maintain some kind of state. In Python we can do this with objects that implement the __call__ method and store the state as instance attributes. ... [596 words]

January 22, 2012 03:05 PM

January 13, 2012

The Voidspace Techie Blog

Simple mocking of open as a context manager

Using open as a context manager is a great way to ensure your file handles are closed properly and is becoming common: with open('/some/path', 'w') as f: f.write('something') The issue is that even if you mock out the call to open it is the returned object that is used as a context manager (and has __enter__ and __exit__ called). Using MagicMock from the mock library, we can mock out context managers very simply. ... [320 words]

January 13, 2012 12:18 PM

January 12, 2012

The Voidspace Techie Blog

Mocks with some attributes not present

Mock objects, from the mock library, create attributes on demand. This allows them to pretend to be objects of any type. ... [199 words]

January 12, 2012 12:33 PM

January 11, 2012

The Voidspace Techie Blog

mock 0.8rc2: new release and development docs

I've pushed out a new release of mock. This fixes an inconsistency in the create_autospec api I discovered whilst working on the docs (yes I've really been working on the docs), and a fix for a bug with using ANY. ... [190 words]

January 11, 2012 02:13 AM

January 03, 2012

The Voidspace Techie Blog

Python on Google Plus

As you may (or perhaps not) have noticed, I've been blogging a lot less in the last year. A new job with Canonical (although I've been there over a year now) and an eight month old daughter all make blogging harder. ... [83 words]

January 03, 2012 11:41 AM

January 01, 2012

The Voidspace Techie Blog

Sphinx doctests and the execution namespace

I've finally started work on the documentation for mock 0.8 release, and much of it involves converting the write-ups I did in the blog entries. The mock documentation is built with the excellent Sphinx (of course!) ... [402 words]

January 01, 2012 12:28 AM

December 29, 2011

The Voidspace Techie Blog

mock 0.8 release candidate 1 and handling mutable arguments

I've released mock 0.8 release candidate 1. You can download it it or install it with: pip install -U mock==dev mock is a library for testing in Python. ... [613 words]

December 29, 2011 01:04 PM

December 21, 2011

Miguel de Icaza

Mono in 2011

This was a very interesting year for Mono, and I wanted to capture some of the major milestones and news from the project as well as sharing a bit of what is coming up for Mono in 2012.

I used to be able to list all of the major applications and great projects built with Mono. The user base has grown so large that I am no longer able to do this. 2011 was a year that showed an explosion of applications built with Mono.

In this post I list a few of the high profile projects, but it is by no means an extensive list. There are too many great products and amazing technologies being built with Mono, but a comprehensive list would take too long to assemble.

Xamarin

The largest event for Mono this year was that the team working on Mono technologies at Novell was laid off after Novell was acquired.

We got back on our feet, and two weeks after the layoffs had taken place, the original Mono team incorporated as Xamarin.

Xamarin's goal is to deliver great productivity and great tools for mobile developers. Our main products are Mono on iOS and Mono on Android.

These products are built on top of the open source Mono project and the MonoDevelop project. We continue to contribute extensively to these two open source projects.

Launching Xamarin was a huge effort for all of us.

Xamarin would not have been possible without our great customers and friends in the industry. Many people cared deeply about the technology and helped us get up and running.

In July, we announced an agreement with Attachmate that ensured a bright future for our young company.

A couple of days later, we were ready to sell the mobile products that had been previously developed at Novell, and we started to provide all existing Novell customers with ongoing support for their Mono-based products.

Half a year later, we grew the company and continued to do what we like the most: writing amazing software.

Meanwhile, our users have created amazing mobile applications. You can see some of those in our App Catalog.

C# Everywhere

On the Mobile Space: This year Sony jumped to C# in a big way with the introduction of PS Suite (see the section below) and Nokia adopted Windows Phone 7 as their new operating system.

And we got you covered on Android and iOS for all of your C# needs.

On the Browser: we worked with Google to bring you Mono to Native Client. In fact, every demo shown at the Google Native Client event on December 8th was powered by Mono.

On the Desktop: this year we added MacOS X as a first-class citizen in the world of supported Mono platforms. We did this by introducing MonoMac 1.0 and supporting Apple's MacStore with it.

Games: continue to take advantage of C# blend of performance and high-level features. Read more on my GDC 2011 post.

It is a wild new world for C# and .NET developers that were used to build their UI using ASP.NET or Winforms only. It has been fascinating to see developers evolve their thinking from a Microsoft-only view of the world to a world where they design libraries and applications that split the presentation layer from the business logic.

Developers that make this transition will be able to get great native experiences on each device and form factor.

Sony PSSuite - Powered by Mono

At GDC, Sony announced that PS Suite was built on top of Mono. PS Suite is a new development stack for cross-platform games and cross-platform applications to run on Android devices and Sony Vita.

The PS Suite presentation is available in the following videos (first, second and third).

In particular, watch the game in Video 2 to get a feeling for the speed of a 3D game purely written in managed code (no native code):

Some of the juicy details from the GDC announcement:

  • PS Suite will have an open appstore model, different than the traditional game publishing business.
  • Open SDK, available for everyone at launch time.
  • PS Suite supports both game development with Sony's 3D libraries as well as regular app development.
  • Cross-platform, cross-device, using the ECMA Common Intermediate Language.
  • Code in C#, run using Mono.
  • GUI Designer called "UI Composer" for non-game applications.
  • The IDE is based on MonoDevelop.
  • Windows-simulator is included to try things out quickly.

MonoDevelop on PSSuite:

PS Suite comes with a GUI Toolkit and this is what the UI composer looks like:

Google Native Client

Google Engineers ported Mono to run on the sandboxed environment of Native Client. Last year they had added support for Mono code generator to output code for Native Client using Mono's static compiler.

This year Google extended Native Client to support Just in Time Compilation, in particular, Mono's brand of JIT compilation. This was used by all three demos shown at the Google Native Client event a couple of days ago:

Unity Powered Builder

This is another game built with Unity's Native Client code generator:

To get the latest version of Mono with support for Native Client, download and build Mono from Google's branch on github.

Mono 2.10

This was the year of Mono 2.10. We went from a beta release for Mono 2.10 in January to making it our new stable release for Mono.

While the world is on Mono 2.10, we have started our work to get Mono 2.12 out in beta form in January.

Mono on Android

This year we launched Mono for Android, a product that consists of port of Mono to the Android OS, C# bindings to the native Java APIs and IDE support for both MonoDevelop and Visual Studio.

The first release came out in April, it was rough around the edges, but thanks to the amazing community of users that worked with us during the year, we solved the performance problems, the slow debugging, vastly improved the edit/debug/deploy cycle and managed to catch up to Google's latest APIs with the introduction of Mono for Android 4.0.

Mono on iOS

Just like Android, we have been on a roll with MonoTouch.

In short, this year:

  • We kept up with Apple's newly introduced APIs (UIKit, iCloud, Airplay, Bluetooth, Newstand, CoreImage).
  • Integrated XCode 4's UI designer with MonoDevelop< and added support for storyboards.
  • Added the option of using LLVM for our builds, bringing thumb support and ARMv7 support along the way.

We started beta-testing a whole new set of features to be released early next year: a new unit testing framework, a heap profiler, integrating MonoTouch.Dialog in the product and improving the debug/deploy process.<

Mono for iOS has been on the market now for two years, and many products are coming to the market based on it.

Phalanger

Phalanger is a PHP compiler that runs on the .NET and Mono VMs and is powered by the Dynamic Language Runtime.

It is so complete that it can run both MediaWiki and WordPress out of the box. And does so by running faster than they would under PHP.

This year the Phalanger guys released Phalanger 3.0 which now runs on Mono (previously they required the C++/CLI compiler to run).

Phalanger's performance is impressive as it is just as fast as the newly announced Facebook HipHop VM for PHP. The major difference being that Phalanger is a complete PHP implementation and the HipHopVM is still not a complete implementation.

The other benefit of Phalanger is that it is able to participate and interop with code written in other .NET languages as well as benefitting from the existing .NET interop story (C, C++).

CXXI

Our technology to bridge C# and C++ matured to the point that it can be used by regular users.

Compiler as a Service

This year our C# compiler was expanded in three directions:

  • We completed async/await support
  • We completed the two code output engines (System.Reflection.Emit and IKVM.Reflection).
  • We improved the compiler-as-a-service features of the compiler.

Our async/await support is scheduled to go out with the first preview of Mono 2.11 in early January. We can not wait to get this functionality to our users and start building a new generation of async-friendly/ready desktop, mobile and server apps.

One major difference between our compiler-as-a-service and Microsoft's version of the C# compiler as a service is that we support two code generation engines, one generates complete assemblies (like Microsoft does) and the other one is able to be integrated with running code (this is possible because we use System.Reflection.Emit and we can reference static or dynamic code from the running process).

We have also been improving the error recovery components of the compiler as this is going to power our new intellisense/code completion engine in MonoDevelop. Mono's C# compiler is the engine that is powering the upcoming NRefactory2 library.

You can read more about our compiler as a service updates.

Unity3D

Unity is one of Mono's major users. At this point Unity no longer requires an introduction, they went from independent game engine a few years ago to be one of the major game engine platforms in the game industry this year.

The Unity engine runs on every platform under the sun. From the Consoles (PS3, Wii and XBox360) to iPhones and Androids and runs on your desktop either with the Unity3D plugin or using Google's Native Client technology. The list of games being built with Unity keeps growing every day and they are consistently among the top sellers on every app store.

Mono is the engine that powers the scripts and custom code in games and applications built with Unity3D and it also powers the actual tool that users use to build games, the Unity3D editor:

The editor itself it implemented in terms of Unity primitives, and users can extend the Unity3D editor with C#, UnityScript or Boo scripts dynamically.

One of my favorite games built with Unity3D is Rochard was demoed earlier this year on a PS3 at the GDC and is now also avaialble on Steam:

Microsoft

Just before the end of the year, Microsoft shipped Kinectimals for iOS systems.

Kinectimals is built using Unity and this marks the first time that Microsoft ships a software product built with Mono.

Then again, this year has been an interesting year for Microsoft, as they have embraced open source technologies for Azure, released SDKs for iOS and Android at the same time they ship SDKs for their own platforms and shipped various applications on Apple's AppStore for iOS.

MonoDevelop

We started the year with MonoDevelop 2.4 and we finished after two major releases with MonoDevelop 2.8.5.

In the course of the year, we added:

  • Native Git support
  • Added .NET 4.0 project support, upgraded where possible to XBuild/MSBuild
  • MonoMac Projects
  • XCode 4 support for MonoMac, MonoTouch and Storyboards
  • Support for Android development
  • Support for iOS5 style properties
  • Major upgrade to the debugger engine
  • Adopted native dialogs on OSX and Windows

Our Git support was based on a machine assisted translation of the Java jGit library using Sharpen. Sharpen has proved to be an incredibly useful tool to bring Java code to the .NET world.

SGen

Our precise collector has gotten a full year of testing now. With Mono 2.10 we made it very easy for developers to try it out. All users had to do was run their programs with the --sgen flag, or set MONO_ENV_OPTIONS to gc=sgen.

Some of the new features in our new Garbage Collector include:

  • Windows, MacOS X and S390x ports of SGen (in addition to the existing x86, x86-64 and ARM ports).
  • Lock-free allocation to improve scalability (we only take locks when we run out of memory).
  • Work stealing parallel collector and a parallel nursery collector, to take advantage of extra CPUs on the system to help with the GC.
  • Work on performance and scalability work, as our users tried things out in the field, we identified hot-spots in SGen which we have been addressing.

As we are spending so much time on ARM-land these days, SGen has also gained various ARM-specific optimizations.

SGen was designed primarly to be used by Mono and we are extending it beyond being a pure garbage collector for Mono, to support scenarios where our garbage collector has to be integrated with other object systems and garbage collectors. This is the case of Mono for Android where we now have a cooperative garbage collector that works hand-in-hand with Dalvik's GC. And we also introduce support for toggle references to better support Objective-C environments like MonoTouch and MonoMac.

XNA and Mono: MonoGame

Ever since Microsoft published the XNA APIs for .NET, developers have been interested in bringing XNA to Mono-based platforms.

There was a MonoXNA project, which was later reused by projects like SilverXNA (an XNA implementation for Silverlight) and later XNAtouch an implementation of XNA for the iPhone powered by MonoTouch. Both very narrow projects focused on single platforms.

This year, the community got together and turned the single platform XNATouch into a full cross-platform framework, the result is the MonoGame project:

Platform Support Matrix

Currently MonoGame's strength is on building 2D games. They already have an extensive list of games that have been published on the iOS AppStore and the Mac AppStore and they were recently featured in Channel 9's Coding For Fun: MonoGame Write Once Play Everywhere.

An early version of MonoGame/XnaTouch powers SuperGiantGame's Bastion game on Google's Native Client. Which allows users of Windows, Mac and Linux desktop systems to run the same executable on all systems. If you are running Chrome, you can install it in seconds.

Incidentally, Bastion just won three awards at the Spike VGA awards including Best Downloadable Game, Best Indie Game, and Best Original Score.

The MonoGame team had been relatively quiet for the most part of 2011 as they were building their platform, but they got into a good release cadence with the MonoGame 2.0 release in October, when they launched as a cross-platform engine, followed up with a tasty 2.1 release only two weeks ago.

With the addition of OpenGL ES 2.0 support and 3D capabilities to MonoGame, 2012 looks like it will be a great year for the project.

Gtk+

Since MonoDevelop is built on top of the Gtk+ toolkit and since it was primarily a Unix toolkit there have been a few rough areas for our users in both Mac and Windows.

This year we started working with the amazing team at Lanedo to improve Gtk+ 2.x to work better on Mac and Windows.

The results are looking great and we want to encourage developers to try out our new Beta version of Mono, which features the updated Gtk+ stack.

This new Gtk+ stack solves many of the problems that our users have reported over the past few months.

Hosting Bills

I never tracked Mono downloads as I always felt that tracking download numbers for open source code that got repackaged and redistributed elsewhere pointless.

This summer we moved the code hosting from Novell to Xamarin and we were surprised by our hosting bills.

The major dominating force are binaries for Windows and MacOS which are communities that tend not to download source and package the software themselves. This is the breakdown for completed downloads (not partial downloads, or interrupted ones) for our first month of hosting of Mono:

  • 39,646 - Mono for Windows (Runtime + SDK)
  • 27,491 - Mono for Mac (Runtime)
  • 9,803 - Mono for Windows (Runtime)
  • 9,910 - Mono for Mac (Runtime + SDK)

  • Total: 86,850 downloads for Windows and Mac

These numbers are only for the Mono runtime, not MonoDevelop, the MonoDevelop add-ins or any other third party software.

It is also worth pointing out that none of our Windows products (MonoDevelop for Windows, or Mono for Android on Windows) use the Mono runtime. So these downloads are for people doing some sort of embedding of Mono on their applications on Windows.

At this point, we got curious. We ran a survey for two days and collected 3,949 answers. These is the summary of the answers:

What type of application will you run with Mono?

This one was fascinating, many new users to the .NET world:

The best results came form the free-form answers in the form. I am still trying to figure out how to summarize these answers, they are all very interesting, but they are also all over the map.

Some Key Quotes

When I asked last week for stories of how you used Mono in 2011, some of you posted on the thread, and some of you emailed me.

Here are a couple of quotes from Mono users:

I can't do without Mono and I don't just mean the iOS or Android dev with C# but MonoMac and Mono for *nix too. Thanks for everything; from the extraordinary tools to making hell turn into heaven, and thank you for making what used to be a predicament to effortless development pleasure.

I don't think we could have achieved our solutions without Mono in enterprise mobile development. It addresses so many key points, it is almost a trade secret. We extensively use AIR and JavaScript mobile frameworks too but ultimately we desperately need 1-to-1 mapping of the Cocoa Touch APIs or tap into low level features which determines our choice of development platform and frameworks.

That's where Mono comes in.

Gratefulness and paying polite respects aside, the key tenets of Mono we use are:

  • shared C# code base for all our enterprise solutions - achieving the write once, compile everywhere promise with modern language and VM features everyone demands and expects in this century
  • logical, consistent and self-explanatory wrapper APIs for native services - allows us to write meta APIs of our own across platforms
  • low latency, low overhead framework
  • professional grade IDE and tools
  • native integration with iOS tools and development workflow
  • existence of satisfactory documentation and support
  • legal clarity - favorable licensing options
  • dedicated product vision via Xamarin - commercial backing
  • community support

Koen Pijnenburg shared this story with me:

We've been in touch a few times before and would like to contribute my story. It's not really an interesting setup, but a real nice development for Mono(Touch). I've been developing app for iPhone since day 1, I was accepted in the early beta for the App Store. On launch day july 2008, 2 of the 500 apps in the App Store were mine, my share has decreased a lot in the past years ;)

I really, really, really like football(soccer), maybe you do also, I don't know. In september 2008 I created the first real soccer/football stats app for the iPhone called My Football. This was a huge succes, basically no competition at that time. In 2009 I released My Football Pro, an app with 800 leagues worldwide, including live data for more then 100 leagues. Since then I created lots of apps, all created with the iPhone SDK and with Objective-C.

Since the launch of MonoTouch, it merged the best of two worlds in my opinion. I've been a Mono/.NET developer for years before the iPhone apps, for me it was love at first line of code.

The last year I've increased my work with MonoTouch / Droid /MonoGame(Poppin' Frenzy etc ;)), and focused less on working with native SDK's only. Since our My Football apps are at the end of their lifecycle in this form, we are working on a new line of My Football apps. Our base framework supporting our data, is built with Mono, and the apps UI will be built with MonoTouch / MonoDroid / WP7 etc.

Included is the screenshot of our first app built with the framework, My Football Pro for iPad. It has a huge amount of data, stats / tables / matches / live data for more then 800 leagues worldwide. We think it's a great looking app!

Working with MonoTouch is fantastic and just wanted you to know this!

Mono on Mainframes

This year turned out to show a nice growh in the deployment of Mono for IBM zSeries computers.

Some are using ASP.NET, some are using Mono in headless mode. This was something that we were advocating a few years ago, and this year the deployments went live both in Brazil and Europe.

Neale Ferguson from Sinenomine has kept the zSeries port active and in shape.

Mono and ASP.NET

This year we delivered enough of ASP.NET 4.0 to run Microsoft's ASP.NET MVC 3.

Microsoft ASP.NET MVC 3 is a strange beast. It is licensed under a great open source license (MS-PL) but the distribution includes a number of binary blobs (the Razor engine).

I am inclined to think that the binaries are not under the MS-PL, but strictly speaking, since the binaries are part of the MS-PL distribution labeled as such, the entire download is MS-PL.

That being said, we played it safe in Mono-land and we did not bundle ASP.NET MVC3 with Mono. Instead, we provide instructions on how users can deploy ASP.NET MVC 3 applications using Razor as well as pure Razor apps (those with .cshtml extensions) with Mono.

2012, the year of Mono 2.12

2012 will be a year dominated by our upcoming Mono release: Mono 2.12. It packs a year worth of improvements to the runtime, to our build process and to the API profiles.

Mono 2.12 defaults to the .NET 4.x APIs and include support for .NET 4.5.

This is going to be the last time that we branch Mono for these extended periods of time. We are changing our development process and release policies to reduce the amount of code that is waiting on a warehouse to be rolled out to developers.

ECMA

We wrapped up our work on updating the ECMA CLI standard this year. The resulting standard is now at ISO and going through the standard motions to become an official ISO standard.

The committee is getting ready for a juicy year ahead of us where we are shifting gears from polish/details to take on significant extensions to the spec.

by Miguel de Icaza (miguel@gnome.org) at December 21, 2011 09:28 PM

December 19, 2011

Miguel de Icaza

CXXI: Bridging the C++ and C# worlds.

The Mono runtime engine has many language interoperability features but has never had a strong story to interop with C++.

Thanks to the work of Alex Corrado, Andreia Gaita and Zoltan Varga, this is about to change.

The short story is that the new CXXI technology allows C#/.NET developers to:

  • Easily consume existing C++ classes from C# or any other .NET language
  • Instantiate C++ objects from C#
  • Invoke C++ methods in C++ classes from C# code
  • Invoke C++ inline methods from C# code (provided your library is compiled with -fkeep-inline-functions or that you provide a surrogate library)
  • Subclass C++ classes from C#
  • Override C++ methods with C# methods
  • Expose instances of C++ classes or mixed C++/C# classes to both C# code and C++ as if they were native code.

CXXI is the result of two summers of work from Google's Summer of Code towards improving the interoperability of Mono with the C++ language.

The Alternatives

This section is merely a refresher of of the underlying technologies for interoperability supported by Mono and how developers coped with C++ and C# interoperability in the past. You can skip it if you want to get to how to get started with CXXI.

As a reminder, Mono provides a number of interoperability bridges, mostly inherited from the ECMA standard. These bridges include:

  • The bi-directional "Platform Invoke" technology (P/Invoke) which allows managed code (C#) to call methods in native libraries as well as support for native libraries to call back into managed code.
  • COM Interop which allows Mono code to transparently call C or C++ code defined in native libraries as long as the code in the native libraries follows a few COM conventions [1].
  • A general interceptor technology that can be used to intercept method invocations on objects.

When it came to getting C# to consume C++ objects the choices were far from great. For example, consider a sample C++ class that you wanted to consume from C#:

class MessageLogger {
public:
	MessageLogger (const char *domain);
	void LogMessage (const char *msg);
}

One option to expose the above to C# would be to wrap the Demo class in a COM object. This might work for some high-level objects, but it is a fairly repetitive exercise and also one that is devoid of any fun. You can see how this looks like in the COM Interop page.

The other option was to produce a C file that was C callable, and invoke those C methods. For the above constructor and method you would end up with something like this in C:

/* bridge.cpp, compile into bridge.so */
MessageLogger *Construct_MessageLogger (const char *msg)
{
	return new MessageLogger (msg);
}

void LogMessage (MessageLogger *logger, const char *msg)
{
	logger->LogMessage (msg);
}

And your C# bridge, like this:

class MessageLogger {
	IntPtr handle;

	[DllImport ("bridge")]
	extern static IntPtr Construct_MessageLogger (string msg);

	public MessageLogger (string msg)
	{
		handle = Construct_MessageLogger (msg);
	}

	[DllImport ("bridge")]
	extern static void LogMessage (IntPtr handle, string msg);

	public void LogMessage (string msg)
	{
		LogMessage (handle, msg);
	}
}

This gets tedious very quickly.

Our PhyreEngine# binding was a C# binding to Sony's PhyreEngine C++ API. The code got very tedious, so we built a poor man's code generator for it.

To make things worse, the above does not even support overriding C++ classes with C# methods. Doing so would require a whole load of manual code, special cases and callbacks. The code quickly becomes very hard to maintain (as we found out ourselves with PhyreEngine).

This is what drove the motivation to build CXXI.

[1] The conventions that allow Mono to call unmanaged code via its COM interface are simple: a standard vtable layout, the implementation of the Add, Release and QueryInterface methods and using a well defined set of types that are marshaled between managed code and the COM world.

How CXXI Works

Accessing C++ methods poses several challenges. Here is a summary of the components that play a major role in CXXI:

  • Object Layout: this is the binary layout of the object in memory. This will vary from platform to platform.
  • VTable Layout: this is the binary layout that the C++ compiler will use for a given class based on the base classes and their virtual methods.
  • Mangled names: non-virtual methods do not enter an object vtable, instead these methods are merely turned into regular C functions. The name of the C functions is computed based on the return type and the parameter types of the method. These vary from compiler to compiler.

For example, given this C++ class definition, with its corresponding implementation:

class Widget {
public:
	void SetVisible (bool visible);
	virtual void Layout ();
	virtual void Draw ();
};

class Label : public Widget {
public:
	void SetText (const char *text);
	const char *GetText ();
};

The C++ compiler on my system will generate the following mangled names for the SetVisble, Layout, Draw, SetText and GetText methods:

__ZN6Widget10SetVisibleEb
__ZN6Widget6LayoutEv
__ZN6Widget4DrawEv
__ZN5Label7SetTextEPKc
__ZN5Label7GetTextEv

The following C++ code:

	Label *l = new Label ();
	l->SetText ("foo");
	l->Draw ();	

Is roughly compiled into this (rendered as C code):

	Label *l = (Label *) malloc (sizeof (Label));
	ZN5LabelC1Ev (l);   // Mangled name for the Label's constructor
	_ZN5Label7SetTextEPKc (l, "foo");

	// This one calls draw
	(l->vtable [METHOD_PTR_SIZE*2])();

For CXXI to support these scenarios, it needs to know the exact layout for the vtable, to know where each method lives and it needs to know how to access a given method based on their mangled name.

The following chart explains shows how a native C++ library is exposed to C# or other .NET languages:

Your C++ source code is compiled twice. Once with the native C++ compiler to generate your native library, and once with the CXXI toolchain.

Technically, CXXI only needs the header files for your C++ project, and only the header files for the APIs that you are interested in wrapping. This means that you can create bindings for C++ libraries that you do not have the source code to, but have its header files.

The CXXI toolchain produces a .NET library that you can consume from C# or other .NET languages. This library exposes a C# class that has the following properties:

  • When you instantiate the C# class, it actually instantiates the underlying C++ class.
  • The resulting class can be used as the base class for other C# classes. Any methods flagged as virtual can be overwritten from C#.
  • Supports C++ multiple inheritance: The generated C# classes expose a number of cast operators that you can use to access the different C++ base classes.
  • Overwritten methods can call use the "base" C# keyword to invoke the base class implementation of the given method in C++.
  • You can override any of the virtual methods from classes that support multiple inheritance.
  • A convenience constructor is also provided if you want to instantiate a C# peer for an existing C++ instance that you surfaced through some other mean.

This is pure gold.

The CXXI pipeline in turn is made up of three components, as shown in the diagram on the right.

The GCC-XML compiler is used to parse your source code and extract the vtable layout information. The generated XML information is then processed by the CXXI tooling to generate a set of partial C# classes that contain the bridge code to integrate with C++.

This is then combined with any customization code that you might want to add (for example, you can add some overloads to improve the API, add a ToString() implementation, add some async front-ends or dynamic helper methods).

The result is the managed assembly that interfaces with the native static library.

It is important to note that the resulting assembly (Foo.dll) does not encode the actual in-memory layout of the fields in an object. Instead, the CXXI binder determines based on the ABI being used what the layout rules for the object are. This means that the Foo.dll is compiled only once and could be used across multiple platforms that have different rules for laying out the fields in memory.

Demos

The code on GitHub contains various test cases as well as a couple of examples. One of the samples is a minimal binding to the Qt stack.

Future Work

CXXI is not finished, but it is a strong foundation to drastically improve the interoperability between .NET managed languages and C++.

Currently CXXI achieves all of its work at runtime by using System.Reflection.Emit to generate the bridges on demand. This is useful as it can dynamically detect the ABI used by a C++ compiler.

One of the projects that we are interested in doing is to add support for static compilation, this would allow PS3 and iPhone users to use this technology. It would mean that the resulting library would be tied to the platform on which the CXXI tooling was used.

CXXI currently implements support for the GCC ABI, and has some early support for the MSVC ABI. Support for other compiler ABIs as well as for completing the MSVC ABI is something that we would like help with.

Currently CXXI only supports deleting objects that were instantiated from managed code. Other objects are assumed to be owned by the unmanaged world. Support for the delete operator is something that would be useful.

We also want to better document the pipeline, the runtime APIs and improve the binding.

by Miguel de Icaza (miguel@gnome.org) at December 19, 2011 06:28 PM

December 17, 2011

Jeff Hardy's Blog (NWSGI)

Setting environment variables for MSBuild Exec tasks

MSBuild has an <Exec> task for calling external programs, but (bafflingly) it doesn’t allow you to set the environment the program runs in. In my case, I need to run a Python script with certain directories in the PYTHONPATH.

The Short Way

On Unix machines, this is trivial:

PYTHONPATH=”~/foo” python script.py

For Windows’ wonderful cmd.exe shell (which MSBuild uses to run Exec) it’s a little longer:

(set PYTHONPATH=C:\Foo) & python script.py

If you want, you can chain multiple set commands together to set multiple variables:

(set PYTHONPATH=C:\Foo) & (set FOO=42) & python script.py

To actually use this in the MSBuild file, you’ll need to escape it like so:

<Exec Command=”(set PYTHONPATH=C:\Foo) &amp; python script.py” />

Getting the quoting right for <Exec> can be tricky; I use the <Message> task for debugging the command line. Remember to use &quot; instead of double quotes.

The Long Way

This method takes more typing but is a bit more clear, especially if you have multiple variables to set. Actually, it can be used to store whole batch files inside the MSBuild file, if necessary.

<PropertyGroup>
  <PythonExec><![CDATA[
set PYTHONPATH=C:\Foo
set FOO=42
python script.py
  ]]></PythonExec>
</PropertyGroup>

<Exec Command="$(PythonExec)" />

A CDATA section is required because the newlines need to be preserved. When running an <Exec> task, all MSBuild does is write the contents of Command to a temporary batch file an execute. This just provides more than the usual single line command.


by jdhardy (noreply@blogger.com) at December 17, 2011 08:33 PM

December 16, 2011

Miguel de Icaza

2011: Tell me how you used Mono this year

I have written a summary of Mono's progress in the year 2011, but I want to complement my post with stories from the community.

Did you use Mono in an interesting setup during 2011? Please post a comment on this post, or email me the story and tell me a little bit about it.

by Miguel de Icaza (miguel@gnome.org) at December 16, 2011 05:55 AM

December 14, 2011

Miguel de Icaza

Porto Alegre

We are traveling to Porto Alegre in Brazil today and will be staying in Brazil until January 4th.

Ping me by email (miguel at gnome dot org) if you would like to meet in Porto Alegre to talk hacking, Mono, Linux, open source, iPhone or if you want to enlighten me about the role of scrum masters as actors of social change.

Happy holidays!

by Miguel de Icaza (miguel@gnome.org) at December 14, 2011 07:30 PM

December 13, 2011

Jeff Hardy's Blog (NWSGI)

IronPython 2011 Survey

The IronPython team would like to know more about how IronPython is being used and what improvements people would like to see in 2012.

Take the IronPython 2011 survey!


by jdhardy (noreply@blogger.com) at December 13, 2011 03:55 AM

November 30, 2011

Miguel de Icaza

Farewell to Google's CodeSearch

It seems that part of Steve Jobs' legacy was to give Larry Page some advise: focus. This according to Steve Jobs' recently published biography.

So Larry Page took the advise seriously and decided to focus. His brand of focus is to kill projects that were distracting to their goals. One of them, -and the one I cared the most about- was CodeSearch..

What did CodeSearch do for programmers?

The CodeSearch service was a unique tool as it indexed open source code in the wild.

Codesearch is one of the most valuable tools in existence for all software developers, specifically:

  • When an API is poorly documented, you could find sample bits of code that used the API.
  • When an API error codes was poorly documented, you could find sample bits of code that handled it.
  • When an API was difficult to use (and the world is packed with those), you could find sample bits of code that used it.
  • When you quickly wanted to learn a language, you knew you could find quality code with simple searches.
  • When you wanted to find different solutions to everyday problems dealing with protocols, new specifications, evolving standards and trends. You could turn to CodeSearch.
  • When you were faced with an obscure error message, an obscure token, an obscure return value or other forms of poor coding, you would find sample bits of code that solved this problem.
  • When dealing with proprietary protocols or just poorly documented protocols, you could find how they worked in minutes.
  • When you were trying to debug yet another broken standard or yet another poorly specified standard, you knew you could turn quickly to CodeSearch to find the answers to your problems (memories of OAuth and IMAP flash in my head).
  • When learning a new programming language or trying to improve your skills on a new programming language, you could use CodeSearch to learn the idioms and the best (and worst practices).
  • When building a new version of a library, either in a new language, making a fluent version, making an open source version, building a more complete version you would just go to Codesearch to find answers to how other people did things.

It is a shame that Google is turning their back on their officially stated mission "To organize the world‘s information and make it universally accessible and useful". It is a shame that this noble goal is not as important as competing with Apple, Facebook, Microsoft, Twitter and Yelp.

Comparing Search Engines

While writing this blog entry, I fondly remembered how Codesearch helped me understand the horrible Security framework that ships with iOS. Nobody informed the Apple engineers that "Security through obscurity" was not intended for their developer documentation.

In this particular case, I was trying to understand the semantics of kSecReturnData. How to use this constant and how it interacts with the keyring system is both tricky, and poorly specified in Apple's docs. Sometimes things fail without any indication of what went wrong, other than "error". So I used CodeSearch to figure this out (along with some other 30 constants and APIs in that library that are just as poorly documented).

These are the results of looking for this value in three search engines as of this morning.

First Contender: GrepCode

GrepCode shows absolutely nothing relevant. But shows a bunch of Java packages with no context, no code snippets and if you make the mistake of drilling down, you wont find anything:

Not useful.

Second Contender: Codease

Codase is indexing 250 million lines of code, usually it takes minutes to get this page:

Maybe the server will come back up.

Third Contender: Koders

Koders is part of Black Duck, and searching for the term renders a bunch of matches. Not a single one of the results displayed actually contain a single use of the kSecReturnData constant. And not a single one of the snippets actually show the kSecReturnData constant. It is as useful as configuring your browser to use StumbleUpon as your search engine:

Not useful.

Google's CodeSearch

And this is what Codesearch shows:

The big innovation on Google's search engine is that it actually works and shows real matches for the text being searched, with a relevant snippet of the information you are looking for.

We are going to be entering the dark ages of software research in the next few months.

Is there a hacker White Knight out there?

Running a service like Codesearch is going to take a tremendous amount of resources. There are major engineering challenges involved and hosting a service like this can not be cheap. It is probably not even profitable.

Larry Page's Google has already dropped the project. We can only hope that in a few years Sergey Brin's Google or Eric Schmidt's Google will bring this service back.

Microsoft is too busy catching up to Google and wont have any spare resources to provide a Bing for code search. And if they did, they would limit the search to Win32 APIs.

Thanks!

I should thank Google for funding that project for as long as they did as well as the Google engineers that worked on it as long as they could. Over the years, it helped me fix problems in a fraction of the time and helped me understand complicated problems in minutes.

The Google engineers whose projects just got shutdown for in the name of strategy and focus are probably as sad as all of us are.

On the plus side, I get to share this rant on Google Plus with a dozen of my friends!

by Miguel de Icaza (miguel@gnome.org) at November 30, 2011 09:44 AM

November 22, 2011

Miguel de Icaza

Updated Documentation Site

Jeremie Laval has upgraded our Web-based documentation engine over at docs.go-mono.com. This upgrade brings a few features:

New Look: Base on Jonathan Pobst's redesign, this is what our documentation looks like now:

Better Links: Links to pages on the site will now properly open the left-side tree to the documentation you linked to. This has been an open request for about six years, and it got finally implemented.

Search: the search box on the web site uses Lucene to search the text on the server side, and shows you the matching results as you type:

Easier to Plug: MonoDoc/Web now easily supports loading documentation from alternate directories, it is no longer limited to loading the system-configured documentation.

No more frames: For years we used frames for the documentation pages. They had a poor experience and made the code uglier. They are now gone.

Powered by Mono's SGen: We have reduced the memory consumption of our web documentation by switching to Mono's Generational GC from Boehm's. The load on the server is lower, responses are faster and we scale better.

The source code changes are now on GitHub in the webdoc module.

We have also added Google Analytics support to our web site to help us determine which bits of documentation are more useful to you.

by Miguel de Icaza (miguel@gnome.org) at November 22, 2011 08:34 PM

November 09, 2011

Mike Stall

Pyvot for Excel

I’m thrilled to see the availability of Pyvot, a python package for manipulating tabular data in excel. This is part of the Python Tools for Visual Studio (PTVS) ecosystem.

Check out the codeplex site at http://pytools.codeplex.com/wikipage?title=Pyvot or the tutorial on python.org.

Excel does expose an object model through COM, but it’s tricky to use.  Pyvot provides a very simple python programming experience that focuses on your data instead of Excel COM object trivia. Here are some of my favorite examples:

  • Easy to send python data into excel, manipulate it in excel, and then send it back to python.
  • if you ask for a column in Excel’s object model, it will give you back the entire Excel column, including the one million empty cells. Wheras Pyvot will just give you back the data you used.
  • Pyvot will recognize column header names from tables.
  • Pyvot makes it easy to compute new columns and add them to your table.
  • Pyvot makes it easy to connect to an existing excel workbook, even if the workbook has not even been saved to a file. (This involved scanning down the running object table, and doing smart name matching). This allows you to use excel as a scratchpad for python.
  • Pyvot works naturally with Excel’s existing auto-filters. This enables a great scenario where you can start with data in python, send it to excel and manipulate it with excel auto filters (sort it, remove bad values, etc), and then pull the cleaned data back into python.

Some other FAQs:

  1. What can’t Pyvot do? Pyvot is really focused on tabular data. Excel becomes a Datatable viewer for Python. However Pyvot is not intended to be a full excel automation solution.
  2. How does Pyvot compare to VBA? a) Pyvot is just Python and so you can use vast existing Python libraries. b) Also, VBA is embedded in a single excel workbook and is hard to share across workbooks. Pyvot is about real Python files that live outside of the workbook and can be shared and managed under source control.  c) VBA uses the excel object model, whereas Pyvot provides a much simpler experience for tabular data.
  3. How does Pyvot compare to an Excel-addin? a) Pyvot runs entirely out-of-process, so you don’t need to worry about it crashing Excel on you.  b) Excel-addins, like VBA, use the excel object model. c) Excel addins need to be installed. Pyvot is just loose python files that don’t interfere with your excel installation.

Anyway, if you need to excel goodness, especially filters, check out Pyvot and PTVS.

by Mike Stall - MSFT at November 09, 2011 05:57 PM

October 18, 2011

Miguel de Icaza

Hiring Mono Runtime Hackers

As Mono grows on servers, mobile and desktop platforms, we are looking to hire programmers to join our Mono Runtime team.

The Mono Runtime team owns the code generator, the just-in-time and ahead-of-time compilers, the garbage collector, the threadpool and async layers in the runtime and mostly works in the C-side of the house.

If you are a developer with low-level experience with virtual machines, just in time compilers or love garbage collection, real time processing, or you read every new research paper on incremental garbage collection, hardware acceleration, register allocation and you are interested in joining our young, self-funded and profitable startup, we want to hear from you.

Send your resumes to jobs@xamarin.com

by Miguel de Icaza (miguel@gnome.org) at October 18, 2011 08:25 PM

October 14, 2011

Miguel de Icaza

Upcoming Mono Releases: Change in Policies

We have historically made stable releases of Mono that get branched and maintained for long periods of time. During these long periods of time, we evolve our master release for some four to five months while we do major work on the branch.

Historically, we have had done some of these large changes since we have rewritten or re-architected large parts of our JIT, or our garbage collector, or our compilers.

There were points in the project history where it took us some 9 months to release: seven months of new development followed by two months of beta testing and fixing regressions. With Mono 2.6 we tried to change this, we tried to close the release time to at most six months, and we were relatively good at doing this with 2.8 and 2.10.

We were on track to do a quick Mono 2.12 release roughly around May, but with the April bump in the road, this derailed our plans.

Since 2.10.0 was released two things happened:

  • On Master: plenty of feature work and bug fixing.
  • On our 2.10 branch: bug fixes and backporting fixes from master to 2.10

Now that things have settled at Xamarin and that we are getting Mono back into continuous integration builds we are going to release our first public beta of the upcoming Mono, it will be called Mono 2.11.1. We will keep it under QA until we are happy with the results and we will then release Mono 2.12 based on this.

But after Mono 2.12, we want to move to a new development model where we keep our master branch always in a very stable state. This means that new experimental features will be developed in branches and only landed to the master branch once they have been completed.

Our goal is to more quickly bring the features that we are developing to our users instead of having everyone wait for very long periods of time to get their new features.

New Features in Mono 2.11

These are some of the new features availalable in Mono 2.11:

  • We refactored our C# compiler to have two backends one based on Cecil, one based on Reflection.Emit. Fixing some important usability properties of our compiler.
  • Implemented C# 5 Async.
  • Our C# compiler has TypedReference support (__refvalue, __reftype and __makeref).
  • Our compiler as a service can compile classes now and has an instance API (instantiate multiple C# compiler contexts independently).
  • Added the .NET 4.5 API profile and many of the new async APIs to use with C# 5.
  • Improved our new Garbage Collector: it is faster, it is more responsive and it is more stable. It has also gained MacOS/iOS native support.
  • We made System.Json available on every profile.
  • We added Portable Class Library support.
  • We added tooling for Code Contracts
  • We added a TPL Dataflow implementation
  • We added fast ThreadLocal support
  • We brought our ASP.NET implementation to the year 2011 and it now sports a new enormously cute error page as opposed to that error page that we have which transports you mind back to 1999.
  • Mono's debugger now supports attaching to a live process (deferred support)
  • Our socket stack is faster on BSD and OSX, by using kqueue (on Linux it uses epoll already).

by Miguel de Icaza (miguel@gnome.org) at October 14, 2011 08:31 PM

October 10, 2011

The Voidspace Techie Blog

mock 0.8 beta 4 released: bugfix and minor features

I've released mock 0.8 beta 4. You can download it it or install it with: pip install -U mock==dev mock is a library for testing in Python. ... [602 words]

October 10, 2011 01:05 AM

September 27, 2011

Miguel de Icaza

WinRT and Mono

Today Joseph mentioned to me that some of our users got the impression from my previous post on WinRT that we would be implementing WinRT for Linux. We are not working on a WinRT UI stack for Linux, and do not have plans to.

WinRT is a fabulous opportunity for Mono, because Microsoft is sending a strong message: if you want your code to run in multiple scenarios (server, desktops, sandboxed environments), you want to split your UI code from your backend code.

This is great because it encourages developers to think in terms of having multiple facades for the same code base and the direction that we have been taking Mono on in the last few years.

Use the native toolkit on each platform to produce an immersive user experience, and one that leverages the native platform in the best possible way.

These are the APIs that we envision .NET developers using on each platform:

  • Windows: WinRT, Winforms, WPF (fallbacks: Gtk#, Silverlight)
  • MacOS: MonoMac (fallback: Gtk#, Silverlight)
  • Linux: Gtk#
  • Android: MonoDroid APIs
  • iOS: MonoTouch
  • Windows Phone 7: Silverlight
  • XBox360: XNA-based UI

Even if a lot of code could be reused from Moonlight, WinRT is a moving target. It is not clear that the Linux desktop, as we know it today, is keeping up with the growth of other consumer environments. I talked to Tim about this at Build.

Head-less WinRT

There are some GUI-less components of WinRT that *do* make sense to bring to Mono platforms. There is already an implementation of some bits of the headless WinRT components being done by Eric.

The above effort will enable more code sharing to take place between regular .NET 4 apps, WP7 apps, Mono apps and WinRT apps.

by Miguel de Icaza (miguel@gnome.org) at September 27, 2011 06:04 AM

September 20, 2011

Mike Stall

Python Tools for VS

I’ve been having a great time using Python Tools for VS.  It’s a free download that provides CPython language support in Visual Studio 2010. The intellisense is pretty good (especially for a dynamic language!) and the debugger is useful to have. Having a good IDE is changing the way I view the language. Check out the homepage for a long list of features it supports. One other perk is that because it’s using the VS 2010 shell, it works with my favorite VS 2010 editor extensions.

by Mike Stall - MSFT at September 20, 2011 06:16 PM

September 16, 2011

Miguel de Icaza

WinRT demystified

Windows 8 as introduced at Build is an exciting release as it has important updates to how Microsoft envisions users will interact with their computers, to a fresh new user interface to a new programming model and a lot more.

If you build software for end-users, you should watch Jensen Harris discuss the Metro principles in Windows 8. I find myself wanting to spend time using Windows 8.

But the purpose of this post is to share what I learned at the conference specifically about WinRT and .NET.

The Basics

Microsoft is using the launch of Windows 8 as an opportunity to fix long-standing problems with Windows, bring a new user interface, and enable a safe AppStore model for Windows.

To do this, they have created a third implementation of the XAML-based UI system. Unlike WPF which was exposed only to the .NET world and Silverlight which was only exposed to the browser, this new implementation is available to C++ developers, HTML/Javascript developers and also .NET developers.

.NET developers are very familiar with P/Invoke and COM Interop. Those are two technologies that allow a .NET developer to consume an external component, for example, this is how you would use the libc "system (const char *)" API from C#:

	[DllImport ("libc")]
	void system (string command);
	[...]

	system ("ls -l /");
	

We have used P/Invoke extensively in the Mono world to create bindings to native libraries. Gtk# binds the Gtk+ API, MonoMac binds the Cocoa API, Qyoto binds the Qt API and hundred other bindings wrap other libraries that are exposed to C# as object-oriented libraries.

COM Interop allows using C or C++ APIs directly from C# by importing the COM type libraries and having the runtime provide the necessary glue. This is how Mono talked with OpenOffice (which is based on COM), or how Mono talks to VirtualBox (which has an XPCOM based API).

There are many ways of creating bindings for a native library, but doing it by hand is bound to be both tedious and error prone. So everyone has adopted some form of "contract" that states what the API is, and the binding author uses this contract to create their language binding.

WinRT

WinRT is a new set of APIs that have the following properties:

  • It implements the new Metro look.
  • Has a simple UI programming model for Windows developers (You do not need to learn Win32, what an HDC, WndProc or LPARAM is).
  • It exposes the WPF/Silverlight XAML UI model to developers.
  • The APIs are all designed to be asynchronous.
  • It is a sandboxed API, designed for creating self-contained, AppStore-ready applications. You wont get everything you want to create for example Backup Software or Hard Disk Partitioning software.
  • The API definitions is exposed in the ECMA 335 metadata format (the same one that .NET uses, you can find those as ".winmd" files).

WinRT wraps both the new UI system as well as old Win32 APIs and it happens that this implementation is based on top of COM.

WinRT Projections

What we call "bindings" Microsoft now calls "projections". Projections are the process of exposing APIs to three environments: Native (C and C++), HTML/Javascript and .NET.

  • If you author a component in C++ or a .NET language, its API will be stored in a WinMD file and you will be able to consume it from all three environments (Native, JavaScript and .NET).

    Even in C++ you are not exposed to COM. The use of COM is hidden behind the C++ projection tools. You use what looks and feels like a C++ object oriented API.

    To support the various constructs of WinRT, the underlying platform defines a basic set of types and their mappings to various environment. In particular, collection objects in WinRT are mapped to constructs that are native to each environment.

    Asynchronous APIs

    Microsoft feels that when a developer is given the choice of a synchronous and an asynchronous API, developers will choose the simplicity of a synchronous API. The result usually works fine on the developer system, but is terrible when used in the wild.

    With WinRT, Microsoft has followed a simple rule: if an API is expected to take more than 50 milliseconds to run, the API is asynchronous.

    The idea of course is to ensure that every Metro application is designed to always respond to user input and to not hang, block or provide a poor user experience.

    Async programming has historically been a cumbersome process as callbacks and state must be cascaded over dozens of places and error handling (usually poor error handling) is sprinkled across multiple layers of code.

    To simplify this process, C# and VB have been extended to support the F#-inspired await/async pattern, turning async programming into a joy. C++ got a setup that is as good as you can get with C++ lambdas and Javascript uses promises and "then ()".

    Is it .NET or Not?

    Some developers are confused as to whether .NET is there or not in the first place, as not all of the .NET APIs are present (File I/O, Sockets), many were moved and others were introduced to integrate with WinRT.

    When you use C# and VB, you are using the full .NET framework. But they have chosen to expose a smaller subset of the API to developers to push the new vision for Windows 8.

    And this new vision includes safety/sandboxed systems and asynchronous programming. This is why you do not get direct file system access or socket access and why synchronous APIs that you were used to consuming are not exposed.

    Now, you notice that I said "exposed" and not "gone".

    What they did was that they only exposed to the compiler a set of APIs when you target the Metro profile. So your application will not accidentally call File.Create for example. At runtime though, the CLR will load the full class library, the very one that contains File.Create, so internally, the CLR could call something like File.Create, it is just you that will have no access to it.

    This split is similar to what has been done in the past with Silverlight, where not every API was exposed, and where mscorlib was given rights that your application did not have to ensure the system safety.

    You might be thinking that you can use some trick (referencing the GAC library instead of the compiler reference or using reflection to get to private APIs, or P/Invoking into Win32). But all of those uses will be caught by AppStore review application and you wont be able to publish your app through Microsoft's store.

    You can still do whatever ugly hack you please on your system. It just wont be possible to publish that through the AppStore.

    Finally, the .NET team has taken this opportunity to do some spring cleaning. mscorlib.dll and System.dll have been split in various libraries and they have moved some types around.

    Creating WinRT Components

    Microsoft demoed creating new WinRT components on both C++ and .NET.

    In the .NET case, creating a WinRT component has been drastically simplified. The following is the full source code for a component that adds 2:

    
    	public sealed class AddTwo {
    		public int Add (int a, int b)
    		{
    			return a + b;
    		}
    
    		public async IAsyncOperation SubAsync (int a, int b)
    		{
    			return a - await (CountEveryBitByHand (b));
    		}
    	}
    	

    You will notice that there are no COM declarations of any kind. The only restriction is that your class must be sealed (unless you are creating a XAML UI component, in that case the restriction is lifted).

    There are also some limitations, you can not have private fields on structures, and there is not Task<T> for asynchronous APIs, instead you use the IAsyncOperation interface. Update to clarify: the no private fields rule is only limited to structs exposed to WinRT, and it does not apply to classes.

    UI Programming

    When it comes to your UI selection, you can either use HTML with CSS to style your app or you can use XAML UI.

    To make it easy for HTML apps to adhere to the Metro UI style and interaction model, Microsoft distributes Javascript and CSS files that you can consume from your project. Notice that this wont work on the public web. As soon as you use any WinRT APIs, your application is a Windows app, and wont run in a standalone web browser.

    .NET and C++ developers get to use XAML instead.

    There is clearly a gap to be filled in the story. It should be possible to use Microsoft's Razor formatting engine to style applications using HTML/CSS while using C#. Specially since they have shown the CLR running on their HTML/JS Metro engine.

    Right now HTML and CSS is limited to the Javascript use.

    In Short

    Microsoft has created a cool new UI library called WinRT and they have made it easy to consume from .NET, Javascript and C++ and if you adhere by their guidelines, they will publish the app on their appstore.

    Xamarin at BUILD

    If you are at build, come join us tonight at 6:30 at the Sheraton Park hotel, just after Meet the Experts. Come talk about Mono, Xamarin, MonoTouch, MonoDroid and MonoMac and discuss the finer points of this blog over an open bar.

    Comments

    There is a long list of comments in the moderation queue that are not directly related to WinRT, or bigger questions that are not directly related to WinRT, .NET and this post's topic, so I wont be approving those comments to keep things on focus. There are better forums to have discussions on Metro.

  • by Miguel de Icaza (miguel@gnome.org) at September 16, 2011 06:03 AM

    September 14, 2011

    Miguel de Icaza

    Xamarin and Mono at the BUILD Conference

    Continuing our tradition of getting together with Mono users at Microsoft conferences, we are going to be hosting an event at the Sheraton Hotel next to the conference on Thursday at 6:30pm (just after Ask the Experts).

    Come join us with your iOS, Android, Mac and Linux questions.

    by Miguel de Icaza (miguel@gnome.org) at September 14, 2011 09:07 PM

    September 08, 2011

    Miguel de Icaza

    MonoDevelop 2.6 is out

    Lluis just released the final version of MonoDevelop 2.6.

    This release packs a lot of new features, some of my favorite features in this release are:

    • Git support.
      • It not only provides the regular source code control commands, it adds full support for the various Git idioms not available in our Subversion addin.
      • Based on Java's JGit engine
      • Ported to C# using db4Object's sharpen tool. Which Lluis updated significantly
      • Logging and Blaming are built into the editor.
    • Mac support:
      • Our fancy MonoMac support lets you build native Cocoa applications. If you have not jumped into this Steve Jobs Love Fest, you can get started with our built-in templates and our online API documentation.
      • Native File Dialogs! We now use the operating system file dialogs, and we even used our own MonoMac bindings to get this done.
      • You can also check my Mac/iOS-specific blog for more details.
    • Unified editor for Gtk#, ASP.NET, MonoTouch and MonoDroid: we no longer have to track various forks of MonoDevelop, they have all converged into one tree.

    The above is just a taste of the new features in MonoDevelop 2.6. There are many more nominate your own!

    Congratulations to the MonoDevelop team on the great job they did!

    And I want to thank everyone that contributed code to MonoDevelop, directly or indirectly to make this happen.

    by Miguel de Icaza (miguel@gnome.org) at September 08, 2011 02:11 AM

    September 06, 2011

    Miguel de Icaza

    Learning Unix

    As I meet new Unix hackers using Linux or Mac, sometimes I am surprised at how few Unix tricks they know. It is sometimes painful to watch developers perform manual tasks on the shell.

    What follows are my recommendations on how to improve your Unix skills, with a little introduction as to why you should get each book. I have linked to each one of those books with my Amazon afiliates link, so feel free to click on those links liberally.

    Here is the list of books that programmers using Unix should read. It will only take you a couple of days to read them, but you will easily increase your productivity by a whole order of magnitude.

    The Basics

    The Unix Programming Environment by Kernighan and Pike is a must-read. Although this is a very old book and it does not cover the fancy new features in modern versions of Unix, no other book covers in such beauty the explanation of the shell quoting rules, expansion rules, shell functions and the redirection rules.

    Every single thing you do in Unix will use the above in some form or shape, and until you commit those to memory you will be a tourist, and not a resident.

    Then you will learn sed and basic awk, both tools that you will use on a daily basis once you become proficient. You do not have to ever be scared of sed or regular expressions anymore.

    Save yourself the embarrassment, and avoid posting on the comments section jwz's quote on regular expressions. You are not jwz.

    It will take you about a week of commuting by bus to read it. You do not have to finish the book, you can skip over the second part.

    Unix Boot Camp

    While Kernighan's book is basic literacy, you need to develop your muscles and you need to do this fast and not buy a book so thick and so packed with ridiculous screenshots that you will never get past page 20.

    Get UNIX for the Impatient. This book is fun, compact and is packed with goodies that will make you enjoy every minute in Unix.

    Learn Emacs

    Emacs has had a strong influence in Unix over the years. If you learn to use Emacs, you will automatically learn the hotkeys and keybindings in hundreds of applications in Unix.

    The best place to learn Emacs is to launch Emacs and then press Control-h and then t. This is the online tutorial and it will take you about two hours to complete.

    The knowledge that you will gain from Emacs will be useful for years to come. You will thank me. And you will offer to buy me a beer, which I will refuse because I rather have you buy me a freshly squeezed orange juice.

    Tooting my own horn

    Learn to use the Midnight Commander.

    The Midnight Commander blends the best of both worlds: GUI-esque file management with full access to the Unix console.

    The Midnight Commander is a console application that shows 2 panels listing two different directories side-by-side and provides a command line that is fed directly to the Unix shell.

    The basics are simple: use the arrow keys to move around, Control-S to do incremental searches over filenames, Control-t to tag or untag files and the F keys to perform copy, move or delete operations. Copy and Move default to copy to the other panel (which you can conveniently switch to by pressing the tab key).

    There is no better way of keeping your file system organized than using my file manager.

    Becoming a Power User

    If you can not quench your thirst for knowledge there is one last book that I will recommend. This is the atomic bomb of Unix knowledge.

    Unix Power Tools is a compilation of tricks by some of the best Unix users that got compiled into a huge volume. This is a book of individual tricks, each about a page long, ideal to keep either on your bedside or in the restoom to pick a new trick every day.

    Mavis Beacon

    At this point you might be thinking "I am awesome", "the world is my oyster" and "Avatar 3D was not such a bad movie".

    But unless you touch-type, you are neither awesome, nor you are in a position to judge the qualities of the world as an oyster or any James Cameron movies.

    You have to face the fact that not only you are a slow typist, you do look a little bit ridiculous. You are typing with two maybe three fingers on each hand and you move your head like a chicken as you alternate looking at your keyboard and looking at your screen.

    Do humanity a favor and learn to touch type.

    You can learn to touch type in about three weeks if you spend some two to three hours per day using Mavis Beacon Teaches Typing.

    Mavis Beacon costs seventeen dollars ($17). Those seventeen dollars and the sixty three hours you will spend using it will do more to advance your carreer than the same sixty three hours spend reading editorials on Hacker News.

    Classics

    All of the books I list here have stood the test of time. They were written at a time when books were designed to last a lifetime.

    Unlike most modern computer books, all of these were a pleasure to read.

    by Miguel de Icaza (miguel@gnome.org) at September 06, 2011 06:45 PM

    September 05, 2011

    The Voidspace Techie Blog

    matplotlib and numpy for Python 2.7 on Mac OS X Lion

    Unfortunately, due to an API change, the latest released version of matplotlib is incompatible with libpng 1.5. Take a wild guess as to which version comes with Mac OS X Lion. ... [275 words]

    September 05, 2011 12:18 AM

    August 31, 2011

    Dino Viehland

    Announcing Python Tools for Visual Studio 1.0

    As you can see from Soma's blog on Monday we released Python Tools for Visual Studio 1.0.  Of course I'm excited about this release as it's been the 1st stable release I've put since IronPython 2.6 (and the first blog too!).  This release of PTVS focuses on a combination of the core IDE experience (intellisense, debugging, profiling, code navigation, etc..) as well as a set of features which target Technical / High Performance Computing.  That includes support for MPI cluster debugging and integrated IPython support. 

    PTVS has been a long time in the making and it represents the fruition of a lot of effort here at Microsoft to produce a Python IDE.  This actually goes back a long time starting it's development several years ago on the IronPython team.  Back then we had done several small projects to figure out what we'd want to do in the Python IDE space.  That included a couple of attempts of building a stand alone IDE using the same components Visual Studio is built upon as a few different attempts at extending Visual Studio to add Python support (some of this having seen the light of day in the form of IronPython Studio and the Python integration which ships w/ the VS SDK).  Ultimately we were able to re-use bits and pieces from all of these attempts and release IronPython Tools for Visual Studio w/ the Alpha of IronPython 2.7. 

    But we needed one last push to turn PTVS into what you see today - and that final push brought support for more than just IronPython and we now have turned Visual Studio into a general purpose Python IDE.  Whatever version of Python you'd like to use I think you'll find that PTVS provides a great experience - whether you're using traditional CPython or IronPython (which we still have special support for including WPF designer support) or another Python distribution such as the speedy PyPy.  The only feature which doesn't currently work across Python distributions is the profiling support which for performance reasons is tied to the CPython embedding API.

    Anyway, if you're looking for doing Python development on Windows I hope you'll give PTVS a shot and let us know what you think.

     

     

    by DinoV at August 31, 2011 08:25 PM

    August 17, 2011

    The Voidspace Techie Blog

    mock 0.8 beta 3 released: feature complete

    I've released mock 0.8 beta 3. You can download it it or install it with: pip install -U mock==dev mock is a library for testing in Python. ... [534 words]

    August 17, 2011 11:35 PM

    August 04, 2011

    Miguel de Icaza

    And we are back: Mono 2.10.3

    This is Xamarin's first official Mono release.

    This is a major bug fix release that addresses many of the problems that were reported since our last release back on April 25th.

    The detailed release notes have all the details, but the highlights of this release include:

    • MacOS X Lion is supported: both the Mono runtime and Gtk+ as shipped with Mono have been updated to run properly on Lion. This solves the known problems that users had running MonoDevelop on MacOS X.
    • Vastly improved WCF stack
    • Many bug fixes to our precise garbage collector.

    Major features continue to be developed in the main branch. Currently we are just waiting for the C# 5.0 Asynchronous Language support to be completed to release that version.

    Mono 2.10.3 also serves as the foundation for the upcoming Mono for Android 1.0.3 and MonoTouch 4.1.

    You can get it from Mono's Download Site.

    Currently we offer source code, Windows and MacOS packages. We will publish Linux packages as soon as we are done mirroring the contents of the old site that contains the Linux repositories.

    On C# 5.0

    Our new compiler, as you might know, has been rewritten to support two backends: a System.Reflection.Emit backend, and the brilliant IKVM.Reflection backend.

    The C# 5.0 support as found on master contains the C# 5.0 support as shipped by Microsoft on their latest public release.

    To try it out, use -langversion:future when invoking the compiler. You can try some of our samples in mono/mcs/tests/test-async*.cs

    by Miguel de Icaza (miguel@gnome.org) at August 04, 2011 10:00 PM

    The Voidspace Techie Blog

    mock 0.8 beta 2:bug fix and side_effect iterables

    I've released mock 0.8 beta 2. You can download it it or install it with: pip install -U mock==dev mock is a library for testing in Python. ... [459 words]

    August 04, 2011 10:48 AM

    July 25, 2011

    The Voidspace Techie Blog

    mock 0.8 beta 1: easier asserts for multiple and chained calls

    I've released mock 0.8 beta 1. You can download it it or install it with: pip install -U mock==dev mock is a library for testing in Python. ... [1376 words]

    July 25, 2011 11:02 AM

    July 20, 2011

    Miguel de Icaza

    MonoDevelop on Lion

    We here at Xamarin are as excited as you are about the release of Lion. But unfortunately we're not quite ready to support you on Lion yet, and MonoDevelop doesn't work quite right. We're working around the clock to make MonoDevelop work perfectly on Lion, and we'll let you know as soon as it's ready.

    Update on July 29th: We have most of the fixes in place for Mono and will issue a build for testing on the Alpha channel soon.

    by Miguel de Icaza (miguel@gnome.org) at July 20, 2011 10:16 PM

    Aaron Marten's WebLog

    Visual Studio @ UserVoice

    We now have an official site for Visual Studio on UserVoice! Please use this as a way to send suggestions and feature requests to the Visual Studio team. For specific bugs and errors, please continue to use Microsoft Connect.

    http://visualstudio.uservoice.com

    image

    by Aaron Marten at July 20, 2011 04:53 PM

    July 18, 2011

    Miguel de Icaza

    Novell/Xamarin Partnership around Mono

    I have great news to share with the Mono community.

    Today together with SUSE, an Attachmate Business Unit, we announced:

    • Xamarin will be providing the support for all of the existing MonoTouch, Mono for Android and Mono for Visual Studio customers.
    • Existing and future SUSE customers that use the Mono Enterprise products on their SLES and SLED systems will continue to receive great support backed by the engineering team at Xamarin.
    • Xamarin obtained a perpetual license to all the intellectual property of Mono, MonoTouch, Mono for Android, Mono for Visual Studio and will continue updating and selling those products.
    • Starting today, developers will be able to purchase MonoTouch and Mono for Android from the Xamarin store. Existing customers will be able to purchase upgrades.
    • Xamarin will be taking over the stewardship of the Mono open source community project. This includes the larger Mono ecosystem of applications that you are familiar with including MonoDevelop and the other Mono-centric in the Mono Organization at GitHub.

    We are a young company, but we are completely dedicated to these mobile products and we can not wait to bring smiles to every one of our customers.

    Roadmaps

    Our immediate plans for both MonoTouch and Mono for Android is to make sure that your critical and major bugs are fixed. We have been listening to the needs of the community and we are working to improve these products to meet your needs. You can expect updates to the products in the next week.

    In the past couple of months, we have met with some of our users and we have learned a lot about what you wanted. We incorporated your feature requests into our products roadmaps for both the MonoTouch and the Mono for Android products.

    Another thing we learned is that many companies need to have a priority support offering for this class of products, so we have introduced this. It can be either be purchased when you first order MonoTouch or Mono for Android, or you get an upgrade to get the priority support.

    Next Steps

    Our goals are to delight software developers by giving them the most enjoyable environment, languages and tools to build mobile applications.

    We are thankful to everyone that provided feedback to us in our online form that we published a month ago. Please keep your feedback coming, you can reach us at contact@xamarin.com. We are reading every email that you send us and you can use my new miguel at new company dot com email address to reach me.

    We will be at the Monospace conference this weekend at the Microsoft NERD Center, hope to see you there!

    Remember to purchase early and often so we have the resources to bring you the best developer tools on the planet.

    by Miguel de Icaza (miguel@gnome.org) at July 18, 2011 08:27 PM

    The Voidspace Techie Blog

    Mock subclasses and their attributes

    This blog entry is about creating subclasses of mock.Mock. mock is a library for testing in Python. It allows you to replace parts of your system under test with mock objects. ... [341 words]

    July 18, 2011 05:22 PM

    July 16, 2011

    The Voidspace Techie Blog

    Mock 0.8 alpha 2: patch.multiple, new_callable and non-callable mocks

    I've released mock 0.8 alpha 2. You can download it it or install it with: pip install -U mock==dev mock is a library for testing in Python. ... [496 words]

    July 16, 2011 03:36 PM

    July 14, 2011

    Hex Dump

    I am speaking at PyCon AU 2011 about CouchDB

    The official schedule for PyCon Australia 2011 has been announced (http://pycon-au.org/2011/conference/schedule/). My talk is the first session after the opening keynote and will be an overview of CouchDB and how you can use it with Python. "CouchDB  (http://couchdb.apache.org/) is an open source, document-oriented NoSQL Database Management Server.It supports queries via views using MapReduce,

    by Mark Rees (noreply@blogger.com) at July 14, 2011 12:40 AM

    July 13, 2011

    Jeff Hardy's Blog (NWSGI)

    Using Downloaded IronPython Modules

    One of Internet Explorer’s many “helpful” features is one that will “taint” any downloaded files as so that the system knows they are from the internet. Honestly, I can’t see what value this feature adds other than breaking CHM files, and preventing IronPython from using downloaded modules.
    This was brought to my attention by Shay Friedman, who was trying to use IronPython.Zlib but couldn’t get it to work. In particular, the error message was misleading:
    IronPython 2.6.1 (2.6.10920.0) on .NET 4.0.30319.1
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import clr
    >>> clr.AddReferenceToFileAndPath('C:\Users\Jeff\Downloads\IronPython.Zlib-2.6-clr4\IronPython.Zlib.dll')
    Traceback (most recent call last):
      File "", line 1, in 
    IOError: System.IO.IOException: file does not exist: C:\Users\Jeff\Downloads\IronPython.Zlib-2.6-clr4\IronPython.Zlib.dll
       at Microsoft.Scripting.Actions.Calls.MethodCandidate.Caller.Call(Object[] args, Boolean& shouldOptimize)
    ...
    >>>
    The file, of course, does exist, so why can’t IronPython find it?
    There are actually a few things that interplay here: first, it must be downloaded with a  browser that taints the file (which I believe are just IE and Chrome), and second, it must be unzipped with Windows’ built in unzipping tools. The built in tools have the interesting property that when unzipping a tainted zip file will also taint all of the unzipped files. Finally, the punchline: .NET will not load an assembly that is tainted.
    So how do we get around this? Well, you can:
    • use a different browser
    • use a different unzipping tool (I highly recommend 7-zip)
    • unblock the zip file prior to unzipping
    To unblock the file, just right click on the zip file, click “Properties”, and click “Unblock”:
    unblock-file
    If you’ve already unzipped the file, you can just unblock the DLL. Depending on where you unzipped the file to, you my need to use an elevated Explorer window. You can also unblock multiple files from the command line.
    This may well affect applications other than IronPython, so it’s just one more thing to watch for.


    by jdhardy (noreply@blogger.com) at July 13, 2011 03:46 PM

    July 06, 2011

    Miguel de Icaza

    Update on Mono

    I have a posted an update on Mono and the upcoming release of Mono 2.12.

    by Miguel de Icaza (miguel@gnome.org) at July 06, 2011 08:45 PM

    July 01, 2011

    Miguel de Icaza

    Mono Consultants

    We are getting flooded with paid support requests for Mono. Developers looking for us to fix bugs in Mono, to do some custom work, to port applications, libraries and adjust Mono for some specific needs.

    But we are trying to be a product company as opposed to a support company.

    We still want to help the Mono user community, and with all of the Mono talent out there, at least we can use this opportunity to get both groups in touch: the users that want custom engineering done, with the talented list of hackers.

    If you are a consultant available to do custom engineering and support for customers, we would love to put you in touch with people that need the custom engineering done. Email us at contact@xamarin.com, in the subject line, specify that you are available for custom engineering, and in the body of the message list both your Mono skills (C# or C coding) and your availability to engage on those gigs.

    We will then get you in touch with users that needs the work done.

    by Miguel de Icaza (miguel@gnome.org) at July 01, 2011 04:21 AM

    June 29, 2011

    Miguel de Icaza

    Xamarin Joy Factory

    Setting up a new company consumes a lot of time. Specially as we are developing as fast as we can not one, but two products: .NET for iPhone and .NET for Android.

    Structurally, we are better off than we were the first time that we built these products. We have more developers working on each product than we did the first time around, so progress is faster. But we also had to swap the developers around: those that wrote Foo, can not work on Foo again. This is just one of the things that we have to do to ensure a clean room implementation.

    Our vision is to create happy developers. We did that in the past by bringing the C# language, garbage collection, LINQ, strongly typed APIs, Parallel FX, intellisense and inline documentation to iPhone and Android developers. And by making it possible for the world's 6 million .NET developers to reuse their skills on the most popular mobile platforms.

    This time around, we are doing even more. We are addressing many of the frustrations that developers had with the old products and making sure that those frustrations go away.

    Nat and myself complement each other very well here. This means that there are a lot of new things that will be present in our offering that we never did in the past.

    There is a new level of polish that those familiar with Nat's previous products had (SUSE Studio, NLD/SLED, Ximian Desktop). Everyone at Xamarin can feel that Nat is hard at work when they noticed that one of the first things Nat did was to engage six design firms and an army of technical writers to ensure that our products go from "Nice" to "Amazing". And that was on his second week as CEO, a lot has happened since.

    I do not want to give away everything that we are doing, it would ruin the surprise, but we are here to deliver joy to programmers everywhere.

    If you are interested in working with us, and making mobile development and .NET development a joy that everyone can enjoy, check out our Jobs page

    Where we are now

    It gives me great pleasure to say that we have elevated the discourse on the iPhone simulator and my Chicken-powered TweetStation is up and running with the new iOS product. The picture on the left is TweetStation powered by MonoTouch, the picture on the right is TweetStation powered by Xamarin's iPhone product:


    TweetStation on MonoTouch

    TweetStation on Xamarin iOS

    Update: TweetStation now starts up on Device! We have the static compiler working!

    We also have the delicious iOS5 APIs exposed as strongly-typed and intellisense-friendly C#. We are now updating the APIs from Beta1 to Beta2, which should be completed today or tomorrow.

    Our Android efforts are moving fast. Only this morning we got Layouts to render on the device. This is a lot of work, as it gets Dalvik to start Mono, and initializes our entire bridge and exercises the C# and Java bridge. In addition, we have identified and fixed a serious problem in the distributed garbage collector.

    We also have a number of surprises for everyone in MonoDevelop, we believe that you guys are going to love the new features for iPhone and Android development.

    There is still a lot of polish left to do. We are working as hard as we can to have Preview releases in your hands, but we feel confident that we will have a great product for sale by the end of the summer. We hope you will all max out your credit cards buying it.

    by Miguel de Icaza (miguel@gnome.org) at June 29, 2011 01:42 AM

    June 21, 2011

    Miguel de Icaza

    June 18, 2011

    Aaron Marten's WebLog

    Temporary Post Used For Theme Detection (0b80dc13-367f-47f4-957b-bf8b55dc5edc - 3bfe001a-32de-4114-a6b4-4005b770f6d7)

    This is a temporary post that was not deleted. Please delete this manually. (72c9b318-73bf-43e4-89ed-ad8cc295876b - 3bfe001a-32de-4114-a6b4-4005b770f6d7)

    by Aaron Marten at June 18, 2011 07:58 PM

    June 14, 2011

    The Voidspace Techie Blog

    mock 0.8 alpha 1: New Features

    This is a long entry, please forgive me. It describes all the new features in mock 0.8.0 alpha 1. The main reason I need to describe it here is that I haven't yet written the documentation. ... [2527 words]

    June 14, 2011 12:13 PM

    June 13, 2011

    The Voidspace Techie Blog

    Mocking Generator Methods

    Another mock recipe, this one for mocking generator methods. A Python generator is a function or method that uses the yield statement to return a series of values when iterated over [1]. ... [267 words]

    June 13, 2011 05:24 PM

    June 12, 2011

    Jeff Hardy's Blog (NWSGI)

    NWSGI 2.1 Now Available

    I’ve finally updated NWSGI to use IronPython 2.7: NWSGI 2.1. The only other change is that NWSGI.dll will be added to the GAC by default by the installer.

    NWSGI 3 Update

    The big feature of NWSGI 3 is decoupling it from IIS and ASP.NET, which involved creating an abstraction layer for web servers (which is funny, because that’s what WSGI is). Shortly after I started that, the OWIN project started, which has essentially the same goal. Since I hate duplicating effort, NWSGI 3 is on hold until OWIN stabilizes, which hopefully shouldn’t be too much longer.


    by jdhardy (noreply@blogger.com) at June 12, 2011 08:25 PM

    June 06, 2011

    The Voidspace Techie Blog

    Another approach to mocking properties

    mock is a library for testing in Python. It allows you to replace parts of your system under test with mock objects. ... [512 words]

    June 06, 2011 08:17 PM

    May 30, 2011

    The Voidspace Techie Blog

    mock 0.7.2 released

    There's a new minor release of mock, version 0.7.2 with two bugfixes in it. http://pypi.python.org/pypi/mock/ (download) http://www.voidspace.org.uk/python/mock/ (documentation) https://code.google.com/p/mock/ (repo and issue tracker) mock is a Python library for simple mocking and patching (replacing objects with mocks during test runs). ... [696 words]

    May 30, 2011 08:11 PM

    The Voidspace Techie Blog

    namedtuple and generating function signatures

    Kristjan Valur, the chief Python developer at CCP games (creators of Eve Online), has posted an interesting blog entry about the use of exec in namedtuple. namedtuple is a relatively recent, and extraordinary useful, part of the Python standard library. ... [682 words]

    May 30, 2011 02:00 PM

    The Voidspace Techie Blog

    Nothing is Private: Python Closures (and ctypes)

    As I'm sure you know Python doesn't have a concept of private members. One trick that is sometimes used is to hide an object inside a Python closure, and provide a proxy object that only permits limited access to the original object. ... [482 words]

    May 30, 2011 12:40 PM

    May 29, 2011

    The Voidspace Techie Blog

    Using patch.dict to mock imports

    I had an email from a mock user asking if I could add a patch_import to mock that would patch __import__ in a namespace to replace the result of an import with a Mock. It's an interesting question, with a couple of caveats: Don't patch __import__. ... [522 words]

    May 29, 2011 07:50 PM

    May 25, 2011

    Miguel de Icaza

    Xamarin recruits best CEO in the Industry

    I could not be more excited about this.

    Nat Friedman has joined Xamarin as a company founder and CEO this week.

    Nat and I have known each other and worked together on and off since the early days of Linux. In 1999, we started Ximian to advance the state of Linux, user experience and developer platforms - with many of our efforts brought to fruition after our acquisition by Novell in 2003.

    Anyone that has had the pleasure to work with Nat knows that ideas come in one side, and objects of desire come out on the other end.

    In mobile development, we've discovered a great opportunity: a need for products that developers love. And we are going to fill this need with great products that will make everyone's eyes shine every time they use our software.

    Update: Nat's most recent product was SUSE Studio.

    by Miguel de Icaza (miguel@gnome.org) at May 25, 2011 08:14 PM

    The Voidspace Techie Blog

    Implementing __dir__ (and finding bugs in Pythons)

    A new magic method was added in Python 2.6 to allow objects to customise the list of attributes returned by dir. The new protocol method (I don't really like the term "magic method" but it is so entrenched both in the Python community and in my own mind) is __dir__. ... [1181 words]

    May 25, 2011 10:04 AM

    May 18, 2011

    Hex Dump

    Python Informix Database Connection Options

    I am currently at the International Informix Users Group Conference (http://www.iiug.org/index.php) in Kansas. In the opening keynote by Jerry Keesee, there some discussion about IBM's Open Source Initiatives for Informix. On the accompanying slide, Python and Django were listed. This reminded me that I hadn't taken stock of what the Informix DB connections options were for the Python user lately

    by Mark Rees (noreply@blogger.com) at May 18, 2011 03:58 PM

    May 17, 2011

    Miguel de Icaza

    Announcing Xamarin

    Today we start Xamarin, our new company focused on Mono-based products.

    These are some of the things that we will be doing at Xamarin:

    • Build a new commercial .NET offering for iOS
    • Build a new commercial .NET offering for Android
    • Continue to contribute, maintain and develop the open source Mono and Moonlight components.
    • Explore the Moonlight opportunities in the mobile space and the Mac appstore.

    We believe strongly in splitting the presentation layer from the business logic in your application and supporting both your backend needs with C# on the server, the client or mobile devices and giving you the tools to use .NET languages in every desktop and mobile client.

    Development started early this morning, we will first deliver the iPhone stack, followed by the Android stack, and then the Moonlight ports to both platforms.

    The new versions of .NET for the iPhone and Android will be source compatible with MonoTouch and Mono for Android. Like those versions, they will be commercial products, built on top of the open core Mono.

    In addition, we are going to provide support and custom development of Mono. A company that provides International Mono Support, if you will.

    As usual, your feedback will help us determine which platforms and features are important to you. Help us by filling out our survey. If you give us your email address, we will also add you to our preview/beta list for our upcoming products.

    Fighting for Your Right to Party

    We have been trying to spin Mono off from Novell for more than a year now. Everyone agreed that Mono would have a brighter future as an independent company, so a plan was prepared last year.

    To make a long story short, the plan to spin off was not executed. Instead on Monday May 2nd, the Canadian and American teams were laid off; Europe, Brazil and Japan followed a few days later. These layoffs included all the MonoTouch and MonoDroid engineers and other key Mono developers. Although Attachmate allowed us to go home that day, we opted to provide technical support to our users until our last day at Novell, which was Friday last week.

    We were clearly bummed out by this development, and had no desire to quit, especially with all the great progress in this last year. So, with a heavy dose of motivation from my music teacher, we hatched a plan.

    Now, two weeks later, we have a plan in place, which includes both angel funding for keeping the team together, as well as a couple of engineering contracts that will help us stay together as a team while we ship our revenue generating products.

    Next Steps

    Our plan is to maximize the pleasure that developers derive from using Mono and .NET languages on their favorite platforms.

    We do have some funding to get started and ship our initial products. But we are looking to raise more capital to address the shortcomings that we could not afford to do before, these include:

    • Tutorials for our various developer stacks
    • API documentation for the various Mono-specific APIs
    • Dedicated Customer Support Software (assistly or getsatisfaction)
    • Upgrade our Bug system
    • Training
    • Consulting and Support
    • and Marketing: we have a best of breed developer platform, and we need the world to know. Our previous marketing budget is what the ancient Olmec culture referred to as Zero.

    Stay tuned for more, meanwhile, hope to see you in July at the Monospace conference in Boston!

    by Miguel de Icaza (miguel@gnome.org) at May 17, 2011 01:39 AM

    May 13, 2011

    The Voidspace Techie Blog

    Django concurrency, database locking and refreshing model objects

    Using expressions to make some of our model updates atomic (as discussed previously) wasn't sufficient to make all of our operations safe for concurrent database modifications (although still useful). This is because having fetched some values we wanted to perform operations based on those values, and they must not change whilst the operations are taking place (because the end result will be written back and would overwrite any other changes made). ... [1090 words]

    May 13, 2011 10:06 AM

    May 12, 2011

    The Voidspace Techie Blog

    mock 0.7.1 and matching objects in assert_called_with

    I've done a new release of mock, version 0.7.1. There are no code changes, but the new release fixes some packaging issues identified by Michael Fladischer. ... [624 words]

    May 12, 2011 11:20 PM

    May 10, 2011

    Aaron Marten's WebLog

    Visual Studio Extensions and Build Servers

    From time to time, we see questions around building a project created with the Visual Studio 2010 SDK on a build server (e.g. Team Foundation Build, TeamCity, CC.NET, etc…). The primary misconception that folks have is that you must install Visual Studio 2010 + SDK on the build server.

    In this post, I’ll walk through the process of getting a C#/VB VSPackage project up and running on Team Foundation Build, without requiring an install of Visual Studio on the build agent machine. The same steps apply for editor extensions or other extensibility project types.

    Once you’ve configured the build server and are ready to try out a build, you’ll probably see something like the following error in your build log:

    The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\VSSDK\Microsoft.VsSDK.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

    Step #1: Put Visual Studio SDK targets/tasks in source control

    Since neither Visual Studio nor the Visual Studio SDK are installed on my build machine, the build complains about the missing Microsoft.VsSDK.targets file. This is simple enough to fix by doing the following:

    1. Create a folder at the root of your solution directory called “vssdk_tools”. We’ll be adding all the necessary targets, tasks, etc… to this folder and adding it to source control.
    2. Copy the contents of %ProgramFiles%\MSBuild\Microsoft\VisualStudio\v10.0\VSSDK into this directory.
    3. Add the contents of your vssdk_tools directory to source control.
      • If you’re using TFS Source Control, you can do this via the “tf add” command or through the Source Control Explorer tool window in Visual Studio 2010.
    4. Edit your project file to point to this new targets file. Change the line:
      <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\VSSDK\Microsoft.VsSDK.targets" />
         to
      <Import Project="..\vssdk_tools\Microsoft.VsSDK.targets" />

    Let’s try checking in again and seeing where we are now:

    image

    Step #2: Put COMReference binaries in source control

    The reason that MSBuild is trying to run AxImp.exe is because we have a collection of COMReference elements in our VSPackage project. Instead of registering these assemblies as COM components on the build server, let’s copy these binaries to our local project and add them as normal assembly references:

    1. Remove the following COMReferences from your project:
      • EnvDTE
      • EnvDTE80
      • EnvDTE90
      • EnvDTE100
      • Microsoft.VisualStudio.CommandBars
      • stdole
    2. Create a “binaries” folder in our VSPackage project
    3. “Add existing item…” on this binaries folder for the following assemblies:
      • %ProgramFiles%\Common Files\Microsoft Shared\MSEnv\PublicAssemblies\EnvDTE.dll
      • %ProgramFiles%\Common Files\Microsoft Shared\MSEnv\PublicAssemblies\EnvDTE80.dll
      • %ProgramFiles%\Common Files\Microsoft Shared\MSEnv\PublicAssemblies\EnvDTE90.dll
      • %ProgramFiles%\Common Files\Microsoft Shared\MSEnv\PublicAssemblies\EnvDTE100.dll
      • %ProgramFiles%\Common Files\Microsoft Shared\MSEnv\PublicAssemblies\Microsoft.VisualStudio.CommandBars.dll
      • %ProgramFiles%\Common Files\Microsoft Shared\MSEnv\PublicAssemblies\stdole.dll
    4. Select all the binary files and set the “Build Action” property to “None”.
    5. Re-add assembly references to the binaries you just added.
    6. Important: Select all the references and set the “Embed Interop Types” property to false. (You can select and change them all in one operation.)

    Let’s check in and try another build on the server

    image

    Step #3: Manually set the VsSDKInstall locations

    Let’s take a look at the actual line where we’re hitting the error in Microsoft.VsSDK.Common.targets:

    <Target Name="FindSDKInstallation" Condition="'$(VsSDKInstall)'==''">
      <FindVsSDKInstallation SDKVersion="$(VsSDKVersion)">
        …

    The reason this task needs to run is because the VsSDKInstall property (and friends) hasn’t been set yet. Let’s use the “vssdk_tools” folder we had set up earlier. Edit your project file again, and add the following properties to the first <ProjectGroup> element:
     

    <VsSDKInstall>..\vssdk_tools</VsSDKInstall>
    <VsSDKIncludes>$(VsSDKInstall)\inc</VsSDKIncludes>
    <VsSDKToolsPath>$(VsSDKInstall)\bin</VsSDKToolsPath>

    Clearly, this won’t work until we actually have the corresponding files from the Visual Studio SDK also checked in to those directories. Let’s do that now:

    1. Copy the contents of %ProgramFiles%\Microsoft Visual Studio 2010 SDK SP1\VisualStudioIntegration\Common\Inc to vssdk_tools\inc
    2. Copy the contents of %ProgramFiles%\Microsoft Visual Studio 2010 SDK SP1\VisualStudioIntegration\Tools\Bin to vssdk_tools\bin
    3. Add all these new files to source control

    Let’s checkin again and see where we are now:

    image

    Step #4: Set VsSDKToolsPath as an Environment Variable

    Hmmm…this one is a bit tricky. It turns out that some of the VSSDK build tasks rely on not only the $(VsSDKToolsPath) MSBuild property, but they also rely on this being set as an environment variable. We can do that fairly easily with an inline build task which we can add to our project file:

    <UsingTask TaskName="SetVsSDKEnvironmentVariables" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
      <ParameterGroup>
        <ProjectDirectory Required="true" />
      </ParameterGroup>
      <Task>
        <Code Type="Fragment" Language="cs">
          System.Environment.SetEnvironmentVariable("VsSDKToolsPath", System.IO.Path.GetFullPath(ProjectDirectory + @"\..\vssdk_tools\bin"));
        </Code>
      </Task>
    </UsingTask>
    <Target Name="SetVsSDKEnvironmentVariables" BeforeTargets="VSCTCompile">
      <SetVsSDKEnvironmentVariables ProjectDirectory="$(MSBuildProjectDirectory)" />
    </Target>

    Let’s cross our fingers and try again:

    image

    Step #5: Use 32-bit MSBuild.exe

    By default, TFS will use the x64 version of MSBuild.exe (assuming you’re on a 64-bit server). Since the VSCT assembly is 32-bit only, it will fail to load in a 64-bit process. To use 32-bit MSBuild.exe on the server (if you’re using Team Foundation Build), simply edit the build definition and change Process => Advanced => MSBuild Platform to “X86” instead of “Auto”.

    One more try:

     

    image

     

    Step #6: Add other VSSDK Assemblies to source control

    In step 3, we only added the COMReferences to source control. Now, let’s do a similar procedure with the other assemblies:

    1. Remove the following assembly references from your project:
      • Microsoft.VisualStudio.OLE.Interop
      • Microsoft.VisualStudio.Shell.10.0
      • Microsoft.VisualStudio.Shell.Immutable.10.0
      • Microsoft.VisualStudio.Shell.Interop
      • Microsoft.VisualStudio.Shell.Interop.10.0
      • Microsoft.VisualStudio.Shell.Interop.8.0
      • Microsoft.VisualStudio.Shell.Interop.9.0
      • Microsoft.VisualStudio.TextManager.Interop
    2. “Add existing item…” on the binaries folder for the following assemblies:
      • %ProgramFiles%\Microsoft Visual Studio 2010 SDK SP1\VisualStudioIntegration\Common\Assemblies\v2.0\Microsoft.VisualStudio.OLE.Interop.dll
      • %ProgramFiles%\Microsoft Visual Studio 2010 SDK SP1\VisualStudioIntegration\Common\Assemblies\v2.0\Microsoft.VisualStudio.Shell.Interop.dll
      • %ProgramFiles%\Microsoft Visual Studio 2010 SDK SP1\VisualStudioIntegration\Common\Assemblies\v2.0\Microsoft.VisualStudio.Shell.Interop.8.0.dll
      • %ProgramFiles%\Microsoft Visual Studio 2010 SDK SP1\VisualStudioIntegration\Common\Assemblies\v2.0\Microsoft.VisualStudio.Shell.Interop.9.0.dll
      • %ProgramFiles%\Microsoft Visual Studio 2010 SDK SP1\VisualStudioIntegration\Common\Assemblies\v2.0\Microsoft.VisualStudio.Shell.Interop.10.0.dll
      • %ProgramFiles%\Microsoft Visual Studio 2010 SDK SP1\VisualStudioIntegration\Common\Assemblies\v2.0\Microsoft.VisualStudio.TextManager.Interop.dll
      • %ProgramFiles%\Microsoft Visual Studio 2010 SDK SP1\VisualStudioIntegration\Common\Assemblies\v4.0\Microsoft.VisualStudio.Shell.10.0.dll
      • %ProgramFiles%\Microsoft Visual Studio 2010 SDK SP1\VisualStudioIntegration\Common\Assemblies\v4.0\Microsoft.VisualStudio.Shell.Immutable.10.0.dll
    3. Select all the binary files and set the “Build Action” property to “None”.
    4. Re-add assembly references to the binaries you just added.

    One more time…

    image

      Step #7: Add Microsoft.VisualStudio.Shell.Immutable.10.0.dll to the tools directory

      CreatePkgDef.exe is the tool used to create a pkgdef file for your VSPackage. The tool itself relies on types defined in the Microsoft.VisualStudio.Shell.Immutable.10.0 assembly. On a machine with Visual Studio 2010 installed, there isn’t a problem loading it since the assembly is installed to the GAC. However, on our build server, the assembly is not in the GAC since Visual Studio 2010 isn’t installed.

      In order to allow CreatePkgDef.exe to find the assembly, we can simply add a copy of this binary in our vssdk_tools\bin directory. Do the following:

      1. Copy Microsoft.VisualStudio.Shell.Immutable.10.0.dll from our project binaries folder to vssdk_tools\bin.
      2. Add this new file to source control and checkin

      image

      Step #8: Add the VSIXManifestSchema.xsd to allow VsixManifest validation on the build server

      This task fails because the build task can’t locate the XML schema file for VSIXManifest to do schema validation. We could just switch this task off, but since it’s a good idea to run this validation when we build, let’s do what’s necessary to enable validation. There is an MSBuild property we can set to override this location on our build server. Simply add the following property to the first <PropertyGroup>:

      <VsixSchemaPath>$(VsSDKInstall)\schemas\VSIXManifestSchema.xsd</VsixSchemaPath>

      Of course, we also need to add the schema file to this directory:

      1. Copy the VSIXManifestSchema.xsd file from “%ProgramFiles%\Microsoft Visual Studio 10.0\Xml\Schemas” to vssdk_tools\schemas.
      2. Add VSIXManifestSchema.xsd to source control

      Let’s try again and see where we are:
      image

      Step #9: Disable deployment to the Experimental Instance

      To make ‘F5’ debugging work without any work by the user, by default, there are some additional targets that run in Microsoft.VsSDK.Common.targets. These targets ‘deploy’ your extension’s files to the Experimental instance for debugging. Since this scenario doesn’t make sense for our build server, we should disable it.

      The Visual Studio SDK includes a project property page for configuring this property:

      image

      Note that you will probably want a separate build configuration for your build server (to set this property to false) so that developers can still easily debug their package on a client machine.

      If you prefer to configure this directly in your project file instead of using the UI, use the following property:

      <DeployExtension>False</DeployExtension>

      Let’s see how this affects our build:

      image

      Success!!

      Hooray! If I check the build output directory, we now see that we have a VSIX file that was built on the server:

      image

      by Aaron Marten at May 10, 2011 06:35 PM

      May 06, 2011

      The Voidspace Techie Blog

      Danger with django expression objects

      I've recently been dealing with a bunch of concurrency issues in our django app. Some of the views modify database rows (model objects), which is unsurprising, but we did have a few situations where concurrent modifications could cause modifications to be overwritten (silently lost). ... [467 words]

      May 06, 2011 02:58 PM

      May 05, 2011

      IronPython Cookbook (New Entries)

      Endeavor launch postponed at last minute Faulty heaters 5

      TheophilaThomason: Created page with 'thumb| Cushions Correct maintenance of your patio furniture will ensure that it remains in beneficial condition with long time. Patio furniture…'


      [[Image:patio_heaterz_2186.jpg|thumb|]]

      Cushions

      Correct maintenance of your patio furniture will ensure that it remains in beneficial condition with long time. Patio furniture cushions may be waterproof, yet this doesn't mean they don't need to be cleaned. Semi-annual cleaning of patio furniture cushions will retain them serviceable for any long time.

      Trouble:
      Moderately Easy

      Instructions

      things you'll need:

      1 Remove the cushions from the patio furniture plus acquire them to any flat surface.

      2 Wipe down the cushion by a damp towel to remove surface dirt.

      3 Prepare a solution of warm water plus 1 tsp. dish detergent. Dip your scrub brush within the answer and scrub the the front and the back of your [http://eng.utah.edu/~agardner/cs4500/index.php?n=PatioHeater.PatioHeater patio] cushion from some circular motion.

      4 Wash your patio cushions. For stains that were not removed by general cleaning, mix a paste of 1 component drinking water and 2 elements baking soda. Work this into the stain with a circular motion with your scrub brush or a toothbrush. Rinse and allow the cushions to air dry.

      5 Clean the cushions before putting them out for the summer also prior to storing them with the winter. Feel-ups need to be completed to remove stains as they appear. Merely make a smaller solution of soap and water, use a sponge to scrub, and rinse.

      Flip patio cushions occasionally.
      Do not use bleach on patio furniture cushions.
      Create never place cushions back on the furniture previous to they dry fully.

      Print
      Email
      Share

      Comments

      by TheophilaThomason at May 05, 2011 08:42 PM

      April 29, 2011

      Aaron Marten's WebLog

      PerfWatson – Automatically report responsiveness issues in Visual Studio 2010

      We’ve just released a new extension on the Visual Studio Gallery called PerfWatson. Have you ever seen this dreaded error message?

      Microsoft Visual studio is waiting for an internal operation to complete. If you regularly encounter this delay during normal usage, please report this problem to Microsoft.

      Well, now you actually can report these problems to Microsoft…automatically. Here’s a description of the extension from the Visual Studio Gallery page:

      “We’re constantly working to improve the performance of Visual Studio and take feedback about it very seriously. Our investigations into these issues have found that there are a variety of scenarios where a long running task can cause the UI thread to hang or become unresponsive. Visual Studio PerfWatson is a low overhead telemetry system that helps us capture these instances of UI unresponsiveness and report them back to Microsoft automatically and anonymously. We then use this data to drive performance improvements that make Visual Studio faster.

      Here’s how it works: when the tool detects that the Visual Studio UI has become unresponsive, it records information about the length of the delay and the root cause, and submits a report to Microsoft. The Visual Studio team can then aggregate the data from these reports to prioritize the issues that are causing the largest or most frequent delays across our user base. By installing the PerfWatson extension, you are helping Microsoft identify and fix the performance issues that you most frequently encounter on your PC.”

      I’d strongly encourage you to install PerfWatson if you’re frustrated with seemingly random UI hangs in Visual Studio. This extension won’t fix the issues, but it will help us see where the real-world responsiveness issues are to help improve future releases.

      by Aaron Marten at April 29, 2011 10:41 PM

      April 19, 2011

      Miguel de Icaza

      Dropbox Lack of Security

      I am a fan of Dropbox. It is a great tool, a great product, and clearly they have a passionate team over at Dropbox building the product.

      Dropbox recently announced an update to its security terms of service in which they announced that they would provide the government with your decrypted files if requested to do so.

      This is not my problem with Dropbox.

      My problem is that for as long as I have tried to figure out, Dropbox made some bold claims about how your files were encrypted and how nobody had access to them, with statements like:

      • All transmission of file data occurs over an encrypted channel (SSL).
      • All files stored on Dropbox servers are encrypted (AES-256)
      • Dropbox employees aren't able to access user files, and when troubleshooting an account they only have access to file metadata (filenames, file sizes, etc., not the file contents)

      But anyone that tried to look further came out empty handed. There really are no more details on what procedures Dropbox has in place or how they implement the crypto to prevent unauthorized access to your files. We all had to just take them at their word.

      This wishy-washy statement always made me felt uneasy.

      But this announcement that they are able to decrypt the files on behalf of the government contradicts their prior public statements. They claim that Dropbox employees aren't able to access user files.

      This announcement means that Dropbox never had any mechanism to prevent employees from accessing your files, and it means that Dropbox never had the crypto smarts to ensure the privacy of your files and never had the smarts to only decrypt the files for you. It turns out, they keep their keys on their servers, and anyone with clearance at Dropbox or anyone that manages to hack into their servers would be able to get access to your files.

      If companies with a very strict set of security policies and procedures like Google have had problems with employees that abused their privileges, one has to wonder what can happen at a startup like Dropbox where the security perimeter and the policies are likely going to be orders of magnitude laxer.

      Dropbox needs to come clear about what privacy do they actually offer in their product. Not only from the government, but from their own employees that could be bribed, blackmailed, making some money on the side or are just plain horny.

      Dropbox needs to recruit a neutral third-party to vouch for their security procedures and their security stack that surrounds users' files and privacy. If they are not up to their own marketed statements, they need to clearly specify where their service falls short and what are the potential security breaches that

      Unless Dropbox can prove that algorithmically they can protect your keys and only you can get access to your files, they need to revisit their public statements and explicitly state that Dropbox storage should be considered semi-public and not try to sell us snake oil.

      by Miguel de Icaza (miguel@gnome.org) at April 19, 2011 09:10 AM

      Miguel de Icaza

      Save the Date: Monospace Conferece in Boston

      The dates for the MonoSpace conference have been announced: July 23rd to 25th, 2011. The event will take place at the Microsoft NERD Center.

      The organizers have just made a call for speakers. If you have an interesting topic to discuss, please submit a talk, we would love to hear from you.

      by Miguel de Icaza (miguel@gnome.org) at April 19, 2011 02:49 AM

      April 06, 2011

      Miguel de Icaza

      Mono Android and iPhone Updates

      Today we are happy to release Mono for Android 1.0 as well as MonoTouch 4.0.

      Both products allow you to use the C# language to write applications that run on Android and iOS devices.

      Both products are based on the latest Mono 2.10 core. The Parallel Frameworks can be used to write more elegant multi-threaded code across all devices, and automatically takes advantage of multiple cores available on the iPad2 and Xoom devices. The C# 4.0 is now the default as well as the .NET 4.0 APIs.

      Mono for Android

      Our Mono for Android debuts today after almost a year worth of development.

      Perhaps the most important lesson that we got from MonoTouch's success was that we had to provide a completely enabled platform. What we mean by this is that we needed to provide a complete set of tools that would assist developers from creating their first Android application, to distributing the application to the market place, to guides, tutorials, API documentation and samples.

      Mono for Android can be used from either Visual Studio Professional 2010 for Windows users, or using MonoDevelop on the Mac.

      Mono code runs side-by-side the Dalvik virtual machine in the same process:

      This is necessary since code running in Dalvik provides the user interface elements for Android as well as the hosting and activation features for applications on Android.

      APIs

      The Mono for Android API is made up of the following components: Core .NET APIs, Android.* APIs, OpenGL APIs and Java bridge APIs.

      Let us start with the most interesting one: Android.* APIs. These are basically a 1:1 mapping to the native Java Android APIs but they have been C#-ified, for example, you will find C# properties instead of set/get method calls, and you will use C# events with complete lambda support (with variables being automatically captured) instead of Java inner classes. This means that while in Java you would write something like:

      	// Java code
      	button.setOnClickListener (new View.OnClickListener() {
                   public void onClick(View v) {
      		button.setText ("Times clicked: " + Integer.toString(counter));
                   }
               });
      	
      	// C# code
      	button.Click += delegate {
      		button.Text = "Times clicked: " + counter;
      	};
      	

      In addition to the UI APIs, there are some 57 Android.* namespaces bound that provide access to various Android features like telephony, database, device, speech, testing and many other services.

      In what is becoming the standard in the Mono world, OpenGL is exposed through the brilliant OpenTK API. OpenTK is a strongly typed, Framework Design Guidelines-abiding binding of OpenGL. The benefit is that both Visual Studio and MonoDevelop can provide intellisense hints as you develop for the possible parameters, values and their meaning without having to look up the documentation every time.

      Finally, for the sake of interoperability with the native platform, we exposed many types from the Java.* namespaces (31 so far) that you might need if you are interoperating with third party libraries that might require an instance of one of those Java.* types (for example, a crypto stack might want you to provide a Javax.Crypto.Cipher instance. We got you covered.

      Core Differences

      Mono for Android has a few differences from MonoTouch and Windows Phone 7 when it comes to the runtime. Android supports JIT compilation while iOS blocks it at the kernel level and Windows Phone 7 has limitations.

      This means that developers using Mono on Android have complete access to System.Reflection.Emit. This in turn means that generics-heavy code like F# work on Android as do dynamic languages powered by the Dynamic Language Runtime like IronPython, IronRuby and IronJS.

      And of course, you can also use our own C# Compiler as a Service

      Now, although those languages can run on Mono for Android, we do not currently have templates for them. The Ruby and Python support suffer due to Android limitations. The Dalvik virtual needs to know in advance which classes you customize, and since it is not really possible to know this with a dynamic language, the use of Iron* languages is limited in that they cant subclass Android classes. But they can still call into Android APIs and subclass as much .NET class libraries as they want.

      Native User Interfaces

      MonoTouch and MonoDroid share a common runtime, a common set of class libraries, but each provides different user interface and device specific APIs.

      For example, this code takes advantage of iOS's UINavigationController and animates the transition to a new state in response to a user action:

      void OnSettingsTapped ()
      {
      	var settings = new SettingsViewController ();
      	PushViewController (settings, true);
      }
      	

      This is an equivalent version for Mono for Android:

      void OnSettingsTapped ()
      {
      	var intent = new Intent ();
      	intent.SetClass (this, typeof (SettingsActivity));
      	StartActivity (intent);
      }
      	

      We chose to not follow the Java write-once-run-anywhere approach for user interfaces and instead expose every single bit of native functionality to C# developers.

      We felt that this was necessary since the iOS and Android programming models are so different. We also wanted to make sure that everything that is possible to do with the native APIs on each OS continues to be possible while using Mono.

      For instance, if you want to use CoreAnimation to drive your user interactions, you should be able to leverage every single bit of it, without being forced into a common denominator with Android where nothing similar to this is available.

      Craig Dunn, one of the authors of the MonoTouch Programming Book, has written a nice Mosetta Stone document that compares side-by-side some of the key UI differences across platforms.

      He also has written the Restaurant Guide Sample which sports a unique user interface for Android, iOS and Windows Phone 7:

      You can take a look at this cross platform sample from GitHub.

      Split your Presentation from your Engine

      Faced with the diversity of platforms to support, both mobile and desktop, this is a good time to design, refactor and prepare your code for this new era.

      Today developers can use C# to target various UIs:

      To give your code the most broad reach, you should consider splitting your backend code from your presentation code. This can be done by putting reusable code in shared libraries (for example, REST clients) and shared business logic on its own libraries.

      By splitting your presentation code from your business logic code for your application, not only you gain the ability to create native experiences in each platform, you also get a chance to test your business logic/shared libraries more easily.

      Linking

      In Mono for Android when you build an application for distribution, we embed the Mono runtime with your application. This is necessary so your application is entirely self-contained and does not take any external dependencies.

      Mono for Android uses the Mono Linker to ensure that only the bits of Mono that you actually use end up in your package and that you do not pay a high tax for just using a handful of functions.

      For example, if you want to just use a method from XElement, you would only pay the price for using this class and any of its dependencies. But you would not end up bringing the entire System.XML stack: you only pay for what you use.

      During development a different approach is used: the Mono runtime is installed on your emulator or test device as a shared runtime. This minimizes both the build and deploy times.

      Mono for Android References

      Start with our documentation portal, there you will find our Installation Guide, a tutorial for your first C# Android application, our tutorials (many ported from their Java equivalents) and our How-To Guides and a large collection of sample programs.

      You can also explore the documentation for the Mono for Android API in a convenient to remember url: docs.mono-android.net.

      The first book of Mono for Android will be available on July 12th. In the meantime, we have created many tutorials and guides that will help you go

      I also strongly suggest those interested in parallel programming to check out the Patterns for Parallel Programming: Understanding and Applying Parallel Patterns with the .NET Framework 4. This is a free PDF, and is a must-read for anyone building multi-core applications.

      Thank You!

      Mono for Android would not have been possible without the hard work of the MonoDroid team at Novell. The team worked around the clock for almost a year creating this amazing product.

      The team was backed up by the Mono core team that helped us get C# 4.0 out, WCF, the linker, the LLVM support, improve the VM, extend the MonoDevelop IDE, scale Mono, improve our threadpool, support OpenTK, implement the Parallel Frameworks, ship dozens of betas for MonoDevelop, Mono and Mono for Android.

      by Miguel de Icaza (miguel@gnome.org) at April 06, 2011 11:40 PM

      April 02, 2011

      Dave Fugate (Testing IronPython)

      How I Lost 25 Pounds in a Month Without Exercising

      How Things Got So Bad
      Since joining Microsoft back in mid-2006, my weight skyrocketed about 15% or 30 pounds. A large part of this can be attributed to the abundance of unhealthy, free food at Microsoft, but that’s only half of the story. When I worked at University of Calgary, I had to walk at least a mile and a half each day to get to and from various transit points. Now, the parking lot is at best 50 meters away from my building. While I might have complained about walking around in -20 degree weather in Canada, I really had no idea how good it was for my health. Up until recently, I didn’t know just how bad Microsoft’s free perks such as unlimited soda and the constant supply of junk food outside co-workers' offiices were really harming me either. That said, my health is my own responsibility and I shouldn't have listened to the demons in my head that kept telling me to eat more.

      The Scare
      Flash forward to January 2011. An annual check-up revealed that my “fatty-liver” condition (human equivalent of foie gras) diagnosed in 2008 had progressed such that I now have either gallstones or possibly even a growth in my gallbladder. I was only 30 at the time! Any ways, this was exactly the ‘scare’ I needed for a major lifestyle change. My amazing wife letting me know that my snoring had gotten far worse since moving to Seattle wasn’t enough. Fear of cancer and Microsoft’s announcement that our 100% healthcare would disappear in two short years skyrocketed me into action.

      Douglas Crockford
      By chance, I came across a wonderful blog post, http://www.crockford.com/pwl/, by Douglas Crockford which explained our society’s current obesity epidemic and gave some awesome advice on losing weight. If you haven’t read this post before, I highly recommend it as it’s quite logical and well thought-out. 
       
      Dr. Sandra Cabot  
      Concurrently, I was also trying to abide by Dr. Sandra Cabot’s advice she gave in her book, the Liver Cleanse Diet. The basic premise of the book is that the liver is solely responsible for removing fat from the bloodstream, and an unhealthy liver implies you’ll pack on the pounds. Well, the way my “fatty-liver” was diagnosed was via blood tests looking for chemicals the liver releases when it’s under duress.
       
      The Lifestyle Changes
      What exactly did I do to lose the 25 pounds you ask? It was a combination of the Liver Cleanse Diet, Doug’s advice, and strong support from my wife:
      • No more sausage biscuits for breakfast. Instead, my wife or I typically juice apples/carrots/celery/kiwi/etc. or eat a bowl of oatmeal followed by a cup of black coffee
      • Replaced Indian food, pizza, and burgers for lunch with either a low-fat salad or a turkey (Subway) sub. The former set is incredibly high in fat
      • Take double the daily recommended amount of Milk Thistle, a herb purported to protect the liver
      • I used to eat 90% meat/cheese/dairy/flour for every meal, and perhaps 10% were fruits and vegetables. Now more than 50% of my food intake comes from fruits and vegetables
      • Portion control, portion control, portion control. My wife’s culture “loves you with food” which needed to change to “love you with less food”
      • Limited my intake of fats to those found in avocadoes, nuts, and lean poultry. It was hard to give up cheese and red meat, but it has paid off
      • Severely restricted my intake of alcohol. While it doesn’t necessarily add fat to my bloodstream, it does hurt one’s liver. Over the course of three months I’ve had a grand total of four beers
      • Severely restricted my intake of refined sugar. Had only one coke in three months and all the oatmeal cookies I’ve eaten have been low-sugar and low-fat. Have had a few peanut butter and honey sandwiches though
      • For two weeks I took a commercial (As Seen on TV) product called the “The Cleaner”. Basically just pop some pills every day and have weird looking bowel movements
      • This is perhaps the most difficult, yet also the most important facet of my diet – do a gallbladder cleanse. After finishing “The Cleaner”, one evening I downed 1.25 cups of the finest cold-pressed olive oil I could find chased by 1 cup of fresh lemon juice; all over the course of three hours. If you want to do this, be forewarned the next day will not be fun by any means. I didn’t *really* start shedding weight like crazy until after the gallbladder cleanse
      • I even jumped off the wagon for four days while on a business trip last month and have lost five pounds since then!
       
      The Benefits
      Now onto the benefits I’ve seen thus far:
      • the look of shock from people who haven’t seen me in a while
      • a recent blood test indicates my liver function is back to normal
      • a sleep study performed after I’d lost about 15 pounds showed I was no longer snoring excessively nor breathing incorrectly
      • my brain is operating at a frequency I quite honestly haven’t experienced since 2004
      • far less tired yet I’ve also been getting less sleep (i.e., maybe six hours a night)
      • lost 31 pounds to date. After another five I plan on relaxing the diet just a bit

      April 02, 2011 08:02 PM

      March 31, 2011

      Miguel de Icaza

      Mono and Google Summer of Code

      We have been lucky enough that Google accepted Mono as a mentoring organization for the Google Summer of Code 2011

      This is a great opportunity for students to get involved with open source, contribute, learn and get paid for their work during the summer.

      We have a lot of ideas to choose from in our student projects page, ranging from virtual machine hacking, MacOS X improvements, MonoDevelop extensions, language bindings and even improving the Manos web application framework.

      Do not let our limited imagination stop you. Although there are plenty of ideas to choose from, students should feel free to come up with their own ideas. In the past years projects based on students' ideas have been very successful and we want to encourage more of those.

      Proposal submission is open until Friday April 8, so now is the time to join our wonderful community, discuss your project ideas and start working on those proposals.

      The Mono Summer of Code IRC channel is #monosoc on irc.gnome.org

      by Miguel de Icaza (miguel@gnome.org) at March 31, 2011 01:23 AM

      March 30, 2011

      Miguel de Icaza

      Monospace Conference: Boston, July 2011

      The Mono community is organizing the Monospace conference to be held in July in Boston. This event is being organized by Dale Ragan, Louis Salin and Paul Bowden.

      The organizers have just made a call for speakers.

      If you have an interesting technology that you would like to talk about during this 3-day event, you should submit a talk.

      Monospace is on a very aggressive schedule. The good news is that the entire Mono team will be participating in the event.

      Once the dates are set in stone, we will open registration. Currently we are thinking of hosting an event for some 200 attendees.

      by Miguel de Icaza (miguel@gnome.org) at March 30, 2011 01:05 AM

      March 29, 2011

      Miguel de Icaza

      Save your Cleverness

      Today, while discussing how @hipsterhacker reminds us some of our friends, Nat pointed me to this interview where Maciej has this beautiful nugget of wisdom:

      Q: The Pinboard about page says: "There is absolutely nothing interesting about the Pinboard architecture or implementation; I consider that a feature!"

      Can you explain why you think that's a feature?

      I believe that relying on very basic and well-understood technologies at the architectural level forces you to save all your cleverness and new ideas for the actual app, where it can make a difference to users.

      I think many developers (myself included) are easily seduced by new technology and are willing to burn a lot of time rigging it together just for the joy of tinkering. So nowadays we see a lot of fairly uninteresting web apps with very technically sweet implementations.

      Too many people over-engineer their software to the point that you can no longer see what the software was supposed to do. Once people find a religion in one of the modern development fads, they tend to jump with both feet, and we end up with uninspiring user-facing software, but internally amazing.

      This disease is widespread. From everyone trying to turn their program into a platform (current fad: dependency injection), to trying to force programming models, to compulsively writing unit tests while ignoring the basic principles that unit tests can not be used to prove the absence of bugs (update: this is my favorite book on the subject; Namedrop alert: Bertrand Meyer introduced me to it).

      There is only one reason to throw away your life writing useless code and that is to train yourself. If you are writing this in a Karate Kid wax-on, wax-off kind of way, go ahead.

      But if you are building a product, you end up spending all of your time designing your architecture, and very little time in delivering a great experience.

      Premature architecture design is like premature optimization: you will be wrong about the things that actually mattered.

      Take the shortcut. Build the product. And if later, it turns out you made a design mistake, refactor the code. But at least you will have a product that your users love.

      by Miguel de Icaza (miguel@gnome.org) at March 29, 2011 09:31 PM

      March 24, 2011

      Miguel de Icaza

      Hardware Accelerated Video Playback in Moonlight

      David Reveman has just completed a series of optimizations in the Moonlight engine that allows Moonlight to take advantage of your GPU for the data intensive video rendering operations. This is in addition to the standard GPU hardware acceleration that we debuted a few weeks ago.

      This is what the video rendering loop looks like in Moonlight:

      Every one of those steps is an expensive process as it has to crunch to a lot of data. For example, a 720p video which has a frame size of 1280x720, this turns out to be 921,600 pixels. This frame while stored in RGB format at 8 bits per channel takes 2,764,800 bytes of memory. If you are decoding video at 30 frames per second, you need to at least move from the encoded input to the video 82 megabytes per second. Things are worse because the data is transformed on every step in that pipeline. This is what each step does:

      The video decoding is the step that decompresses your video frames. This is done one frame at a time, the input might be small, but the output will be the size of the original video.

      The decoding process generates images in YUV format. This format is used to store images and videos but and with previous versions of Moonlight, we had to convert this YUV data into an in-memory bitmap encoded in RGB format.

      The final step is to transfer this image to the graphics card. This typically involves copying the data from the system memory to the graphics card, and in Unix this goes through the user process to the X server process, which eventually moves the data to the graphics card.

      New Hardware Accelerated Framework

      The new hardware acceleration framework now skips plenty of these steps and lets the GPU on the system take over, this is what the new pipeline looks like:

      The uncompressed image in YUV format is sent directly to the GPU. Since OpenGL does not really know about YUV images, we use a custom pixel shader that runs on the graphics card to do the conversion for us and we also let the GPU take care of scaling the image.

      The resulting buffer is composited with the rest of the scene, using the new rendering framework introduced in Moonlight 4.

      Although native video playback solutions have been doing similar things for a while on Linux, we had to integrate this into the larger retained graphics system that is Moonlight. We might be late to the party, but it is now a hardware accelerated and smooth party.

      And what does this looks like? It looks like heaven.

      We were watching 1080p videos, running at full screen in David's office and it is absolutely perfect.

      Getting the Code

      The code is available now on Github and will be available in a few hours as a pre-packaged binary from our nightly builds.

      by Miguel de Icaza (miguel@gnome.org) at March 24, 2011 08:53 AM

      Miguel de Icaza

      Kid's Games on the iPad

      My eight month old daugther loves her iPad.

      We have gotten a bunch of baby games, kids games and visualizations for her.

      But many of these apps have one fundamental issue: the author adds one or more buttons with useless stuff like "Provide Feedback", "Info", "Visit Web Site", "Check my Other Apps" and other assorted buttons on the screen:

      Now, perhaps the apps did great when used by a professional QA team in Daytona that reported back "yes, every animal in the app makes the proper sound, and the cows scroll as they are intended to".

      In this case, the "Main" button, will bring up a convenient page with options to send feedback to the author, to visit his web site and check out his other apps.

      This means that my daugther can not really enjoy her games without supervision, since every few seconds, she will end up visiting a web site in Safari.

      Joseph has a similar problem, he has equipped both of his kids with iPads, and they routinely report "the iPad broke", every time one of their games ends up in some lame web site for the developer.

      Developers for kid games should use slider switches if they really want to impose their hooks into their customers.

      Some Games

      On twitter Paul Hudson suggested a couple of games for 1-year olds: Uzu (my daughter also loves this one), BeBot and SoundTouch.

      I have found that she likes GarageBand a lot (we just have to be around to make sure we can reset the screen when she changes instruments).

      by Miguel de Icaza (miguel@gnome.org) at March 24, 2011 05:04 AM

      March 23, 2011

      The Voidspace Techie Blog

      configure_mock: improved mock configuration (take two)

      A coupla days ago I blogged my ideas for making mock configuration less verbose. After some useful feedback in the comments here's an improved version. ... [189 words]

      March 23, 2011 11:34 PM

      March 21, 2011

      The Voidspace Techie Blog

      Mock 0.7.0 final release and PyCon talk video

      Yay for conference driven development, I got the final release of mock 0.7.0 done in time for PyCon. No api changes since the release candidate. ... [622 words]

      March 21, 2011 11:47 PM

      The Voidspace Techie Blog

      Lococast PyCon Podcast

      Whilst I was at PyCon (which was awesome by the way) I recorded an interview with Rick Harding from the Lococast podcast. It's a half hour ramble around topics like IronPython, testing, PyCon, working for canonical, choice of operating system and other topics. ... [68 words]

      March 21, 2011 11:27 PM

      The Voidspace Techie Blog

      Less verbose configuration of mock objects

      One of the things to come out of recent discussions with mock module users, and developers of alternative mock frameworks, is that for non-trivial mocking scenarios configuring your mocks can be verbose. If you have a mock object, particularly one created for you by patch, setting up attributes and return values for methods takes one line for every aspect of configuration. ... [431 words]

      March 21, 2011 05:40 PM

      The Voidspace Techie Blog

      Mock: tracking order of calls and less verbose call assertions

      One advantage of jet-lag is opportunity to write blog entries. The Mock class in the mock module allows you to track the order of method calls on your mock objects through the method_calls attribute. ... [394 words]

      March 21, 2011 05:39 PM

      Noah Gift

      PyCon 2011: Exceeded My Expectations


      It had been a couple of years since I went PyCon, but I was very happy with my experience. Conferences are expensive to me, both in terms of the cost of travel, and in the opportunity cost. Essentially, the money I could have made doing something else.

      What would make me come back next year is a continued emphasis on the diversity of thought and ideas. I enjoyed watching the talk David Cramer did about the worlds largest Django website, which runs his own bootleg version of Django. I also enjoyed talking to him in person. He is a bright guy, and I think he is going to do some interesting things. Would love to hear more talks from him in the future, and more about people willing to go bootleg. Love that stuff!!!

      I also enjoyed talking to Jim Fulton, who I met randomly while washing my hands. I mentioned to him that I absolutely LOVE bobo. It is my favorite web framework, and I love it that is was done with minimalism, by a true master of the language.

      Finally, I met Massimo Di Pierro who is the creator of web2py. There were a couple of threads both at the convention, and online about how I shouldn't use web2py. To me this literally puts the web framework on the map. If anyone is taking the effort to go out of their way to tell me to NOT use someone else's code, it has to be an interesting idea. I can think of no higher praise in fact.

      On my to do list, it is try to use web2py as much as I can this year. That fact that it is forbidden makes the fruit all the more sweet to taste! Will blog on my experiences with web2py this year, as time permits.

      I enjoyed giving a talk on writing command-line tools on Windows, where I was able to bring up Windows, PowerShell, and F#, and still have a great discussion afterwards with some really smart people: http://pycon.blip.tv/file/4883215/.

      Essentially, I love the Outliers I meet at PyCon. Not the guys who are the most popular, but who have the most interesting viewpoints and ideas. Ideas people tell me I shouldn't listen to! I want those please, double helping in fact. This is why I come to PyCon, I hope it stays that way.

      by Noah Gift (noreply@blogger.com) at March 21, 2011 05:47 AM

      March 17, 2011

      Aaron Marten's WebLog

      Temporary Post Used For Theme Detection (6f2d4d1e-786d-4503-862e-6696167d20ad - 3bfe001a-32de-4114-a6b4-4005b770f6d7)

      This is a temporary post that was not deleted. Please delete this manually. (04b29f36-2655-4638-a217-6d6eb0bce6ef - 3bfe001a-32de-4114-a6b4-4005b770f6d7)

      by Aaron Marten at March 17, 2011 09:10 PM

      March 08, 2011

      Miguel de Icaza

      GDC 2011

      Three years ago, we were almost laughed out of the Game Developer Conference Show floor.

      C# as the heir to C++ back then was mostly an academic discussion. And there were only a few anecdotal examples of developers using C# for fast and safe scripting in games such as Second Life and Unity.

      Three years ago, C# as a scripting language for games had shared the reputation that Javascript had before the Ajax and Web 2.0 revolutions. It was a bad word. Anything short of C++ and assembly language was not up to the taste of most game developers. Ironically, developers were willing to take the hit of an interpreted languages to drive their games.

      It was perhaps Unity Technologies that started to change this when they adopted Mono as their scripting engine, giving their developers a choice of C#, strongly typed Javascript and Boo as programming languages to author their game's logic, effects and behaviors. They got the benefits of high-level languages, with the added performance of being compiled:

      A New Generation of Game Developers

      In the past years, a new generation of game developers have entered the stage. These are developers that have cut their teeth with Unity, XNA and frameworks like PyGame.

      They value malleability, rapid iteration and safe environments without crashing over raw performance. They have grown used to profiling their software and tuning the hot-spots instead of depending on hunches that lead to premature optimizing.

      This year things were very different at our booth. Lots of happy Unity users came by to talk about MonoDevelop, about the new soft debugger, and about the joy of using C# to build applications with Unity. Lots of people are working on big and small game titles using Mono.

      MonoTouch and MonoDroid also helped us gain visibility in this space. Lots of existing users, and users-to-be came to discuss Mono's state.

      But Mono has now spread its wings from being a pure extension system for C++-based systems (like Unity or the Sims3), to be used as the main language for building game engines and game frameworks.

      There is the 2D MonoGame (an open source effort previously known as XNAtouch) which supports iPhone, Android (and they are working on Windows and Mac backends).

      At the show, both DeltaEngine and Silicon Studio were showing pure C#-based 3D game engines powered by Mono. There were as well a number of stealth-mode projects and startups using Mono either as their scripting engine or the main runtime.

      Walking around the GDC show-floor, you could see Mono running in many booths thanks to Unity's overwhelming popularity.

      Perhaps my favorite Unity game at the show was Rochard, an upcoming PS3 game with interesting puzzles and the level of polish that you expect from a game like Ratchet and Clank (videos, screenshots).

      Helping Game Developers

      In the past couple of years we have made some changes to Mono that help developers use Mono as either a scripting system for an existing C or C++ code base, or for those using Mono as their main runtime.

      We still deliver all the bonus features that come from using C# and the CLI, like lambda functions, functional style-programming, garbage collection, type safety, iterators, generics and improve upon the basics to include:

      • Mobile profile: a minimal profile of class libraries that is better suited for mobile, embedded and console uses.
      • LLVM-based code optimizer: in addition to our standard code generator designed for JIT compilation, we now offer developers a choice to use the LLVM optimizing compiler to generate code. Modulo a handful of issues, the code generated is as good as the one you would get by doing low-level programming with C++.
      • SIMD intrinsics: we treat the various Vector data types in the Mono.Simd namespace as first-class types recognized by the JIT and mapped directly to hardware supported SIMD operations:
        		// This code:
        		using Mono.Simd;
        		
        		Vector4f Add (Vector4f one, Vector4f two)
        		{
        			return one + two;
        		}
        
        		// Is inlined by our LLVM code generator when invoked
        		// with the two statics first and second:
        		mov    first,%eax
        		movups (%eax),%xmm0
        		mov    second,%eax
        		movups (%eax),%xmm1
        		addps  %xmm1,%xmm0
        		
      • Unsafe execution: some of our users wanted to continue using Mono and C# for their code for compute intensive operations. We now offer an unsafe option that will remove all arrays bounds check from the code. This, needless to say, is incredibly unsafe as it would open the doors to the sort of bugs that are common in C++. But if you are dying to squeeze the last bit of performance and treat C# as a nicer C++ and are ready to make a commitment to debug memory-corruption bugs, we got you covered.
      • Runtime Continuations: to create lightweight co-routines that are not bound to threads and allow developers to suspend execution at any point without having to change their code, or require new compilers. Silicon Studio's Homei system uses it.

      Additionally, many developers are doing a little bit of embrace-and-extending the Mono runtime in creative ways to extend the CLI in new ways.

      We want for example to introduce both a [ForceInline] and a [UnsafeCode] attributes that can be applied to methods to hint the code generation engine to always inline a method, and to remove arrays-bounds-checking on a per-method basis.

      Hot Topics

      A hot topic at the GDC was when we would bring the new C# 5 "await" feature to Mono.

      C#'s await is a perfect solution to many of the problems that game developers face. Although there are solutions like Unity's co-routines, Mono Continuations/microthreads and Michael Hutchinson's open sourced micro-threading framework these features require a particular set of programming practices and pattern or support in the VM to do this.

      C# Await is beautiful in that it integrates directly into the language and allows developers to focus on the algorithm and not in the administrivia of suspending execution and the boilerplate involved.

      Which leads me to F#. The C# await functionality is based on F#'s Asynchronous Workflows which is available to everyone (thanks to Microsoft open sourcing the F# compiler and runtime).

      What is fascinating is what some people are doing with F# in games: they can use F# to express the game AI in more succinct terms than any other scripting language can do. Not being a game designer, I do not quite understand the domain space, but apparently F# is just what the doctor ordered for complicated AI behaviors.

      This coupled with async execution is a game engine developer's dream. But F# is not for everyone, there is a learning curve for getting to express problems in F# that is not suitable for game developers that have simple needs for their in-game logic.

      WPF: A Recurring Topic

      Many tool vendors (animation, pipeline, version control) have used WPF for their software or are planning on using it for new projects. These vendors have historically only supported Windows and are now looking at adding either Mac or Linux. This became almost a FAQ at the Mono booth: when are you going to ship WPF on Mac/Linux.

      We have no plans on building WPF. We just do not have the man power to build an implementation in any reasonable time-frame.

      Today, we offer a few suggestions to developers. Feel free to pick and choose:

      • Use Gtk# if you want to share the same code across all three platforms.
      • Split your UI code from the non-UI code and build a UI per system. On Windows, use WPF, on Mac use MonoMac, on Linux Gtk#. Or use gtk# on Mac and Linux.
      • For tools that are mostly OpenGL/DirectX based, use Windows.Forms, keeping in mind that some bug fixing or work around on their part might be needed as our Windows.Forms is not actively developed.

      If you can afford building two or three UIs

      Those are the toolkits you can use today to get your .NET-based tools working on multiple platforms. There are a number of longer-term options in the horizon that could be useful, but would require a concerted effort by the community to complete:

        Monomac.Winforms: assist the effort to have a Winforms look-alike API that happens to be based entirely on MonoMac and provides a native experience at the expense of dropping compatibility with some Winforms features.

        Create an SWT-like toolkit, like Eclipse did for Java, but this time for .NET. Mapping UI components to Cocoa, Gtk+ or WPF depending on the platform.

        Use Silverlight on Windows. And then use a modified version of Moonlight on Linux (and assist porting Moonlight to Mac) to get enough support to integrate with the native OS (menus, file dialogs, file system access) and to access and embed OpenGL in their applications.

        WPF implementation: not impossible, but this will require someone to fund some 15-20 developers to implement this enormous stack and some 2-3 years of work.

      by Miguel de Icaza (miguel@gnome.org) at March 08, 2011 03:18 AM

      February 27, 2011

      The Voidspace Techie Blog

      mock 0.7.0 release candidate one, a theme a talk and an interview

      Mock 0.7.0 release candidate 1 has been released. http://pypi.python.org/pypi/mock This is intended to be the last release of mock before 0.7.0 final and the only changes anticipated are documentation changes which I've finally started work on. ... [461 words]

      February 27, 2011 02:52 PM

      The Voidspace Techie Blog

      PyCrypto 2.3 Windows binaries

      Hey all, seems like a long time since we've spoken. I'm afraid I'm still crazy busy so I can't chat for long. ... [57 words]

      February 27, 2011 02:52 PM

      February 26, 2011

      Miguel de Icaza

      Saturday Mono Update

      Following a long established tradition of doing a quick Mono update after we do a major release, we released Mono 2.10.1 to the world.

      There are four big features in this release that we backported from our master branch in addition to some 25 fresh bug fixes:

      • Support for running OrchardCMS on Linux. We also wrote a PostgreSQL backend for it. You can find the patches in this discussion.
      • The Parallel Framework's Default task scheduler has been switched to use our new and improved internal threadpool that we introduced with Mono 2.10. Previously it used its own (and amazing) scheduler, but did not share the same properties as .NET as there were by default two active threadpools, now there is only one.
      • Plenty of updates to the WCF stack.
      • OSX is a fast growing OS for Mono, this release brings performance counters for OSX as well as adding debugging symbols to all of our libraries if you install the CSDK package from our download page.

      There were also three important regressions from Mono 2.8 that have been fixed. We encourage everyone to use Mono 2.10.1.

      by Miguel de Icaza (miguel@gnome.org) at February 26, 2011 09:54 PM

      Miguel de Icaza

      MVP Summit and GDC 2011

      Next week I will be in Bellevue, WA from Sunday to Wednesday to participate in the 2011 Microsoft MVP Summit.

      From Wednesday to Friday I will be San Francisco attending the Game Developer's Conference.

      Ping me if you want to get together.

      by Miguel de Icaza (miguel@gnome.org) at February 26, 2011 03:21 AM

      February 24, 2011

      Miguel de Icaza

      C# Compiler as a Service Update

      Our C# compiler-as-a-service library can now process any C# construct, it is no longer limited to expressions and statements.

      This means, that you can now enter entire class definitions in the command line:

      csharp> class Demo {
            >     public int Add (int a, int b)
            >     {
            >          return a + b;
            >     }
            > }
      csharp> new Demo ().Add (1, 3);
      4
      csharp>
      

      This work was done by the amazing Marek and is now available on Mono's master branch in github.

      This functionality can also be used for scripts, in particular in Unix, you can now create C# "source executable" files, like this:

      bash$ cat demo.cs
      #!/usr/bin/csharp
      class Demo {
      	public dynamic Add (dynamic a, dynamic b)
      	{
      		return a + b;
      	}
      }
      Console.WriteLine (new Demo ().Add ("this is", " cute"));
      bash$ chmod +x demo.cs
      bash$ ./demo.cs
      this is cute
      bash$
      

      Multiple Compiler Instances

      In addition, we turned the static API Evalutor.Eval (string expression), into an instance API. The instance API allows developers that are embedding the C# compiler-as-a-service in their application to have different contexts.

      This required the entire compiler to be updated from being a giant set of static classes that could safely use global variables and state into a state that was properly encapsulated.

      The API is now richer, we provide a way to configure the compiler settings using a settings class. This can be populated either manually, or by using the build-in command-line parser for compiler options. The following sample shows how this could be used:

      using Mono.CSharp;
      using System;
      
      class Runner {
      	static int Main (string [] args)
      	{
      		var r = new Report (new ConsoleReportPrinter ());
      		var cmd = new CommandLineParser (r);
      		
      		var settings = cmd.ParseArguments (args);
      		if (settings == null || r.Errors > 0)
      			Environment.Exit (1);
      
      		var evaluator = new Evaluator (settings, r);
      
      		evaluator.Run ("class Demo { public static int Add (int a, int b) { return a+b; }}");
      		evaluator.Run ("print (Demo.Add (1,2));");
      		return 0;
      	}
      }

      Testers Wanted

      This revamped compiler will be part of Mono 2.12, but we would love to get users to test the new functionality and to help us identify any problems early on, before we even release this code.

      We do provide a convenient sln file that you can use the compiler as a service, and it works both in Visual Studio/.NET and Mono.

      Silverlight

      We have not tested this with Silverlight, but in theory, it should now work fine with it. We would love to see someone build an interactive shell like the one we did with Gtk# but hosted on the browser:

      by Miguel de Icaza (miguel@gnome.org) at February 24, 2011 10:49 AM

      February 18, 2011

      Miguel de Icaza

      Well, Actually

      Why you are not getting laid

      As software developers, we develop habits that allow us to build products that work and do not fail under stress. Every software developer knows what an "off-by-one" error is, and like the Karate Kid, we train extensively so we can avoid those traps. We learn how to avoid these and other similar software problems and we sharpen our skills to find logic errors.

      As we mature as developers, finding logic errors and incomplete solutions becomes our way of life. It defines us.

      But our engineering strength is also our social weakness. Countless times as engineers you will find yourself interrupting someone telling a story, an anecdote or a joke to correct a false assumption, provide an extra fact that the narrator overlooked, give a bigger perspective on the problem or point out that the joke premise is actually flawed.

      You can identify this behavior because the person interrupting usually starts with the phrase "Well, actually...".

      As a kid, I thought this was my strength. I knew a little bit more than my sister. So whenever she would say something, I would quickly interject something like "Well, actually, the origin of the word Shih Tzu means Lion Dog and has nothing to do with the dog's digestive patterns".

      Yes, I was really fun to hang out with.

      As a child, I wondered why my sister could make friends and keep them so easily, while I could not. It would take me years to discover this. And now, as a public service I am sharing with you, my fellow geek friends, what I learned.

      Whoever pulls a "well, actually" almost always shifts the conversation to himself. And now we are no longer following along with your friend's joke, we get to learn how much more you know about the limitations of the Sun Protection Factor scale in sunblock products.

      You are doing it wrong

      As a seasoned engineer, you need to learn control your impulses. Having dealt with my own well, actually problem, I can attest that adjusting this social behavior might even get you laid.

      Jokes are funny because they surprise us. But a joke is not funny if you have to present a 30-page document setting up every little detail. An ill-placed "Well, actually" will get your colleagues to abandon in an instant the water cooler conversation and escape to the peaceful solitude of their workstations.

      Range of Action

      You can find full-time well-actually folks both in person or monitoring your every quip on twitter.

      Even the most rudimentary of the well-actuallistas is able to spoil even the best Ricky Gervais material.

      Twitter being a medium limited to 140 character is like catnip for patronizing douchebags. They can not resist the urge to point out logic flaws in your minimalist observation.

      This is particularly a problem for those of us that love to tweet things that amuse us or that we find amusing. Fear of a barrage of factoids from an omitted detail can be paralyzing.

      Dealing with the Well Actually crowd

      The well-actually crowd wants as much as everyone else to participate in the conversation. They want to be loved.

      But instead of rolling with the punches and participating in a brainstorm of ideas and exploding humor, they contribute interruptions, facts and details that merely produce stop energy on an ongoing discussion. They turn the center of attention towards them.

      The well-actually crowd means well. They want to be loved, they just have not realized that they are undermining their own quest for friends.

      If you are a sagacious well-actuallista you need to understand that you are not outwitting anyone. It takes more intelligence to build a joke, tell a funny anecdote or narrate a gripping story than it takes to nitpick.

      You are not impressing anyone with your hard earned encyclopedic knowledge that you obtained by spending hours on the Internet. You are just making everyone around you realize that you are as much fun to have lunch with as a flaming turd in a bag.

      Those of us in the receiving end of a well-actually, need to start an awareness campaign. Perhaps using Twibbons to cure this disease. Unlike many diseases, this awareness program will lead to a cure.

      While being technically correct is the best kind of correct, what you don't realize is that while you enjoy the triumph of your well-actually, everyone around you is secretly hoping that you choke on a bucket of cocks.

      Practical Solutions

      In the office, we have lots of talented engineers and at one point or another one of us will interject a well placed "well, actually" at an innapropriate moment.

      These days we are fully aware of this social disease and we strive to avoid it. When someone interrupts a discussion with a well-actually you can hear someone say:

      "Did you just well-actually me?"

      Which is basically a way of saying "That has nothing to do with the topic, but thanks for derailing us" without having to go into the explanation and getting lost on the tangent.

      This is a good first step. In our case, we have printed copies of the Ok, It's Time To Explain Some Stuff Patronizing Douchebag Trollcat in two sizes: a full-size well-actually cat, and a small one that is given as an award to the douchiest interruption:

      Okay it’s time to explain some stuff patronizing douchebag trollcat

      On the Internet, you can try to point the patronizing douchebag to this blog post. Or if you have no patience, just click "block" on twitter.

      by Miguel de Icaza (miguel@gnome.org) at February 18, 2011 04:14 AM

      February 17, 2011

      Miguel de Icaza

      Moonlight 4 Preview 1 is out

      Yesterday we released Moonlight 4, Preview 1.

      This release of Moonlight completes the Moonlight 3 feature set and includes many features from Silverlight 4. Check out our release notes for the list of things that are currently missing from our Silverlight 4 support.

      Rendering

      Moonlight rendering system uses a painter's algorithm coupled with culling to reduce the amount of rasterization that needs to take place.

      For example, if we had these objects all rendered at the same location, on top of each other:

      A simple implementation would render the triangle, then the rectangle and then the circle, and we would get this result:

      Moonlight optimizes this rendering by computing the bounding boxes of each element and determining which objects are completely obscured. In this case, the triangle never needs to be rendered as it is fully covered.

      Since we have the entire graph scene in memory, we can push all the rendering to the X server without ever having to pull data back from it.

      Each visible element on Silverlight derives from the class UIElement and Moonlight tracks the bounding box for all of each individual element. As you compose elements, the aggregate bounding box is computed. For example, a canvas that hosts these three UIElements would have a bounding box that contains all three of them:

      New Rendering Features

      With Silverlight 3, Microsoft introduced two large important changes to the framework: 3D transformations on objects and support for pixel shaders. Both of these are applied to every visual element in Silverlight (this is implemented in the class UIElement).

      In addition to the properties inherited from Silverlight 2, UIElements now have two new properties: Projection and Effect.

      The Projection property is a 3D matrix transformation (the 3D variation of the 2D affine transform that is available in most 2D graphics APIs). Silverlight exposes both the raw 3D matrix or a set of convenient properties that are easier to use and require no understanding of the interactions of the twelve elements of the 3D matrix (see this page for an explanation).

      Just like 2D affine APIs typically expose convenience methods to scale, rotate, skew and translate, the PlaneProjection properties allow developers to focus on those components.

      You can see a sample here.

      Effects follow a similar pattern. The blur and drop-shadow effects are given convenient names and accessors (BlurEffect and DropShadowEffect but Silverlight exposes an API to create programmable pixel shaders that go beyond these two simple cases.

      The ShaderEffect allows users to load pixel shaders written using the High Level Shader Language (HLSL). Here is a sample app showing pixel shaders in action.

      3D transformations and pixel shaders require that the contents of a UIElement are rendered to an intermediate output surface. The 3D transformation and shader effect is applied when this surface is composited onto the parent output surface. This compositing operation can be accelerated using graphics hardware.

      From our previous example, the three elements would be rendered into a 2D surface, and the actual transformation can be done in the hardware:

      Finally, the third new rendering upgrade was the introduction of a bitmap cache that can be applied to a UIElement. When a UIElement is flagged for being bitmap cached, the same kind of intermediate surface rendering and hardware accelerated compositing is performed as for elements with 3D transformations or pixel shaders. The contents of bitmap cache elements are also rendered once and kept on a bitmap that is later composited. This can improve performance vastly for complex controls with many interlocking pieces: instead of computing and re-rendering the entire contents every time, the bitmap cache is used.

      This of course has some visible effect. If you instruct Silverlight to use a bitmap cache, and then you zoom-in the contents, you will see the result get pixelated. You can learn more about this on the BitmapCache documentation.

      Moonlight's New Rendering Pipeline and GPU Acceleration

      Both effects and projections can be implemented purely in software. Effects can be implemented by providing a small interpreter for HLSL code and projections by performing the rendering in software and compositing the results.

      David Reveman, the hacker behind Compiz joined the Moonlight team last year to implement the new rendering primitives, but also to figure out how we could hardware accelerate Moonlight. The results of his work are available on yesterday's release of Moonlight 4.

      The rendering pipeline was modified. Now, whenever a UIElement has either a Projection, an Effect or has the the flag BitmapCache set the entire UIElement and its children are rendered into a surface that is then off-loaded for the GPU to render.

      When OpenGL is available on the system, the composition of UIElements is entirely done by the GPU.

      Moonlight will use the GPU to accelerate for compositing, perspective transformations and pixel shaders if the hardware is present without having to turn this on. Silverlight by default requires developers to opt into hardware acceleration and has its own set of features that it will hardware accelerate.

      In general, Moonlight uses the GPU more than Silverlight does, except in the case of DeepZoom, where we still do not accelerate this code path.

      Gallium3D

      Our new rendering pipeline is built using OpenGL and Gallium3D.

      Gallium is an engine that is typically used to implement OpenGL. In our case, we use the Gallium3D API when we need to fallback to software rendering 3D transforms on Linux. Otherwise we go through the OpenGL pipeline:

      If we were to only support Linux/X11, Gallium3D would have been a better choice for us. But we want to allow the Moonlight runtime to be ported to other windowing systems (Like Wayland on Linux) and other operating systems.

      Room for Growth

      Now that we have this 3D accelerated platform in place, it is easy to fine-tune specific UIElements to be hardware accelerated.

      This first release did only the basics, but we can now trivially use hardware decoders for video and have that directly composited in hardware with the rest of a scene, or we can offload image transformations entirely to the hardware on a type-by-type basis and of course, DeepZoom.

      Object Lifecycle

      Objects in moonlight live in two spaces, low-level components live in C++ and are surfaced to C#. Typically this means that we have code that looks like this in C++:

      	//
      	class MyElement : public UIElement {
      	  protected:
      		MyElement ();
      	  private:
      	        // fields and methods for MyElement go here
      	}
      	

      In C# we create a mirror, like this:

      
      	public class DependencyObject {
      		// Points to the C++ instance.
      		IntPtr _native;
      	}
      	

      When a user wrote in C# "new MyElement", we would P/Invoke into C++ code that does "new MyElement", get a pointer back to this instance and store it in the "_native" field.

      In the other direction, if we created a C++ object and then we had to "surface" it to the managed world, we would initialize the object based on our C++ "this" pointer.

      We could create instances of MyElement in C++, and when this instance needs to be surfaces to the managed world, we would create an instance of the managed object, and store the pointer to the underlying C++ object in the _native pointer.

      In the Moonlight 2.0 days we used to have C++ objects that would only create managed objects on demand. At the time, we did this to avoid creating thousands of managed objects when loading a XAML file when only a handful of those would be controlled by user code.

      The Moonlight runtime, running in pure C++ code, surfaced objects to the C# world and we tracked the object life cycle with good old reference counts. But with Silverlight 2, we started to see problems with the design as it was possible to end up with cycles. These cycles did not happen only in the C++ side or the C# side, but they spanned the boundaries. This made it very hard to debug and it made it hard to keep Moonlight from not leaking memory.

      Templates for example could create these cycles.

      With Moonlight 4, we have landed a new life cycle management system that works like this:

      • Every C++ object that we create always points to a managed counterpart. Gone are the days where the managed peer was created only when needed.
      • Every C++ instance field that points to a DependencyObject subclass goes through this cool C++ templated class that notifies managed when the reference changes.
      • There are no ref/unref pairs surrounding stores to instance fields in c++ anymore.

      Now our base class in C++ has this:

      	// Our entire hierarchy exposed to managed code
      	// derives from EventObject
      	class EventObject {
              	GCHandle managed_handle;
      	}
      	

      Now all the c++ objects exist and are kept alive solely by their managed peers (there are some rare exceptions for things like async calls) and the whole graph is traversable by Mono's GC because all stores to c++ instance fields result in a managed ref between the respective peers.

      With the new code, we no longer live in a world of refs/unrefs (again, except for some rare cases) and whenever we assign to a C++ field that points to a managed object we notify the managed peer of the change.

      We were not able to ship Moonlight 4 with our new garbage collection system (Sgen) as we ran into a couple of hard to track down bugs at the last minute, but we are going to switch it on again soon.

      Future Work

      There is still room for improvement, and now that we know how to cook this kind of code, the goal is to use Mono's new GC in Moonlight more extensively.

      We want to teach SGen to scan the C++ heap and track references to managed objects, dropping another potential source of problems and reducing the code needed. We would also love to go back to only creating managed objects on demand.

      Platform Abstraction Layer

      Moonlight was originally designed as a Linux-only, X11-only plugin for rendering Silverlight content. Developers constantly ask us whether they could run Moonlight on platform XX that is either not Linux or does not use X11.

      The amount of work to port Moonlight 2 to those kinds of scenarios was so overwhelming that most people abandoned the efforts relatively quickly.

      With Moonlight 4, we have introduced a new platform abstraction layer that will make it simpler for developers to port the Moonlight engine to other platforms.

      Whether you want hardware accelerated user experiences in your video game or you want to put Moonlight on a the FreezeMaster 10000 Domestic Fridge with an Internet Connection and SmoothStreaming running on a barebones ARM CPU, you can now enjoy this in the comfort of your home.

      We have done some minimal tests to exercise the API and can run the Moonlight engine on both MacOS and Android. You can look at exclusive footage of the animation test suite running on OSX and on Android.

      If you are like me, not much of a click-on-the-video kind of person, and would rather get a screenshot, you can bask on the smooth colors of this screenshot on Android or in this delightful test on MacOS.

      We are currently not planning on completing that work ourselves, so this is a fabulous opportunity for a caffeine-driven hacker to complete these ports.

      Some possibilities, from the top of my head include being able to use Silverlight to design parts of your user experience for apps on the Mac AppStore (think MoonlightView in your MonoMac apps), or for your Android app.

      Using Expression beats coding cute animations and futuristic UIs by hand. That is why every major video game embeds ScaleForm, the embeddable Flash runtime for handling the UI.

      New XAML Parser

      Our original XAML parser was written in C++, this worked fine for Moonlight 1, but with Moonlight 2 it started to become obvious that we were spending too much time calling back from C++ to C# to create managed objects.

      This was acceptable up to version 2, but it no longer scaled with Moonlight 3. Too much time was spent going back and forth between the C++ world and the C# world. Those following the development of Moonlight would have noticed that every couple of weeks a new extra parameter to the xaml_load function was added to deal with yet another callback.

      The new XAML parser is entirely written in C#, is faster and more reliable.

      And lots more

      Check out our release notes for Moonlight 4 Preview 1.

      by Miguel de Icaza (miguel@gnome.org) at February 17, 2011 05:19 AM

      Miguel de Icaza

      Three Months and Ten Days

      That is the time between our last major Mono release and the new hotness: Mono 2.10.

      New in this release:

      Check out our Mono 2.10 release notes for all the details.

      by Miguel de Icaza (miguel@gnome.org) at February 17, 2011 03:24 AM

      February 15, 2011

      Miguel de Icaza

      Nokia Simplifies the Mobile Landscape

      On Friday, Nokia announced that they were adopting WP7 as their operating system. Although some open source advocates might see this as a set-back for Linux, Android is already the best-selling Linux OS of all times. Meanwhile, as a Ben Zander student, all I see is possibility and the the world of opportunities that this opens to developers.

      Although they will continue shipping Symbian for a while, they are effectively sun-setting it. Just like you can still purchase Itanium systems from HP, nobody really develops for those anymore.

      Nokia had this chart to offer on Friday:

      This is fascinating turn of events for C# developers as Nokia will make WP7 more relevant in the marketplace, making C# the lingua-franca of all major mobile operating systems. This astute chart explains why I am basking in joy:

      C# and the ECMA CLI everywhere!

      Now, certainly lots of developer houses can afford to build their software once for each platform. This is fine if your VC has a mandate to "spend that cash quickly" or if you have a surplus of interns at your disposal.

      Now, if trollcats have taught us one thing is that users like the UI of their apps to be as native as possible. That is, mind-blowingly beautiful on iOS and try to match the carpet on the others.

      Other snake oil vendors will tell you that you can use the same code across all platforms and still deliver an emotional experience to your users. I agree, you can deliver the same emotion of disgust when using a cross platform toolkit.

      With Mono we have taken a different approach, based on our own failures from the past. We give developers access to all of the native APIs in the platform to create the best possible user experience, and exploit every single last bit of functionality available on the platform.

      We advise our users to split their user interface code from the engine, or their business logic. Developers should create a native experience for their mobile apps: one per platform. For example, consider Angry Birds on iOS and Angry Birds on Blackberry. Each version adapts to provide the best user experience available on the platform.

      This is a grand time to be a mobile developer. This chart illustrates the elegant balance of native experience and code sharing available to C# developers:

      Update: As much as I have enjoyed responding to the comments on this blog post, the comments are now closed. I will make an exception with anyone that wants to follow up on an existing discussion. For everyone else, if you have something to share, write it on your blog.

      by Miguel de Icaza (miguel@gnome.org) at February 15, 2011 01:49 AM

      February 11, 2011

      Jeff Hardy's Blog (NWSGI)

      First IronPython Bug Weekend Coming Up

      The first IronPython Bug Weekend is this weekend, February 12-13, 2011. The purpose of the bug weekend is to get as many issues as possible looked at and fixed before the next pre-release of 2.7. There are a large number of issues in the issue tracker that need to checked to see if they are still valid (based on what I've seen, probably half of them are already fixed). If they're not reproducible, they can be closed; if they are reproducible, then patches are always welcome!

      In particular, we'd like to get people who haven't contributed to IronPython before to chip in. It's really not that scary, I promise! To get started, check out how to get and build the source code and how to handle issues. If you have any questions, just ask – everyone is willing to help out.

      To get in touch with the other bug weekend participants, there are two primary channels: the mailing list (sign up, view the archives) and the #ironpython IRC channel on freenode.net. If you're looking at a particular bug, make an update to the Bug Weekend spreadsheet, and make sure no one else is working on it either. It's a good idea to send a message on IRC or the mailing list as well.

      Here's to a good bug-fixing weekend!


      by jdhardy (noreply@blogger.com) at February 11, 2011 06:14 PM

      February 09, 2011

      IronPython Cookbook (New Entries)

      I did right below her insurance number 58577

      HuldahStiles2: Created page with 'thumb| User-Submitted Document Learning how to reduce your home owner's insurance rates can keep funds in your pocket and out of the insurance poli…'


      [[Image:insurance_2844.jpg|thumb|]]

      User-Submitted Document

      Learning how to reduce your home owner's insurance rates can keep funds in your pocket and out of the insurance policy organization's hands. Home owner's insurance can be some major expense and it is important to get out how to save money while nevertheless having appropriate coverage for your house. Insurance companies depend on their customers not spending time to unearth out the way in which to conserve cash on their policies. They expect the consumers to be as well busy to look with ways to hold their home owner's insurance quotes low. Now is the time to bear in mind insurance companies work to you, the consumer. Spend some duration learning how to lower your home [http://progrape.jp/pgr/hiki.cgi?Automobile+Insurance+-+Thing+You+Should+to+Have+Fo insurance] policy rate in reading this easy to make article.

      Difficulty: Uncomplicated
      Directions

      1 Collect your current scheme paperwork for your home owner's insurance. Maintain your policy nearby so that you can refer when trying to reduce your rates.

      3 Examine with protection discounts on your residence owner's insurance if you have some home security method. Question the insurance policy company if there is some way to reduce your rate if you have an alarm program to your home.

      4 Inquire for fire safety discounts. Test to spot if you homeowner's insurance will offer a reduce premium if you contain fire alarms and/or sprinklers installed within your home.Boost the quantity regarding policies you hold by way of them. Question if they offer any discount if you carry extra than single policy with the company. Decide if it is cheaper to include your car insurance or lifetime insurance through the company if they offer them.

      5 Keep a good credit score. Home insurance premiums are often based on your credit score so keep some beneficial score and check it continually for any inaccurate information.

      by HuldahStiles2 at February 09, 2011 10:38 AM

      IronPython Cookbook (New Entries)

      Insurance conference in Dallas Likely very similar to latest tweet 54261

      BorromeoShea5: Created page with 'thumb| Crashing your car will considerably increase auto insurance rates. website reports that the rate will be elevated for three long time. I…'


      [[Image:auto_insurance_2438.jpg|thumb|]]

      Crashing your car will considerably increase auto insurance rates. website reports that the rate will be elevated for three long time. If you were at fault and if you were ticketed for the accident, your premiums may increase with some longer period. While you probably won't be able to lower your auto insurance policy rates at once after some automobile accident, there are steps you can take that might keep them from going sky huge.

      Difficulty: Moderately Easy
      Directions

      Report any accidents to your insurance policy company immediately after the crash, even if they are minor. State laws may prevent the auto insurance premium from being elevated unless the accident was your fault. If you are with fault, the auto insurance policy firm lawyers may be able to demonstrate that is the other driver was additionally at fault. Proving responsibility about the other driver will reduce the period your organization has to spend out for mend claims, so it could reduce the amount regarding the premium improve. If you fail to report even a minor crash, you could get hit for some great premium increase if the insurance company finds out.

      2 No accidents for years is a plus.

      Inquire for forgiveness away from your insurer. Some vehicle insurance companies maintain a "forgive the first accident" policy. As the substitute remains getting hit along with a 40 percent premium improve and losing current discounts, according to Netquote, you will want to ask in regard to this policy when you talk to your insurance company after the accident. Express Farm yous just one business that offers this policy if you have had no additional accidents for nine years. The Canadian Vehicle Association also offers any "forgive the first accident" policy.

      3 Too many points on your license will increase rates.

      Maintain your driving record clean. One of the ingredients that is influences your [http://marketing-mastermind.com/howtomakeaclaim54/blog/54550 vehicle insurance] rate remains the amount of points you have on your driving record. Purchase as well many points also your license is suspended, plus each point improves the insurance policy premium. Visit your state's Division of Car Cars web site for any list regarding transgressions and the point penalty for each one. There are two ways to get rid regarding the points: attend driving school courses or wait some few years and the points will vanish if you lodge outside about trouble.

      by BorromeoShea5 at February 09, 2011 09:51 AM

      IronPython Cookbook (New Entries)

      Maybe I need medical insurance It d be so expensive I m so broken 79266

      GaryLocke9: Created page with 'thumb| Insurance regulations with Florida are covered under Title XXXVIII of the Florida Statutes, since defined by the Legislative Branc…'


      [[Image:Automobile_insurance_2311.jpg|thumb|]]

      Insurance regulations with Florida are covered under Title XXXVIII of the Florida Statutes, since defined by the Legislative Branch of the state govt. These ordinances protect law for a broad range about insurance types, including homeowners, vehicle , health , existence and credit living policies. Guidelines and regulations applicable to the licensing about insurance factors, as well as policy rates are furthermore protected under Title XXXVIII.

      During the 2009to 2010 fiscal year, the FOIR monitored nearly 69 million dollars in customer refunds.

      The Florida Office of Insurance Regulation (FLOIR) is responsible for the rule, compliance and enforcement of Florida insurance statutes. As of 2000 to 2010 fiscal year reporting, the FLOIR was responsible for overseeing nearly 4,000 insurance entities, such as real estate, health, life plus casualty insurers, and more than 100 billion bucks valued at about insurance premiums. Throughout this same reporting point, the FOLIR assessed almost 13 million dollars valued at regarding goods.

      Factor Licensing

      Fingerprints are applied to establish criminal history of agent candidates.

      Rates

      Insurance policy rates plus rate boosts are controlled by way of the FLOIR. Insurance policy entities must apply with permission before applying any across-the-board rate improves to policies with Florida. This procedure helps to ensure that Florida residents are not issue to incongruous or illegal increases, whereas well being providing insurers the capability to boost rates with relation to marketplace changes. Rate increase requests must garner the approval about the Florida Insurance Commissioner earlier to going into effect.

      Homeowners Insurance

      According to Florida Statutes, new homeowners insurance cannot take effect while any area about Florida remains below a hurricane watch or warning.

      Due to climate plus other geographic issues, homeowners insurance is some subject below continuous dialogue. Major catastrophes, such as the unusually active 2005 hurricane season, may result in billions regarding dollars worth of destruction plus insurance policy declares. This level of liability has forced many insurers out of the homeowners insurance market, forcing the state to create the Citizens Property Insurance policy Company. Regulation of homeowners insurance covers kinds regarding coverages, limitations, compliance, claims course of action and coverage termination.

      Types

      Within addition to conventional insurance policies, such as automobile, homeowners plus health, the FLOIR yous also responsible to the oversight and regulation of any extensive range of insurance kinds. Numerous regarding these kinds contain car vehicle service arrangements, home warranties, mortgage guaranty insurance, legal cost insurance, bail bonds, discount medical plans also workers' salary. [http://www.markpreston.co.uk/dokuwiki/doku.php?id=automobile_insurance Automobile insurance].

      by GaryLocke9 at February 09, 2011 09:39 AM

      IronPython Cookbook (New Entries)

      Don t assume all companies provide dental insurance plans 5293

      YaropolkMoody: Created page with 'thumb| Effective June 1, 2010, Wisconsin is a compulsory insurance state. All drivers must contain automobile insurance that meets minimum peri…'


      [[Image:auto_insurance_2732.jpg|thumb|]]

      Effective June 1, 2010, Wisconsin is a compulsory insurance state. All drivers must contain automobile insurance that meets minimum periods for liability and uninsured motorists. The mandatory insurance yous meant to guarantee the safety plus financial obligation regarding drivers on the road in Wisconsin. [http://simteach.com/wiki/index.php?title=Automobile_Insurance_-_How_To_Buy_Auto_Insurance auto insurance].

      Responsibility

      Uninsured Motorist

      Your insurance policy must watch over you against uninsured motorists. It take on the place of the other driver's scheme, and your complete declare is settled together with your own insurance company. You are needed to cooperate with the insurance company considering it issued the insurance. This may require giving entry to your medical records and/or seeing a doctor the organization chooses. Beyond this, however, your state is the same because if the other motorist were insured. It's recommended that you have an attorney represent you and negotiate your claim so you do not overlook away on any coverage to which you are entitled.

      Under-Insured Motorist

      Under-insured motorist coverage is not required yet is good to boast, and you should buy as very much coverage because possible. This coverage applies when the person at fault has insurance policy but the limits aren't huge enough to compensate you thoroughly for your losses. If you carry $50,000 about under-insured insurance coverage plus the additional driver has $50,000 of responsibility coverage, he would never be considered exclusive under-insured motorist when compared to you. As a end result your wounds may never be completely covered because the price tag of the injuries could be greater besides the amount of coverage. Under-insured motorist coverage is inexpensive, so frequently try to get as very much seeing that possible to defend you and your family .

      by YaropolkMoody at February 09, 2011 09:36 AM

      IronPython Cookbook (New Entries)

      Maybe I need medical insurance It d be so expensive I m so broken 39428

      BoleslawMccray: Created page with 'thumb| User-Submitted Article Health insurance policy is a must for any student planning to study abroad but the preparation can regularly be mind-…'


      [[Image:insurance_1166.jpg|thumb|]]

      User-Submitted Article

      Health insurance policy is a must for any student planning to study abroad but the preparation can regularly be mind-boggling for those unfamiliar by way of the process. Follow these steps to make confident you are fully covered whilst studying abroad.

      Difficulty: Moderate
      Directions

      1 Find away what type of and how a lot fitness [http://futanari.org/wiki/insurance_guides_-_luck insurance] you will want. Check with your review abroad program or school's research abroad office. They ought to be able to tell you the specific health insurance duty to your personal land also foreign school . If they are unable to tell you, you will need to work a little digging. Go to your host region's web site and appear for facts on health and visa requirements to get into the country.

      2 Once you boast the requirements, contact your well-being insurance provider. Nearly all insurance plans cover people while traveling and/or studying abroad, but there are a lot more steps to file a claim. Too, every foreign physicians will as well be considered away of network. Produce sure to let the insurance company know what countries you will be visiting and the approximate dates. Inquire about every special requirements they might have need to you need to look for medical attention while away.

      3 Once you know what your plan does plus does not insure, purchase extra insurance to fill in the gaps. Check by means of the research abroad office as they routinely have supplemental plans obtainable at lower costs. Observe that is most colleges will require students to get any International Student Identification Card (ISIC) which furnishs some medical coverage for American scholars traveling abroad.

      4 Send in proof of health insurance with your study abroad paperwork plus visa application. Some schools plus countries will accept photocopies of your insurance card. Additionals might demand a letter from your insurance policy supplier.

      5 Pack your insurance card, copies of the card, insurance contact info, and additional claim variety in your luggage.

      6 If you obtain to seek medical consideration while abroad, retain copies about all bills. Your insurance supplier need to maintain told you how to submit claims whilst out of the region. This remains usually via exclusive Web style, fax, or some style sent via postal mail. If they request a hard copy of the bill, send any photocopy and keep the original as it may be easily lost in route. If the doctor proposes one English translation of the bill, mail this being well. Otherwise the insurance company might hold up expense while lingering to a translation.

      7 Regularly times it is easier to submit claims by way of any Power regarding Attorney again residence. This is some appropriate document signed and notarized that gives specified powers to some designated person under certain conditions. (This will need to be organized Prior to traveling abroad.) The Power about Attorney is then able to speak to the insurance supplier and/or offer with any problems that might arise. You will only need to post copies of each and every bill to the Power of Attorney.

      Suggestions & Cautions

      You will usually be required to fork out every and all medical bills upfront. The insurance corporation will then reimburse you.

      by BoleslawMccray at February 09, 2011 08:56 AM

      IronPython Cookbook (New Entries)

      Vote on Top 5 Reasons to Choose an Independent Insurance Agency 22339

      GladysPhipps3: Created page with 'thumb| Journey insurance typically covers you to any accident sustained whilst traveling. Insurance companies offer various plans that cover a numer…'


      [[Image:insurance_5110.jpg|thumb|]]

      Journey insurance typically covers you to any accident sustained whilst traveling. Insurance companies offer various plans that cover a numerous about events you might encounter while traveling. Depending on your policy, you can file travel insurance policy states for journey cancellation, travel delay, baggage loss, bag delay, baggage injury, medical expenses plus accident to a rented car . Here's how you may file some travel insurance claim.

      From Essentials: Lost Luggage 411

      The way to Recover Lost Luggage

      It's a traveler's worst nightmare. You arrive on your destination after a long flight and are…
      A lot more

      More: Observe All Articles in this Essentials

      How to Reduce the Chances regarding Lost Luggage While Traveling

      Dealing with lost bags can damage any journey or vacation. Even although airlines only really lose…
      More

      More: See All Articles in this Essentials

      How to Decrease the Possibility of Lost or Damaged Luggage

      Arriving at your destination only to get that your baggage isn’t there is a fantastic way to…
      Added

      More: View All Documents in this Essentials

      How to Never Lose One's Bags

      If you fly much, you may have had to cross your fingers plus hope that your luggage makes it to…
      Added

      The way to Lose Airplane Baggage

      Airlines expend hundreds regarding thousands about dollars each year to ensure that is you and your luggage…
      Further

      How to Get Luggage Lost on a Shuttle

      So you're at the end of a tiring journey plus you realize that any fellow airport shuttle passenger…
      Further

      More: Understand All Articles in this Essentials

      How to Get Lost Baggage Insurance

      Lost baggage insurance policy is with both domestic and international flights. The cost also replacement…
      More

      Further: Find out All Articles in this Essentials

      How to File a Lost Baggage Insurance Claim

      Nothing ruins a holiday prefer an airline carrier losing your baggage. If you're growing on some journey,…
      More

      Additional: Observe All Documents inside this Essentials

      Journey insurance generally covers you with any mishap sustained whilst traveling. Insurance…
      Further

      Further: Understand All Articles in this Essentials

      How to Secure International Travel Insurance

      Many travelers believe trepidation about international journeys because of uncertain conditions from…
      More

      More: See All Articles in this Essentials

      How to Indicate Luggage so that It is Uncomplicated To Spot

      Have you ever been by the airport, ready for your baggage at the baggage claim … only…
      Much more

      More: See All Articles in this Essentials

      How to Make Luggage Tags

      Making your suitcase remain out in a sea regarding nearly matching checked bags is easy whenever you make…
      More

      More: See All Articles in this Essentials

      How to File any Complaint About an Airline

      Few travelers have never at least proficient once or twice the fury of traveling on an airline…
      Extra

      Even though many regarding us own become accustomed to traveling through baggage, you can travel with no…
      A lot more

      More: View All Articles on this Essentials

      How to Acquire Lost Luggage

      Extra: See All Articles within this Essentials

      Difficulty: Moderately Uncomplicated
      Directions

      1 Test the coverage provided by way of the travel insurance policy policy.

      2 Decide the series of activity based on the kind of loss or misfortune sustained.

      4 Call the insurance policy factor to make sure you employ the correct claim form. Claim forms differ according to the kind of coverage inside your policy.

      5 Inquire the insurance agent in relation to the facts and documents required for processing your claim. Usually several documents being nicely as pertinent info roughly your journey need to be submitted with your claim kind. These typically include travel date(s), manner of transport, name of travel agency also reservation receipts.

      6 Collect and keep all the documents you believe are related to your declare for the kind of coverage in the policy. Your insurance agent can guide plus aid you in this effort.

      7 Cooperate along with the adjuster from the [http://howtomakeaclaim54.deviantart.com/journal/37089251 insurance] firm to verify your declare.

      8 Assess the depreciation value, if possible.

      10 Stay on touch by way of your agent to ensure prompt processing of state.

      Documents Needed for Distinct States:

      1 Rental auto claim: Provide the make of car, journey date, proof of journey, law enforcement agency complaint copy and the estimate of loss or damage.

      2 Air travel: Supply a copy regarding the airline tickets, evidence regarding travel plus estimated loss or harm.

      3 Baggage theft: Offer a list of items that is are lost or stolen, some copy of the grumble to police and travel agency plus estimated cost.

      4 Baggage delay: Furnish a list along with receipts of urgent purchases until your baggage was returned.

      5 Medical expenses: Monitor the treatment offered also retain a list of prescriptions and receipts for reimbursement.

      A large quantity of claims are rejected in insurance companies for belongings that were left unattended in airport lounges, hotels, restaurants, train stations plus bus stops. The firm rejects these claims with proverb the person had never taken "reasonable treatment."

      by GladysPhipps3 at February 09, 2011 08:25 AM

      IronPython Cookbook (New Entries)

      Incar insurance 8567

      MarquisFeliciano: Created page with 'thumb| Difficulty: Challenging Directions 1 Find the approximate value regarding the automobile you want to insure. Insurers need their own pr…'


      [[Image:auto_insurance_4595.jpg|thumb|]]

      Difficulty: Challenging
      Directions

      1 Find the approximate value regarding the automobile you want to insure. Insurers need their own proprietary tables they use to determine any baseline value for a vehicle. You may get an approximate value by way of looking in the Kelley Blue Book, using online tools or checking what the express values the automobile on for possession tax objectives. The more valuable a vehicle, the more it will charge to insure.

      2 Add any additional premiums or discounts to where you stay. If you live inside a large metropolis or high crime location, your vehicle insurance will rise. However, if you live in a crime-free or rural region, you can anticipate to pay less.

      3 Add up the way many driving tickets you need received or every other negative driving incidents, like driving under the influence. A bad driving record leads to higher insurance premiums. Numerous insurers deal discounts to good records.

      4 Add in the stuff of your credit rating. If you get a beneficial credit rating, you might spend less for car insurance. However, a bad credit rating will count against you also cause your premiums to rise.

      5 Add upward the way many accidents you possess been involved in. Even if the accidents were not your fault, you will pay more for automobile insurance for every accident.

      6 Check to spot if you have had any gaps in insurance policy coverage. If you obtain let your [http://www.hangar.org/wikis/lab/doku.php?id=car_insurance_online_-_how_to_compare_car_insurance_prices_online auto insurance] policy lapse prior to, insurers will charge you further to coverage.

      7 Add in each other additional costs that is might affect your insurance policy. Men pay more other than girls. If you are below 25 long time aged, you will obtain to pay more. Single persons are charged higher rates than married persons.

      Suggestions & Warnings

      Quite a few insurers have extra discounts for a variety of things. Ask if you qualify for any one.

      Some automobile insurance companies propose online premium guess. You can enter your basic facts on their websites to find a rate quote.

      by MarquisFeliciano at February 09, 2011 07:57 AM

      IronPython Cookbook (New Entries)

      YOU WOULD COOK FOR HER THEN SLIT HER THROAT AND COLLECT THE INSURANCE MONEY 42070

      WitaWomack8: Created page with 'thumb| Learn the Illinois Laws regarding [http://wiki.od.k12.in.us/groups/21stcenturylearning/weblog/24909/Auto_Insurance__How_To_Choose_An_Aut…'


      [[Image:auto_insurance_5086.jpg|thumb|]]

      Learn the Illinois Laws regarding [http://wiki.od.k12.in.us/groups/21stcenturylearning/weblog/24909/Auto_Insurance__How_To_Choose_An_Auto_Insurance_Deductible.html auto insurance].

      Drivers purchase auto insurance for cars , trucks, trailers and other moving vehicles . The insurance policy protects you away from any losses that is could result away from a collision, and covers you for liability in a crash. Having auto insurance policy is a official demand, nonetheless certain insurance laws differ state by express. If you reside in Illinois, familiarize yourself in the express's auto insurance policy laws.

      Minimums

      Uninsured Protection

      Under Illinois law, uninsured motorist coverage and underinsured motorist coverage are mandatory. Uninsured coverage pays the expenses of bodily injuries you attract in the event about one accident with a hit and run driver, or someone driving with no car insurance who causes some crash. The minimum limits with this insurance are $20,000 each person, and $40,000 per accident. Underinsured Motorist Coverage spends for any one difference between some policyholder's limits and the liability boundaries of the individual who caused the accident. This only occurs if the limits are decrease besides the underinsured motorist coverage.

      Proof regarding Insurance

      You must produce proof regarding insurance to register or drive your automobile. Failure to do very may result in a very good of up to $1,000 depending on the predicament. Your insurance policy card represents proof about insurance, which you need to manufacture upon request.

      by WitaWomack8 at February 09, 2011 07:29 AM

      IronPython Cookbook (New Entries)

      Health insurance 4731

      FerrerDoty3: Created page with 'thumb| If you are interested in exclusive accident, you will want to present evidence of insurance. All 50 states have laws requiring mo…'


      [[Image:Automobile_insurance_4038.jpg|thumb|]]

      If you are interested in exclusive accident, you will want to present evidence of insurance.

      All 50 states have laws requiring motorists to carry insurance on their passenger vehicles . Insurance policy is necessary to spend with special bodily injury and possession harm incurred in exclusive automobile accident. Because numerous folks fail to bring proper insurance on their vehicle, the states additionally now require motorists to purchase uninsured motorist coverage so costs you attract being a effect of exclusive accident will be enveloped.

      Liability Insurance policy

      The essential insurance requirement for operating any passenger car on the streets and highways about the U.S. yous liability insurance policy. Liability insurance policy protects you if you are by fault for an accident, as you can be held financially responsible for any damages or each injury you or another person sustained. Automobile proprietors must provide proof of responsibility insurance for automobile registration plus registration renewal. Simple liability coverage in many express is $25,000 each person for bodily injury, $50,000 each accident for bodily injury plus $10,000 each accident for property damage. Check along with your state's department of engine vehicles for required coverage sums. [http://vietmee.com/blogs/entry/Online-Automobile-Insurance-How-To-Search-For-Insurance Automobile insurance].

      Current Coverage

      Evidence of Insurance

      Proof regarding existing insurance need to be carried in the automobile at all times, in any case of the kind of insurance. Depending on your express of residence, there may be several options for providing insurance policy coverage for your passenger vehicles. Besides purchasing liability coverage from exclusive insurance company, you may be able to post a surety bond or some other variety of safe monetary instrument in an amount establish by your state's insurance law. Different express get detailed necessity, but this amount remains usually at least $60,000. Large businesses with some fleet of vehicles can file self insurance documents that prove the capacity to spend with damage caused by a vehicle owned by the corporation. This option can include posting documents with the express displaying the self insurance amount has been collection aside in an account that is cannot be used for other normal business needs. In all cases, present evidence regarding insurance should be carried with every vehicle driven on our country's streets and roads.

      by FerrerDoty3 at February 09, 2011 07:00 AM

      IronPython Cookbook (New Entries)

      Legal difference is that auto insurance mandated by states under police power 90856

      PraksedaSherman: Created page with 'thumb| New Jersey provide you with an affordable basic policy. Each express has its own laws governing car insurance requirements, like …'


      [[Image:automobile_insurance_2476.jpg|thumb|]]

      New Jersey provide you with an affordable basic policy.

      Each express has its own laws governing car insurance requirements, like as required amounts regarding coverage and what types regarding insurance a driver must have to legally operate some automobile . Inside order to produce car insurance further affordable, New Jersey enacted the [http://exim-jp.sourceforge.jp/cgi-bin/moin.cgi/AutoInsurance Automobile Insurance] policy Cost Reduction Act that established a essential scheme that resembles the typical minimum limits policy on many methods. Still, there are certain critical exceptions that could demonstrate expensive in the occasion of exclusive accident. The Department about Banking and Insurance recommends that only folks with restrained assets and family responsibilities opt with the simple policy.

      Liability Insurance policy

      Personal Injury Guard

      New Jersey law takes drivers to carry personal injury shield insurance. This insurance deal with medical expenses regardless about fault. Both the normal plus basic policies offer at lowest $15,000 of coverage. Certain sorts of injuries such being brain also spinal cord injuries qualify for upward to $250,000 of coverage, regardless of the chosen policy amount.

      Underinsured/Uninsured Motorist Coverage

      Drivers must also carry insurance to cover damages ensuing out of an accident in which the at-fault driver has no insurance or not enough insurance to cover responsibility. The regulation takes carriers to offer consumers amounts equal to their picked liability periods. The basic scheme does not provide this coverage.

      Lawsuits

      Basic scheme coverage does not pay for appropriate representation if someone sues the policyholder. This insurance policy policy also limits the consumer's right to sue for damages resulting away from an accident. Whether a driver elects for limited right to sue (she might only sue in certain instances such as loss of a body part or permanent injury) or indefinite appropriate to sue (she has the correct to sue for each and every injury) will affect the cost of the premium.

      by PraksedaSherman at February 09, 2011 03:20 AM

      IronPython Cookbook (New Entries)

      Hey iwonder if there really is a gekco for tha gieco auto insurance 31979

      SorrowsCook8: Created page with 'thumb| Insuring any auto that is you conduct not own, that is never registered in your name may be any difficult topic. This is since insurance…'


      [[Image:auto_insurance_2131.jpg|thumb|]]

      Insuring any auto that is you conduct not own, that is never registered in your name may be any difficult topic. This is since insurance law prohibits insurers from selling policies to individuals to cars they do not own insurable attention on. This regulation restricts the opportunity for fraud that arises when an people buys any [http://wiki.guillaume.lelarge.info/doku.php?id=paccident_awareness_-_be_safe car insurance] policy for someone else, only with the purpose about making a earnings when the insured party is included on an accident. Although most insurers may sell you auto insurance for one automobile that belongs to someone else, most insurers will not even take into account marketing such a policy. With the small percentage of companies that will allow you to buy auto insurance to any car you manage not own, you will have to satisfy diverse necessities and display insurable attention.

      Difficulty: Reasonable
      Directions

      1 Conduct an online price comparison. The initial step with purchasing auto insurance for any vehicle you work not own is the identical as for some vehicle registered in your name. Visit various vehicle insurance policy websites, fill in the particulars plus compare prices quoted by different insurance providers. Notable car insurance websites contain website" plus website." Once you have narrowed your list of insurance policy providers, you will have to speak to every one individually.

      3 Determine the way in which to demonstrate insurable attention. If a supplier is willing to sell you a policy, you would have to confirm that is your reasons for insuring someone else's automobile is legitimized, and not geared toward profit. Talk to the insurer and find out what documents to furnish to display insurable curiosity. If the owner about the vehicle remains family member, similar as your father or teenage child, you may well provide documents to verify that both regarding you live in the similar address or have the same final name. If you want to insure a vehicle you recently purchased, and the title about the car remains all the same within the authentic owner's name, you may need to make available evidence of purchase, such as a sale contract.

      4 Afford the required documents to demonstrate insurable interest. In addition to the documents, you would as well obtain to obtain express penned consent from the car's proprietor, permitting you to buy a policy on the automobile. Collect the documents and provide them to the company. The agent you are dealing with might help you in gathering and preparing the obligatory paperwork.

      5 Determine whether to include the owner in the policy. The company will require you to either include the registered owner as the driver, or solely exclude from coverage. If you determine to exclude the driver, you will have to sign a formal contract stating that the insurance policy business will not deal with the driver unless you personally add the driver.

      Tips & Warnings

      Inside some events it may possibly be impossible to reflect insurable attention that is will satisfy the insurance provider's requirements. Inside conditions wish this, consider talking to the car owner and becoming one of the owners. If this is never an option, the proprietor may buy the insurance policy scheme except you would pay out the premiums to the owner, who would after that pay it to the company.

      by SorrowsCook8 at February 09, 2011 03:02 AM

      IronPython Cookbook (New Entries)

      Insurance approved auto glass repair and replacement In shop or we come to you 28085

      MinnieJacobsen: Created page with 'thumb| Buyer-Submitted Article [http://podcast.kent.k12.md.us/groups/galenamiddle/weblog/a9271/Insurer_Programs_-_How_to_Find_a_Cheap_He…'


      [[Image:automobile_insurance_2061.jpg|thumb|]]

      Buyer-Submitted Article

      [http://podcast.kent.k12.md.us/groups/galenamiddle/weblog/a9271/Insurer_Programs_-_How_to_Find_a_Cheap_Health_Insurance_Plan__-_Save_Big.html Automobile insurance] with your truck, auto or SUV is a want in most express. Numerous purchasers need no idea what they are purchasing, but it is significant to understand the basics of any car insurance policy scheme. You can figure this away, in the breakdown below.

      Difficulty: Reasonable
      Instructions

      Things You'll Need:

      reading skills

      1 Realize the terms. Liability insurance yous coverage in case you cause an accident. It does never cover you. It deal with the additional driver and his vehicle . This is the insurance that is yous generally required by state law. New Hampshire plus Wisconsin create not require auto insurance at this duration. Liability coverage remains split into Possession Injury and Physical Injury. Possession Damage Liability covers anything your car harms. Bodily INJURY Liability covers wounds to some individual caused by your car. Here may also be Personal INJURY Immunity and extra Bodily INJURY COVERAGE that will defend you. Complete and COLLISION coverage are insurance on YOUR automobile. Comprehensive remains coverage to incidents to your automobile--fire, burglary, trees dropping, glass breakage. Collision coverage remains in circumstance you are in an accident, and it deal with your car. UNINSURED MOTORIST coverage covers YOUR medical bills in situation of hit-and-run or somebody with no insurance policy injures you. Various states call for that is this also contain under-insured motorists, or those whose insurance policy yous not sufficient to protect your injuries.

      2 Know what you need. Each express usually has some minimum with liability coverage (except for New Hampshire also Wisconsin once again) plus of program you want to boast the minimum. You need to have more than the minimum if you have assets. Another advantage to having high responsibility limits yous to be able to increase your uninsured motorist coverage (guard for yourself). Most policies will never allow coverage for uninsured motorists to exceed liability limits.

      3 Save cash on auto insurance policy. Ask to discounts and ask the agent to calculate several deductibles also different coverages. You may get a discount with additional cars, good driving record, age deductions, home and auto discounts for having either with the identical agent, plus driver's education courses. Anti-theft devices on the automobile, also even your location can affect the expense of an car insurance policy policy. Utilize a comparison web site to compare prices on several insurance companies. You may well furthermore want to contact your State Insurance Commissioner or similar workplace to witness if there are ratings for the companies you are interested in. Many states have websites fixed up with ratings for insurers, and you may check to realize the way in which beneficial they are to pay, how promptly they pay a claim, and the way they rank with consumer satisfaction.

      By means of the knowledge of terms for vehicle insurance and a tiny information, you can make an advised decision for your automobile insurance policy.

      copyright 2009 Linda Richard

      Please feel free to link to this article or send it to a friend.

      by MinnieJacobsen at February 09, 2011 01:57 AM

      February 08, 2011

      IronPython Cookbook (New Entries)

      Meh Certification 38442

      NonnatusSong3: Created page with 'thumb| User-Submitted Article Obtaining Internet teacher certification remains becoming main stream being more plus more people look for degrees…'


      [[Image:certification_703.jpg|thumb|]]

      User-Submitted Article

      Obtaining Internet teacher certification remains becoming main stream being more plus more people look for degrees on the web . If you want to go this route, you need to choose the institution out of which you obtain your online teaching certification meticulously.

      1 The first step with getting Internet teacher documentation is to research colleges that is offer degrees in the type about teaching that you want to accomplish.

      2 Once you have found several schools offering the online teacher certification that you are looking for, examine to see that they are accredited. Solely because the website asserts they are does not mean it is true. Look to discover that they are accredited by the National Council to the Accreditation of Teacher Education . It should additionally satisfy the minimums for the No Child Left Behind Act.

      3 After checking their accreditation, check to see that is the online teaching [http://www.hvacinstaller.com/training-schools-certification/ authorization] courses offered match your state's requirements.

      4 Once you obtain narrowed your choices of colleges offering Internet teacher authorization speak to an enrollment counselor. They are there to aid you and answer questions.

      5 Once you boast enrolled plus are nearing the end of your Web teaching authentication classes secure on feel with the school district that is you wish to instruct in. Find out what their specific requirements are in regards to practice teaching, etc.

      6 After you have successfully finished your online teacher documentation you are ready to apply for your express license.

      by NonnatusSong3 at February 08, 2011 08:55 AM

      IronPython Cookbook (New Entries)

      Mail to VMware certification is sent 99106

      AutherSanford: Created page with 'thumb| If you are a competent swimmer also you like to teach, then a YMCA swim instructor authorization may be the qualification that is will se…'


      [[Image:certification_3154.jpg|thumb|]]

      If you are a competent swimmer also you like to teach, then a YMCA swim instructor authorization may be the qualification that is will set your skills and enthusiasm to very good use to great pay.

      Prerequisites

      Candidates must be 16 years of era, be competent with a variety about swim strokes and have a basic first aid qualification. Some YMCAs also demand lifeguard authentication prior to taking their swim instructor course, which is some good idea in any case mainly because many swim instructor piece of work also require it.

      Program Details

      Advantages

      Swim instructors are in high demand. Essential group lessons shell out around $15/hour, yet good instructors can charge three to six times that is volume for exclusive lessons. Part-free time work remains additionally obtainable, and a YMCA swim instructor [http://www.hvacinstaller.com/training-schools-certification/ authentication] can also be an engaging addition to any summer camp counselor or aquatics instructor.

      by AutherSanford at February 08, 2011 08:19 AM

      John Lam on IronRuby

      My First Day in Windows

      Every now and then an opportunity opens up that so lines up with my interests that I can't pass it up. Today, I just completed my first day as a member of the Windows team. My career so far has been a series of these interesting changes, all of which has led me to my new team.At each step I've learned something new, be it launching my own start-up to sell software to OEMs to working on a start-up team at Microsoft building some fantastic tooling for Technical Computing. The next step of my journey will involve learning how to ship software at scale. I'm looking forward to the challenge, and being able to share with you (at the appropriate time) all of the hard work that we're doing in Windows!

      Permalink | Leave a comment  »

      February 08, 2011 07:22 AM

      February 07, 2011

      Jeff Hardy's Blog (NWSGI)

      IronPython 2.7 Beta 2 Now Available

      At long (long) last, the first community release of IronPython is now available – IronPython 2.7 Beta 2. The highlights of this release are the new zlib (which also enables gzip) and subprocess modules. There have also been a number of bug fixes.

      Since Beta 1, we've moved all development to the Github IronLanguages project, although the issue tracker is still on CodePlex. This meant learning the build system, learning how to package a release (something that needs some work), and various other odds 'n ends. There are definitely some stumbling blocks that new people might trip over, so those should be taken care of as soon as possible.

      The next release is scheduled for February 20th. The first IronPython Bug Weekend is scheduled for February 12-13th; more on that coming soon.


      by jdhardy (noreply@blogger.com) at February 07, 2011 08:40 AM

      February 04, 2011

      IronPython Cookbook (New Entries)

      Miguel de Icaza

      On Reflector

      Red Gate announced that their Reflector tool would soon become a paid-for app. A few years ago they bought the rights to Reflector from Lutz Roeder and started maintaining two editions of the product: a free version and a commercial version with extra features. Many people in the .NET community feel unhappy about that decision.

      Whether Red Gate's decision is good or not for them is up to other blogs to discuss. I am grateful that over the years Reflector ran with Mono's Windows.Forms implementation and that the maintainers were careful to keep the code running with Mono.

      Of course, I would always like more an open source equivalent to a proprietary tool, and while Reflector was a free download, it was never open source.

      Some believe that in response to the announcement we created a competitor to Reflector. We did not.

      We have had a decompiler in Mono for a few years now. First, we had a decompiler contributed to MonoDevelop by Andrea and we later replace it with the one that was developed by JB Evain:

      The current decompiler in MonoDevelop actually originated not as a decompiler, but as a flow-analysis tool in 2005. It was part of db4Object's Native Queries. Native Queries were a way of getting some of the benefits of LINQ without any compiler support. It worked by reassembling the AST at runtime from a stream of IL instructions. For example, you could use the following C# code to query a database:

      IList  pilots = db.Query  (delegate(Pilot pilot) {
      	return pilot.Points == 100;
      });
      	

      The Query method would decompile the code in the delegate and reconstruct the abstract syntax tree and determine that the expression to query was pilot.Points == 100.

      JB Eventually expanded hi IL Manipulation library Cecil to contain a decompiler built based on the ideas of flow analysis. JB described this back in December of 2008 as part of a Hack Week followed by a hack-a-thon:

      During the last Hack-Week, I started refactoring Cecil.FlowAnalysis, and since then, I’ve been working pretty seldom on it. It was last month that I decided to give it a kick, and even took a week of vacations to organize a CodeCamp with friends to give it a boost and have fun altogether

      The decompiler is just one of the various tools built with Cecil and has been a standard component of MonoDevelop for a long time (it is part of MonoDevelop 2.4).

      Although yesterday in response to the announcement, a WPF UI was created for the Cecil.Decompiler.dll, this is not the only effort. There is also an older Cecil Studio that uses Windows.Forms that was created a few years ago and of course, our own MonoDevelop assembly browser.

      We welcome contributions to the decompiler for people interested in improving the core, regardless of their preference for a UI built on top of it:

      That being said, JB has been working on a new system that goes beyond decompilation and will be demoed at QCon next month. Stay tuned for his demo.

      by Miguel de Icaza (miguel@gnome.org) at February 04, 2011 08:44 PM

      January 22, 2011

      Hex Dump

      I finally own a smartphone, and it's not an iPhone

      After years of being an outcast amongst my colleagues, happy with a simple mobile phone that just made phone calls, I made the decision to upgrade to a smartphone. Why would I, since I was actually happy with my "no frills" Nokia and it's excellent battery life which makes a smartphone look retarded. At work we are working on making our web applications more mobile friendly, so we needed a range

      by Mark Rees (noreply@blogger.com) at January 22, 2011 07:58 AM

      Miguel de Icaza

      Adult Principles, from JPBarlow

      A few days ago, John Perry Barlow twetted a series of Adult Principles, and I enjoyed reading them. When he was asked where they came from, he said:

      They're from a list I assembled for myself on the eve of my 30th birthday. Many years ago.

      This is the collected set from his twitter feed:

      Adult Principle #1: Be patient. No matter what.

      Adult Principle #2: Don’t badmouth: Assign responsibility, not blame. Say nothing of another you wouldn't say to him.

      Adult Principle #3: Never assume the motives of others are, to them, less noble than yours are to you.

      Adult Principle #4 Expand your sense of the possible.

      Adult Principle #5 Don’t trouble yourself with matters you truly cannot change.

      Adult Principle #6 Don't ask more of others than you can deliver yourself.

      Adult Principle #7 Tolerate ambiguity.

      Adult Principle #8 Laugh at yourself frequently.

      Adult Principle #9 Concern yourself with what is right rather than who is right.

      Adult Principle #10 Try not to forget that, no matter how certain, you might be wrong.

      Adult Principle #11 Give up blood sports.

      Adult Principle #12 Remember that your life belongs to others as well. Don't risk it frivolously.

      Adult Principles #13 Never lie to anyone for any reason. (Lies of omission are sometimes exempt.)

      Adult Principle #14 Learn the needs of those around you and respect them.

      Adult Principle #15 Avoid the pursuit of happiness. Seek to define your mission and pursue that.

      Adult Principle #16 Reduce your use of the first personal pronoun.

      Adult Principle #17 Praise at least as often as you disparage.

      Adult Principle #18 Admit your errors freely and quickly.

      Adult Principle #19 Become less suspicious of joy.

      Adult Principle #20 Understand humility.

      Adult Principle #21 Remember that love forgives everything.

      Adult Principle #22. Foster dignity.

      Adult Principle #23. Live memorably.

      Adult Principle #24. Love yourself.

      Adult Principle #25. Endure.

      A small detour, he also tweeted

      If you want a new, improved mate, try treating the one you have better.

      by Miguel de Icaza (miguel@gnome.org) at January 22, 2011 03:49 AM

      January 20, 2011

      Miguel de Icaza

      Help us test Mono 2.10

      Andrew has just released the packages for our first preview of Mono 2.10, we published sources and packages for SLES, OpenSUSE, RHEL, Windows and MacOS X here:

      http://mono.ximian.com/monobuild/preview/download-preview

      From our draft release notes, here are some of the highlights in this release:

      As well as containing a pile of bug fixes.

      As I mentioned last year, we are moving to a faster release schedule to get important features out for our users faster. For instance, our SGen garbage collector has been vastly improved and should perform better under load, and our ParallelFX got some real-life testing which helped us improve it significantly.

      SGen Technical Discussion

      Mark has been blogging the technical details about the architecture of the SGen garbage collector, you can read the documents here:

      by Miguel de Icaza (miguel@gnome.org) at January 20, 2011 09:23 AM

      January 18, 2011

      John Lam on IronRuby

      January 14, 2011

      Miguel de Icaza

      Your Own Sandbox

      Since the beginning of time, men have sought to find a way of creating a sandbox for untrusted code running on their Mono virtual machine.

      Those of you familiar with Silverlight's security system, commonly referred as CoreCLR Security, have wondered "how can I get me some of dat". Today Sebastien wrote a How-to guide for those of you interested in creating your own secure sandboxes like Moonlight or Unity3D have done.

      From his blog:

      So what was missing was not facts but orientation. It kind of make sense, most people are not doing an open source implementation of Silverlight, we are. However we're providing a lot of cool (yes it is ;-) stuff within - stuff, like coreclr, xaml, the cecil-based linker... that can be reused in other projects. So the missing piece is an how to for people wishing to enable CoreCLR when embeding mono in their own application. It does not bring a lot of new facts but, hopefully, it will order them in a more useful way.

      by Miguel de Icaza (miguel@gnome.org) at January 14, 2011 07:21 AM

      January 10, 2011

      The Voidspace Techie Blog

      Sad that Python doesn't moo? A reason to be happy

      Further inspired by python -me I've finally solved one of the big problems that hinders adoption of Python in the corporate world. Python can now moo: pip install oo python -moo This requires pygame 1.8 (or more recent) and Python 2.6 (or more recent). ... [75 words]

      January 10, 2011 08:02 PM

      January 07, 2011

      Miguel de Icaza

      Mono at CES: More Games

      During today's Nvidia press conference at CES, a the Monodroid-powered DeltaEngine was shown running the SoulCraft Tech Demo:
      CES Video.

      Although today's demo was powered by MonoDroid the engine is a cross-platform .NET game engine, it runs on on Mono-powered systems like Linux, MacOS X, MonoTouch and MonoDroid as well as Microsoft .NET powered systems like the XBox360, Windows Phone 7 and Windows:


      If you have an iPad, you can try the Zombie Party game on the AppStore, it is the first game powered by DeltaEngine. ExDream is the group behind DeltaEngine.

      For information on how the demo was built check out this blog post. The engine will be open sourced this year.

      by Miguel de Icaza (miguel@gnome.org) at January 07, 2011 06:33 AM

      January 04, 2011

      Miguel de Icaza

      Mono for Android

      Now that we feel that we have fixed all the embarrassing bugs in Mono for Android, so we have opened up our Mono for Android preview program to anyone that wants to take it out for a spin.

      Mono for Android brings the full Mono VM to Android. We use a library profile that is better suited for mobile devices, so we removed features that are not necessary (like the entire System.Configuration stack, just like Silverlight does).

      In addition to bringing the core ECMA VM to Android, we bound the entire set of Android Dalvik APIs to C# and in the process C#-ified them. This includes using C# properties for metadata (less XML config file messing around), exposing C# events, C# properties, strongly typed generic types where necessary, implicit conversions where needed, using the C# API style, IEnumerable where appropriate (to let you LINQ over your Dalvik, and we turn IIterable into IEnumerables for you).

      On the OpenGL front, we brought the same OpenTK library that is popular among .NET developers on both Windows, Linux and iPhone, so you can share the same OpenGL logic across all platforms.

      Unlike iOS where the JIT is not supported, Mono on Android supports the full JIT, so you can use Reflection.Emit and dynamic code compilation as much as you want.

      This initial release only comes with templates for C#, but other .NET compilers should work, as long as they reference Mono for Android's libraries (as we removed a few methods that make no sense on mobile devices).

      Support for OSX

      Through the lifetime of our preview program, Mono for Android only supported Windows development using Visual Studio. Today we are also releasing support for developing Android applications on MacOS X using MonoDevelop.

      Getting Started

      Please check our Welcome page, it contains installation instructions, links to tutorials, mailing lists, chat rooms and more.

      I strongly advise our users to join our mailing list and to check the previous discussions on the mailing list for some tasty insights.

      You can also browse the API that we expose to C# developers.

      Upcoming Features

      We are working as fast and as hard as we can to complete Mono for Android. This includes Linux support and bringing MonoDevelop to Windows, for users that can not run Visual Studio 2010 Professional.

      Giving us Feedback

      Please provide your feedback on the product directly on our mailing list, as this is what the MonoDroid developers monitor. Bug reports should be filed on Novell's Bugzilla.

      by Miguel de Icaza (miguel@gnome.org) at January 04, 2011 06:59 PM

      January 02, 2011

      John Lam on IronRuby

      Photos From China: Bicycles Everywhere!

      This fall, I spent a couple of weeks traveling through China with my Dad, who's now 75. Amazingly enough, was the first time that either my Dad or I had been to China.

      I shot a lot of photos there, and here's a collection of photos of bicycles. Bicycles were once ubiquitous throughout China, but they're an endangered species in urban areas. Here's a collection of photos of people using bicycles in interesting ways. Almost nobody wore helmets, and often you could see entire families commuting on a single bicycle.

       

      Permalink | Leave a comment  »

      January 02, 2011 11:34 PM

      January 01, 2011

      John Lam on IronRuby

      Looking Back On A Year Of Cycling

      2010 was my first year back on the bike after a long time off. It felt good to be a bit more "selfish" now that the boys were 6 and 4, and take some time to do some riding just for me.

      Edge_500

      Without a doubt, the best purchase I made this year was my little blue friend: a Garmin Edge 500 bike computer. It's an ANT+ compatible device that records data from a number of different channels:

      • Heart rate
      • Cadence
      • Speed
      • Temperature
      • Location
      • Power

      For a fantastic review, check out Ray Maker's write-up on the Edge 500. The Garmin software is pretty good (I've re-implemented a good chunk of it on my own as well - look for details in the new year). It makes it really easy to analyze your rides after you're done.

      My goals this year were pretty simple: 1) get out and have fun, and 2) ride up as many hills as I could find to force myself to get into some kind of shape. I didn't have any well-defined goals this year, since that would have defeated the get out and have fun goal. Looking back on my training logs on Garmin Connect, I can see that I:

      • Rode over 2000 miles
      • Climbed over 115K vertical feet
      • Completed the Seattle LIVESTRONG century in abysmal conditions
      • Rode up my first mountain pass (I spent most of my life in Toronto) when I rode up to Johnston Ridge. 
      • Recorded an FTP of 207W on one of my loops around Lake Sammamish.

      Next year I'll follow a much more structured training plan to see what I can pull off. Looking forward to it!

       

      Permalink | Leave a comment  »

      January 01, 2011 03:00 PM

      John Lam on IronRuby

      Predictions for 2011

      Mostly, I'm writing this post so I'll have something to make fun of in a December 31, 2011 blog post. So here goes ...

      1. We're going to see a lot of interest in business models that sell new customer relationships to existing businesses. The current poster child for this business model is Groupon. If they can successfully validate this business model (and this is by no means a slam dunk) look for Facebook to pull a fast-follow and enter the market in 2011. 
      2. Kinect is going to have a big impact on Microsoft's image in the consumer market. Last Wednesday, I saw a crowd of nearly 50 people watch a kid play Dance Central at the Microsoft Store in Bellevue. The kid was good - and got a big round of applause from the crowd when he was done. The crowd spontaneously formed around him as he played, with some people literally stopping dead in their tracks walking by the store. Kinect's open relationship with the hacker community is also going to play a huge role in establishing it as a mainstream technology, particularly for PCs; the guy in the picture is playing WoW via Kinect. I predict that we'll see a Kinect "halo effect" that extends into consumer PCs, which will be driven by ISV's who take advantage of some of the libraries being created by the hacker community.  
        Kinect
      3. We're going to see a lot more evidence that HTML 5 is a legitimate application platform. The major platform vendors  The Pirates and Daisies tower defense game is just the first of many more apps to come. I predict that a major game publisher will announce and/or deliver a web-based game using nothing but HTML 5 in 2011.
        Html5

      Happy New Year everyone!

      Permalink | Leave a comment  »

      January 01, 2011 05:03 AM

      Miguel de Icaza

      Open Source Contribution Etiquette

      Some developers, when faced with fixing, or adding a feature to an open source project are under the mistaken impression that the first step before any fixing takes place, or before adding a new feature takes place is to make the code "easier for them" to work on.

      "Easier for them" usually is a combination of renaming methods, fields, properties, locals; Refactoring of methods, classes; Gratuitous split of code in different files, or merging of code into a single file; Reorganization by alphabetical order, or functional order, or grouping functions closer to each other, or having helper methods first, or helper methods last. Changing indentation, aligning variables, or parameters or dozen other smaller changes.

      This is not how you contribute to an open source project.

      When you contribute fixes or new features to an open source project you should use the existing coding style, the existing coding patterns and stick by the active maintainer's choice for his code organization.

      The maintainer is in for the long-haul, and has been working on this code for longer than you have. Chances are, he will keep doing this even after you have long moved into your next project.

      Sending a maintainer a patch, or a pull request that consists of your "fix" mixed with a dozen renames, refactoring changes, variable renames, method renames, file splitting, layout changing code is not really a contribution, it is home work.

      The maintainer now has to look at your mess of a patch and extract the actual improvement, wasting precious time that could have gone to something else. This sometimes negates the effort of your "contribution".

      If you really have an urge to refactor the code, first of all, discuss the changes with the maintainer with the rationale for the changes. If the maintainer agrees with the changes, make sure that you keep your refactoring and changes independent from code fixes, it makes reviewing the code a lot simpler.

      The alternative, to keep your fork, is usually a guarantee that your effort will be wasted, and wont help other users. People have tried to do this. It is attempted every year, by hunders of developers who in tbe back of their minds are thinking "I can do better" and "I wont make the same mistakes". After 18 years doing open source I can probably think of a handful of project forks that have survived and flourished. Out of hundreds of such failures. So the odds are not good.

      So respect the original coding style, and if you want to make refactoring changes, discuss this with the maintainer.

      by Miguel de Icaza (miguel@gnome.org) at January 01, 2011 03:14 AM

      December 30, 2010

      John Lam on IronRuby

      Got Lower Back Pain?

      Media_httpwwwtri247co_sgocj

      I've got a spotty track record of working on strengthening my core. During the winter, I'm usually on a 16 week weight program, and I make really solid gains in strength then. But during the riding season, I neglect my core and ultimately wind up paying a price for it with lower back pain on my rides. This article does a great job at explaining why you might get lower back pain during rides. It does, however, assume that you've been competently fitted to your bike. This winter is the first that I'm doing a mixed riding / weight program. Early signs point to it helping me keep my spine in a neutral position during my rides (losing some weight around my midsection will also help this too!).

      Permalink | Leave a comment  »

      December 30, 2010 03:00 PM

      John Lam on IronRuby

      Using Games To Help Us Learn

      Late last night, I discovered VimGolf, and I was instantly hooked.

      Vimgolf

      VimGolf is a social game that encourages people to simultaneously compete and teach at the same time. In VimGolf, you're given a file that contains the starting text, along with a file that contains the "solution". Your job is to transform the starting text into the solution in the fewest number of keystrokes. If you want to see other people's solutions, you have to submit one of your own. Your submission will only let you see people's solutions that are worse (higher number of keystrokes) than yours, and a small number of solutions which have a better score than yours. By looking at other people's solutions, you will likely learn a trick or two that you can use to improve your score. You can then submit another solution and repeat the learning process.

      It's a fantastic example of using a game to improve your skill. The general idea of using games to teach is more broadly applicable as well. For example, it's well known that most users only use a small fraction of the features in their software. If your game encourages users to try new features of the software that they haven't used before in order to "win" at the game, you're going to be far more successful at teaching them how to use your software. Users don't want to read a manual; they would much rather learn by doing, and games are a great way to make that happen. 

      VimGolf encourages users to practice using vim. Daniel Coyle's excellent book, The Talent Code, talks about how people improve through "deep practice", or practicing at the edge of one's abilities for a sustained period of time.

      I've seen this in action first hand in our house. Since the start of the school year, my 7-year old son has been really interested in learning how to play chess. I remembered learning how to play chess as a kid: the only way for me to "practice" was to play a real game. And since my dad was a lot better than me, I wasn't learning a whole lot during the infrequent games that we would play (losing repeatedly did not encourage me to want to play more games).

      Chessmagnet

      Matthew is fortunate to have ChessMagnetSchool available to him through his chess club at school. In Chess Magnet School, you are presented with problems like the one shown above, and you're asked to solve it. Matthew has solved over 1000 problems to date. As he solves more problems, he continues to advance. After a certain number of problems are solved correctly, he gets promoted to the next level. Right now Matthew is a Herald and he really wants to move on to be a Jester. He has concrete goals that he sets for himself "Daddy, tomorrow I want to go from 30% to 50% of the way to becoming a Jester". The game adapts to his ability, and he gets a ton of practice working on problems right at the edge of his ability. He's learning at an incredible rate; it won't be long before he's moping up the floor with his Dad.

      So the next time you're designing a program, try and think about whether you can use a game-based learning approach. It can easily be the difference between a program that has tons of features that nobody knows about and a program that has a fanatic online following.

      Permalink | Leave a comment  »

      December 30, 2010 05:09 AM