Friday, January 04, 2013

Threading threading safely with the Immutable Collections Preview from the BCL Team

Base Class Library (BCL) Blog - Preview of Immutable Collections Released on NuGet

This includes the Task Parallel Library (TPL) as well as the new async/await keywords features to reduce the friction when writing asynchronous code. However, it’s still challenging to keep mutable state under control when multiple threads are involved. A common approach is to make use of immutable state that can be passed freely between different threads. Unfortunately, implementing immutable data structures can be quite hard, especially when collections are involved. In this post, Andrew Arnott, a developer from the Visual Studio team, will talk about a set of collection types we developed to make that easier. –Immo

Today [GD: December 18th] we released a preview of the immutable collections for the .NET Framework 4.5 and Windows Store apps on NuGet, as planned.

If you’re not already familiar with immutability concepts and where it’s valuable in your application you may want to read Read-only, frozen, and immutable collections.

...

Why should I use immutability?

There are many good reasons to use immutable collections. Here are a few:

  1. Snapshot semantics, allowing you to share your collections in a way that the receiver can count on never changing.
  2. Implicit thread-safety in multi-threaded applications (no locks required to access collections).
  3. Any time you have a class member that accepts or returns a collection type and you want to include read-only semantics in the contract.
  4. Functional programming friendly.
  5. Allow modification of a collection during enumeration, while ensuring original collection does not change.
  6. They implement the same IReadOnly* interfaces that your code already deals with so migration is easy.

Introducing the immutable collections

The NuGet package preview includes these types:

  • ImmutableStack<T>
  • ImmutableQueue<T>
  • ImmutableList<T>
  • ImmutableHashSet<T>
  • ImmutableSortedSet<T>
  • ImmutableDictionary<K, V>
  • ImmutableSortedDictionary<K, V>

Interfaces for each of these types are also defined to facilitate exchange of immutable collection types that may be implemented differently to optimize for very specific performance or memory requirements.

...

Performance characteristics

How do immutable collections perform relative to their well-known mutable BCL counterparts? These immutable collections have been heavily tuned for maximum performance and minimum GC pressure. They’re very fast, and in most cases they will be appropriate to use in your applications.

...

How can I get started?

Install the Microsoft.Bcl.Immutable NuGet package into one of your Visual Studio projects. Before consuming the package, make sure you've got the NuGet 2.1 or newer installed. (What is Nuget?)

Call for feedback

The NuGet package will be in a prerelease form for a brief time, giving you an opportunity to tell us what you think so we can make necessary changes. Add comments to this post, or contact the authors of our NuGet package.

..."

I had missed this over the holiday period. And since the BCL teams are one of my favorites (alone with most of the teams in DevDiv... ;), anything coming them gets a free mention!

I just dig seeing their samples and previews as they often foreshadow what we might be seeing in the next .Net version. That and I'm just glad there IS someone on the BCL team... :P (See, .Net isn't dead! The BCL team is still coding their little fingers off!...  )

Teachers and School Leaders, Microsoft has got your badges...

UK Schools Blog - Earn Microsoft badges for teacher and school leader professional development

We believe in anytime, anywhere learning. We also believe your achievements should be recognized so that you can share your accomplishments and knowledge with your colleagues and communities. That’s why the Partners in Learning Network awards badges for the skills and knowledge that are learned and shared through our online professional learning community, in our in-person events, and in school communities around the world.

Check out the badges you can earn and add to your Partners in Learning online profile. Earn enough and you can establish yourself as a Microsoft Expert Educator (more info to follow on this).

image

...

Once signed in, don’t forget to complete your profile. Check out this innovid created by Jonny Carter, from St-Malachy's Primary school, who demonstrates how easy it is to build your profile on www.pil-network.com

..."

Given the blog source, I'm not sure if this is just for the UK or not, but I still think it's cool. I mean badges are cool, right? And schools are cool right? And educators? So that makes this triple cool?

Is that the world's tallest thermometer in your pocket or are you just...anyway... The Baker Thermometer is for sale!

laist - World's Tallest Thermometer in Baker Is Up For Sale

If you've driven from Los Angeles to Las Vegas, surely you've noticed the town of Baker, and its iconic giant thermometer. In recent years the 134-foot-tall landmark hasn't been working, however, and a couple of the businesses on the property on which it stands have also gone kaput. Now its owner is searching for a remedy in the form of a buyer: The thermometer is up for sale for $1.75 million.

image
Photo by matchity via Flickr

For that bargain price, you can not only just claim ownership of the world's tallest thermometer, but you'll also be the owner of "the vacant gift shop at the base and the four-acre parcel along Baker Boulevard," Baron Castillo of Coldwell Banker Commercial in Los Angeles tells the L.A. Times. Castillo, who is handling the sale, says it's really just a matter of the new owner fixing it up.

...

Now THAT'S what I should have asked Santa for! And only $8k a month for the power to light it up. Given the location, sounds like perfect solar opportunity... um... hook in some advertising for the solar company on the sign... um...

"Honey, I've got this idea for an investment..."

[SMACK!! Annette hits Greg with the Stupid Stick... ;]

Your shortcut link to exploring Windows Explorer shortcut LNK's

CodeProject - Windows Link (Shortcut) File Explorer

It was not exactly the flashing action experience I had when I wrote a Side Launcher (Start Menu showing up on the side of the screen) which was seen in a previous Database application written in assembler under Windows. Accessing sequential, unsorted Records, with properly organized record lengths, resulted in speeds near to access indexed databases in any application. Yes, it’s true! Reducing the clutter was the way to go and analyzing Link files gave an idea why. ShellLink contributed to the slow acting of the Side Launcher. In fact circumventing Widows, respectively its preference to store huge administrational info into files and deal with that, also seen in PE files, could speed up the application to desired levels. During analysis the Link File Explorer was created.

Features

  • The Link File Explorer analyses Windows shortcut file content and displays the data.
  • Links can be run from inside the explorer.
  • Internet Shortcuts (plain text files) are supported in this application and can be run.
  • Link files can be taken into a HexEditor from the Link Explorer.
  • Network, Printer, Mouse, etc.  link files are supported.
  • Accessing Desktop, StartMenu and user directory from inside the Explorer.
  • The Link File Explorer contains an easy report facility.
  • Report files can be edited from inside the Link File Explorer.
  • Opening documents document files directly.
  • Related data is supported with color coding for easy recognition.
  • A whole variety of documents, explaining structures, are included in the download.
  • The Explorer uses default applications for external calls.

...

image

..."

While not something you need everyday (week, month, year...) but I thought this was cool and the R&D into the LNK format something pretty interesting (yeah, I know, I need a life... um... shut up? ;)

Thursday, January 03, 2013

Did ya get the memo? Let me send you another copy... Windows Phone 8 Delightful Design Memo (aka Cheat Sheet)

[Windows Phone] Modern UI memo to make beautiful applications on Windows Phone 7 & 8 ([Windows Phone] Memo ModernUI pour faire de belles applications sur Windows Phone 7 & 8)

In a previous article I presented you a memo sheet that summarizes all you need to know to develop applications on Windows 8 modernUI. This time it's around Windows Phone!

The developers have at their disposal the Center Windows Phone Dev to the modern look of the guidelines: http://dev.windowsphone.com

In order to not waste any time to search for information for each new application, I created a memo card which summarizes the important points for the development of your applications.

On this card you can thus find information on:

  • The various resolutions on Windows Phone 7 / 8
  • All type of logos and images to include in your application with different sizes
  • The different types of tiles,
  • The accent colors,
  • The icons available with font Segoe UI Symbol (the very good article Jonathan Antoine tires)... [GD: Machine Translated]

image

Sorry, had to use the memo line...

(via Windows Phone Geek - Cheat Sheet for Windows Phone Modern UI Design)

A few tips for creating professional visual presentations

Microsoft Small Business - GUEST BLOG: 5 Tips on Creating Effective Visual Presentations Like a Pro

5 Tips on Creating Effective Visual Presentations Like a Pro

Here is a constant predicament for presenters - How can a topic be effectively discussed to an audience in such a way that they will be interested in learning more about the issue and actually be drawn to understand and remember what has been presented to them? Despite your best intentions, incorporating your entire monologue into numerous slides filled with bullet points does not help in increasing the audience’s interest and engagement in the presentation. Adding bar graphs and pie charts do not help as well. Understanding human nature points to one solution – visuals.

Communicating with pictures makes it easier for people to remember things that have been discussed with them visually. Studies done by Psychologist Jerome Bruner of New York University have shown that people remember 80% of what they see and do, while only 10% is retained from what they hear and 20% from what they read. According to Psychologist Albert Mehrabian, an audience during a presentation absorbs 55% of the information presented through visuals, and only 38% of verbal and 7% of text.

Ideally, hiring a designer would be the best solution for having a highly engaging and effective presentation. A presentation created by a professional designer will guarantee a polished presentation that will help you, as a presenter, to capture the attention of your audience and successfully communicate your message. However, hiring a pro to do this may be too expensive for small businesses so here are some tips for achieving a visually engaging presentation without the additional costs.

...

SNAGHTML4108088b..."

As someone who would like to become a Microsoft MVP one day, and knows that I need to get out from behind the keyboard and in front of people, presenting and sharing, to get there, these kinds of tips are those that I like to gather.

We all hate crappy presentations, so anything we can do to make them better is a good thing, right? Maybe just a few tweaks will take take your crap-tastic presentation to fantastic? (Well, we can always hope ;)

What Windows Runtime runs where?

Jim O'Neil - Technology Evangelist - Windows Runtime–what’s supported where?

As I’m sure you've heard, Windows Phone 8 and Windows Store (nee Metro) applications share a common core operating system, and that’s great news for developers looking to take advantage of both platforms with a single or complementary applications.

The common core does not, however, mean that the platforms are identical – in fact, only about 1/3 of the Windows Runtime API members are available on both platforms, and there are some APIs that are specific to either Windows Phone or Windows 8 due the unique experiences or features of the hardware.

Then, of course, there’s a .NET API available for both Windows Store applications and Windows Phone applications each a somewhat differing subset of the complete .NET API you’ve been using to build Windows Forms, WPF and ASP.NET applications for years.

As someone that’s been transitioning his skills from core .NET development to the Windows Runtime, I share the pain of trying to make that call to API X and finding it’s not supported on Windows 8 (or Windows Phone) or wondering why the namespace that I’ve used for years refused to resolve in a new Windows 8 app.

The good news is that the documentation is there, but there are some subtleties and nuances, so I’ve pulled this post together to outline some of the tricks and links I’ve discovered.

image

...

image

We've heard what Windows Runtime is available on a number of devices, but only pieces and parts are available in a given space... So what runs where? Jim's post helps us find what runs where for the Runtime. Worse case, it's a great resource link post... :)

Wednesday, January 02, 2013

DPack 3.5.x is out (Think VS2012++ version)

Visual Studio Gallery - DPack

DPack is a FREE collection of Microsoft Visual Studio 2012 tools. DPack is designed to greatly increase developer's productivity, automate repetitive processes and expand upon some of Microsoft Visual Studio features.

DPack includes various browser tools that allow the developer to quickly find solution files, types, particular type members, methods or properties for instance, or quickly find and reference standard .NET framework types. DPack includes greatly enhanced numbered bookmarks feature, various code navigation tools as well as streamlined surround with feature, and much more. See screenshots and learn more about individual features using Features menu.

Major features included:

  • Code Browser
  • File Browser
  • Solution Browser
  • Framework Browser
  • Numbered Bookmarks
  • Surround With
  • Code Navigation
  • Solution Statistics
  • Solution Backup

All features support C#, VB, C++ and Ruby In Steel based projects.

www.usysware.com/dpack/

DPack - What's New

v3.5.1, January 1, 2013

New Features and Improvements:

  • First Visual Studio 2012 RTM compatible version. Visual Studio 2012 RC and betas are no longer supported.
  • Improved File Browser dialog mode performance for large solutions. If solution file structure doesn't change then File Browser will cache the collected information in memory to be re-used on the next request.
  • Improved browsers performance processing solutions with Setup type projects.
  • Modified Code Browser to differentiate between fields and constants.
  • Added Command Prompt to Solution Explorer context menu item.
  • Reworked Tools|Options dialog to make it easier enable/disable individual features.
  • Chrome/Oxygen language based projects are no longer supported.

As you can see below, I've been following DPack for years now. It's great to see it continue to grow.

Related Past Post XRef:
DPack 3 (3.0.1) is out - Think VS2010 RTM, VS2008 versions and with great tasting filling too…
DPack 2.8.1 Released (Now with VS2008 RTM Support)
DPack 2.6.1 Released (Last VS2003 Version)
DPack 2.5.1 with Visual Studio 2005 (RTM) Support Released
DPack 2.2.0 Released...
DPack 2.0 is live
USysWare DPack Home (1.3.2 Released)
USysWare DPack Home [Free VS 2003 Add-ins]

From Ping to Power, the IT Admin's CMD to PowerShell Cheat sheet

Goatee PFE - Free Download: CMD to PowerShell Guide for AD

New Years ResolutionSkip the treadmill.  Learn PowerShell.

Hi folks. It's your friendly, neighborhood PFE again. In order to avoid the long lines to buy a treadmill the first week of January I thought I would save you some time and give you an easier New Years Resolution… Learn PowerShell.

It's time to part with "blankie".

For years many of us have relied on trusty command line utilities like PING, IPCONFIG, and REPADMIN. Some of us are still hanging on to those instead of embracing the brave new world of PowerShell.

In an effort to assist with the transition and to introduce some of the cool new cmdlets in PowerShell v3 I have created a free reference guide showing how the old meets the new. For example, instead of PING try the PowerShell cmdlet Test-Connection, instead of NSLOOKUP use Resolve-DNSName, instead of GPUPDATE use Invoke-GPUpdate.

The guide attached at the bottom of this blog post contains four packed pages of PowerShell pleasure for your perusing.

Why?

Why would someone want to use PowerShell instead of command line utilities? There are several reasons:

...

Free Download

While studying the new 2012 cmdlets in preparation for conference talks last summer I created a quick cheat sheet for PowerShell equivalence to REPADMIN and DNSCMD. The other day I sat down and expanded this to include a raft of familiar utilities:

REPADMIN
DCPROMO
CSVDE
NETDOM
NLTEST
GPUPDATE
GPRESULT

DSGET
DSQUERY
DSADD
DSMOD
DSRM
DSMOVE
DSACLS

DNSCMD
NSLOOKUP
PING
IPCONFIG
NETSTAT

This guide will get you off and running to convert any old batch files you still have lying around or hiding in scheduled tasks.

Four pages. Really?

Yes. I know that sounds like a lot to learn

..."

You can have my PING & IPCONFIG when you pry it from my cold, dead fingers... NOT! It's time to join the PowerShell age and start adjusting your typing muscle memory away from the tools that are decades old to a more modern set of tools. If you're not already a PowerShell user, think of these as your gateway drug... :)

SNAGHTML3be5cfa0

Tuesday, January 01, 2013

Windows 3.1 simulated in a browser (really)

Windows 7 Hacker - Fun Hack Fully Functional Windows 3.1 Simulator In Browser

While some of you might already in the new year, let’s not forget way back in 1992, more than 20 years ago, pre Windows 95 era. The year Windows 3.1 makes to the consumer market, even though those days are in the past, people still find ways to appreciate and enjoy the classic era of computing.

Head over to http://www.michaelv.org/ to experience what you life might be like 20 years ago. (be aware the simulator runs VERY fast compare to what you might actual get out of 20 years ago)

...

http://www.michaelv.org

Michaelv.org is coded in JavaScript and strict XHTML 1.0, with AJAX functionality provided through PHP. It has been tested for compatibility in Firefox and IE. Firefox 2 or 3 is highly recommended, but the site is almost entirely functional in IE 6, 7, or 8. Media Player does not work in IE as IE lacks the ability to dynamically instantiate <OBJECT>

The file system is stored in SQL and is dynamic. File creation, renaming, deletion, reading, and writing can all be accomplished in real-time and with persistent results. However, for obvious reasons, visitors are not able to make changes to the file system in any way.

The goal of this site is not to create an entirely complete mirror image of Windows 3.1, but rather keep the spirit and omit features when they are not justified by an effort to usability ratio. For example, Notepad lacks a find and replace feature because it is not worth the effort. Where features do exist, every effort is made to present them in exactly the manner that they existed in Windows 3.1.

I have also endeavored to put plenty of features in which are not readily apparent, hopefully making the site a fun and long-lasting process of experimentation and discovery. For example, try pressing the keystroke for full screen mode in MS-DOS Prompt.

[GD: These are real screenshots of it running on my Win8 notebook]

image

image

image

I find it funny how fast Windows 3.1 is in the simulation.

Monday, December 31, 2012

Fix it for Security Advisory 2794220 (This Saturday's IE6/7/8 zero-day remote exploit)

Microsoft Security Response Center - Fix it for Security Advisory 2794220 now available

We have updated Security Advisory 2749920 to include the Fix it we discussed in Saturday’s blog post.  This easy, one-click Fix it is available to everyone and prevents the vulnerability from being used for code execution without affecting your ability to browse the Web. Additionally, applying the Fix it does not require a reboot. While we have still observed only a few attempts to exploit this issue, we encourage all customers to apply this Fix it to help protect their systems. [GD: Emphasis added]

We continue to work on a security update to address this issue and we’re closely monitoring the threat landscape. If the situation changes, we will post updates here on the MSRC blog and on Twitter at @MSFTSecResponse

Microsoft Security Advisory: Vulnerability in Internet Explorer could allow information disclosure

Microsoft has released a Microsoft security advisory about this issue for IT professionals. The security advisory contains additional security-related information. To view the security advisory, go to the following Microsoft website:

http://technet.microsoft.com/security/advisory/2794220

image

..."

This should make it easier for you all to walk remote loved ones through if they are stuck using an older browser (i.e. XP users)

PowerSwitchUserTile - Creating a Switch User Windows 8 Tile with PowerShell

TechNet Script Gallery - Script to create a Windows 8 Switch User Tile for the Start menu (PowerShell)

This PowerShell Script shows how to create a Windows 8 Switch User tile for the Start menu.

Scenarios

Properly switching users in Windows 8 without a Start button can be a bit of a chore. Many users may want to switch users in just one click. This script enables users to click a tile to switch user on the Start menu.

...

image

..."

One of the killer features for Windows 8 usage in our house is our being able to have one device that we can easily switch to our own logins (and syncs with our other Win8 devices). But it is a little bit of a pain to switch users, so I wanted to capture this for future reference and use.

BGInfo4U - Creating your own dynamically updating BGInfo

Visual Studio Gallery - [CCS LABS] Windows Forms: Dynamically Writing to the Background Desktop -BGInfo2

Introduction

Sysinternals provide a great utility called BGInfo. This utility writes information about your computer system on the Desktop. The problem is that the information is not dynamically updated - so quickly the information becomes outdated. This example shows how to created a dynamically created BGInfo application.

image

The above image shows BGInfo by SysInternals. The application we will be producing writes yellow dynamically updating information to the screen. In the sample we only show two pieces of information the logged on user's name and how long the computer has been running since it was switched on.

We have used a little employed cheat to produce the sample. Which is using a full screen window which is fully transparent - this allows you to see the background icons etc and click through the transparent window to the icons below.

The only real task we have is to set the transparent window to the furthest back that we can. This we do with the following code:

..."

Let's see I've only been a fan of BGInfo since 2005, so I guess it's okay to highlight this BGInfo like code sample... :)

Now  how I feel about this approach [Full screen transparent form], but still, it's an interesting idea and if you need near real-time BGInfo, then this should work. If you only need scheduled updates, then I'd probably use a scheduled task to run BGInfo. Still I thought simple code sample pretty cool and I thought it nice that both C# and VB.Net versions were included.

 

Related Past Post XRef:
BGInfo isn't just for wallpaper you know... (I didn't, but now I do ;) - Using BGInfo to capture and save system configuration to SQL Server (or other database)
JonGalloway.ToString() - Util - BgInfo
BGInfo (Background Info from Sysinterals)

Use the Sysinternals Utilities? The EULA bug dialog you? Then try this…
The latest Sysinternals utilities are just a URL away, Live.Sysinternals.com