Accessing the Android Barometer using Xamarin.Android

Easily:

< ![CDATA[
[Activity (Label = "HelloBarometer", MainLauncher = true)]
public class Activity1 : Activity, ISensorEventListener
{
    TextView mainLabel;  

    protected override void OnCreate(Bundle bundle)
    {
        base.OnCreate(bundle);
        // Set our view from the "main" layout resource
        SetContentView(Resource.Layout.Main);
        //Detect the barometer
        var sm = (SensorManager) this.GetSystemService(Context.SensorService);
        var barry = sm.GetDefaultSensor(SensorType …
more ...

Tap 7 Times to Enable Developer Options in Android Jelly Bean

How to enable developer settings on Android 4.2 | Android Central.

I just got myself a Nexus 4 for cross-platform development, but it didn't initially appear as a device in Xamarin Studio. Initial Googling and SO'ing indicated a non-existent "Settings->Application->Developer" route to enable debugging on the phone.

Instead …

more ...

The Governor vs. Boyd Crowder

The Justified finale had a scene that summed up one of it's greatest strengths: Raylan, the putative hero, and Boyd, the putative villain, demonstrate how parallel they are to each other: Raylan points to Boyd's career and sneers at the thought that Boyd imagines himself anything other than "the bad …

more ...

Hungarian Monadic Notation: Call Me Maybe

Update: this is an April Fool's joke. It's the most incoherent, illogical thing I could think of. It's a bad idea, it wouldn't work, and it misses the point of everything.

Hungarian Monadic Notation: Call Me Maybe()

Update: This was an April Fool's joke. If you are interested in monads …

more ...

Literate Programming from HTML

OK, let's see if this works...

This is the basic structure of the "Hello, World!" program in C#:

using System;

class Hello
{
   <getchunk id="Main"/>
}

where the Main chunk is defined as :

static void Main()
{
   Console.WriteLine("Hello, World!");
}

C# Command-Line Extraction

And if you clone my Github repository, you …

more ...

The Gray

Spoiler alert.

Not that you care. Scientists at UCSD have shown that people actually prefer stories when they have advance knowledge of the plot twists. Maybe movie companies have figured this out, because the trailer for The Gray has the final two shots of the movie in it. Not, mind …

more ...

Reviewed 4 Stars: Lost at Sea, The Jon Ronson Mysteries

Lost At Sea: The Jon Ronson MysteriesLost At Sea: The Jon Ronson Mysteries by Jon Ronson
My rating: 4 of 5 stars

Highly recommended. Ronson returns to the form of "Them," and "The Men Who Stare At Goats," in this collection of humorous journalistic essays. His last book, "The Psychopath Test," was a little one-note and …

more ...

How does Ravelry make money?

Ravelry is a profitable 4-person company, a "lifestyle business". This model is of little interest to venture capitalists but is, I think, very appealing to most people dreaming about their own business:

Unraveled » Blog Archive » How does Ravelry make money?.

more ...


Why I've Joined Xamarin

Today is my first day at my new employer, Xamarin, sponsors of the Mono project and developers of MonoTouch and Mono for Android. Mobile cross-platform C#: long-term readers will probably see why this is the perfect job for me. (Well… short of a gig doing AI on a robot submarine …

more ...