Quantcast
Channel: Scott Hanselman's Blog
Viewing all 1148 articles
Browse latest View live

NuGet Package of the Week: ASP.NET Web API Caching with CacheCow and CacheOutput

$
0
0

You can see other cool NuGet Packages I've mentioned on the blog here. Today's NuGet package is CacheCow, which has possibly the coolest Open Source Library name since Lawnchair.js.

image

"CacheCow is a library for implementing HTTP caching on both client and server in ASP.NET Web API. It uses message handlers on both client and server to intercept request and response and apply caching logic and rules."

CacheCow was started by Ali Kheyrollahi with help from Tugberk Ugurlu and the community, and is a fantastically useful piece of work. I wouldn't be surprised to see this library start showing in more places one day.

As an aside, Ali, this would be a great candidate for setting up a free AppVeyor Continuous Integration build along with a badge showing that the project is building and healthy!

CacheCow on the server can manage the cache in a number of ways. You can store it in SQL Server with the EntityTagStore, or implement your own storage handler. You can keep the cache in memcached, Redis, etc.

Consider using a library like CacheCow if you're putting together a Web API and haven't given sufficient thought to caching yet, or if you're already sprinkling cache code throughout your business logic. You might already suspect that is going to litter your code but perhaps haven't gotten around to tidying up. Now is a good time to unify your caching.

As a very simple example, here's the HTTP Headers from an HTTP GET to a Web API:

Cache-Control: no-cache
Content-Length: 19
Content-Type: application/json; charset=utf-8
Date: Fri, 27 Jun 2014 23:22:10 GMT
Expires: -1
Pragma: no-cache

Here's the same thing after adding the most basic caching to my ASP.NET applications config:

GlobalConfiguration.Configuration.MessageHandlers.Add(new CachingHandler(GlobalConfiguration.Configuration));

The HTTP Headers with the same GET with CacheCow enabled:

Cache-Control: no-transform, must-revalidate, max-age=0, private
Content-Length: 19
Content-Type: application/json; charset=utf-8
Date: Fri, 27 Jun 2014 23:24:16 GMT
ETag: W/"e1c5ab4f818f4cde9426c6b0824afe5b"
Last-Modified: Fri, 27 Jun 2014 23:24:16 GMT

Notice the Cache-Control header, the Last-Modified, and the ETag. The ETag is weak as indicted by "W/" which means that this response is semantically equivalent to the last response. If I was caching persistently, I could get a strong ETag indicating that the cached response was byte-for-byte identical. Also, if the client was smart about caching and added If-Modified-Since or If-None-Match for ETags, the response might be a 304 Not Modified, rather than a 200 OK. If you're going to add caching to your Web API server, you'll want to make sure your clients respect those headers fully!

From ALI's blog, you can still use HttpClient in your clients, but you use WebRequestHandler as the message handler:

HttpClient client = new HttpClient(new WebRequestHandler()
{
CachePolicy = new RequestCachePolicy(RequestCacheLevel.Default)
});
var httpResponseMessage = await client.GetAsync(http://superpoopy);

Really don't want a resource cached? Remember, this is HTTP so, Cache-Control: no-cache from the client!

Of course, one of the most important aspects of caching anything is "when do I invalidate the cache?" CacheCow gives you a lot control over this, but you really need to be aware of what your actual goal is or you'll find things cache you don't want, or things not cached that you do.

  • Are you looking for time-based caching? Cache for 5 min after a DB access?
  • Are you looking for smart caching that invalidates when it sees what could be a modification? Invalidate a collection after a POST/PUT/DELETE?

Given that you're likely using REST, you'll want to make sure that the semantics of these caching headers and their intent is reflected in your behavior. Last-Modified should reflect realty when possible.

From the CacheCow Wiki, there's great features for both the Server-side and Client-side. Here's CacheCow.Server features

  • Managing ETag, Last Modified, Expires and other cache related headers
  • Implementing returning Not-Modified 304 and precondition failed 412 responses for conditional calls
  • Invalidating cache in case of PUT, POST, PATCH and DELETE
  • Flexible resource organization. Rules can be defined so invalidation of a resource can invalidate linked resources

and the CacheCow.Client features

  • Caching GET responses according to their caching headers
  • Verifying cached items for their staleness
  • Validating cached items if must-revalidate parameter of Cache-Control header is set to true. It will use ETag or Expires whichever exists
  • Making conditional PUT for resources that are cached based on their ETag or expires header, whichever exists

Another good ASP.NET caching library to explore is ASP.NET Web API "CacheOutput" by Filip Wojcieszyn. While it doesn't have an fun to say name ;) it's got some great features and is super easy to get started with. You can find CacheOutput with NuGet at

Install-Package Strathweb.CacheOutput.WebApi2

And you'll configure your caching options using the intuitive CacheOutput attributes like those you may have seen in ASP.NET MVC:

[CacheOutput(ClientTimeSpan = 100, ServerTimeSpan = 100)]
public IEnumerable<string> Get()
{
return new string[] { "value1", "value2" };
}

ASP.NET Web API CacheOutput has great getting started docs and clear easy to ready code.

So, you've got options. Go explore!

You can also pickup the Pro ASP.NET Web API book at Amazon. Go explore CacheCow or CacheOutput and support open source! If you find issues or feel there's work to be done in the documentation, why not do it and submit a pull request? I'm sure any project would appreciate some help with updated samples, quickstarts, or better docs.


Sponsor: Many thanks to our friends at Octopus Deploy for sponsoring the feed this week. Did you know that NuGet.org deploys with Octopus? Using NuGet and powerful conventions, Octopus Deploy makes it easy to automate releases of ASP.NET applications and Windows Services. Say goodbye to remote desktop and start automating today!



© 2014 Scott Hanselman. All rights reserved.
     

Diabetics: It's fun to say Bionic Pancreas but how about a reality check

$
0
0

A diagram outlining the complete bionic pancreas systemThe state of healthcare reporting is just abysmal. It's all link-bait. It's fun to write things like "Random Joe invents cure for diabetes in his garage, saves dying 5 year old." It's surely less fun to read them with you're the one with the disease.

It's time for medical journalists to try a little harder and pushback against editors that write headlines optimized for pageviews. The thing is, I've met a dozen General Practitioners who are themselves confused about how diabetes works, and link-bait journalism just ruins it for the public, too. I've received no fewer than 50 personal emails or FB posts from well-meaning friends this last week. "Have you heard? They've cured your diabetes with a bionic pancreas!"

I have been a Type 1 Diabetic for 20 years, I've worn an insulin pump 24 hours a day for the last 15 years (that's over 130,000 hours, in case you're counting), I'm a diabetes off-label body hacker with an A1C of 5.5%. What's that mean to you? I'm not a doctor, but I'm a hell of a good diabetic.

I know what I'm talking about because I'm living it, and living it well. A doctor may be able to tell me to adjust my insulin every 3 months when I see them, but they aren't up with me at 4 am in a hotel in Germany with jet-lag telling me what to do when I'm having a low. Forgive me this hubris, but it comes from 75,000 finger pricks and yes, it hurts every time, and no, my insulin pump doesn't automatically cure me.

Last year the FDA approved an Insulin Pump that shuts off automatically if it detects the wearer is having a low sugar. The press and the company itself called this new feature an "artificial pancreas." Nonsense. It's WAY too early to call this Insulin Pump an Artificial Pancreas.

Now we are seeing a new "bionic" pancreas for which that the press is writing headlines like "A Father Has Invented a Bionic Organ to Save His Son From Type 1 Diabetes" and "Bionic Pancreas" Astonishes Diabetes Researchers."

It's a great proof concept for a closed system based on dual insulin pumps (one with glucagon) and a high accuracy CGM managed by an iPhone. But that's a not a fun headline, is it?

"Boston University biomedical engineer Ed Damiano and a team of other researchers published a study earlier this month detailing a system that could prevent these dangerous situations."

Indeed, the study in the New England Journal of Medicine where Ed Damiano, Ph.D. is listed alongside Steven J. Russell, M.D., Ph.D., Firas H. El-Khatib, Ph.D., Manasi Sinha, M.D., M.P.H., Kendra L. Magyar, M.S.N., N.P., Katherine McKeon, M.Eng., Laura G. Goergen, B.S.N., R.N., Courtney Balliro, B.S.N, R.N., Mallory A. Hillard, B.S., David M. Nathan, M.D.

They are clearly all brilliant and of note. Let's break the study down.

"...we compared glycemic control with a wearable, bihormonal, automated, “bionic” pancreas (bionic-pancreas period) with glycemic control with an insulin pump (control period) for 5 days in 20 adults and 32 adolescents with type 1 diabetes mellitus."

They are trying to improve blood sugar control. That means keeping my numbers as "normal" as possible to avoid the nasty side-effects like blindness and amputation in the long-term with highs, and death and coma with lows. The general idea is that since my actual pancreas isn't operating, I'll need another way to get insulin into my system. "Bihormonal" means they are delivering not just insulin, which lowers blood sugar, but also glucagon, which effectively raises blood sugar. They tested this for 5 days on a bunch of people.

"The device consisted of an iPhone 4S (Apple), which ran the control algorithm, and a G4 Platinum continuous glucose monitor (DexCom) connected by a custom hardware interface."

I use a DexCom G4, by the way. It's a lovely device and it gives me an estimate of my blood sugar every 5 minutes by drawing a parallel between what it detects in the interstitial fluid of my own fat and tissues (not my whole blood) and then sends it wirelessly to a handset. I currently then make calculations in my head and decide (Note that keyword: decide) how much insulin to take. I then manually tell my Medtronic Insulin Pump how much insulin to take. The DexCom must be calibrated at least twice daily with a whole blood finger stick. Also, it's not too accurate on day 1, and can be wholly inaccurate after it's listed 7 day effectiveness range. But it's that keyword that this project is trying to help with. Decide. I have to decide, calculate, guess, determine. That's hard for me as an adult. It's near-impossible for an 8 year old. Or an 80-year old. Computers are good at calculating, maybe it can do this tedious work for us.

It's two pumps, one with insulin, one with glucagon, and an iPhone controlling them both

The thing is, with Type 1 Diabetes there's dozens of other factors to consider. How much did I eat? What did I eat? Am I sick? Does my stomach work? Do I digest slowly? Quickly? Do I have any acetaminophen in my system? Am I going jogging afterwards? Is this insulin going bad? Is the insulin pump's cannula bent, and dozens (I'm sure I could come up with a hundred) of other factors. Read Lane Desborough's paper (PPT as a PDF) on "Applying STPA (System Theoretic Process Analysis) to the Artificial Pancreas for People with Type 1 Diabetes" for a taste of what needs to be done.

image

The brilliance of this system - this "bionic" pancreas - is this...and these are MY words, no one else's:

The two pump bionic pancreas system gives you rather a LOT of insulin if needed (as if it's descending a plane quickly and dramatically) then it pulls you up nicely with a bit of glucagon (as if the pilot screamed pull up as he noticed the altitude change).

It's the addition of the glucagon to get you out of lows that is interesting. Typically Diabetics have a big syringe of glucagon in the fridge for emergencies. If you're super low - dangerously loopy - your partner can get you out of it with a big bolus of glucagon. But if you put glucagon in an insulin pump, you can deliver tiny amounts and now you are are moving the graph in two directions.

Think I'm kidding about the "pull up, pull up" analogy?

Here's a snippet of a graph from page 15 of one of the Appendices (PDF). Note around 19:00, the blue bar going down, that's a lot of insulin. Then the BG numbers come down, FAST. Note the black triangle at around 20:20. That's "pull up, pull up" and a bolus of glucagon in red. And more, and more, in fact, there are many glucagon boluses keeping the numbers up, presumably happening while the subject sleeps. Then around 07:00 the numbers rise, presumably from the Dawn Effect, and another automatic insulin bolus (an overcorrection) and then more glucagon. It's a wonderfully controlled roller-coaster. This isn't using the word roller-coaster as a pejorative - that is the life I lead as a diabetic.

Pull up, pull up!

It's also not mentioned in the press that this system uses lot more insulin than I do today. A lot more, due to it's "dose and correct" algorithm's design.

"Among the other 11 patients, the mean total daily dose of insulin was 50% higher during the bionic-pancreas period than during the control period (P=0.001);"

I use about 40U a day, total. So we're looking at me using perhaps 60U a day with this system. As with any drug, though, insulin use has its side effects. It can cause fat deposits, scarring at injection sites, and we can become resistant to it. It'd be interesting to think about a study where someone's on 50% more insulin for years. Would that cause increases in any of these side effects? I don't know, but it's an interesting question. Should a closed system also optimize for doing its job with the minimum possible insulin. I optimize for that today, on my own, hoping that it will make a difference in the long run.

But, glucagon isn't pump friendly as it is today. An unfortunate note that isn't covered in any of the press is that they are having to replace the glucagon every day. Juxtapose that with what I do currently with insulin. I keep my pump filled and swap out its contents and cannula (insertion site) every 4-7 days. Insulin itself can surface ~28 days at room temperature although it's most often refrigerated. Changing one of the pumps daily is a bummer, as they point out.

"...the poor stability of currently available glucagon formations necessitated daily replacement of the glucagon in the pump with freshly reconstituted material."

It's early, people. It's not integrated, it's a proof of concept. It's impressive, to be sure, but Rube-Goldbergian in its hardware implementation. Two pumps, a Dexcom G4 inside a docking station, receiving BG data over RF from the transmitter, then the Dexcom wirelessly talking to an iPhone within another docking station.

"Since a single device that integrates all the components of a bionic pancreas is not yet available, we had to rely on wireless connectivity to the insulin and glucagon pumps, which was not completely reliable."

I'm not trying undermine, undercut, or minimize the work, it's super promising, but medical journalists need to seriously understand what's really going on here.

Fast forward a few years, and there will very likely be an bi-hormonal "double" pump with both (more stable) glucagon and insulin that combines with a continuous glucose meter that provides the average Type 1 Diabetic with a reasonable solution to keep their numbers out of imminent danger. Great for kids, a relief for many.

But, just as pumps are today, it'll be USD$5000 to USD$10000. It will require insurance, and equipment, it'll require testing and software, it'll require training, and it won't be - it can't be - perfect. This is a move forward, but it's not a cure. Accept it for what it is, a step in the right direction.

Do I want it? Totally. But, journalists and families of diabetics, let's not overreact or get too ahead of ourselves. Does this mean I should eat crap and the machine will take care of it? No. I'm healthy today because I care to be. I work at it. Every day. As I'm typing now, I know my numbers, my trend-line, and my goal: stay alive another day.

Read my article from 2001 - yes, that's 13 years ago - called One Guy, an Insulin Pump, and 8 PDAs:

"I imagine a world of true digital convergence -- assuming that I won't be cured of diabetes by some biological means in my lifetime -- an implanted pump and glucose sensor, an advanced artificial pancreas. A closed system for diabetics that automatically senses sugar levels and delivers insulin has been the diabetics' holy grail for years. But with the advent of wireless technology and the Internet, my already optimistic vision has brightened. If I had an implanted device with wireless capabilities, it could be in constant contact with my doctor. If the pump failed, it could simultaneously alert me, my doctor, and the local emergency room, downloading my health history in preparation for my visit. If it was running low on insulin, the pump could report its status to my insurance company, and I'd have new insulin delivered to my doorstep the next day. But that's not enough. With Bluetooth coming, why couldn't my [PDA] monitor my newly implanted smart-pump?"

Go an educate yourselves about the "We Are Not Waiting" movement. Hear how Scott Leibrand has a "DIY Artificial Pancreas" that's lowered his girlfriends average blood sugar dramatically using only an DexCom G4 and smart algorithms. You can make a change today, at your own risk, of course.

Read about the The DiabetesMine D-Data ExChange and how non-profit Tidepool is creating open source software and systems to make innovation happen now, rather than waiting for it. Get the code, join the conversation. Exercise, eat better, read, work. You can hack your Diabetes today. #WeAreNotWaiting

Related Links and Writings


Sponsor: Thanks to friends at RayGun.io. I use their product and LOVE IT. Get notified of your software’s bugs as they happen! Raygun.io has error tracking solutions for every major programming language and platform - Start a free trial in under a minute!



© 2014 Scott Hanselman. All rights reserved.
     

Catch up on all the videos from DotNetConf Spring 2014

$
0
0

Did you miss out on DotNetConf when it streamed LIVE just a few weeks ago? Don't you worry, it's all recorded and online for you to stream or download!

We are happy happy to announce that we’re planning another .NET Conf to be happening in a few months, so keep tuned thru the .NET Conf Twitter account (Twitter: @dotnetconf), or checking our .NET Conf site in the future: http://www.dotnetconf.net. Big thanks to Javier Lozano for all his work with the site and conference coordination.

Everything was recorded is is up here: http://channel9.msdn.com/Events/dotnetConf/2014

.NET Conf summary and recorded content

The .NET Conf 2014 was a two-day virtual event (June 25th-26th) focused on .NET technologies, covering application development for the desktop, mobile and cloud/server. It is hosted by the MVP community and Microsoft, bringing top speakers and great topics straight to your PC.

Below you can review all the delivered sessions and reach to their related recorded content.

Day 1 – .NET core and .NET in client/devices

clip_image001State of .NET (Keynote)- Jay Schmelzer
Opening and overview of current .NET state and .NET on the Client side.

clip_image002

New Innovations in .NET Runtime

Andrew Pardoe

We're changing the way we execute code in the .NET Runtime. Hear about .NET Native, RyuJIT, and modern server strategy.

clip_image003

The Future of C#

Kevin Pilch-Bisson, Mads Torgersen

The Microsoft Managed Languages team has been focused on rebuilding the VB and C# compilers and editing experiences as part of Project "Roslyn". This effort has paved the way for these languages to continue evolving for many years to come. However, what does that future actually look like? We explore the editing experience, how public APIs may be used to write language-level extensions, as well as new language features.

clip_image004

Building Universal Windows Apps with XAML and C# in Visual Studio

Larry Lieberman

In April at Build 2014, Microsoft unveiled universal Windows apps, a new approach that enables developers to maximize their ability to deliver outstanding application experiences across Windows PCs, laptops, tablets, and Windows Phones. This means it's now easier than ever to create apps that share most of their code. Code can be shared using the new shared app templates, as well as by creating Portable class libraries. This session will walk through the development of a shared app and will discuss where it still makes sense to implement platform specific features.

clip_image005

.NET Native Deep Dive

Andrew Pardoe

Look inside the .NET Native compiler toolchain to understand how we enable .NET Windows Store apps to compile to self-contained native apps.

clip_image006

Fun with .NET - Windows Phone, LEGO Mindstorms, and Azure

Dan Fernandez

In this demo-packed session, we'll walk through building your first .NET controlled LEGO Mindstorm using Windows Phone. You'll learn about the LEGO EV3 API, how to control motors and read sensor data, and how to batch commands to the robot. Once we have a working, drivable robot, we'll switch to cloud-enabling the robot so that you can drive the robot remotely via a Web site hosted in Microsoft Azure.

clip_image007

Kinect for Windows

Ben Lower

We will take a look at what's new in Kinect for Windows v2 including the improvements in core sources like Infrared and Depth data.  We will also show how the new Kinect Studio enables Kinect development even while travelling via plane, train, or automobile (note: you should not dev and drive) and how Kinect Interactions can be used to add a new input modality to Windows Store applications.

clip_image008

What's New in XAML Platform & Tooling

Tim Heuer

Tim will do a lap around what is new to the Windows Phone 8.1 platform as well as a tour of the new XAML tooling in Visual Studio Update 2 for developers and designers.

`clip_image009

Developing Native iOS, Android, and Windows Apps with Xamarin

James Montemagmo (Xamarin)

Mobile continues to expand and evolve at a rapid pace. Users expect great native experiences in the palm of their hands on each and every platform. A major hurdle for developers today is that each platform has its own programming language and tools to learn and maintain. Even if you tackle the burden of learning Objective-C and Java you will still have to manage multiple code bases, which can be a nightmare for any development team large or small. It doesn't have to be this way as you can create Android, iOS, Windows Phone, and Windows Store apps leveraging the .NET framework and everything you love about C#.

clip_image010

What's new for WPF Developers

Dmitry Lyalin

Windows Presentation Foundation (WPF) enables .NET developers to build rich and powerful Windows desktop applications using managed languages and XAML. In this session we'll cover all the latest innovations available to WPF developers such as improvements coming from .NET, integration points with the latest cloud technologies and enhanced tooling & profiling capabilities in Visual Studio.

Day 2 – .NET in server and cloud

clip_image011

ASP.NET Today and Tomorrow (Keynote)

Scott Hunter

It's been an amazing decade for ASP.NET. Today in 2014, most all of ASP.NET is open source, developed in the open, and accepting community contributions. One ASP.NET and VS 2013 added some amazing new tooling enhancements for HTML5, CSS3 and JavaScript. VS2013.3 is coming soon with even more innovations as we march towards ASP.NET vNext. Join Scott Hunter as he shows you how it works together. What's available on ASP.NET today, and where is ASP.NET headed tomorrow, and what do you need to know to best support the code you've written and the code you will write. We'll also talk about the rise of the cloud and how it changes the way we write large systems. All this, plus a lot of open source, and deploying to Azure.

clip_image012

ASP.NET Web Forms

Scott Hunter, Pranav Rastogi

Do you want to learn techniques to enhance your Web Forms development experience. See how you can improve your code's maintainability and testability and your site's performance. Leverage new features in ASP.NET Web Forms 4.5 to reduce the amount of UI "yuck" code and focus on your application's logic. We will look at some of the improvements to Web Forms such as support for EF 6, new Scaffolders and more features which you might not have heard of. We will see how to leverage all of the latest tools in Visual Studio like Browser Link and Web Essentials to make their coding experience simpler, shorter, and more enjoyable. 

clip_image013

ASP.NET MVC 6 (now with integrated Web API!)

Daniel Roth

ASP.NET MVC and ASP.NET Web API in ASP.NET vNext are becoming one singular framework: ASP.NET MVC 6. Join Daniel Roth as he shows how to create great ASP.NET web apps that serve both pages and services. First we'll see how to build OData v4 compliant services using ASP.NET Web API 2.2 and the new attribute routing features available in ASP.NET MVC 5.2. Then we'll take a look at how ASP.NET MVC and Web API are being combined into a single framework, ASP.NET MVC 6, for handling all of your Web UI and services. We'll learn how to use ASP.NET MVC and Web APIs in ASP.NET vNext to support connected applications for browsers, Windows Phone, Windows Store and more!

clip_image014

Entity Framework (v6 and v7 preview)

Rowan Miller

Entity Framework is Microsoft's recommended data access technology for new applications in .NET. We'll explore how the current release of Entity Framework can be used to build applications. We'll also look at an early preview of EF7, a modern, lighter weight, and composable version of Entity Framework (EF) that can be used on a variety of platforms, including ASP.NET vNext, Windows Phone and Windows Store. This new version will also support targeting non-relational data stores.

clip_image015

Taking Your ASP.NET Apps to the Cloud with Microsoft Azure Web Sites

Brady Gaster

Web developers are seeing huge boosts in their productivity building Web Applications with ASP.NET, with so many huge improvements to Visual Studio focused on the problems web developers solve each day. We've also made some significant improvements in Microsoft Azure for web developers by concentrating on providing the community the best cloud in which to host ASP.NET web apps. Features like Auto-scaling and Traffic Management provide high-performance, internationally-distributed web hosting scenarios. We've made it easier than ever to add background processing by adding Azure WebJobs as an option for web developers who need to add a middle tier. Along with staging and production deployment slots, and a rich SDK to enable service automation - a feature many software-as-a-service apps can use to automate their provisioning and deployment experiences - there's no better place than Microsoft Azure Web Sites to host your ASP.NET apps.

clip_image016

ASP.NET Publishing Explained

Sayed Hashimi

The Visual Studio publishing experience for ASP.NET projects has been refined over the past few years. In this talk we will go into detail covering all the different techniques to publish your asp.net apps. We will start in Visual Studio, and quickly move to the command line and continuous integration servers. Sayed will you how you can improve your publish process to target multiple environments and how to automate publishing from a CI server. We will also take a look at some of the unique publish workflows that Azure Web Sites supports.

clip_image017

ASP.NET Identity

Pranav Rastogi

ASP.NET Identity is a totally rewritten framework that brings the ASP.NET membership system into the modern era. ASP.NET Identity makes it easier to integrate different authentication systems such as local username, password as well as social logins such as Facebook, Twitter etc. It also gives you greater control over persisting data to your backend technology of choice. ASP.NET Identity is a game changer by bringing in more modern authentication systems such as Two-Factor Authentication. You can use ASP.NET Identity to secure Web Apps as well as Web APIs.

clip_image018

Dependency Injection and Testability in .NET

Mani Subramanian, Francis Cheung

Testability is more important than ever. With short ship cycles and the desire for continuous delivery, it is critical to quickly know if a modification has destabilized your code base. This session will enable you to use a dependency injection container of your choice to create testable code. We will examine tightly coupled code and what problems it causes and how DI can be used to avoid these problems. The Unity DI container will be used as the medium to understand the concepts.

clip_image019

SignalR

Damian Edwards

SignalR is one of the latest additions to the ASP.NET web stack. It provides real-time HTTP support for your web applications, but the good news is that SignalR is useful outside of a web browser, too. With a client API that's virtually identical in both the JavaScript and native .NET client implementations, developers only need to learn the SignalR abstraction itself to be able to write cross-platform real-time applications. This session will walk through the process of adding real-time functionality to your Windows 8 and Windows Phone 8 apps. We'll also take a look at the scale-out providers and OWIN hosting capabilities available in the latest release of SignalR.

clip_image020

ASP.NET vNext 101

Damian Edwards, David Fowler

ASP.NET vNext is a lean and composable framework for building web and cloud applications. ASP.NET vNext is fully open source and available on GitHub. ASP.NET vNext is currently in preview, and in this talk Fowler and Edwards will put it all into Context. vNext apps can use a cloud-optimized subset of the .NET framework. This subset of the framework is about 11 megabytes in size compared to 200 megabytes for the full framework, and is composed of a collection of NuGet packages. What does that mean for compatibility? When would you choose vNext and when would you not? You don't have to use Visual Studio to develop ASP.NET vNext applications. You can develop and run vNext on platforms that Visual Studio doesn't run on. But Visual Studio provides the best development experience, and we'll cover ASP.NET vNext both inside and outside the IDE.

We encourage you to share this content with your colleagues and friends, and remember that .NET Conf and all its content is free!


Sponsor: Thanks to friends at RayGun.io. I use their product and LOVE IT. Get notified of your software’s bugs as they happen! Raygun.io has error tracking solutions for every major programming language and platform - Start a free trial in under a minute!



© 2014 Scott Hanselman. All rights reserved.
     

Review: Logitech ConferenceCam CC3000e - A fantastic pan tilt zoom camera and speaker for remote workers

$
0
0

cc3000eI'm forever looking for tools that can make me a more effective remote worker. I'm still working remotely from Portland, Oregon for folks in Redmond, Washington.

You might think that a nice standard HD webcam is enough to talk to your remote office, but I still maintain that a truly great webcam for the remote work is one that:

  • Has a wide field of view > 100 degrees
  • Has an 5x - 10x optical zoom to look at whiteboards
  • Has motorized pan-tilt-zoom

Two years later I'm still using (and happy with) the Logitech BCC950. I'm so happy with it that I wrote and maintain a cloud server to remotely control the PTZ (pan tilt zoom function) of the camera. I wrote all that up earlier on this blog in Cloud-Controlled Remote Pan Tilt Zoom Camera API for a Logitech BCC950 Camera with Azure and SignalR.

Fast-forward to June of 2014 and Logitech offered to loan me (I'm sending it back this week) one of their new Logitech ConferenceCam C3000e conferencing systems. Yes, that's a mouthful.

To be clear, the BCC950 is a fantastic value. It's usually <$200, has motorized PTZ, a remote control, (also works my software, natch), doesn't require drivers with Windows (a great plus), is a REALLY REALLY good speakerphone for Skype or Lync calls, it's camera is 1080p, the speakerphone shows up as a standard audio device, and has a removable "stalk" so you can control how tall the camera is.

BUT. The BCC950's zoom function is digital which sucks for trying to see remote whiteboards, and it's field of view is just OK.

Now, enter the CC3000e, a top of the line system for conference room. What do I get for $1000? Is it worth 4x the BCC950? Yes, if you have the grand and you're on video calls all day. It's an AMAZING camera and it's worth it. I don't want to send it back.

Logitech ConferenceCam CC3000e - What do you get?

The unboxing is epic, not unlike an iPhone, except with more cardboard. It's a little overwhelming as there are a lot of parts, but it's all numbered and very easy to setup. My first impression was "why do I need all these pieces" as I'm used to the all-in-one-piece BCC950 but then I remembered that the CC3000e is actually meant for business conference rooms, not random remote workers in a home office like me. Still, later I appreciated the modularity as I ended up mounting the camera on top of an extra TV I had, while moving the speaker module under my monitor nearer my desk.

You get the camera, the speaker/audio base, a 'hockey puck' that routes all the cables, and a remote control.

The Good

You've seen what a regular webcam looks like. Two heads and some shoulders.

Skyping with a regular camera

Believe it or not, in my experience it's hard to get a sense of a person from just their disembodied head. Who knew?

I'm regularly Skyping/Lyncing into an open space in Redmond where my co-workers move around friendly, use the whiteboard, stand around, and generally enjoy their freedom of motion. If I've got a narrow 70 degree or less field of view with a fixed location, I can't get a feel for what's going on. From their perspective, none of them really know what my space looks like. I can't pace around, use a whiteboard, or interact with them in any "more than just a head" way.

Enter a real PTZ camera with real optics and a wide field of view. You really get a sense of where I am in my office, and that I need to suck it in before taking screenshots.

The CC3000e has an amazing wide field of view

Now, move the camera around.

The CC3000e has a remote control to turn it

Here's me trying to collaborate with my remote partners over some projects. See how painful that is? EVERY DAY I'm talking to half-heads with tiny cameras.

My co-worker's chin

Part of my co-workers' faces

Half my boss's head

These calls weren't staged for this blog post, people. FML. These are real meetings, and a real one-on-one with the half a forehead that is my boss.

Now, yes, I admit that you'll not ALWAYS want to see my torso when talking. Easy, I turn, and face the camera and zoom in a smidge and we've got a great 1:1 normal disembodied head conversation happening.

A bright HD Skype

But when you really want to connect with someone, back up a bit. Get a sense of their space.

A wide field of view shows you more context

And if you're in a conference room, darn it, mount that sucker on the far wall.

A wide field of view shows you the whole room

While only the me-sides of these calls used the CC3000e (as I'm the dude with the camera) I've used the other screenshots of actual calls I've had to show you the difference between clear optics and a wide field of view, vs. a laptop's sad little $4 web cam. You can tell who has a nice camera. Let me tell you, this camera is tight.

The CC3000e has a lot of great mounting options that come included with the kit. I was able to get it mounted on top of my TV like a Kinect, using the included brackets, in about 5 minutes. You can also mount it flat against the wall, which could be great for tight conference room situations.

1photo 2

The camera is impressive, and politely looks away when it's not in use. A nice privacy touch, I thought.

photo 4

The optical zoom is fantastic. You'll have no trouble zooming in on people or whiteboards.

Here's zoomed out.

Zoomed out

Here's zoomed in. No joke, I just zoomed in with the remote and made a face. It's crazy and it's clear.

Zoomed in

The speakerphone base is impressively sturdy with an awesome Tron light-ring that is blue when you're on a call, and red when you're either on hold (or you're the MCP.)

The screen will also show you the name/number of the current caller.

image

A nice bonus, you can pair the base with your cell phone using Bluetooth and now you've got a great speaker and speakerphone. This meant I could take all calls (mobile, Lync, Skype) using one speakerphone.

The Weird

There have been a few weird quirks with the CC3000e. For example - right this moment in fact - the camera on indicator light is flashing blue, but no app is using the camera. It's as if it got stuck after a call. Another is that the microphone quality (this is subjective, of course) for people who hear me on the remote side doesn't seem as deep and resonant as with the BCC950. Now, no conference phone will ever sound as nice as a headset, but the audio to my ear and my co-worker's ear is just off when compared to what we're used to. Also, a few times the remote control just stopped working for a while.

On the software side, I've personally found the Logitech Lync "Far End Control" PTZ software to be unreliable. Sometimes it works great all day, other days it won't run. I suspect it's having an isue communicating with the hardware. It's possible, given the weird light thing combined with this PTZ issue that I have a bad/sick review model. Now, here's the Far End Control Application's PDF Guide. It's supposed to "just work' of course. You and the person you're calling each run a piece of software that creates a tunnel over Lync and allows each of you to control the other's PTZ motor. This is a different solution than my PTZ system, as theirs uses Lync itself to transmit PTZ instructions while mine requires a cloud service.

Fortunately, my PTZ System *also* works with the ConferenceCam CC3300e. I just tested it, and you'll simply have to change the name of the device in your *.config file.

<appSettings>
<!-- <add key="DeviceName" value="BCC950 ConferenceCam"/> -->
<add key="DeviceName" value="ConferenceCam CC3000e Camera"/>
</appSettings>

To be clear, the folks at Logitech have told me that they can update the firmware and adjust and improve all aspects of the system. In fact, I flashed it with firmware from May 12th before I started using it. So, it's very possible that these are just first-version quirks that will get worked out with a software update. None of these issues have prevented my use of the system. I've also spoken with the developer on the Far End Control system and they are actively improving it, so I've got high hopes.

This is a truly killer system for a conference room or remote worker (or both, if I'm lucky and have budget.)

  • Absolutely amazing optical zoom
  • Top of the line optics
  • Excellent wide field of view
  • The PTZ camera turns a full 180 degrees
  • Programmable "home" location
  • Can act as a bluetooth speaker/speakerphone for your cell phone
  • The camera turns away from youwhen it's off. Nice reminder of your privacy.

The optics alone would make my experience as a remote worker much better. I am boxing it up and I am going to miss this camera. Aside from a few software quirks, the hardware is top notch and I'm going to be saving up for this camera.

You can buy the Logitech CC3000e from Logitech directly or from some shady folks at Amazon.

Related Links


Sponsor: Thanks to friends at RayGun.io. I use their product and LOVE IT. Get notified of your software’s bugs as they happen! Raygun.io has error tracking solutions for every major programming language and platform - Start a free trial in under a minute!

© 2014 Scott Hanselman. All rights reserved.
     

How to enter and use Emoji on Windows 8.1

$
0
0

I have an iPhone 5s and every once in a while my wife and would be texting and I would send her a and she would be like "why you sending me a square?" Then later she got a Nokia 1020 and then we could send each other Emoji's back and forth 😄😃😀😊☺😉😍.

Today you can use Emoji pretty much anywhere, be it mobile or on the web with most modern browsers. Windows 8 has an on-screen keyboard that you can use to type Emoji, even if you use a regular keyboard and mouse.

Perhaps you think Emoji are silly? Did you know that Twitter actually makes sure Emoji work in all browsers by swapping them out for their own Twitter-custom images? The people LOVE them some Emoji.

Right click in the Taskbar and make sure you have the Touch Keyboard checked:

Windows 8.1 Emoji Touch Keyboard

You can see it there in the Taskbar. Click it.

Windows 8.1 Emoji Touch Keyboard

Now, click the Smiley.

Windows 8.1 Emoji Touch Keyboard

It's important to note the Arrows on the left there, as well as the categories on the bottom. ALL the Emoji are there.

Windows 8.1 Emoji Touch Keyboard

Even U+1F4A9 PILE OF POO. So that's 💩

Also noticed that Emoji are in COLOR in Internet Explorer. Here is the GetEmoji site with Chrome on the left and IE11 on the right. I've zoomed in on IE to show that the font scales.

Look at all the Emoji

There's an amazing article by Ralf Herrmann on Color Emoji in Windows 8.1—The Future of Color Fonts? that I recommend you read immediately. I've taken part of his image below to show one of the main points of his articles. The Emoji in Windows 8.1 are inside of the Segoe UI Emoji font, and are NOT PNGs (as on other systems) which allows them to scale. Instead, they are layered and each layer has a color. So cool.

winemoji

I'm going to hack around and see if I can change the color of each individual layers. "Diversified Emoji" is a big topic right now, as not everyone wants a yellow LEGO head. There's lots of quasi-Emoji chat apps on all phones with afrocentric or other kinds of emojis. I wonder if a layering system like this would be way to create infinitely diverse emoji?

NOTE: I have NO idea what I'm talking about here, just thinking out loud.

It doesn't seem like Window's built in CharMap.exe supports newer Unicode 7 (?) but BabelMap is a fantastic Extended Character Map that will let you explore all of your choices in a font like Segoe UI Emoji.

BabelMap

Now I need to think about how unprofessional it will be to include Emoji in all my work email. And, more importantly, if it'll all just turn into a "J" in Outlook. ;)


Sponsor: Thanks to friends at RayGun.io. I use their product and LOVE IT. Get notified of your software’s bugs as they happen! Raygun.io has error tracking solutions for every major programming language and platform - Start a free trial in under a minute!

© 2014 Scott Hanselman. All rights reserved.
     

Hanselman's Newsletter of Wonderful Things: June 2nd, 2014

$
0
0

I have a "whenever I get around to doing it" Newsletter of Wonderful Things. Why a newsletter? I dunno. It seems more personal somehow. Fight me.

You can view all the previous newsletters here. You can sign up here to the Newsletter of Wonderful Thingsor just wait and get them some weeks later on the blog, which hopefully you have subscribed to. If you're signed up via email, you'll get all the goodness FIRST. I also encourage you to subscribe to my blog. You can also have all my blog posts delivered via email if you like.

Here's the Newsletter from June. Subscribers get the new one first. ;)

Again, this the newsletter from June. There will be a new issue, very soon.


Sponsor: Thanks to friends at RayGun.io. I use their product and LOVE IT. Get notified of your software’s bugs as they happen! Raygun.io has error tracking solutions for every major programming language and platform - Start a free trial in under a minute!



© 2014 Scott Hanselman. All rights reserved.
     

Personal Productivity: Business vs. busyness vs. laziness

$
0
0

image

There's an ancient cliché that drives a lot of my thinking about personal productivity. "Excessive busy-ness is a common form of laziness."

Busy-ness in the Tibetan tradition is considered the most extreme form of laziness. Because when you are busy you can turn your brain off. You’re on the treadmill. The only  intelligence comes in the morning when you make your To Do list and you get rid of all the possible space that could happen in your day. - Elephant Journal, 2008

The Tibetan term lelo, as I understand it, begins to describe this kind of laziness.

Kausidya (Sanskrit; Tibetan Wylie: le lo) is a Buddhist term translated as "laziness" or "spiritual sloth".

Alan Wallace explains that kausidya (lelo in Tibetan) refers to a very specific type of laziness, that is concerned only with virtuous activity. Wallace explains from Wikipedia:

[...] lelo in Tibetan, is often translated as ‘laziness,’ but it is much more specific. If a person is working sixteen hours a day, hellbent on earning a whole lot of money with absolutely no concern for virtue, from a Buddhist perspective you could say that person is subject to lelo. A workaholic is clearly not lazy, but such a person is seen as lelo in the sense of being completely lethargic and slothful with regard to the cultivation of virtue and purification of the mind. Our translation of this term is ‘spiritual sloth,’ which we have taken from the Christian tradition, where it is very comparable to the Buddhist notion.

I'm not saying you're lazy so don't get mad quite yet. I'm saying that using "I'm too busy" as an excuse or a reason to not do something important to you, then you might want to give your situation a closer look. I'm saying that sometimes we are busy with work, but not the kind of work we should be busy with.

Sakyong Mipham states: "Speediness is laziness when we use it as a way to avoid working with our minds."

Of course, there's busy people who are literally on fire and being chased by ninjas, I'll give them a pass. But when someone says "I'm too busy" perhaps they are letting you know they are too important to talk to you, or they are just using it as an excuse to not engage. Often I've said in the past that "I'm busy" when I really mean "I'm not really that into your idea to take the time to think deeply about it."

So when we say "being busy is a form of being lazy" we're saying think about what's important, and think about the work you're doing. Is it moving the ball forward? Is it moving YOUR BALL forward. The Ball that you care about?

I have an hour set aside once a week that's for a meeting. The meeting is with myself. No one else comes to this meeting but me. I think about what I'm doing, where I'm going, and what I need to be working on. I use this meeting to think about the business and busyness of my previous week. I think about what busy work I did that was a waste of time, and try to setup myself up for success in the coming week.

My parents and brother are convinced that I'm too busy to hang out or have lunch. I constantly hear "Well, we didn't want to bother you." I'm never too busy for them. Time can be made. It's amazing how quickly a day of meetings (or a half-day) can be cancelled or moved. Days can be cleared and time can be made.

It's easy to get caught up in the chaos of business. It's fun to play Tetris with your Outlook calendar. It's satisfying to pack those productive meetings in and feel important and urgently needed. It's cathartic to delete email and think that getting rid of that email is moving my life forward, but often it's not. Often I'm just on a treadmill, running to keep up. I know this treadmill and my inertia keeps me going.

The hard work is to consciously step off the treadmill, step away, turn around and look at it. What can be removed? What can be refined? In what ways have we taught our bosses or co-workers how to treat us and our time?

I was in Egypt once and the hosts wanted to take me to the Sphinx, but I didn't want to miss a weekend with my sons. They may have thought me rude, but it was about consciously choosing one priority over another. I knew my time and my priorities and made a conscious choice on how I was going to spend it.

In what way are you buying into the idea of being always busy? What are you doing to find balance?


Sponsor: Thanks to friends at RayGun.io. I use their product and LOVE IT. Get notified of your software’s bugs as they happen! Raygun.io has error tracking solutions for every major programming language and platform - Start a free trial in under a minute!



© 2014 Scott Hanselman. All rights reserved.
     

Parenting Tip: Star Wars Audiobooks, Family, and narrator Marc Thompson

$
0
0

The wife and the boys and I are often in the car for 30 minutes or more, heading off to various activities or events. We live pretty far outside of town, and when we need to head into the city, it's almost an hour. While we have lots of music, discussions, and what not, the boys aren't quite ready to listen to the unfiltered news.

 

BetrayalcoverMy buddy Dennis Petersen from LEGO recommended Star Wars audiobooks as a great way to pass the time as a family. I was a little suspicious, as I've listened to a lot of Audible audiobooks and it's been hit or miss. It all comes down to having a good narrator. Also, has the producer of the audio book decided that this would be a voice actor just reading the book or is this a radio production with music, voices, and sound effects.

The Star Wars Random House audiobooks with narrator Marc Thompson are AMAZING. My family and I have listened to nearly 50 hours of them and we still have a dozen and a half to go. These audiobooks strike a great balance between a dry reading (bad) and a the sounds of a movie (over the top). Marc Thompson does ALL the voices himself, and they are spot on. From Jabba to Boba Fett, C3PO to Darth Vader, we are consistently blown away by the quality of the voices. It's not distracting at all and it makes it much easier to follow the story.

You can buy any of the Star Wars audiobooks in Audible format at Amazon or as Audio CDs. You can also get them at iTunes. I recommend starting with the Star Wars: Legacy of the Force Series. The first book is #1 Betrayal. This starts 40 years the battle of Yavin when the first Death Star was destroyed. Leia and Han are married, they have two kids, and there's bunch of cool stuff going on.

Now at this point in the post, the non-Star Wars aficionados amongst you may have already checked out. But let me tell you this. My wife is NOT a Star Wars person. She couldn't care less. She slept through the movies. BUT, she loves these books. We'll get home from somewhere and she'll insist we sit in the driveway and finish a chapter. It's amazing.

The whole family has been having fun with these. It's much better (IMHO) than giving the kids an iPad or a DVD player on a long trip, and it's got us pausing the book and discussion galactic affairs with the 6 year old (who has turned out to be quite the the strategist).

Check out this YouTube video for a sense of the quality of narator Marc Thompson's amazing range. We've gotten to know him very well as a family, we think, while listening to these books.

Related Links


Sponsor: Thanks to friends at RayGun.io. I use their product and LOVE IT. Get notified of your software’s bugs as they happen! Raygun.io has error tracking solutions for every major programming language and platform - Start a free trial in under a minute!



© 2014 Scott Hanselman. All rights reserved.
     

How to add a keyboard and write in YOUR language in Windows for free

$
0
0

A lot of people don't realize that Windows supports a LOT of different languages out of the box. After Windows 7 and now with Windows 8 and 8.1, you can add keyboards to dozens of languages without buying or downloading anything. You have non-English keyboards now, today! Even if you just have English Windows out of the box, you can add a Japanese Input Method Editor (IME - a way to enter kanji), or any of a dozen other methods for entering non-English text on an English Keyboard. This is great for writing family back home, letting your teen write reports for Chinese class in Word, and more.

If you know someone who could benefit from knowing this, tell them! I met a woman from Ethiopia who spoke Amharic recently and somehow we got to talking about the unique syllabary (an alphabet of symbols) that one uses to write Amharic/Ge'ez using Fidel (their lettering system). She had used Windows for 10+ years and had NO idea she could write emails, make web pages, and write Word documents in her native language FOR FREE. She had this feature in Windows and never turned it on.

In Windows 8 or 8.1, press the Windows key and type "Add language."

Screenshot (29)

Select one of these options (doesn't really matter which) and then select the language you want to add. There's a lot.

Look how many languages are available!

I'm selecting Amharic. Note that I could also select Tigrinya as well.

Tigrinya

I'm just adding the Keyboard so I can write letters, but many languages also have a Language Pack where I could change the look and feel of Windows itself. This could make Windows more comfortable for the grandparents, so experiment with this and their settings.

Amharic IME

An Input Method Editor lets you type English/Latin letters and output non-Latin characters. For example, I'll L-A-space, and get ላ or H-I-space and get ሂ.

Typically as you type a list of options appears and is narrowed down by your choices. Sometimes these are phonetic (they sound like the language) and sometimes they are just letter combos you'll learn.

 

The Ethiopic IME

The results are awesome though, and it makes Windows just that much more usable for folks who regularly need to switch between languages.

Scott Hanselman

Use the Hotkey "Windows Key + Space" to toggle keyboards, or just press the keyboard that appears in your Taskbar.

Switching languages

Now, go tell your family and setup alternate languages on their PC! I can speak from experience that a great way to make a computer more accessible for a relative (and get a smile) is adding support for their native language(s).



© 2014 Scott Hanselman. All rights reserved.
     

NuGet Package of the Week: MarkdownLog makes log files much prettier

$
0
0

While I'm not 100% gaga over Markdown as I know many of you are, I definitely appreciate it's usefulness and it's clarity. Some folks would say I shouldn't rest until every binary document on my hard drive has been converted to Markdown. I say, nay nay. That said, I totally dig MarkdownPad and you should use it every day. It's lovely.

If you don't want to install anything, check out http://dillinger.io and quickly edit some Markdown in the browser.

image

But, I digress.

Note: Be sure to check out all the NuGet packages of the week! There's more!

The general idea behind Markdown is that HTML is way too complex for 90% of what you need, so rather than <ul> and <li> and all that, why not just express bullets with asterisks? We can all get behind that. There are many other simple Markdown syntaxes that you can learn in a few minutes. Once you've created some Markdown, you can easily generate PDFs, HTML, Word Documents, whatever you like.

Recently I stumbled upon Stuart Wheelwright's article on Using Markdown for Effective Logging over at CodeProject. Here's the first image borrowed from his excellent article where he clearly shows why Markdown is simpler than HTML:

html-vs-md

Stuart has taken Markdown and created a wonderful little library called MarkdownLog. It's a brilliant little idea that one of us should have come up with first! Kudos to Stuart. ;)

[MarkdownLog] is designed to make it trivial to produce Markdown formatted text from an application's data structures. Using just one line of code, a collection of .NET objects can be output as a table or list. And, because the output is Markdown, it can later be converted to HTML for publishing, if needed.

Even better, MarkdownLog is a Portable Class Library (PCL) and can be used with any .NET platform, including iOS with Xamarin. In fact, it's an iPhone app written with Xamarin that compelled Stuart to write MarkdownLog.

Here's one of his first examples. This C# code:

var myStrings = new[] { "John", "Paul", "Ringo", "George" };
Console.Write(myStrings.ToMarkdownBulletedList());

Gives you this simple Markdown.

   * John
* Paul
* Ringo
* George

At this point, you are likely unimpressed. But wait! There's more! There's a whole series of nice extension methods that make it easy to create templates from objects of any shape. Here's another example of his:

var data = new[]
{
new{Name = "Meryl Streep", Nominations = 18, Awards=3},
new{Name = "Katharine Hepburn", Nominations = 12, Awards=4},
new{Name = "Jack Nicholson", Nominations = 12, Awards=3}
};

Console.Write(data.ToMarkdownTable());

This gives you a Markdown table, of course. This looks nothing like an HTML table, but remember, Markdown is source code that can be translated into other formats like HTML and PDF.

 Name              | Nominations | Awards
----------------- | -----------:| ------:
Meryl Streep | 18 | 3
Katharine Hepburn | 12 | 4
Jack Nicholson | 12 | 3

Be sure to explore the full CodeProject article and the home page for MarkdownLog. Think about how you could add this to your existing logging framework and create better logs for tests, builds, anything. Take a look at the HTML render of one of Stuarts's Test Suite Runs and tell me that you want immediately want to get to work updating your old .LOG files.

Related Links



© 2014 Scott Hanselman. All rights reserved.
     

How to create a file with a . dot prefix in Windows Explorer

$
0
0

If you right click in Windows and try to make a new text file with a . period/dot in front of it:

image

Name the file...something like .gitignore, for example.

image

You'll get the "You must type a file name" error.

image

But, rather than typing .gitignore, if you include an ending dot also, like

.gitignore.

Then it works fine.

image

Thanks, Mads, for the tip!

NOTE: We're assuming that you have "File name extensions" turned on, because if you don't, you're likely not a programmer. ;)

image



© 2014 Scott Hanselman. All rights reserved.
     

You aren't using Resource Monitor enough

$
0
0

Most folks learn how to use Task Manager pretty quickly. We've all been on the phone with non-technical-relative and ask them to open up Task Manager.

As we move from user to technical-user we are introduced to SysInternals tools and perhaps Process Monitor for finding out what's happening to a disk. However, I find that for quick questions that using Resource Monitor is faster to access and the information is easier to interpret.

You can bring Task Manager up, of course, by right clicking the Taskbar and clicking Task Manager. Or, hit Ctrl-Alt-ESC as a hotkey for Task Manager.

From Task Manager, you may never have noticed the Open Resource Monitor link at the bottom of the Performance tab.

image

Click that and open up a whole new insight into what's going on.

Disk

This is all great stuff but I find myself exploring the Disk tab the most.

Disk Activity

Remember to sort by Read or Write bytes/sec. I often sort by Total and often find things like DropBox in there.

CPU and the CPU usage of Services

Task Manager is great but it doesn't easily show how much CPU is being used by a Service. Resource Monitor not only lets you easily Filter processes with a checkbox, but you can also sort services by CPU usage.

Service by CPU time

On the CPU tab, is an Associated Handles pane. If Resource Monitor is a well-kept secret, then Associated Handles is a secret within a secret. You can search across all processes for an open file name (or any handle), as well as filter by Process or Service.

Filtered by Chrome

Network Activity

The Network Activity tab is super useful and jam-packed with information. It makes it easy to find a process from a port or TCP connection.

Network Activity

You have this tool and all these views now, and I suspect you might not be using it to the fullest. Perhaps you pull from a number of smaller applets or shareware utilities to pull it all together.

Once I reminded myself that Resource Monitor could be launched directly from the Task Manager (an app that I have open often a lot already) I started using it even more. I may just pin it to the Taskbar!



© 2014 Scott Hanselman. All rights reserved.
     

Fixing the Touch Screen in Windows 8.1 on my old HP TouchSmart with NextWindow Drivers

$
0
0

HP TouchSmartWe've got an older HP TouchSmart all in one computer that we use as the "Kitchen PC." It's basically a browsing, emails, YouTube, and recipes machine. It's lovely machine, really. I've actually seen them at Goodwill, in fact, for cheap. If you can pick one up inexpensively, I recommend it.

Mine was starting to get sick so I opened it up (a challenge, but OK if you count all the screws) and replaced the Hard Drive. It comes with a 500gig 5400RPM full size SATA drive as I recall, but that was on its last legs. I happen to have a first gen 64G Intel laptop SSD around, so I use some 3M Command double-sided tape and basically taped this tiny hard drive to the inside of the thing and reinstalled Windows. This time, however, instead of the Windows Vista that it came with, I put on Windows 8.1.

You'd think I'd be asking for trouble. In fast, it's amazing. Literally everything worked, first try, with ZERO third party drivers. Blueooth, wireless, graphics, everything. Worked and worked immediately. Nothing was banged out in Device Manager. Even the touch screen worked, but only with 1 point of touch. That meant no pinch to zoom in browsers or maps. Cool, but I wanted to see if I could fix it.

These HP TouchSmarts had touch screens made by a New Zealand company called NextWindow, except they recently went out of business. Their website includes a few drivers, but not the one I needed.

I've mirrored them here because I don't trust that their website will be around long.

Here's the actual driver I needed for the TouchScreen. It doesn't appear to be available anywhere else, so I'm mirroring it here, as-is. It's the "HID Driver" (Human Interface Device) driver for the NextWindow 1900 TouchScreen. It's version 1.4 from May 24th, 2012. It works with NextWindow 2150 and 2700 touchscreens as well and it works under Windows XP, Vista, Windows 7, and now Windows 8 and 8.1!

This completely brought my HP TouchSmart new life with proper multitouch. It's paved completely with a new Windows 8.1 installation and just one third party driver and NO HP crapware.

Hope this helps you, random internet visitor.

Related Links



© 2014 Scott Hanselman. All rights reserved.
     

Exploring Impostor Syndrome in Technology - SXSW '15

$
0
0

I've written before about the idea of Imposter Syndrome or being a "Phony." It's the idea that on the surface you're an accomplished technologist but inside you're always questioning if you're really good enough. It turns out that this is SUPER common. You're not alone.

That little voice or feeling that "I can do better." Or, "I'm not 100% qualified but I think I can push through this" can sometimes be a motivator.

This is Indexed

This wonderful index card is by Jessica Hagy of This Is Indexed. Explore her blog and book! 

Remember that while you may feel like a phony, those around you who think they are awesome may not be!

The Dunning–Kruger effect is a cognitive bias in which unskilled people make poor decisions and reach erroneous conclusions, but their incompetence denies them the metacognitive ability to recognize their mistakes.

But the most important part is:

...people with true ability tended to underestimate their relative competence.

My excellent friend and very accomplished phony Chanelle Henry will be exploring these concepts on stage at SXSW 2015...if our panel is accepted!

You may have heard Chanelle on Hanselminutes Podcast episode #401 on "An Internet of Inclusion" or read her viral essay "Is it too late to be awesome?"

You can help us by quickly making a SXSW account and casting your Thumbs Up Vote (and leaving a comment) for our session proposal! Even better, tweet or blog your thoughts and encourage others to vote if you'd like to see content like this at the South By Southwest Interactive Conference.

Go read my blog post called "I'm a phony" and if it helped you, help me by voting for our session at SXSW! Thanks!


Sponsor: And a big thanks to Raygun for sponsoring the feed this week! I love Raygun and use it on all my apps. Get notified of your software’s bugs as they happen! Raygun.io has error tracking solutions for every major programming language and platform - Start a free trial in under a minute!



© 2014 Scott Hanselman. All rights reserved.
     

Surface Pro 3 - Initial Impressions

$
0
0

I went out and bought a Surface Pro 3. I bought the i7 8 gig RAM 256 gig storage version. It was paid for with my own money and there were no discounts. It's been a while since I had a high-powered laptop that was my own, not my employers, so I was mostly happy to spend the money. I bought the "Microsoft Complete" plan that covers accidental damage, even from drops.

That's a Surface Pro 3 there

I was a big fan of the size of the the Surface RT and the Surface 2. Those were the tiny thin ARM-based Surfaces. I used them all the time for email, Videos, browsing. I have an iPad Air, but used the Surfaces for their keyboard and their split screen abilities. Sitting on a plane with an 8 hour battery life device doing email and watching a movie at the same time is killer. If my iPad could do split screen that would be something.

I was NOT a fan of the Surface Pro 2. I have a lot of friends who have some but it was just so thick and heavy. The differential between the thickness of the keyboard and the thickness of the device itself was near comical. I wasn't going to try a Pro until it was as thin as a Surface 2.

And the Surface Pro 3 is thin. It's crazy thin. It's 9.1mm thick and about 800grams. That's about 1.8 lbs.

Now, I'm never going to be able to do a review like Paul Thurrott or AnandTech so I'd encourage you to read those uber-reviews. Instead, I'm going to cut through the specs and get to the questions and answers that matter to me.

Oh, and this is random as I'm not a sticker person. I have no stickers on any of my laptops but this Decal from DecalGirl was too awesome so I went all in.

What IS this device? The Obvious Comparisons

IMG_8260The difference between my Lenovo X1 Carbon and my iPad Air is clear. One's a powerhouse laptop and one is a lightweight tablet. I do work on the X1 and I surf and relax with the Air. I throw them both in my bag and go. I'll do a little light email on the iPad but it's largely my media and gaming device. They are separate and their difference makes sense to me.

After carrying the Surface Pro 3 around for a week, two interesting things happened. The screen on my iPad now feels small and the screen on my X1 seems HUGE. The Surface is basically the size and weight of a large magazine or a stack of papers.

The Surface occupies a space in my brain like a real hybrid. I want to throw the Surface on the couch with abandon like I do my iPad, but somehow I carry it with more reverence. That's likely because I didn't get the cheapest Surface. My subconscious knows it's a non-trivially-priced laptop rather than a tablet. 

I truly love my iPad Air. It works, it turns on, it runs one app at a time, and runs them well. I play games like Modern Combat with my Steelseries Stratus bluetooth controller and am amazed.

But then I plug the Surface Pro into my 30" monitor, add a keyboard, mouse, or an Xbox controller and play a Steam Game, and I realize this is an i7 PC. It's a weird shift that has taken me the week to get my head around.

The Good

From a consumers point of view (and in this context, that's me) it seems there are a lot of updates coming down for the Surface. Just yesterday an update came in that gave me more control over the touchpad and its right-click behavior. I hope that the updates continue. According to the Penny Arcade review they are looking at updates to improve the pen and other little details.

Can it run Visual Studio? Sure. I have been using it full time for a week and it's been fine. I wish it had 12 gigs of RAM, but I wish everything did.

The Type Cover 3 is WAY better than the Type Cover 2, and that one was pretty good. I thought the fold-up extra magnet was a gimmick but it's not. It does more than change the angle of the keyboard, it adds lateral stability to the device and makes it feel more like a laptop and less like a tablet with a keyboard attached.

The screen is fantastic. I mean, truly awesome. It's "retina" in that I can't see individual pixels and it's super bright and clear. The resolution on devices like the Yoga 2 Pro are so high that they can be overwhelming. The Surface Pro 3's 2160x1400 is such that I can run it at 100% (no scaling) and find it usable. I am running at 125% right now and am not having any of the high-dpi issues that happen when you scale out to 200%. It's also worth noting that you can scale the desktop and full-screen apps separately.

There is a micro-SD card slot hidden under the stand. I popped it a 64-gig card and told Windows to store videos there. Easy expansion and my movies take up no space on my main drive.

NOTE: Having a USB3 port is awesome, so I got a 3 port USB3 hub with Ethernet and it works great. I added a tiny Smart Card reader and a 3-in-1 mini DVI video adapter (DVI/HDMI/VGA) and got my bag of adapters down to just these three.

The Bad

Noting that I have an i7 version, and not the i3 or i5, I have noticed both fan noise and heat when the Surface Pro 3 is working hard. By working hard, I mean sustained CPU over 50-60% plus hard drive access plus wireless. So, playing Steam Games, installing Visual Studio, running Handbrake.

I was initially really disappointed that there was a fan at all. But again, after a week, I realized that the laws of physics are what they are and I'm carrying around an i7 the size of a paper notebook. I also went back to my X1 Carbon Touch and installed Visual Studio 2013.3 and noticed that the fan turned on noted it was hot too. In fact, hotter than I remembered.

So, is there a fan and will it blow when needed? Yes. I'm cool with it, because 90% of the time, it's off. It did take a mental adjustment.

Conclusion

I'm 90% happy with the Surface Pro 3. It's small and it's fast. It's not my desktop but it's definitely as fast as my beloved Lenovos when doing regular stuff. Right now I've got Outlook, Chrome, Firefox,  and IE all open. I've got 20+ tabs going, Windows Live Writer and an instance of Visual Studio. I've ordered the Docking Station and will report back when I've hooked it up.

Do any of you have a Surface Pro 3? What are your thoughts?


Sponsor: And a big thanks to Raygun for sponsoring the feed this week! I love Raygun and use it on all my apps.Get notified of your software’s bugs as they happen! Raygun.io has error tracking solutions for every major programming language and platform - Start a free trial in under a minute!



© 2014 Scott Hanselman. All rights reserved.
     

I was annoyed by the web font issues at Upworthy...you won't believe what I did next!

$
0
0

Sorry about the title, I had to. ;)

I was running Windows and Google Chrome and I clicked on a link to an Upworthy.com video. When I go to Upworthy recently (don't judge me) I've been seeing this weird font for the last few months. It's obnoxious, and I was surprised they'd let this fly.

Upworthy has weird fonts

Later, though, I looked in another browser, and it looked fine.

Upworthy rendered in IE

Ok, time to F12. According to IE's Developer Tools there are three webfonts coming down and they each are downloading completely.

IE dev tools say the WOFF file is fine

Interestingly Chrome says the same thing:

Chrome agrees

What's the DOM expecting the font to be? Well, basically all of them. ;)

That's a long font-family

Seriously, though, IMHO pick a font or font family and move on. There's really no need to make a list of 11 font types in the order you'd prefer them. Either your web font works or it's Helvetica time.

Gill Sans? I don't see a Gill Sans available here. Gill Sans is a Mac OS X system font, but it seems that Google Chrome on Windows REALLY don't like being asked for it. ;)

I took each of the downloaded WOFF files and tried to open them at http://www.pkmurphy.com.au/glyphviewer/ to see if one was Gill Sans. Of course, none contained any of the first their fonts they're asking for. Unless you explicitly download a web font, a list of fonts like these are a just a designer's wish list.

Web Designers: Design for the web, not the cool fonts you have on your machine.

On 99% of Windows machines you're going to end up with Segoe UI with this CSS font-family as most folks won't have those first three fonts. It seems that Chrome gives up (?) after a few tries (not sure?) but if I remove Gill Sans as the first item it renders fine.

image

The font is correct with a smaller font-family

I tried to find a bug on this in the Chromium bug database...I'm not sure if it might be this one?

I hope a CSS person at Upworthy sees this and solves the mystery! What are your thoughts, Dear Reader?


Sponsor: And a big thanks to Raygun for sponsoring the feed this week! I love Raygun and use it on all my apps.Get notified of your software’s bugs as they happen! Raygun.io has error tracking solutions for every major programming language and platform - Start a free trial in under a minute!


© 2014 Scott Hanselman. All rights reserved.
     

How to run Background Tasks in ASP.NET

$
0
0

A few years back Phil Haack wrote a great article on the dangers of recurring background tasks in ASP.NET. In it he points out a few gotchas that are SO common when folks try to do work in the background. Read it, but here's a summary from his post.

  • An unhandled exception in a thread not associated with a request will take down the process.
  • If you run your site in a Web Farm, you could end up with multiple instances of your app that all attempt to run the same task at the same time.
  • The AppDomain your site runs in can go down for a number of reasons and take down your background task with it.

If you think you can just write a background task yourself, it's likely you'll get it wrong. I'm not impugning your skills, I'm just saying it's subtle. Plus, why should you have to?

There's LOT of great ways for you to do things in the background and a lot of libraries and choices available.

Some ASP.NET apps will be hosted in IIS in your data center and others will be hosted in the Azure cloud. The spectrum of usage is roughly this, in my opinion:

  • General: Hangfire (or similar similar open source libraries)
    • used for writing background tasks in your ASP.NET website
  • Cloud: Azure WebJobs 
    • A formal Azure feature used for offloading running of background tasks outside of your Website and scale the workload
  • Advanced: Azure Worker Role in a Cloud Service
    • scale the background processing workload independently of your Website and you need control over the machine

There's lots of great articles and videos on how to use Azure WebJobs, and lots of documentation on how Worker Roles in scalable Azure Cloud Services work, but not a lot about how your hosted ASP.NET application and easily have a background service. Here's a few.

WebBackgrounder

As it says "WebBackgrounder is a proof-of-concept of a web-farm friendly background task manager meant to just work with a vanilla ASP.NET web application." Its code hasn't been touched in years, BUT the WebBackgrounder NuGet package has been downloaded almost a half-million times.

The goal of this project is to handle one task only, manage a recurring task on an interval in the background for a web app.

If your ASP.NET application just needs one background task to runs an a basic scheduled interval, than perhaps you just need the basics of WebBackgrounder.

using System;
using System.Threading;
using System.Threading.Tasks;

namespace WebBackgrounder.DemoWeb
{
public class SampleJob : Job
{
public SampleJob(TimeSpan interval, TimeSpan timeout)
: base("Sample Job", interval, timeout)
{
}

public override Task Execute()
{
return new Task(() => Thread.Sleep(3000));
}
}
}

Built in: QueueBackgroundWorkItem - Added in .NET 4.5.2

Somewhat in response to the need for WebBackgrounder, .NET 4.5.2 added QueueBackgroundWorkItem as a new API. It's not just a "Task.Run," it tries to be more:

QBWI schedules a task which can run in the background, independent of any request. This differs from a normal ThreadPool work item in that ASP.NET automatically keeps track of how many work items registered through this API are currently running, and the ASP.NET runtime will try to delay AppDomain shutdown until these work items have finished executing.

It can try to delay an AppDomain for as long as 90 seconds in order to allow your task to complete. If you can't finish in 90 seconds, then you'll need a different (and more robust, meaning, out of process) technique.

The API is pretty straightforward, taking  Func<CancellationToken, Task>. Here's an example that kicks of a background work item from an MVC action:

public ActionResult SendEmail([Bind(Include = "Name,Email")] User user)
{
if (ModelState.IsValid)
{
HostingEnvironment.QueueBackgroundWorkItem(ct => SendMailAsync(user.Email));
return RedirectToAction("Index", "Home");
}

return View(user);
}

FluentScheduler

FluentScheduler is a more sophisticated and complex scheduler that features a (you guessed it) fluent interface. You have really explicit control over when your tasks run.

using FluentScheduler;

public class MyRegistry : Registry
{
public MyRegistry()
{
// Schedule an ITask to run at an interval
Schedule<MyTask>().ToRunNow().AndEvery(2).Seconds();

// Schedule a simple task to run at a specific time
Schedule(() => Console.WriteLine("Timed Task - Will run every day at 9:15pm: " + DateTime.Now)).ToRunEvery(1).Days().At(21, 15);

// Schedule a more complex action to run immediately and on an monthly interval
Schedule(() =>
{
Console.WriteLine("Complex Action Task Starts: " + DateTime.Now);
Thread.Sleep(1000);
Console.WriteLine("Complex Action Task Ends: " + DateTime.Now);
}).ToRunNow().AndEvery(1).Months().OnTheFirst(DayOfWeek.Monday).At(3, 0);
}
}

FluentScheduler also embraces IoC and can easily plug into your favorite Dependency Injection tool of choice by just implementing their ITaskFactory interface.

Quartz.NET

Quartz.NET is a .NET port of the popular Java job scheduling framework of the (almost) same name. It's very actively developed. Quartz has an IJob interface with just one method, Execute, to implement.

using Quartz;
using Quartz.Impl;
using System;

namespace ScheduledTaskExample.ScheduledTasks
{
public class JobScheduler
{
public static void Start()
{
IScheduler scheduler = StdSchedulerFactory.GetDefaultScheduler();
scheduler.Start();

IJobDetail job = JobBuilder.Create<MyJob>().Build();

ITrigger trigger = TriggerBuilder.Create()
.WithDailyTimeIntervalSchedule
(s =>
s.WithIntervalInHours(24)
.OnEveryDay()
.StartingDailyAt(TimeOfDay.HourAndMinuteOfDay(0, 0))
)
.Build();

scheduler.ScheduleJob(job, trigger);
}
}
}

Then, inside your Application_Start, you call JobScheduler.Start(). There's a great getting started article on Quartz at Mikesdotnetting you should check out.

Hangfire

And last but definitely not least, the most polished (IMHO) of the group, Hangfire by @odinserj. It's a fantastic framework for background jobs in ASP.NET. It's even optionally backed by Redis, SQL Server, SQL Azure, MSMQ, or RabbitMQ for reliability.

The Hangfire documentation is amazing, really. Every open source project's document should be this polished. Heck, ASP.NET's documentation should be this good.

The best feature from Hangfire is its built in /hangfire dashboard that shows you all your scheduled, processing, succeeded and failed jobs. It's really a nice polished addition.

image

You can enqueue "fire and forget" jobs easily and they are backed by persistent queues:

BackgroundJob.Enqueue(() => Console.WriteLine("Fire-and-forget"));

You can delay them...

BackgroundJob.Schedule(() => Console.WriteLine("Delayed"), TimeSpan.FromDays(1));

Or great very sophisticated CRON style recurrent tasks:

RecurringJob.AddOrUpdate(() => Console.Write("Recurring"), Cron.Daily);

Hangfire is just a joy.

Check out the Hangfire Highlighter Tutorial for a sophisticated but easy to follow real-world example.

There's a rich ecosystem out there ready to help you with your background tasks. All these libraries are excellent, are open source, and are available as NuGet Packages.

Did I miss your favorite? Sound off in the comments!


Sponsor: Many thanks to my friends at Raygun for sponsoring the feed this week. I *love* Raygun and use it myself. It's amazing. Get notified of your software’s bugs as they happen! Raygun.io has error tracking solutions for every major programming language and platform - Start a free trial in under a minute!



© 2014 Scott Hanselman. All rights reserved.
     

ASP.NET vNext - August 2014 Status Rollup

$
0
0

Work on the next version of ASP.NET continues. It's a world of Alpha software, Git commits, breaking changes, and daily builds. If you're not one for risk, this blog post is for you. Read about all the fun stuff that's going on, and install nothing. If you do like a little spice in your life, jump in and install some early builds and join this active and opinionated community.

Introducing ASP.NET vNext

We announced vNext in May and did some great talks at TechEd.

ASP.NET vNext has number of notable features, including, but not limited to:

  • Open Source from the start and runs on Windows, Mac, and Linux.
  • No "build to disk" step, just refresh and go with runtime in-memory compilation from the Open Source Roslyn compiler.
  • Optional cloud optimized local install the CoreCLR that runs great in Azure.
  • Want to use a Mac and Sublime rather than Windows and VS? Sure.
  • No strong naming, no dependency on System.Web
  • Dependency injection everywhere
  • side-by-side runtimes (one app can't hurt another, get your own versions of everything)
  • NuGet Packages easy to bring in the new project.json system. But, you can also swap in the source for your favorite libraries!

 

David Fowler and Scott Hanselman

Since then we've seen the release of betas of the next version of Visual Studio, like Visual Studio "14" CTP 3. This version of VS includes the ASP.NET vNext alpha 3 packages plus initial tooling. The project system is changing and this VS14 build includes Intellisense for the new Project.json files.

  • ASP.NET and Web Development vNext Updates. This CTP includes all the Visual Studio 2013 Update 3 web tooling improvement and ASP.NET vNext alpha 3 runtime packages. It has improved tooling support for ASP.NET vNext, such as support for build configuration and support for unit tests, and it no longer includes content and compile items inside “.kproj” file. ASP.NET vNext includes an updated version of the RyuJIT JIT compiler. For details, please read the full post on the .NET Web Development Tools blog.

Separate from ASP.NET vNext, this build of VS14 also includes .NET Native, C++ updates, Shared Projects, as well as little things like retina icons for HiDPI displays.

Project.json files

Scaffolding for ASP.NET vNext

ASP.NET vNext is very modular and will include customizable command-line scaffolding . As with all of ASP.NET vNext, it's easy and alpha, but we've got blog posts up showing you how to get started with scaffolding. We've also got details on how to customize (of course) scaffolding for your personal needs.

ASP.NET vNext on a Mac

Sure, why not? We're working on a Sublime Text 3 plugin at https://github.com/ligershark/Kulture that means you'll be able to develop ASP.NET vNext apps in your favorite IDE. There's a quick YouTube video here.

ASP.NET on a Mac

There's also some clever community members with C# Intellisense working! The LEGO pieces are snapping together nicely.

Intellisense on a Mac

This is just a taste, there's more coming that WILL surprise you

What else is possible?

ASP.NET vNext going forward...Alpha 3

David Fowler has some great Alpha 3 details on his blog that cover some architecture changes and explains some choices. ASP.NET vNext apps get their own copy of the CLR/BCL when deployed, but this is a hassle when developing. So, ASP.NET vNext apps can use a Global NuGet repository (this is NOT the GAC, relax.)

Apps can also opt in to new C# 6 features easily with a quick change to project.json.

{
"compilationOptions": {
"languageVersion": "experimental"
}
}

Again, this is all happening in the open on GitHub at https://github.com/aspnet, so check out the last milestone's issues here: https://github.com/aspnet/KRuntime/milestones/1.0.0-alpha4

I'm sure I missed something. Sound off in the comments!


Sponsor: Many thanks to my friends at Raygun for sponsoring the feed this week. I *love* Raygun and use it myself. It's amazing. Get notified of your software’s bugs as they happen! Raygun.io has error tracking solutions for every major programming language and platform - Start a free trial in under a minute!


© 2014 Scott Hanselman. All rights reserved.
     

Introducing Gulp, Grunt, Bower, and npm support for Visual Studio

$
0
0

Web Development, specifically front end web development, is fast becoming as complex and sophisticated as traditional back end development. Most projects don't just upload some JS and CSS files via FTP. There's now a front end build process that can include expansion of SASS and LESS, minification of CSS/JS, running JSHint or JSLint, and much more. These build tasks and processes are coordinated with tools like Gulp and Grunt. Additionally, client-side libraries are managed as packages using management systems like npm and bower.

Why client-side package managers for ASP.NET? Why not NuGet? Why not MSBuild?

Some of you may ask, why not use NuGet for JavaScript? Why not extend MSBuild for building CSS/JS? Simple. Because there's already a rich ecosystem for this kind of thing. NuGet is great for server side libraries (and some client-side) but there are so many more CSS and JS libs on npm and bower. MSBuild is great for server-side builds but can be overkill when building a client-side app.

So, use both. These are tools in your toolkit. Adding support for Gulp, Grunt, Bower, npm (and other stuff, in the future if needed) means a more familiar environment for front-end devs doing ASP.NET and it opens the doors for ASP.NET devs to bring in the JS and CSS library the all communities use every day.

Introducing Task Runner Explorer

We’ve received a ton of feature requests regarding Grunt/Gulp support from many of you as well as the community at large. We are building first-class support for both Grunt and Gulp in Visual Studio “14” with full extensibility. Now we’re ready to ship a preview of this support as an extension to VS2013 and would appreciate your help testing and exploring this feature. 

Today we're introducing a preview of the "Task Runner Explorer" as a VSIX extension. We're also recommending two other VSIXs to round out the experience for this feature.

NOTE: Much of the functionality included in these multiple VSIX extensions will be built into Visual Studio so you won't need to install so many things. However, for VS2013 and this preview we needed multiple VSIXs in order to get you the bits sooner than later. Also note that today onlyTask Runner Explorer will work on Visual Studio Expressbut for VS14 all  the features will work in the free VS Express version.

Consider these features as a "DevLabs" preview for now, much like the VS Productivity Power Tools. They'll graduate into the final product.

What do you need?

First, you'll need Visual Studio 2013.3 - that 3 means "Update 3" which is a free update.

  1. TRX - Task Runner Explorer Visual Studio Extension
  2. NPM/NBower Package Intellisense - Search for online NPM and Bower packages directly with Intellisense
  3. Optional Grunt Launcher (gives right-click options in Solution Explorer - including "npm install")
    • Without this extension, for now you'll need to run npm install yourself to restore/add packages.
    • If you DO have this extension, right click on packages.json and "npm install" before running a grunt/gulp task.

To open the TRX (Task Runner Explorer), simply right-click any gruntfile.js in your project:

image002 

The TRX sits at the bottom of VS by default and looks like this:

 image001

Here we can see that it found a gruntfile.js in the root of one or more projects in the solution. It also shows the task bindings feature that allows any task or target to be triggered by 4 different Visual Studio events.

To associate a task/target with a VS event, just right-click and setup bindings.

image003

To run any task/target, just double-click it and a console appears:

image004

When you've got the Package Intellisense Extension you'll find it easy to add and update packages when directly editing your package.json for both bower and npm.

completion-name

You'll even get metadata tooltips populated asynchronously.

tooltip-animated

As you go testing it, remember you'll need to run "npm install" before you use the Task Runner Explorer to run Grunt tasks.

Big thanks to Mads Kristensen, Dan Chartier, and Van Kichline for their great work on this feature!


Sponsor: Many thanks to Intersoft for sponsoring the feed this week! Enterprise cross-platform native apps development made painless with Intersoft Crosslight. Sounds too good to be true? See it for yourself and get started today! 



© 2014 Scott Hanselman. All rights reserved.
     

Can you hear me now? Unmute your microphone

$
0
0

I've been working remotely now, from home, for over half a decade. I work in my home office, from cafes, from my tethered mobile, basically anywhere I can be productive and not feel like a phony.

Here's the thing, though. I have to go to meetings, and I spend 15 minutes of those meetings waiting for YOU (yes, you, there) to unmute your mic, setup your cam, mess around with your internet, and generally waste the remote worker's (yes, me, here) time.

So, as a customer service to the internet, I present.

http://howtounmute.com

That domain points directly to this post. Please, tell your friends family and clients.

Why not include http://howtounmute.com as a link in your meetings?

Is your mic muted?

Using Skype?

image

See that circled icon? That's a muted microphone. Click to unmute.

Using Lync?

In Lync, this means your phone and mic are turned off.

image

Click the left one to unmute! Click the right one to turn on your cam! You can also use the "Win+F4" global hotkey to unmute Lync.

Using Google Hangouts?

The unmute button is at the top of the hangout.

image

Click the little Settings Gear to select your microphoen and speakers from within Google Hangouts.

image

Using Some Weird old Adobe Flash-based Web Conferencing Thing?

Seriously, stop. What's wrong with you? Then, right click on the box where the app is running and click Settings...

image

You can select your Microphone and see the bar move on the right, indicating it can hear you.

Wait, did you select the right microphone globally?

Most apps let you select microphones within the app. You can also set your preferred mic globally.

Which mic am I using? Right click on the little speaker near the clock and select "Recording Devices."

image

Some machines have more than one microphone. Windows lets you set a "Default Communications Device" for calls like Skype, and this is different from the "Default Device" for regular audio apps like Audacity. Right click to set your default.

image

PRO TIP: Tap your microphone (or where you think it is) to confirm where you THINK it is. Watch the green bars move.

Applications can also select their individual preferred microphone. Here's Tools | Options in Skype. See how I can select where I want my audio output to go? And where I want my input to come from?

image

Got a Mac?

That's cool. Type "Sound" into Spotlight and open your settings. Note you can see your input volume, your preferred input devices and preferred output device.

clip_image001

Got a physical phone?

There is VERY likely a microphone mute button on the phone. Familiarize yourself with the phone's buttons and try this one.

cx600_options2

Maybe you have a headset? Does it have a mute button? Maybe you bumped it.

c26-478USB-2-l

Call to AUDIBLE ACTION

If you take 5 to 10 minutes NOW to make sure you know how to select your microphone and umute yourself, you will save remote workers everywhere 15 minutes for every 1 hour meeting.


Sponsor: Many thanks to Intersoft for sponsoring the feed this week! Enterprise cross-platform native apps development made painless with Intersoft Crosslight. Sounds too good to be true? See it for yourself and get started today!



© 2014 Scott Hanselman. All rights reserved.
     
Viewing all 1148 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>