Apps, Coding, How to, MicrosoftBand, Windows Phone

Streaming Sensor data from the Microsoft Band using Reactive Extensions and C#

Hi,

So I’ve recently been working on programming for the Microsoft Band. In particular looking at streaming sensor data back from the band in realtime to process on my Windows Phone phone and, depending on the data, push up to a cloud service.

Out of the box the Band SDK will give you a set of SensorManagers to which you can hook up .NET EventHandlers and then do what you will with the output.

However, working with streams of data in .NET using EventHandlers is a pain and there is a much nicer technology for dealing with streams -> Reactive Extensions. (It’s a pretty bit topic, if you haven’t heard of it I’d strongly recommend reading up and having a play.)

So I set about writing a little wrapper to take the input from the Band’s SensorManagers and create an IObservable stream of events.

This lets you do awesome stuff, like doing linq queries over the realtime data stream or time based operations, among other things.

Continue reading

Standard
Apps, How to

Appveyor, Github and Chocolatey: Automatically Build your project and publish updates to Chocolatey

So the aim here is to get the PowerGist project a nice CI process. I want to accept pull requests to the github repository and have these changes build, tested (future) and be published to Chocolatey for people to install/update.

Before I go on, if you haven’t used chocolatey, its a great tool similar to apt-get on linux for installing applications – have a look at it now, I’ll wait. Good, now that’s sorted lets crack on.

As this is a free time project, this CI process needs to be buttery smooth. There is nothing like a bit of friction (anywhere but mainly when releasing) to put you off doing an update, fixing a quick change or adding a feature. At the end of the day I want to write the code, accept a pull request or do a commit and have everything happen automagically.

There is one exception to this, I don’t want every build to release to Chocolatey, I want a release gate. When a build succeeds I want a versioned artifact to be created, I can then review this and click a big “Go” button, when happy, to push this to Chocolatey.

I’ve been looking at appveyor for a while now and this was the perfect project to take it for a spin, didn’t regret it – got exactly what I wanted.

So let’s get into it, first of all setup your Project:

Continue reading

Standard
Apps, Coding, How to, powershell

PowerGist – Source Control for Powershell ISE with Github Gists

 

 

Install

Get Chocolatey (awesome command line installer for windows)

Open powershell as administrator and type:

C:\> choco install powergist

Once that’s done simply type ISE and you’ll see it pop up on the right.

Login to your Github account and away you go.

*Warning – This was a quick project and should be considered Alpha quality to see if it was possible and/or useful. If you find a bug or issue head over to the github repo site to report it or fix it in a pull request*

About

One of the reasons I always advise people writing software to provide an API’s or a plugin model is that it allows end users to enhance the functionality of the product. If it doesn’t do what they want they can add it making your product better for free. It’s also a nice way to POC new features, internally, off the critical path.

So when I sat next to @StuartLeeks and said “I wish Powershell ISE integrated with some kind of source control” he pointed me to the addin model for ISE and said “Bet you can’t do it” (well known as a stealth motivation tactic for me within the team). So I set about trying.

The addin model is awesome. It’s nice and quick to get up and running and I was done writing a simple integration for Githubs Gist service (if you’ve never used it think git repos but for snippets) inside a day. I’ll go into a bit of detail on how to write addins in a future post, in the meantime feel free to have a look at the source.

Standard