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

Tuesday, June 03, 2014

Not your usual Succinctly book... "Neural Networks using C# Succinctly" (reg-ware)

James D. McCaffrey - Neural Networks using C# Succinctly

I wrote a new book titled “Neural Networks using C# Succinctly”. It was published this week. There are many existing books on neural networks but no good ones (in my opinion) that focus on how to create neural networks from a software developer’s point of view. My book is free and you can download a PDF version from here:

...

I’ve written books before but for “Neural Networks using C# Succinctly” the process was a bit different. I was sitting at my desk one day when I got an unsolicited phone call. Normally I never answer such calls but on this particular day, I did. The call was a young woman named Hilary Bowling who worked for a company called Syncfusion. Hilary asked me if I’d be interested in writing a book about neural networks.

Hilary told me that Syncfusion published relatively short (roughly 100 page) e-books and made them available for free. I was skeptical — I figured there’d have to be a catch of some sort. But in fact, Syncfusion does publish free e-books for software developers. The only minor catch is that you have to register and end up on Syncfusion’s mailing list, but Syncfusion doesn’t take advantage of this (I signed up to see what would happen).

Anyway, it took me a few months to write “Neural Networks using C# Succinctly” (writing a book is much more time-consuming than you might expect) and now it’s available from the Syncfusion Web site...

Syncfusion - Neural Networks using C# Succinctly

image

Neural networks are an exciting field of software development used to calculate outputs from input data. While the idea seems simple enough, the implications of such networks are staggering—think optical character recognition, speech recognition, and regression analysis. With Neural Networks Using C# Succinctly by James McCaffrey, you'll learn how to create your own neural network to solve classification problems, or problems where the outcomes can only be one of several values. Learn about encoding and normalizing data, activation functions and how to choose the right one, and ultimately how to train a neural network to find weights and bias values that provide accurate predictions.

Table of Contents

  1. Neural Networks
  2. Perceptrons
  3. Feed-Forward
  4. Back-Propagation
  5. Training

How can you go wrong with 128 free('ish) pages on C# Neural Networks!

image

 

Related Past Post XRef:
"Visual Studio 2013 Succinctly" free [reg-ware] now available from... you guessed it, Syncfusion
"Windows Phone 8 Succinctly - The practical approach to Windows Phone 8 development" eBook (Reg-ware)
Succinctly eBook of the Day: "Twitter Bootstrap Succinctly" [Reg-ware]
Need some help up the WPF learning curve? "WPF Succinctly" from Syncfusion is now available (and free :)
TypeScript Succinctly - Free [Name/email-ware] eBook
Getting sharp with F# with the free "F# Succinctly" eBook [reg-ware]
Syncfusion helps shed a little succinct light on LightSwitch with "LightSwitch Succinctly" (Reg-ware)
"JavaScript Succinctly" - Another free (reg-ware) eBook from Syncfusion
Get into sync with HTTP with the new free (reg-ware) Syncfusion Succinctly eBook, "HTTP Succinctly"
Spelunk the technical details of the PDF format with "PDF Succinctly" from Syncfusion (Free/reg-ware PDF/Mobi ebook)
"Git Succinctly" Free/reg-ware PDF/Mobi ebook)
jQuery Succinctly - Free eBook (reg-ware, PDF and/or Mobi)

 

Visual Studio "14" CTP 1 Now Available

Somasegar’s blog - Visual Studio "14" CTP

Today, we are making available a first community technology preview of the next version of Visual Studio, codenamed Visual Studio “14”.  This early build is focused on enabling feedback and testing from the Visual Studio community.  Visual Studio "14" will most likely be available sometime in 2015, with a more complete preview release and final naming available later this year.  Given that this is a very early build, please install in a test environment with no earlier versions of Visual Studio installed.

You can read about the new features and known issues in this first Visual Studio “14” CTP, and also download today.

Over the last 3 months, we've announced many exciting technologies that will be important parts of Visual Studio "14" - including the "Roslyn" .NET compiler platform, ASP.NET vNext and Apache Cordova tooling.  The Visual Studio "14" CTP 1 includes these tools, as well as many additional improvements across Visual Studio, including an early look at some new C++ 11 support that will be part of Visual Studio "14".

C# and VB with the .NET Compiler Platform ("Roslyn")

In Visual Studio "14", the C# and VB compilers and IDE support are fully built on the .NET Compiler Platform ("Roslyn").  This open-source compiler as a service now sits behind dozens of developer experiences in Visual Studio "14", powering build, IntelliSense, refactoring, CodeLens, debugging and many more features developers use every day.  In most places the experiences are unchanged, but there have also been many small improvements across the entire development experience as part of the new compiler platform.

In the Visual Studio "14" preview C# refactoring support has been completely revamped including two new core refactorings: Inline Temporary Variable and Introduce Explaining Variable. Additionally, refactoring support for Visual Basic has been added for the first time.

image

Visual Studio "14" also supports APIs that come from NuGet with their own analyzers, squiggling issues in your code as you type and offering you automatic fixes, all powered by the .NET Compiler Platform.

You can read more about the new C# and VB developer experiences on the C# blog and the Visual Basic blog.

ASP.NET vNext

...

You can read more about ASP.NET vNext in the Visual Studio "14" CTP on the .NET Web Development and Tools blog.

C++ 11/14

We've continued to push forward on the standards conformance of the Visual C++ compiler....

...

You can read more about the C++ improvements in the Visual Studio "14" CTP on the C++ blog.

Summary

This early preview of Visual Studio "14" is an opportunity to gather feedback on the next version of Visual Studio and .NET.  For developers picking up the CTP, I encourage you to share your feedback on the Connect website, or through Send-a-Smile in the Visual Studio IDE.

Visual Studio "14" CTP release notes

Visual Studio "14" CTP Version 14.0.21730.1.DP release notes

This article lists the release notes for the Microsoft Visual Studio "14" Community Technology Previews (CTPs).

Visual Studio "14" CTPs are previews for the next major release of Visual Studio. These Visual Studio CTPs are intended to promote continuous feedback between early adopters and the Visual Studio development team. We would love to receive your input on the new product functionality and the improved experiences. Your feedback will help shape the future of Visual Studio, and together we will improve the developer experience.

The following download link will always point you to the latest CTP:
Download the latest Visual Studio "14" CTP package now

Notes:

  • CTPs are English only.
  • CTPs are unsupported and are intended to be used for testing, trial, and feedback purposes only.
  • CTPs have not been subject to final validation. They are not meant to be run on production workstations or servers, or used to create production code. Installing a CTP on a production server will put the server in an unsupported state.
  • Although these CTPs are intended to be installed side-by-side with earlier versions of Visual Studio, complete compatibility on every CTP is not guaranteed. For this early Visual Studio "14" CTP, we recommend that you install the product in a VM, a VHD, or on a fresh computer, because there are known side-by-side compatibility issues with Visual Studio 2013.
Feedback

The goal of this CTP is to collect your feedback. To report a bug, please use Connect. You can also share your ideas and suggestions on UserVoice. Your quick thoughts can be shared by using Send-a-Smile through the Visual Studio IDE.

New Features

image

 

Known issues

...

Installing Visual Studio "14" CTP side-by-side with Visual Studio 2013

There are known issues when you install Visual Studio "14" CTP 14.0.21730.1 DP on the same computer as Visual Studio 2013. While we expect that an uninstallation of Visual Studio "14" and then a repair of Visual Studio 2013 should fix these issues, our safest recommendation is to install Visual Studio "14" in a VM, a VHD, a fresh computer, or another non-production test-only computer that does not have Visual Studio 2013 on it. All of these Visual Studio side-by-side issues are expected to be fixed soon.

There is an installation block in this Visual Studio "14" CTP that will prevent installation on a computer where an earlier version of Visual Studio is already installed. To disable the block that will put the computer in an un-recommended state, add the value "BlockerOverride" to the registry:

HKLM\SOFTWARE\Microsoft\DevDiv\vs\Servicing

Note the Known Issues! But Yeah! New VS!  :)

Monday, May 19, 2014

What is 14 sessions, 21 hours and free? The Exam Prep Sessions from TechEd North America 2014...

Speaking of content to catch on the Channel 9 Windows Phone App...

Born to Learn - Now Available On Demand: Exam Prep Sessions from TechEd NA 2014

Whether you attended TechEd North America 2014 or not, all the Exam Prep sessions are available for you to watch anytime, thanks to our friends at Channel 9. Catch them all here.

For ease of reference, here's the list of Exam Prep sessions in the order they were presented during TechEd NA. Enjoy!

image

14 sessions, 21 hours'ish, all free...

image

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

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

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

image

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

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

Dan's @ it again with @XamarinAppDev and XamarinAppDev.com

DanRigby.com - Announcing XamarinAppDev.com 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 http://XamarinAppDev.com and @XamarinAppDev!

image

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 http://WindowsAppDev.com 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 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...

Friday, February 21, 2014

Need a little help cleaning up your code? CodeMaid will help with that developer dirty work...

Dotnetjalps-asp.net - 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.

CodeMaid

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

image

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.

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

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

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

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

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

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

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

Finding
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

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

Tuesday, February 18, 2014

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

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

image

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

Prerequisites:

1. .Net technologies.

2. Basic understanding of design patterns.

3. Basic understanding of OOPS.

Description:

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.

image

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

imageimageimage

...

CodePlex - Stateless Designer

...

About stateless

stateless is a lightweight C# hierarchical state machine framework made by Nicholas Blumhardt. The stateless project is hosted here: http://code.google.com/p/stateless/. 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: http://nuget.org/packages/Stateless. 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
www.dotnettips.info article 1168 - Note: Not in English
www.dotnettips.info 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

image

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

...

image

...

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.

Contents

Introduction
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

Introduction

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.

...

image

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

image 

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 5.0.0.3652, 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

Finally.(Download)

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

...

image

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
SourceForge.net: #develop 1.0.2a stopgap release
SourceForge.net: #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

image

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!)