Showing posts with label C#. Show all posts
Showing posts with label C#. Show all posts

Wednesday, April 16, 2014

Droning on with Tasks, Rx and some TPL

The Brain Dump - Tasks and awaits and Rx! (And Drones!) Oh My!

A few people I work with are tinkering with an off-the-shelf drone in our spare time and so we are writing a C# library to control it.

The way it works is you send UDP commands to the drone and you receive a stream of status & navigation UDP packets from it. So everything is asynchronous by default. You don’t send a command and get back an “I got it!” response. You have to send a command and then monitor the status for a change reflecting your desired state,

For example, to start flying, you must repeatedly send the “take off” packet every few milliseconds until you see the “is flying” flag set in the status packets. Lets see what that would look like.

We want the SendCommand method to be asynchronous and totally decoupled from the UI. So the send process looks like this.



Broken down, each function is simple enough to understand and debug. This simplicity only comes from the power of Rx, the TPL and the async/await functionality. Imagine what the code would look like before when all the timers and .NET events and state would have to be managed directly.

Mostly I just liked his title... :P

Well that and there are some tips in this post that will come in handy, right about, well, now...

Wednesday, April 09, 2014

Roslyn gets Mono - Mono and Roslyn

Last week, Microsoft open sourced Roslyn, the .NET Compiler Platform for C# and VB.

Roslyn is an effort to create a new generation of compilers written in managed code. In addition to the standard batch compiler, it contains a compiler API that can be used by all kinds of tools that want to understand and manipulate C# source code.


Roslyn on Mono

At BUILD, we showed Roslyn running on Mono. If you want to run your own copy of Roslyn today, you need to use both a fresh version of Mono, and apply a handful of patches to Roslyn [2].


Adopting Roslyn: Mono SDK

Our goal is to keep track of Roslyn as it is being developed, and when it is officially released, to bundle Roslyn's compilers with Mono [6].

But in addition, this will provide an up-to-date and compliant Visual Basic.NET compiler to Unix platforms.

Our plans currently are to keep both compilers around, and we will implement the various C# 6.0 features into Mono's C# compiler.


Mono Project and Roslyn

Our goal is to contribute fixes to the Roslyn team to make sure that Roslyn works great on Unix systems, and hopefully to provide bug reports and bug fixes as time goes by.

We are very excited about the release of Roslyn, it is an amazing piece of technology and one of the most sophisticated compiler designs available. A great place to learn great C# idioms and best practices [5], and a great foundation for great tooling for C# and VB.

Thanks to everyone at Microsoft that made this possible, and thanks to everyone on the Roslyn team for starting, contributing and delivering such an ambitious project.


VB.Net on Linux? Awesome. Xamarin really is exciting to watch. I love those guys (and it's not just the free booze from their Build talking either... well.. much... ;)

Monday, March 24, 2014

Image Resizer for Windows Explorer (Right-Click... Resize Picture...)

Windows Enterprise Desktop - Image Resizer: Free, Handy Windows Explorer Shell Extension

For those not already familiar with the terminology, the software tool “Image Resizer for Windows” is what’s called an Explorer Shell Extension (aka ShellEx). When you install it on a Windows PC, it adds to Explorer’s capabilities. Thus, if you can puzzle your way into the screen capture to the left (which I resized using the very tool I’m writing about at the moment), you’ll see that an entry in the right-click Explorer menu called “Resize pictures” has been added to call put this utility to work. Selecting that menu entry produces the Image Resizer window that appears beneath the menu snippet, and shows that you can pick any of a number of default resizings (small, medium, large, or mobile). You can also create you own custom resizings as well (as I typically do for my blog posts, which are limited to 500 pixels in width, maximum).

For anybody who must work with images or screen captures on a regular basis, Image Resizer for Windows is a great add-in for their software toolbox. It’s a CodePlex project so it’s Open Source, free, and safe for general and widespread use. There’s even a server version that’s based on ASP.NET available through And for those whose memories go back far enough, yes indeed, this is a faithful replacement for the old Windows XP PowerToy also named Image Resizer. It’s pretty popular, too: according to the CodePlex home page for the tool, it’s been downloaded over 1.4 million times.


Image Resizer for Windows

Image Resizer for Windows is a utility that lets you resize one or more selected image files directly from Windows Explorer by right-clicking. I created it so that modern Windows users could regain the joy they left behind with Microsoft's Image Resizer Powertoy for Windows XP.
Feedback & Support
If you need help installing or using the tool, use the Discussions tab to ask your question.
If you find a bug or think of a feature, use the Issue Tracker tab to submit your request.


While it's been a couple years since this was updated/released, it's still a great tool for anyone doing "stuff" with images/pictures. Best part is the source is available... :)


Related Past Post XRef:
Easy image resizing for the digital camera happy - Image Resizer Powertoy clone for Vista & Windows 7 (32 & 64 bit)
Image Resizer PowerToy for XP and Vista - Easy Resizing of Images, Pictures, Digital Photos, etc via Windows Explorer

Wednesday, March 05, 2014

"Location Intelligence for Windows Store" the free eBook...

Ricky's Bing Maps Blog - Free eBook: Location Intelligence for Windows Store


I am happy to announce the release of my  book “Location Intelligence for Windows Store Apps”. This is available as a free eBook. Yes I said “free”, as in “Free beer”.

Location Intelligence has been one of the fastest growing industries in recent years and continues to grow at an exponential rate. Seventy to eighty percent of all business data has some sort of geospatial context. Many companies want to make use of this data however most of them do not know where to start. Many of these same companies are planning to create Windows Store apps.

In this book we will dive into the world of location intelligence and the different options for creating location aware applications in Windows 8.1. The first half of the book focuses on the inner workings of Window Store Apps and the various location related tools available such as sensors and the Bing Maps SDK. The second half of the book focuses on creating several useful location intelligent apps. All code samples are provided in JavaScript, C# and Visual Basic.

Table of Contents

  • Chapter 1: Getting Started
  • Chapter 2: The Sensor and Location Platform
  • Chapter 3: Bing Maps JavaScript API
  • Chapter 4: Bing Maps Native API
  • Chapter 5: Bing Maps REST Services
  • Chapter 6: Bing Spatial Data Services
  • Chapter 7: Working with Spatial Data
  • Chapter 8: Drawing on the Map
  • Chapter 9: Creating an Augmented Reality App
  • Chapter 10: Creating a Templatable Compass Control
  • Chapter 11: Cross Platform Development

... [Click through for the download links]

At 421 pages this is not your slim eBook... :)


From the PDF;

Location Intelligence has been one of the fastest growing industries in recent years and continues to grow at an exponential rate. Seventy to eighty percent of all business data has some sort of geospatial context. Many companies want to make use of this data however most of them do not know where to start. Many of these same companies are planning to create applications targeting Windows 8. You may well be reading this book for this very reason.

With Windows 8 you have the ability to create applications that reach across many platforms such as desktops, laptops and tablet devices. A Windows Store app is a new type of application that runs on Windows 8 devices. Unlike traditional desktop apps, a Windows Store app has a single, chrome-less window that fills the entire screen by default, so there are no distractions. In addition to this, these apps can support different layouts and views to create a fluid experience across different screen sizes and orientations. Several different types of input sources are supported, including touch, pen, mouse, and keyboard input. It’s also possible for apps to communicate with each other by sharing content in a standard way. Instead of icons, Window Store apps uses live tiles which can be used to display useful, at-a-glance data to the user, without the need for the user to open up the app. Windows Store apps can be written in several different languages including JavaScript, C#, Visual Basic, C++ and C. Apps are distributed through the Windows Store in Windows 8 and gives you the ability to make your app available to millions of people around the world.

In this book we will dive into the world of location intelligence and the different options for creating location aware applications in Windows 8. The first half of the book focuses on learning what tools are available for creating location aware Window Store applications. The second half of the book uses a more hands on approach by demonstrating how to develop complete end-to-end location aware solutions.

Who this book is for?
This book is aimed at developers who are being introduced to creating location based Windows Store apps using both Web (HTML, CSS3, JavaScript) and Managed (C#, Visual Basic) programming languages. Previous knowledge on creating location based application is not required or needed and all topics are explained from the ground up. This will including the use of Bing Maps and sensors such as the accelerometer, compass, gyro, and location services. It will be assumed that you have a working knowledge of one of these programming languages; JavaScript, C# or Visual Basic. Experience creating Windows Store applications will help but is not required.

Chapter Overview
In the first half of this book each chapter builds on top of the previous such that by the time you reach the end chapter 7 you will have gained a good working knowledge on how to use all the tools available for creating location aware Windows Store app. The chapters in the second half of the book are independent of each other. Each of these chapters show how to create a complete end to end application. If you wish to skip between these chapters, you can do so without missing out on any content that might be required


A Windows 8.1 C# Code Snip Sheet, Vol 1...

msplebanon - "W8.1 C# Cheat Sheet Vol.1" by Moalla Ilani

After a long experience with new developer students, I have seen some are thirsty for very basic codes to startup their first apps. Some spend hours on search engines to find the codes they need from open source websites, and from professional point of view, being familiar with search engines is a great talent to have, while other fresh students are still not familiar and may give up from first time.

So cheers this is a safe place to start, this cheat sheet is full of very basic and useful C# windows 8 codes that will help you run your first apps, and you will always stay in need for it whatever professional you are. Of course I may miss some codes you may be waiting for, please feel free to tell me about in order to add them. So before beginning, I recommend everyone to save this cheat sheet on their desktop, in a notepad.txt file, and continue on adding some useful codes to it for future daily use, so that you save time and be more productive.


Nice little collection of Windows 8.1 code snips...

Today's Shiny... C# Pad, web based C# REPL environment

Sunny Ahuwanya's Blog - Introducing C# Pad

I’m excited to present C# Pad, an interactive web based C# REPL.

Have you ever wanted to quickly evaluate an expression or test some code, like say try out different DateTime string formats or test a method or clear up some confusion (like what’s the difference between Uri.EscapeDataString and Uri.EscapeUriString or what new Random().Next(0) returns), or decode some string in Base64 or some other format?

C# Pad lets you easily do all those things and a whole lot more.

Interactive REPL

Do you see the embedded code pad below? Go ahead and hit the Go button.


That’s because C# Pad is a REPL. Objects in previous submissions are visible and accessible from the current one.
( Did you also notice the cool code completion? :) )

You don’t need to call Console.WriteLine to display results. Simply type the variable name (without a semicolon) in the last line of a code submission and the string representation of the variable’s value will be displayed. 
For example, type greeting in the same code pad and hit Go to see its value.


You can use C# Pad to write complex code, define classes and methods and evaluate all kinds of expressions ranging from simple mathematical expressions like 60 * 60 * 24 or Math.Sin((30 * Math.PI)/ 180) to LINQ expressions.


C# Everywhere

You can embed interactive code pads in your blog, website or any site you can edit, just like I have in this blog post. You can even select a theme that matches your site.
Yes, this means you can now create a C# playground anywhere. Simply visit, compose the code you’d like to embed, click the embed button and follow the instructions. 


You can also load and save Github Gists.
To load a Gist, open or simply

As examples, the links below open up Gists in C# Pad. ( Did you know The Octocat codes in C#? )


Numerical Analysis

The awesome Math.Net Numerics library is bundled with C# Pad, which makes working on complex math and statistics problems a breeze.


C# Pad is the first and only (as of this writing) web based interactive C# REPL, with code completion, diagnostics, themes, embeddability, timing information, Gist support and more features to come.

I hope you find C# Pad useful and delightful. Drop me a line or use the help link on the site to provide feedback on feature suggestions, bug reports and other kinds of feedback


C# Pad





Now that's pretty damn cool... Editing code is a little bit of a pain, as code seems to be highlighted often (so keying replaces the highlighted block), and tab doesn't selected the intellisense like hints, but this is still some awesome coding... :)

Friday, February 28, 2014

Dan's @ it again with @XamarinAppDev and - Announcing and @XamarinAppDev

Some of you may have noticed that I silently launched a new link blog and Twitter account on Monday. Today I'm formally announcing both: Say hello to and @XamarinAppDev!


I've been working on a very large native cross platform application for a client that runs on iOS, Android, Windows Phone, and Windows Store, leveraging the Xamarin tools. A natural extension of that process has been searching for news and content about what is going on in the Xamarin developer community.

So following in the footsteps of and @WindowsAppDev, my hope is that the new site and and Twitter feed will be a valuable resource for the Xamarin community.


So you've heard my total and complete Build WAG (Wild Ass Guess) is? That on Day One they announce MS's is buying Xamarin. We'll see... (okay, maybe it will be Day Two... or not at all... lol)

Wednesday, February 26, 2014

? for C#? (aka C# might be getting a object hierarchy Safe Navigation Operator)

Jerry Nixon @ Work - At last, C# is getting “?.”, sometimes called the Safe Navigation Operator

Visual Studio (and many other Microsoft Products) uses as a feedback mechanism for users to suggest and vote on product features. One of the most popular features, with 3,752 votes, a new “?.” operator for the C# language, sometimes called the Safe Navigation Operator.

The news

Rejoice. Yesterday, Tuesday, February 25, 2014, on the Visual Studio User Voice, Mads Torgersen, the C# Language PM, responded on behalf of the Visual Studio Project Team. He said, “We are seriously considering this feature for C# and VB, and will be prototyping it in the coming months.” ...


What is it? Here’s the scenario

Consider getting the grandchild of a parent object like this:

var g1 = parent.child.child.child;

Okay, so, this is some poor coding because the value of child could be null....


How the new operator works

Consider getting the grandchild of a parent object like this:

var g1 = parent?.child?.child?.child;
if (g1 != null) // TODO

Wow! ...



Mad’s Visual Studio User Voice comment continued with a little more explanation of the operator’s implementation. He said, “If the type of e.x (etc) is a non-nullable value type S, then the type of e?.x is S?. Otherwise the type of e?.x is the same as that of e.×. If we can’t tell whether the type is a non-nullable value type (because it is a type parameter without sufficient constraints) we’ll probably give a compile-time error.” This comment, and the idea that a method call or indexer can be to the right of the operator are just candy.


This operator would be pretty awesome and safe me a great deal of code... Wonder if we'll hear more about this at Build? Here's to hoping...

Friday, February 21, 2014

Need a little help cleaning up your code? CodeMaid will help with that developer dirty work... - CodeMaid extension for visual studio

Till now I’m a resharper fan boy and I still love using it. It is a great productivity tool. But it is not free for commercial use. So lots of my friends tell we want something open source or free which provide some kind of productivity over normal visual studio things and recently I came across CodeMaid extension of visual studio. It is a great plugin.

What is CodeMaid?

CodeMaid is an open source Visual Studio extension to cleanup, dig through and simplify our C#, C++, F#, VB, XAML, XML, ASP, HTML, CSS, LESS, JavaScript and TypeScript coding.


An open source visual studio extension to cleanup, dig through and simplify our C#, C++, F#, VB, XAML, XML, ASP, HTML, CSS, LESS, JavaScript and TypeScript coding


Code Digging
Visualize and navigate through the contents of your C# and C++ files from a tree view hierarchy. Quickly switch between different sorting methods to get a better overview. Drag and drop to reorganize the code. See McCabe complexity scores and informative tooltips.

Reorganize the layout of members in a C# file to follow Microsoft’s StyleCop convention, or your own preferences.

Recursively collapse nodes or the entire tree in the solution explorer window.

Enable, modify or disable many of the aspects of how CodeMaid does its work.

Format comments to wrap at a specified column and arrange XML major and minor tags on separate lines.

View the overall progress of a build within Visual Studio, or in the Windows taskbar, both with a green/red status indication.

Switch between related files, such as cpp and header files or xaml and code-behind.

Join two adjacent lines, or a highlighted section of code onto a single line.

Find the current file in the solution explorer window.

and More!
Toggle read-only state, close read-only files, etc.

Download (Visual Studio Gallery) Go Straight to the Source

I dig the number of languages supported (and that it's OSS :) This is SO likely to see a Coding4Fun blog post in the near future... :)

Thursday, February 20, 2014

"Biggy: SQLite for Documents and .NET"

wekeroad - Hello Biggy


A File-based Document Store for .NET

I've been using NeDB (a file-based document store for Node) for a few projects and I utterly love it. Such a simple idea, so fast, so elegant and many times just what I need! I had assumed that such a thing must be around for .NET because there are about 100 different kinds of lists in C#... someone must have made one with a persistent backing store!

But I looked around and couldn't find it, so I made it (as I'll need this in the coming months).

The idea is basically this: I want to use LINQ, I like Dynamics, and I like speed. So that's it, and here's Biggy:


Reading and Writing

So, by now you should be wondering why this is useful. The simple answer is that if you have a high-read application (like a blog, CMS, etc) then something like Biggy could speed things up.

Whenever you instantiate a new BiggyList it tries to read it's data from disk - this is good, and it's bad. It's good because from that point on whenever you try to query your data (using LINQ) it's an in-memory operation and you can't get much faster than that.

It's bad because this means you probably want to have a single DB instance around for the life of your app. This might be easy for some, might be repulsive to others. I'm used to doing this kind of thing with Node (all modules in Node are cached which means you always hit the same module instance).

For a blog engine, this might be a very fun thing to have - no database installs, superfast, easy to use. For a Twitter clone... not so much.


robconery / biggy

Biggy: SQLite for Documents and .NET

This is just a goofy idea at this point, inspired by NeDB which is basically the same thing, but with Node.

I like the idea of SQLite (a file-based relational data-store), but wouldn't it be fun to have this kind of thing for a Document database too? One nice thing about C# (among many) is the built-in LINQ stuff, another nice thing is that C# has Dynamics now too. Biggy is simply an implementation of ICollection with a JSON backing store. I added a few helpy things in there (like events and a few other things) and this might be completely dumb but I like the idea.


What It's Good For

The only disk activity occurs when you call "Save()" and when you instantiate the List itself - everything else happens in memory. This makes Biggy incredibly fast but it also means we're doing file management - which can be tricky.

This is one place that I hope I can get a PR for - I'm dropping the entire contents to disk on every save and YES if you try this will millions of records it will probably cause you some problems. But with 100 or so, it shouldn't be that big of a problem.

That makes Biggy compelling for high-read situations, such as a blog, product catalog, etc. At least that's what I've used NeDB for and it works great.


In the Tasks project (a Console app) there are simple loops that write 1000 records to disk at once (in a batch) as well as a simple read. You can see the results for yourself... they are OK.

Writing 1000 records in a batch takes about 30ms (give or take), writing in a loop takes about 4 seconds (!), but reading records out is too small to record :):):).

There's a lot to do to make this a bit more functional, but for now it does what I envisioned.

Wanna Help?


Now that's an interesting project to play with... hum... and it looks like of fun too. [i.e. queued for a future Coding4Fun blog post ;]

Tuesday, February 18, 2014

101 [+ 7] C# LINQ samples, one project...

Visual Studio Gallery - MSDN 108 C# LINQ Samples Consolidated with Single Project


All MSDN LINQ 101 Samples and few more samples consolidated to Single project and given required comments for each topic...


Targeted Audience:

1. .NET Architects

2. .NET Application Designers

3. .NET Application Developers


1. .Net technologies.

2. Basic understanding of design patterns.

3. Basic understanding of OOPS.


All MSDN LINQ 101 Samples and few more samples consolidated to Single project and given required comments for each topic.

1. Open Solution.

2. Right click on the project and select Manage NuGet.

3. Select missing packages and Add

4. Run the application

Topics Covered:

1. Restriction Operators

2. Projection Operators

3. Partitioning Operators

4. Ordering Operators

5. Grouping Operators

6. Set Operators

7. Conversion Operators

8. Element Operators

9. Generation Operators

10. Quantifiers

11. Aggregate Operators

12. Custom Sequence  Operators

13. Query Execution  Operators

14. Join  Operators

15. Miscellaneous Operators

Sometimes it's just easier to have it local. And if you're using a cool code indexer like Sando (and) then finding that right snip is even easier...

BTW, here's the original/source, 101 LINQ Samples.


Related Past Post XRef:
An oldie but a goodie, 101 LINQ Samples (C# and VB)

Monday, February 17, 2014

Bing your IDE to this new C# Code Search VS Extension (from Bing)

The Visual Studio Blog - Introducing Bing Code Search for C#

Imagine wanting to read a file line by line, and process those lines. Today, we’d most likely load up a web browser, visit our favorite search engine, and start crafting a well-designed set of keywords that helps the search engine understand the problem we’re trying to solve.

In the ideal case, we’d find high quality official documentation with examples, or a highly voted-on topic from one of the major forums or crowd sourced Q&A web sites. We would then scan through the options, try to figure out what’s relevant to us and do some copy/paste magic.

We wanted this to be become more accessible and make finding relevant code samples for the given tasks you’re trying to complete far easier.

Making it better

We wanted to make that experience better for you. To that end, Visual Studio, Bing and Microsoft Research have teamed up to deliver a DevLabs experience that takes code search to the next level.

When you find yourself looking for a code-sample that you could leverage for a task, you can trigger the new Bing Code Search experience directly from IntelliSense.


Behind the scenes, that query is securely beamed up to Bing along with contextual pieces that help us hone in on the fuller meaning of that query. We use meta-data like the project type, semantic context (using the new C#/VB compiler services aka ‘Roslyn’!), and a few other sprinkles of Microsoft Research magic.

Those pieces along with the query then leverage Bing’s enormous search index and keyword analysis to track down potential pages that might contain high quality examples you can learn from.

From those pages, we isolate and rank the relevant code samples, using a large number of syntactic and semantic code metrics.


Visual Studio Gallery - Bing Code Search for C#

...[Try it out Online ]

The Bing Code Search add-in for Visual Studio 2013 makes it easier for .NET developers to search for and reuse code samples from across the coding community, including MSDN, StackOverflow, Dotnetperls and CSharp411.

Bing Code Search improves developer productivity and speed by bringing the experience of searching for reusable C# code into Visual Studio IDE.

Check out this demo video for more info

Got to love the DevLabs and some of the stuff they throw over the wall to us. Now I'm not going to comment on "Google Bing Coding" as without that my day would be much less productive! But I do wonder if there's a lack of context in using this? So many answers provide more than just code...

Thursday, February 13, 2014

Stateless Designer Visual Studio Extension (with Source)

Visual Studio Gallery - Stateless Designer

Visual Studio extension to support visual design of stateless state machines. Support for Visual Studio 2012 and Visual Studio 2013. The goal for this projects is to allow software developers to design a state machines visually.

Project site



CodePlex - Stateless Designer


About stateless

stateless is a lightweight C# hierarchical state machine framework made by Nicholas Blumhardt. The stateless project is hosted here: If you don't know stateless, here is a comparison between stateless and Windows Workflow Foundation: Comparison between Stateless (on google code) and Windows Workflow. stateless also comes as a NuGet package: stateless is a great alternative to WWF.

About Stateless Designer

The goal for this projects is to allow software developers to design a state machines visually. Why a statemachine can improve your design. The true power of using a state machine is to have a graph showing the states with transitions. Stateless Designer can help you achieve this.

Stateless Developer use case:
- install Stateless Designer
- start Visual Studio
- create or open a C# project
- Add new Item to the C# project
- select Stateless State Machine
- design your state machine
- a C# class is created with your state machine

Getting started using Stateless Designer step-by-step.

Currently supported features

- Triggers without arguments
- OnEntry and OnExit delegates
- Reentrant transitions
- OnUnhandledTrigger delegate - new in Stateless Designer 1.4
- Guard Clauses: PermitIf and PermitReentryIf functionality - new in Stateless Designer 1.4

External articles

Twitter article 1168 - Note: Not in English article 1169 - Note: Not in English

Technology used

- Visual Studio Extensibility
- stateless

Sure Windows Workflow now support State Diagrams, but this is something a little different and I think pretty cool (and WWF just doesn't seem to be getting much press, attention, I wonder...). Anyway, not only do you get the designer, but it's nuget'able and you get the source too it all too. Now that's cool... :)

Thursday, January 30, 2014

Going APE for The Asset Pipeline Editor (think an XNA Content Pipeline for the 10's)

The Asset Pipeline Editor


What Is THE APE?

The APE stands for "The Asset Pipeline Editor" created by Pedro Güida -a former MSFT XNA/DX MVP.

(i) Some of its key features:

  • It is a highly-customizable tool,
  • It eases the task of managing game content throughout the whole development process,
  • It helps you build asset files and processes for the platforms you desire, tailoring them for each platform,
  • It is a perfect choice not only for solo devs but also for teams, and
  • Its GUI is independent from any programming IDE!!!

ii) Build your own import process, the one you dream of, with C# ...

Are you programming your games with C++, Objective-C, C#, Java, Phyton ... <pick your language here> ... and you need a content pipeline? Not using authorware like Unity3D, UDK, CryEngine or others? Have your own game engine? Then the APE will help you (and your team) manage your game assets with ease!

Use the well-known developer-friendly C# language to implement the software elements that will drive the behavior of the APE for your game-dev process.

Why Does APE Exist?

Good question.

(i) The answers ...

  • Microsoft decided not to continue developing the XNA Framework any further,
  • Many alternatives do not come bundled with a handy content pipeline tool,
  • XNA's CP only runs on Windows machines since it uses the MSBuild API,
  • XNA's CP GUI has not been updated to work with the latest versions of the Visual Studio IDE,
  • Can you use the XNA's CP from within VS 2012 or VS 2013? Nope ...,
  • Why non-programmers should use any programming IDE as a CP in the first place?
  • XNA's CP only produces binaries targeting Microsoft's platforms.

(ii) Think of the APE as a replacement of XNA's content pipeline "in spirit" since ...

  • ... it does not strictly work the same way as XNA's CP did, ...
  • ... it does not come bundled with content importers for your game assets, ...
  • ... but it could have some importers if the extended goals are reached (wink!).




While I don't usually highlight projects that in the process of crowd funding, I'm also pretty grumpy with what happen (or didn't) to XNA. So I wanted to make sure and shout-out to this project  from Pedro Güida. Make sure you check out the videos, screenshots and such.

Also of note is that this project has been mentioned by 3D Artist magazine AND Telerik is now sponsoring the campaign with a free license of its WPF controls. It just needs a little backing... :)

Tuesday, January 28, 2014

Blast from the Past - 'The XML Diff and Patch GUI Tool'

I needed to diff some OPML files today and came across this project. Even through it's 10 years old, it still mostly worked and the best part is it's a source distrib... :)

The XML Diff and Patch GUI Tool

Amol Kher
Microsoft Corporation

July 2004

Applies to:
   the XML Diff and Patch GUI tool

Summary: This article shows how to use the XmlDiff class to compare two XML files and show these differences as an HTML document in a .NET Framework 1.1 application. The article also shows how to build a WinForms application for comparing XML files.


An Overview of the XML Diff and Patch API
XML Diff and Patch Meets Winforms
Working with XML DiffGrams
Other Features of the XML Diff and Patch Tool


There is no good command line tool that can be used to compare two XML files and view the differences. There is an online tool called XML Diff and Patch that's available on the GotDotNet website under the XML Tools section. For those who have not, you can find it at Microsoft XML Diff and Patch 1.0 [GD: yes, this link is busted... you can download it below]. It is a very convenient tool for those who want to compare the difference between two XML files. Comparing XML files is different from comparing regular text files because one wants to compare logical differences in the XML nodes not just differences in text. For example one may want to compare XML documents and ignore white space between elements, comments or processing instructions. The XML Diff and Patch tool allows one to perform such comparisons but it is primarily available as an online web application. We cannot take this tool and use it from command line.

This article focuses on developing a command-line tool by reusing code from the XML Diff and Patch installation and samples. The tool works very similar to the WinDiff utility; it presents the differences in a separate window and highlights them.

The XML Diff and Patch tool contains a library that contains an XmlDiff class, which can be used to compare two XML documents. The Compare method on this class takes two files and either returns true, if the files are equal, or generates an output file called an XML diffgram containing a list of differences between the files. The XmlDiff class can be supplied an options class XmlDiffOptions that can be used to set the various options for comparing files.



Microsoft Downloads - XML Diff & Patch GUI Tool

Winforms application that can be used to compare 2 XML files.

Version: 1.0

Date Published: 7/14/2004

xmldiffgui.msi, 278 KB

This code sample shows how to build a Windows forms application that utilizes the XML Diff & Patch library to show the difference between 2 XML files.

There's a bug somewhere in it in that it was giving me an error when trying to load the HTML into an IE window, but that's likely a path thing. In the end, it executed and diff'd the two XML files. And since we do have the source... :)


Another blast from the past is that this was available on the old GotDotNet site. I miss that site... :(

Monday, January 27, 2014

SharpDevelop 5 goes MIT and Beta 1 too!

SharpDevelop Community - Christoph Wille - License Change for SharpDevelop 5

With commit hash 1300bac39c (corresponding to build number, our Beta 1 release) we have switched the license for SharpDevelop from LGPL to MIT. (SharpDevelop 4.x and older remain LGPL licensed)

This means one very important thing: You can use our source code in your projects (not only the assemblies).

As a user of SharpDevelop, nothing really changes. You still can build applications of any license flavor.


SharpDevelop Community - Christoph Wille - SharpDevelop 5 Beta 1 Available


It has been (too) long in the making, but our major rearchitecting of SharpDevelop is close to being done, with only a few functional areas not in this Beta release:

  • EnvDTE.FileCodeModel is missing, thus our custom NuGet packages will be broken (T4MVC, MVCScaffolding and EF)
  • Code Quality Analysis and SharpDevelop Reports are missing (due to a rewrite of SDR)

Please note that Beta 2 is not too far off, and these will be in Beta 2.

As pointed out in the blog post SharpDevelop 5 C# Tech Preview, we are still shipping with C# only in SharpDevelop 5 – and this will most likely remain true for RTM too. (VB.NET will compile, but it won’t have code completion nor refactoring) SharpDevelop 5 installs in parallel to older versions, and if you have the patience: give it a dry run with a copy of an existing project (at least backup and/or use source control before you let a beta IDE touch your source code).

For further information on what’s new, please consult this list of select blog posts from the team members (I'll be doing a few "What's New" blog posts in the coming days, because obviously these are only a few big-ticket items - check back!):



It's darn nice to see SharpDevelop still kicking. I've been following them for about 10 years, imagine the projects that have come and gone in that time, so seeing that this has stood the test of time, let alone improved with age like a fine wine... well that makes this a happy Monday indeed!


Related Past Post XRef:
SharpDevelop gets T4 support
NuGet isn’t just for Visual Studio anymore… NuGet coming soon to SharpDevelop
NuGet your Avalon (SharpDevelop’s AvalonEdit and ICSharpCode.TextEditor, plus samples, are now available via NuGet)
SharpDevelop (aka #develop) 3.0 RTM’s
SharpDevelop for Applications (SDA)
Web Development with SharpDevelop, Web Matrix, and DBGCLR #develop 1.0.2a stopgap release #develop 1.0.2 available for download
SharpDevelop 1.0 Released

Thursday, January 16, 2014

Third Party Office Library or OpenXML?

CodePlex - Aspose for OpenXML

The Open XML SDK for Office simplifies the task of manipulating Open XML packages and the underlying Open XML schema elements within a package. The classes in the Open XML SDK encapsulate many common tasks that developers perform on Open XML packages, so that you can perform complex operations with lines of code.

Using the classes in the Open XML SDK 2.5 is simple. When you have installed the Open XML SDK 2.5, open your existing project or application in Visual Studio, or create a new project or application. Then, in your project or application, add references to the following components:

  • DocumentFormat.OpenXml
  • WindowsBase
To add a reference in a Microsoft Visual Studio project
  • In Solution Explorer, right-click References and then click Add Reference. If the References node is not visible, click Project and then click Show All Files.
  • In the Add Reference dialog box, click .NET.
  • In the Component Name column, select the components (scroll if you need to), and then click OK.

This project covers the following topics:

What is the use of Aspose .NET Products?

Aspose are file format experts and provide APIs and components for various file formats including MS Office, OpenOffice, PDF and Image formats. These APIs are available on a number of development platforms including .NET frameworks – the .NET frameworks starting from version 2.0 are supported. If you are a .NET developer, you can use Aspose’s native .NET APIs in your .NET applications to process various file formats in just a few lines of codes. All the Aspose APIs don’t have any dependency over any other engine. For example, you don’t need to have MS Office installed on the server to process MS Office files. Below is a list of products we support for .NET developers:


I've mentioned OpenXML in the past and that it's cool that you can use it to get all the deep deep data in Office *x files? Then you've also heard me say what a pain it can be if you're used to a more traditional Office Object Model. It's a completely different way of thinking about your documents... And doing that hurts my brain. So I go out of my way to find libraries that make it easier. One such, that we've bought in my day job, is Aspose. If you've read any MS dev mag, you've seen the ads for them.

I ran across this and sure, it's sales-ware, still it's useful to OpenXML dev's does a good job of showing the differences between the two approaches...

OpenXML SDK Word Processing Code Snippets - Create a word processing document


IMHO, if you can, use a third party library, free or commercial. OpenXML might get the job done and it is free, but the time you spend on it isn't (And remember, friends don't let friend Office interop!)

"Enterprise DevCamps Training Kit" - 85MB, Five modules, code and decks for the LOB Dev

Microsoft Downloads - Enterprise DevCamps Training Kit

The Enterprise DevCamps Training Kit shows enterprise developers how to modernize existing .NET client line of business apps to target back-end services running on Windows Azure.

Version: 1.0.0

Date Published: 1/16/2014

EnterpriseDevCampTK.exe, 114 KB [Kind of, more like 85MB]

This training kit shows how to modernize your existing .NET client line of business (LOB) applications for multiple devices. You will learn how to move .NET client LOB applications forward without having to start from scratch with new technologies. You will learn about Microsoft’s devices and services strategy, what it means for you and how your existing applications fit in. You will review best practices for using a services architecture. You will see how and why to move your LOB applications to Windows Azure, how to use 3rd party controls to add a modern look and feel and how to provide your users the ability to use LOB apps on a variety of devices, including Windows 8 and Windows Phone. And you will do all of this using Visual Studio 2013 and your existing XAML skills!


The Content is installed into the C:\EnterpriseDevCamp\ folder, where C: is the home drive for your Windows Installation.  ..."

The file size is a little misleading as it's just a WPI (Web Platform Installer] shortcut.



And note the install folder in bold above, C:\EnterpriseDevCamp\. This is buried in the download "Supported Systems" note.

image Don't know why I couldn't find it at first... :/

So what's in it?


By size, PowerPoint... Yet, in some of the modules there are some nice labs and code...


If you're a LOB Dev, it's a pretty quick download...

Tuesday, January 14, 2014

Interesting Project of the Day - CudaSharp (C#'ing your GPU)

Khyperia's Coding Adventures - Making C# run on the GPU

I just spent the past few hours making a C#/CUDA library.

This library “makes C# run on the GPU”.

It takes .net IL and translates it to LLVM through a (admittedly quite feature lacking) compiler written by me. Then, it takes the LLVM bitcode and translates it to NVIDIA PTX. This PTX then can be uploaded to the GPU and executed.

The library is still an extreme work-in-progress, as I have only just started writing it a few hours ago. ...



A library to make C# run on CUDA-enabled GPUs

This library is currently far from complete and is not intended for general use.

C# is executed on the GPU like so:

  • Your C# compiler translates C# to .net CIL

  • Calling the CudaSharp.Translate method reads the CIL, translates to LLVM IR, and compilers to NVIDIA PTX

  • Use your GPU library of choice (for example, ManagedCuda) to read in the PTX file and execute it on the GPU

For an example usage, see CudaSharpTest/Program.cs


As said in the title, this is just a cool project to check out.

Monday, January 06, 2014

Speaking of ducks... The Rubber Duck edition of the Yellow Book (That learning to program with c# book), a 2014 refresh, Kindle version and a new cover - C# Yellow Book


The C# Yellow Book is used by the Department of Computer Science in the University of Hull as the basis of the First Year programming course. You can download your own copy from here.

We give away a free printed copy to students when they arrive in the department, and we also give a copy away to anyone who comes to see us on an Open Day. This is the 2014 version of the book, the Rubber Duck edition.

The material in the Yellow Book is Copyright (c) Rob Miles and the University of Hull 2014. If you find any mistakes in the text (it has been known) then I would be most grateful if you could send me an email to so that I can put it right.


Kindle Version

There is now a Kindle version of the text available. You can find it here.


I directed a co-worker to Rob's site and this book today and noticed that there was very recent, days old, refresh and a very reasonable kindle version. How reasonable? $0.99! Yeah, the entire book for less than a buck. Now that's a deal! (Yes, I bought one and sent it too all my devices... ;)

Speak of Ducks, you ask? If you have to ask, you didn't get it... ;)


Related Past Post XRef:
C# Yellow Book 2012 RTW - Want to learn how to program, using C#, Yellow's your color...
The C# Yellow Book gets a 2011 refresh...
New C# Yellow Book version available - Yeah, big, yellow, ebook, 197 pages, C#, free…

The Blue Book gets Mango'd! Rob Miles' "Windows Phone Programming in C#" Blue Book updated for Windows Phone 7.1(5) And so do the lab's and demo's too!
“Windows Phone Programming in C#,” the Curriculum (think “Stuff to help teach Windows Phone Dev… Code, Demo’s, Pptx’s, Labs, 152 page eBook, etc”)
16 hours, 2 Days, 1 Mango - Online, live and free training, "Building Applications for Windows Phone Mango Jump Start" August 23 & 24 (i.e. next week)