Showing posts with label .Net. Show all posts
Showing posts with label .Net. Show all posts

Monday, April 21, 2014

Prism continues its Windows Desktop/WPF/MVVM Love with v5

Francis K. Cheung - Prism 5.0 for WPF just shipped.

Prism version 5.0 for WPF is now available. This version of Prism includes updates to existing and several new NuGet packages:

  1. Prism
  2. Prism.Composition (New)
  3. Prism.Interactivity (New)
  4. Prism.Mvvm (New)
  5. Prism.MefExtensions
  6. Prism.UnityExtensions

We’ve updated Prism 4.1 with bug fixes and a few new features. ...

Developer's Guide to Microsoft Prism Library 5.0 for WPF

April 2014

Prism provides guidance in the form of samples and documentation that help you easily design and build rich, flexible, and easily maintained Windows Presentation Foundation (WPF) desktop applications. Using design patterns that embody important architectural design principles, such as separation of concerns and loose coupling, Prism helps you to design and build applications using loosely coupled components that can evolve independently but which can be easily and seamlessly integrated into the overall application. In short, these applications are "built to last" and "built for change." These types of applications are known as composite applications.

This topic provides a brief overview of the Prism concepts with links to associated source code and documentation. If you are considering upgrading from Prism 4.1 to Prism 5.0 we include a "What’s New" and "Upgrading from Prism 4.1" topic that you should read.

...

...

image

What's New in Prism Library 5.0 for WPF

Prism 5.0 includes guidance in several new areas, resulting in new code in the Prism Library for WPF, new and updated QuickStarts, and updated documentation. Parts of the Prism Library changed between Prism 4.1 and Prism 5.0 to support the new guidance, fix existing issues, and respond to community requests.

...

New Guidance

Prism 5.0 contains several areas of new guidance as follows:

  • Prism.Mvvm is a portable class library that encapsulates Prism’s MVVM support. This library includes ViewModelLocationProvider. Views and view models can be wired up together using the new ViewModelLocationProvider’s convention-based approach as explained in Implementing the MVVM Pattern. View model construction can be accomplished using a dependency injection container. The ViewModel Locator’s extensibility points are discussed in Extending the Prism Library. DelegateCommands are now extendable and provide Async support. A new implementation of the INotifyPropertyChanged interface, the BindabaleBase class, was added.
  • The PopupWindowAction class was added to the Prism.Interactivity assembly to open a custom window in response to an interaction request being raised.
    The InvokeCommandAction action provided by Prism now passes trigger parameters to the associated command.
    For more information see Advanced MVVM Scenarios.
  • The EventAggregator classes have been moved to the Prism.PubSubEvents portable class library.
  • The NavigationParameters class can now be used to pass object parameters during navigation, using the overloads of the RequestNavigate method of a Region or RegionManager instance.

Changes in the Prism Library

Prism Library 5.0 includes changes related to new functionality, code organization, and APIs.

Code Organization

...

API Changes

...

Additions to the Prism Library Core API

The following namespaces were added to the Prism Library to support the new areas of guidance added in Prism 5.0:

  • Microsoft.Practices.Prism.PubSubEvents was added to help you send loosely coupled message using a portable class library.
  • Microsoft.Practices.Prism.Mvvm was added to assist you in implementing MVVM using a portable class library and several platform specific libraries.
  • Microsoft.Practices.Prism.SharedInterfaces has been added to share the IActiveAware interface between Prism and Prism.Mvvm assemblies, therefore the IActiveAware interface has been moved to this assembly. It is also intended for future use.

CodePlex Issues Resolved

  • ...

Example Code Changes

Prism 5.0 contains eleven separate code samples that demonstrate portions of the provided guidance. Several samples from Prism 4.1 were removed or replaced, and new samples added.

The following samples were added for Prism 5.0:

  • Basic MVVM QuickStart. This QuickStart shows a very simple MVVM application that uses the ViewModel Locator and show a parent and child ViewModels. For more information, see the MVVM QuickStart.
  • MVVM QuickStart. This QuickStart was removed for this version.
  • MVVM Reference Implementation. This reference implementation was removed for this version.
  • View-Switching Navigation QuickStart. This QuickStart now supports WPF. It demonstrates how to use the Prism region navigation API. For more information, see View-Switching Navigation QuickStart.
  • State-Based Navigation QuickStart. This QuickStart now supports WPF. It shows an approach that uses the Visual State Manager to define the views (states) and the allowed transitions. For more information, see State-Based Navigation QuickStart.
  • UI Composition QuickStart. This QuickStart now supports WPF. It replaced the View Injection QuickStart and the View Discovery QuickStart from Prism 2.0. In the current versions, both concepts are shown in one example application. For more information, see UI Composition QuickStart.
  • Interactivity QuickStart. This new QuickStart demonstrates how to exposes an interaction request to the view through the view model. The interactions can be a popup, confirmation, custom popup, and a more complex case where the popup needs a custom view model. It also shows Prism’s InvokeCommandAction action that passes the EventArgs from the trigger, as a command parameter. For more infromation, see Interactivity QuickStart.

NuGet Packages Now Available

In your application, you can now use NuGet to add references to the Prism assemblies. These packages include:

..."

Microsoft Downloads - Prism 5.0 for WPF – April 2014

Prism provides guidance designed to help you more easily design and build rich, flexible, and easy to maintain Windows Presentation Foundation (WPF) desktop applications.

...

MSDN Code Gallery - Getting Started Code Sample Using the Prism Library 5.0 for WPF

In this lab and associated sample, you will learn the basic concepts of modular application development using the Prism Library, and apply them to create a solution that you can use as the starting point for building a composite Windows Presentation Foundation (WPF) application. After completing this lab, you will be able to do the following:

  • You will create a new solution based on the Prism Library.
  • You will create and load a module.
  • You will create a view and show it in the shell window. 

This lab includes the following tasks:

...

MSDN Code Gallery - MVVM Code Sample using the Prism Library 5.0 for WPF

The Model-View-ViewModel (MVVM) QuickStart provides sample code that demonstrates how to separate the state and logic that support a view into a separate class named ViewModel using the Prism Library. The view model sits on top of the application data model to provide the state or data needed to support the view, insulating the view from needing to know about the full complexity of the application. The view model also encapsulates the interaction logic for the view that does not directly depend on the view elements themselves. This QuickStart provides a tutorial on implementing the MVVM pattern.

A common approach to designing the views and view models in an MVVM application is the first sketch out or storyboard for what a view looks like on the screen. Then you analyze that screen to identify what properties the view model needs to expose to support the view, without worrying about how that data will get into the view model. After you define what the view model needs to expose to the view and implement that, you can then dive into how to get the data into the view model. Often, this involves the view model calling to a service to retrieve the data, and sometimes data can be pushed into a view model from some other code such as an application controller.

This QuickStart leads you through the following steps:

  • Analyzing the view to decide what state is needed from a view model to support it
  • Defining the view model class with the minimum implementation to support the view
  • Defining the bindings in the view that point to view model properties
  • Attaching the view to the view model

..."

Finally:

That should be enough Prism for WPF to get you started at least...

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.

image

...

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

http://tirania.org/blog/ - 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.

image

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... ;)

Friday, March 28, 2014

NuGet, Open Wrap, NPanday, Chocolatey, Chewie, Ninite, top Package/Dependency Management for .Net tools

Visual Studio Magazine - 6 Top .NET Package- and Dependency-Management Tools

They may not be sexy, but package managers are an integral part of every developer's work -- using the right ones can make you more productive. Read on to find out what -- and where -- they are.

...

For the app developer or system admin, however, the process of getting utilities, libraries and frameworks installed, along with any required dependencies -- particularly when dealing with the huge ecosystem of open source software -- represents a bigger problem. And this is where package management comes to the rescue.

Package managers help you download, install, configure and update software "packages" from repositories. A package contains the software itself (possibly as source), plus metadata specifying the locations of any dependencies that need to be installed and instructions for automatic compilation, when necessary.

... Here are some great package- and dependency-management tools created specifically for Windows-based development.

...

NuGet
NuGet is probably the best-known package and dependency manager for, in Redmond's words, "the Microsoft development platform including .NET." As with the other tools I've mentioned here, NuGet helps you find, install, update and remove packages. However, similar to CocoaPods, NuGet focuses primarily on package and dependency management at the development-project level.

...

Open Wrap
OpenWrap is another popular open source package-management sytem for .NET programmers. Created by Sebastien Lambla, OpenWrap is command-line only and supports both OpenWrap and NuGet packages. OpenWrap also includes ReSharper integration, so ReSharper knows about the packages you've installed and doesn't throw up spurious warnings.

...

NPanday
NPanday is an Apache Incubator project "to integrate Apache Maven into .NET development environments." Maven is more of a build-automation and dependency-management tool, and also developed more specifically for Java-based development, but developers have figured out how to Maven build for .NET applications.

...

Chocolatey NuGet
So, those are the big, established players in package management on Windows. But they're not the only options. Chocolatey is a general-purpose "tools enabler" and "silent application installer" for Windows, modeled after apt-get.

...

Chewie
Chewie is yet another NuGet offshoot that attempts to incorporate some features of the Ruby Bundler gem manager into the package\-management workflow on Windows.

...

Ninite
OK, Ninite isn't really a package manager in any typical sense of the word, and unlike the rest of the apps I've discussed, it's neither open source itself nor open source focused. But it is a handy utility and it does fall into the same general category as apt-get and Chocolatey.

...

image

..."

You mean there's more than NuGet? No, say it's not so! Kidding aside, this is a great article of tools you might not of heard of before. Make sure you click through to read the details.

Jetting to the new home of ManagedEsent, a new v1.9 and MSDN Doc's too!

JET - Welcome to the home of the JET (aka ESE or ESENT) team

The Extensible Storage Engine (ESE/ESENT), also known as JET Blue, is an Indexed Sequential Access Method (ISAM)data storage technology. Its purpose is to allow applications to store and retrieve data via indexed and sequential access.

ESE provides transacted data update and retrieval. A crash recovery mechanism is provided so that data consistency is maintained even in the event of a system crash. Transactions in ESE are highly concurrent making ESE suitable for server and client applications. ESE caches data intelligently to ensure high performance access to data. In addition, ESE is lightweight making it suitable for auxiliary applications.

The ESE Runtime (ESENT.DLL) has shipped in every Windows release since Windows NT 3.5, with native x64 version of the ESE runtime shipping with x64 versions as well (including IA64), and ARM. ESE is available on Windows, all flavors (server and client) and SKUs....

JET - ManagedEsent 1.9.0.1 is released

... To download the latest ManagedEsent version, visit the nuget project page at http://www.nuget.org/packages/ManagedEsent/

JET - ManagedESENT documentation now available on MSDN!

Check out the new ManagedESENT documentation on MSDN at http://msdn.microsoft.com/en-us/library/windows/desktop/dn375980(v=exchg.10).aspx. This documentation covers over 300 public methods exposed by ManagedESENT.

How is the ManagedESENT library different than ESENT?

ESENT is an embeddable, transactional database engine that allows you to create custom applications that need reliable, high-performance, low-overhead storage of data. The ESENT engine can help with data needs that range from something as simple as a hash table that is too large to store in memory, to something more complex, such as an application with tables, columns, and indexes. To create an application with ESENT, you use the esent.dll DLL that is part of the Windows operating system and write your code with C/C++. For more information about ESENT, see Extensible Storage Engine Reference.

ManagedESENT is built on top of esent.dll, which is part of Windows, so there are no extra unmanaged binaries to download and install. With the ManagedESENT library, you can create your application by using a managed language such as C# instead of C/C++. ...

Extensible Storage Engine Managed Reference

image

If you're using ManagedEsent, have heard of it but haven't started yet, or never heard of it before, you've got a new shiny blog, NuGet version and doc resource...

 

Related Past Post XRef:
Easing into the Extensible Storage Engine on Windows 8 with ManagedEsent v1.8
ESE C#/C++ Toolkit v1.2 for Microsoft Extensible Storage Engine (ESE) (ESE is the database engine that's been in the box since Windows 2000)
Did you know Windows (since Windows Server 2000) comes with a transactional database engine already baked into the OS, which you can use in your applications today, no download required?
Managed ESENT v1 released – Managed/.Net access to the free embedded database (“Extensible Storage Engine/ESE”) that ships with Windows

Tuesday, March 25, 2014

JustMock Lite - Free and open source too...

Telerik - JustMock Lite

For developers who practice unit testing and want to deliver exceptional software, JustMock Lite is the superior free mocking framework that makes unit testing simpler for SOLID testable projects. JustMock Lite is an open source product that is easy to use, feature rich, with great power and flexibility, making it the superior choice. JustMock Lite cuts your development time and helps you create better unit tests. It enables you to perform fast and controlled tests that are independent of external dependencies like databases, web services or proprietary code.
Like any open source software, JustMock Lite allows for full code transparency as well as easy product update and support by the community. JustMock Lite is the same set of assemblies as the commercial edition of JustMock, and just like JustMock, it is commercially backed with 3 major releases per year and continuous product improvement.

If you are dealing with a legacy code project or tightly coupled code that requires elevated mocking (such as mocking private, static, or sealed items), you need the JustMock full edition.

...

Why Choose?

  • Superior Free Mocking Framework
  • Commercially Backed
  • Open Source
  • Mocks SOLID Code
  • Arrange, Act, Assert Oriented
  • Error-Free Mocking
  • Automocking
  • Easy Migration to JustMock Full Edition

image ...

telerik / JustMockLite 

Welcome to the Telerik JustMock Lite source code repository!

About

JustMock Lite by Telerik is a powerful free mocking library available for .NET developers. For more information, refer to our JustMock Lite website. You can suggest and vote for feature requests in our JustMock feedback website.

Nuget

JustMock Lite is also available in a Nuget package.

Building

You can compile the JustMock Lite project with Visual Studio Express 2012 for Desktop and greater.

  1. In Visual Studio, open the Telerik.JustMockLite.sln file.
  2. Dismiss any Unsupported project type warnings. You can still build JustMock Lite.
    Visual Studio Express shows this warning to indicate that it does not support the Silverlight projects included in the JustMock Lite solution.
  3. Build the project in a DebugFree or ReleaseFree configuration.
    This will ensure that the JustMock Lite unit tests remain green.
  4. Locate the JustMock Lite binaries in the ..\..\Binaries folder.

Let us know if you encounter any issues with the project.

License

JustMock Lite is licensed under Apache 2.0 (https://github.com/telerik/JustMockLite/blob/master/LICENSE).

Happy mocking!

Not only free, but open source too... Nice. :)

(via tweet from @alvinashcraft)

 

Related Past Post XRef:
Telerik, are you just mocking me? Yep! With the Telerik JustMock Free Edition
"Why I Hate Unit Testing"

Thursday, March 20, 2014

MEF'ing with WP8 (or Now you're "cooking with MEF")

.Netitude - WP8 Breaks Bad (cooking with MEF)

Microsoft’s Managed Extensibility Framework is somewhat of an unsung hero in the .Net world in my opinion. The framework itself is insanely powerful and magical but when you combine it with other patterns and frameworks like MVVM it becomes pure sorcery. If you haven’t checked out MEFedMVVM, I suggest doing so after you get up to speed on MEF and what it is and offers you as a developer.

Recently, the DotNet team announced an update to their Microsoft.Composition nuGet package (MEF 2) which brings MEF-ability to Windows Phone 8.

To understand what MEF proper (ie: full-blown on the desktop) is and how you can use it, there are numerous examples throughout the interwebs. Check out this one and this one for a good start/overview.

What I couldn’t find, however, were actual code examples of using it on Windows Store or Windows Phone apps. The Windows Store support has existed for a few months now, so that surprised me. Let there be light!

(more…)

image

...

Now imagine that you separate out your classes to other assemblies, or simply add new classes to one folder w/in your project. The ease with which you can now add and remove features and objects to your applications becomes MUCH greater, and your confidence in your changes goes up dramatically – you know that you *only* added a feature, you didn’t muck with the view, change the view model, write a bunch more code, just added a new class.

Go forth and cook your apps with MEF!

.NET Framework Blog - Upcoming .NET NuGet Releases

We recently concluded a planning exercise for the next few months of work. From this exercise, we’d like to share the next set of NuGet releases that we plan to do. We chose this particular set based on your feedback and internal partner requests.

All of these packages will be released as pre-release packages on nuget.org.

image

Mostly I just love Brandon's post title... but this is also good news for WP8 dev's. MEF is a great framework and it can really help you build plug-in'able app's.

"Designing Evolvable Web APIs with ASP.NET" [Currently] free webook (web ebook)

Kris' blog - Designing Evolvable Web APIs with ASP.NET now as a free ebook

If you’re interested to update your knowledge of simply get started with Web API then there are a bunch of decent books already out there. I noticed however that Glenn Block and others at Microsoft released a book as well and, at the moment, provide for free over at http://chimera.labs.oreilly.com/books/1234000001708.

To get a grasp of what’s in there:

...

Designing Evolvable Web APIs with ASP.NET

by Glenn Block, Pablo Cibraro, Pedro Felix, Howard Dierking, and Darrel Miller

With this digital Early Release edition of Programming JavaScript Applications, you get the entire book bundle in its earliest form—the author's raw and unedited content—so you can take advantage of this content long before the book's official release. You'll also receive updates when significant changes are made, as well as the final ebook version.

Build HTTP services that reach a broad range of clients—including browsers and mobile devices—with ASP.NET Web API. This practical guide shows you how to build evolvable HTTP services using Microsoft's new Web API framework. It included both real world design and technical guidance from members of the ASP.NET Web API team and it's early adopters. It will cover fundamentals of Web API design and how to apply them properly using the technology. You'll learn fundamentals like how to design and select a media type, how to build out your API, and then move on to more advanced topics like how to use content negotiation, leveraging hypermedia, securing and testing your API, and much much more.

image

While I really don't dig webooks (I love my kindle entirely too much... even Firing, as in Kindle Firing, my dev book reading...) free is a hard deal to beat.

Wednesday, March 19, 2014

Link to Elastic with ElasticLINQ

Brad Wilson - Getting Started with ElasticLINQ

Jim Newkirk and I have been doing xUnit.net for 7 years now (and for Jim, NUnit for many years before that). You could say that open source is part of our blood, and when we left Microsoft, we made sure that open source would continue to be part of our daily efforts at Tier 3.

Fast forward 15 months: Tier 3 has been acquired (and is now the CenturyLink Cloud Development Center), and our first major open source effort Iron Foundry has been accepted into the Cloud Foundry Incubator project. Lots of great developers are working to ensure that you can write .NET code against a Platform-as-a-Service stack that doesn't lock you into a specific vendor.

Today we are proud to announce our second major open source effort: ElasticLINQ.

What is ElasticLINQ?

One of the major challenges when writing distributed software is how to distribute the data. When I started here 15 months ago, we had 4 data centers, and plans to expand into several more over the coming year. The data was being stored primarily in Microsoft SQL Server. As our data center footprint grew, it was becoming clear that centralized data storage was not going to scale with us. Having islands of data means that your application (and your users) can end up spending a lot of time waiting for data requests to go halfway around the world; and if there are any network glitches along the way, you might even fail to get the data entirely.

Almost right away we started evaluating alternatives that would let us keep all the data locally. We decided to use Couchbase as our primary data store, based on its extremely strong Cross Data-Center Replication (XDCR) capabilities. Many object data storage systems end up paired with an index engine for comprehensive searching capabilities. Couchbase provides an indexing integration solution with Elasticsearch, a horizontally scalable wrapper around Lucene.

The Lucene query syntax is based on JSON; ElasticSearch documents are also stored as JSON. Our developers, steeped in the worlds of .NET and SQL Server, were much more comfortable using the Language Integrated Query (LINQ) functions introduced in .NET 3.5.

ElasticLINQ bridges these two worlds by letting us query Elasticsearch using LINQ, and have the results projected into CLR types. We enlisted the expertise of Damien Guard (of Attack Pattern), who worked on both the LINQ to SQL and Entity Framework teams, to do the initial version of ElasticLINQ for us.

How do I use ElasticLINQ?

Connection and Context ...

Querying with the Context ...

Full-text searching ...

Custom queries with ElasticMethods ...

image

Custom queries and projections with ElasticFields ...

What's next?

This is v1.0 software, so we have a lot left that we can do. We've just recently started using this in our production code, and we are constantly finding new things we want to support. We expect you will come up with things we never dreamed of, too.

We are excited for the community to start using and contributing to ElasticLINQ. The Github site is a work in progress. Soon we will get documentation posted to the Wiki pages on the site, and get a real home page set up. We are anxiously awaiting the first community contributed bugs, Wiki edits, and pull requests.

We hope you love using ElasticLINQ as much as we do!

...

Got to love LINQ Love! :)

Now if only I knew something, anything about Elastic... :/

Monday, March 17, 2014

Going gaga for Google APIs Client Library for .NET (because it's gone GA)

Google Developers Blog - GA Release for Google APIs Client Library for .NET

We strive to make our APIs accessible to anyone on any platform: ReST, HTTP and JSON mean that from nearly any language on nearly any hardware, you can call any of our APIs. However, to be truly useful on many platforms, it helps to have a client library -- one that packs a lot of functionality like handling auth, streaming media uploads and downloads, and gives you native language idioms.

Today, we are announcing General Availability of the Google APIs Client Library for .NET.

This library is an open-source effort, hosted at NuGet, that lets developers building on the Microsoft® .NET Framework to integrate their desktop or Windows Phone applications with Google’s services. It handles OAuth 2.0 integration, streaming uploads and downloads of media, and batching requests. For more than fifty Google APIs, it is the easiest way to get access for any Windows developer. Whether you are plugging Google Calendar into your .NET Framework-based application, translating text in a Windows Phone app or writing a PowerShell script to start Google Compute Engine instances, the Google APIs Client Library for .NET can save you tons of time.

Want to try it out? Visit the Getting Started tutorial. Want to hear more about about using Google’s services from .NET? Follow the Google APIs Client Library for .NET blog here. [GD: Post leached in full]

google-api-dotnet-client Announcements - Announcing the release of 1.8.1

Did you notice we have dropped the beta and rc labels out from this release?

That's right; the Google APIs Client Library for .NET is now in GA (General Availability).

Thanks for all your help and support getting out of beta!

From today, all our Google.Apis NuGet packages are stable. There have been no real changes in the libraries since the release candidate (RC) version, but we have worked hard on improving the documentation on developers.google.com/api-client-library/dotnet/.

As usual, feel free to open new threads in StackOverflow with our google-api-dotnet-client tag for any questions, suggestions or bugs. [GD: Post also leached in full]

NuGet - Google.Apis

image

I've been using their .Net Library for the better part of a decade, but it wasn't as uber (i.e. as Google API wide) as this one.  Anyway... Good to seem them push this forward and give it some love (kind of/mostly, but better this then dead I guess!).

 

Related Past Post XRef:
Google .Net API's go portable... The v1.4.0 Google APIs .NET library is now a Portable Class Library (PCL) And now uses TPL and the new HttpClient lib too
.NET Client Library for Google+ (Both in original binary form and decompiled/source version too)
GData .Net Assembly 1.1.4.0 Released. Now .Net Framework 2, VS (2005) Templates, and support for Google Contacts

Thursday, March 13, 2014

Bing it right from VS - The Web Search Visual Studio Extension (and walk-through on how it was built)

Web Search - Visual Studio Add-in , Search (Google, Yahoo, MSDN, Code Project, Stack Overflow and more...) for the selected text/item

Introduction

Visual Studio provides one of the most powerful IDEs on the market. And it also allows us to extend the functionalities too. Visual Studio Add-ins are powerful way to do this.
In this article I’m going to create a Visual Studio Add-in named “Web Search”. Using this Add-in we can easily search online for a selected text from the editor window or an item from the error list/ reference folder. Multiple search engine options are available with this Add-in.

This WebSearch AddIn setup can be downloaded from Visual Studio Gallery also. Please check WebSearch official page for latest updates.

For your reference I have attached the working source code that's used in this article and setup(updated) for this Add-In.

I have put my time and efforts on all of my articles, Please don't forget to mark your votes, suggestions and feedback to improve the quality of this and upcoming articles.

Note : This add-in/plugin has been used and recommended by many visual studio experts.

Intro4_1

...

Please check WebSearch official page for latest updates

..."

Shemeer's World of Programming - WebSearch

...

Search (Google, Yahoo, MSDN, Code Project, Stack Overflow and more…) for the selected text/item. Supports most of the Visual Studio Versions.

  • Multiple search options included in all Text Editor, Reference Items, Error List. (Integrated search options for Visual Studio IDE)
  • Currently this Add-in works fine with Visual Studio 2005, 2008, 2010, 2012, 2013.
  • You can customize web-search by configure option.
  • Open Search in Default Web Browser or Visual Studio Tab or any other installed browser.
  • Change WebSearch context menu position
  • Easy access with Shortcut key. I use Alt+F1.
  • WebSearch context menu available in all most all editor files.
  • WebSearch menu also available in Tools menu with default search option.
  • Configurable shortcut key.
  • WebSearch menu in Tools menu
  • WebSearch context menu in all Text Editor, Reference Items, Error List.

...

Beyond being a cool extension, the awesome is that not only did he provide the source but he also took the time to walk us through how he created the whole thing! Talk about teaching us to fish... :)

When Directory.GetFiles gets crappy and grabs *.htm but not *.html (here's one reason why)

The Old New Thing - Why does the Directory.GetFiles method sometimes ignore *.html files when I ask for *.htm?

...

A customer reported that one of their programs stopped working, and they traced the problem to the fact that a search for *.htm on some machines was no longer return files like awesome.html, contrary to the documentation. What's going on?

What's going on is that the documentation is trying too hard to explain an observed behavior. (My guess is that some other customer reported the behavior, and the documentation team incorporated the customer's observations into the documentation without really thinking it through.)

The real issue is that the Get­Files method matches against both short file names and long file names. If a long file name has an extension that is longer than three characters, the extension is truncated to form the short file name. And it is that short file name that gets matched by *.htm or *.txt.

Even as originally written, in the presence of short file names, the documentation is wrong, because it would imply that a search for reallylong*.txt could match reallylong_filename.txtother. But try it: It doesn't. That's because the short name is probably REALLY~1.TXT, and that doesn't match reallylong*.txt.

What happened is that short file name generation was disabled on the drive at the time the files were created, so there was no short file name available, so there was consequently no SHORTN~1.HTM file to match against.

...

image

This is one of those things that you might never find and might never even know you might not find. No exception, it just doesn't work as expected...

Trust, but verify.

Wednesday, March 05, 2014

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

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

image

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... :)

image

From the PDF;

"Introduction
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.

imageSNAGHTML2a823e8d

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 csharppad.com, 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 csharppad.com/gist/_gist_owner_/_gist_id or simply csharppad.com/gist/_gist_id

As examples, the links below open up Gists in C# Pad.

http://csharppad.com/gist/9220821
http://csharppad.com/gist/octocat/1169852 ( 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

SNAGHTML2a789132

image

image

image

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

XNA for VS 2013? Yes, you can...

robmiles.com - Return of XNA

image

Now here's a sight for sore eyes

I've mentioned this before, but I think it is worthy of mention again (since I've just done it and it works really well). If you are running later versions of Visual Studio (2010, 2012 or 2013) you can now get XNA goodness onto your machine really easily....

XNA Game Studio 

Project Description
Support for XNA Game Studio until Microsoft will restore support.

Project which continue support to Microsoft XNA Game Studio.

We released XNA Game Studio Extension for Visual Studio 2012/2013 as a VSIX package. This extension is also available on Visual Studio Gallery.

W will release XNA Game Studio as MSI package at March 1st, 2014.

We are looking for programmers to make new release which will support DirectX 11.

XNA Game Studio, XNA Logo are trademarks of Microsoft Corporation in the U.S. and/or other countries.

Nice to see this continue to get interest and that the VS2013 support is now available too.

Say it with me, "XNA Lives!" :)

 

Related Past Post XRef:
Community Driven XNA Game Studio Installer for VS 2012 and soon VS 2013

Thursday, February 27, 2014

24 cloud design patterns and 10 related guidance topics, one eBook - "Cloud Design Patterns" (PDF, ePub)

Microsoft Downloads - Cloud Design Patterns – Book Download

This guide contains twenty-four design patterns and ten related guidance topics that articulate the benefits of applying patterns by showing how each piece can fit into the big picture of cloud application architectures. It includes code samples and general advice on using each pattern. 

Version: 1.0

Date Published: 2/27/2014

CloudDesignPatternsBook-PDF.pdf, 5.8 MB
CloudDesignPatternsEPUBebook.epub, 3.4 MB

Containing twenty-four design patterns and ten related guidance topics, this guide articulates the benefit of applying patterns by showing how each piece can fit into the big picture of cloud application architectures. It also discusses the benefits and considerations for each pattern. Most of the patterns have code samples or snippets that show how to implement the patterns using the features of Windows Azure. However the majority of topics described in this guide are equally relevant to all kinds of distributed systems, whether hosted on Windows Azure or on other cloud platforms.

...

Related Resources

..."

Some snaps from the PDF;

[sigh... snaps removed because it seems Blogger doesn't like my posts with images today (getting a real helpful 500 error when an post has any image in it)... sigh]

Preface

This guide from the Microsoft patterns & practices group, produced with the help of many people within the developer community, provides solutions for common problems encountered when developing cloud-hosted applications.

The guide:
• Articulates the benefit of applying patterns when implementing cloud applications, especially when they will be hosted in Windows Azure.
• Discusses the problems that the patterns address, and how these relate to Windows Azure applications.
• Shows how to implement the patterns using the features of Windows Azure, emphasizing benefits and considerations.
• Depicts the big picture by showing how these patterns fit into cloud application architectures, and how they relate to other patterns.

The majority of topics described in the guide are equally relevant to all kinds of distributed systems, whether hosted on Windows Azure or on other cloud platforms.

Our intention is not to provide a comprehensive collection of patterns. Instead, we chose what we think are useful patterns for cloud applications—taking into account the popularity of each one amongst users. Neither is this a detailed guide to the features of Windows Azure. To learn about Windows Azure see http://windowsazure.com.

[Insert my usual, "Don't reinvent the wheel if you don't have to" blurb here...especially when there's free resources available ]

 

Related Past Post XRef:
Cloud Design Patterns (24 design patterns, two primers, eight guidance topics and 10 sample applications)
Windows Azure Guidance - Cloud Design Patterns Alpha drop...

Wednesday, February 26, 2014

F# for your favorite VB'er

Phil Trelford's Array - F# Eye for the VB Guy

Are you a VB developer curious about functional-first programming. F# is a statically typed language built into Visual Studio. It is a multi-paradigm language with both functional and object-oriented constructs.

F# has powerful type inference which reduces the amount of typing you need to do without reducing performance or correctness.

F# projects are easily referenced from VB and vice versa. Like VB, F# makes minimal use of curly braces, and for many operations the syntax will feel quite familiar.

Here’s my cut-out-and-keep guide to common operations in both languages:

...

SNAGHTML6776995

image

Great little side-by-side for that little VB'er that's in your heart (you know it, you still look back at your VB times with a little longing...)

? 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 http://UserVoice.com 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! ...

...

Furthermore

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.

image...

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...

Thursday, February 20, 2014

"Biggy: SQLite for Documents and .NET"

wekeroad - Hello Biggy

image

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.

Performance

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 ;]