Scott Hanselman

ConEmu - The Windows Terminal/Console/Prompt we've been waiting for?

June 11, 2012 Comment on this post [86] Posted in Open Source | Tools
Sponsored By

I have long sung the praises of Console2, an alternative Windows Command Prompt. In fact, I declared in 2004 that Windows was (and is) missing the boat when it comes to Text Mode. A kick ass terminal is exactly what Windows needs. I'm not talking about PowerShell, which many agree is crazy powerful, but rather the Terminal itself. We want tabs, we want control, we want better full screen, we want themes, we want more.

While I love Console2, I think I'm ready to switch as I've just been turned on a NEW contender in the Windows Console Wars. It's ConEmu and it's insane (in a good way.) It's also actively developed.

I haven't even begun to scratch the surface as ConEmu is one of those applications that is so configurable that you can become lost in the flexibility.

Here's some of ConEmu's fantastic improvements to the Windows terminal experience.

Jump Lists

Of course! So obvious it should have been done before. Now I can have all my favorite commands and configurations in a one click location. Best yet, these are actual commands, not just shells, so I can pin batch files, common commands (deploy, etc) or whatever I like.

ConEmu adds Jump Lists

Status Bar Details

There's a hundred little details that make ConEmu fun to explore. This details also show ConEmu was created by a developer. ;)

ConEmu Console App

Running as Administrator

Check out the status bar there. You've got the current process id, as well as the status of your CAPS, NUM and SCRL locks. You can quickly change your transparency and smoothly resize your terminal.

Running as Administrator

Check out the tabs. See how one of my Tabs is running as Administrator? It's the little details, my friends.

You can even "attach" or suck in existing console that are already running into ConEmu.

Configuration

Literally everything is configurable. Each time I find myself wishing for a specific feature, I find it somewhere in the settings. For example, I wanted to change the behavior of the console (colors, fonts, etc) when a specific application was running. Turns out that feature exists and you can set distinct preferences for specific executables.

ConEmu Settings

You can even get applications like putty.exe to startup inside a tab with the -new_console switch or run obscure DOS applications inside the ConEmu using DosBox.

Progress Bars

The feature that really blew me away was Progress Bar integration. If you're familiar with Windows 7 you are likely familiar with the way that progress bars are overlaid over a Windows 7 Taskbar button. ConEmu looks at the current application running and some heuristics and overlays progress. Madness. Do a chkdsk and watch the progress bar. Love this little detail.

ConEmu Progress Bar

FarManager

Not enough awesome? OK, add in the FarManager text-based File Manager (ala Norton Commander) and watch ConEmu light up even more. It also includes FarManager plugins for drag and drop within the text mode app.

FarManager DragDrop

I've gone and customized my Windows 7 task list to include Azure PowerShell, Git Bash in Cygwin, Far and Visual Studio's command prompt.

menus

Go and download ConEmu and try it for yourself. There's a few obscure things, and you'll want to spend some time customizing it, updating the jump list manually, checking all the settings as well as changing some of the hotkeys, but in the end you'll have the best Console application Windows has to offer.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Visual Basic 6, Ruby and Getting Off My Lawn

June 10, 2012 Comment on this post [45] Posted in Musings
Sponsored By

Why hate on Visual Basic? Because it's successful.David Platt has a great article called The Silent Majority: Why Visual Basic 6 Still Thrives. Even though I studied C++ in school, my first corporate job was in Visual Basic 2, then quickly VB3. By the time VB6 came out it's fair to say I could make that thing sing. It's funny how the older and more successful a language is, the more likely the language literati are to bash it. Bigger targets are, well, bigger.

Visual Basic 6 first shipped in 1998, so its apps will have at least 24 years of supported lifetime. Contrast that with the Microsoft .NET Framework 1.0 (2002), which is incompatible with Windows 7 (2009). - David Platt

You could get SO much work done SO quickly in Visual Basic 6 and that itself made the experience of coding in it fun. Once you added in some of the advanced techniques with tools like Dan Appleman's SpyWorks and other comparatively low-level API tools, it was arguably near as powerful and productive as its more advanced brother, MFC and C++.

Another key to the success of Visual Basic 6 was the much shorter learning curve demanded by its limited feature set. Learning to drive a bus takes much less time than learning to fly a fighter jet. Becoming a good Visual Basic 6 programmer took much less time than becoming a good C++ programmer, the primary alternative at the time. - David Platt

A Hacker News discussion started up around this article and one HN'er said what I've been saying for years (emphasis mine):

For those who have never used it, VB6 syntax is actually very similar to Ruby. It uses English language words instead of braces, does not require parentheses, and uses dynamic typing.

VB6 is also quite fast, all things considered, and runs on lots of fairly old hardware.

Don't get me wrong, I'd never choose to use it, but for those who use it day to day it offers overall simplicity and flexibility that few mainstream languages can match. - grandalf

and the obvious followup...

The irony is, [today's] Ruby "rockstar ninjas" are doing exactly the same work that used to be done with VB and Access. - gaius

This is true...20 years later and it's all still text boxes over data. Even the most advanced client side JavaScript single page apps are often shadows of their terminal and text mode grandparents.

Ruby does feel in some ways like the VB of two decades ago. Quick, is this Ruby or VB6?

class MyClass  
def describe
print self.class
end
end

What about Fibonacci?

Public Function Fib(ByVal n As Integer) As Integer
If (n < 2) Then
Fib = n
Else
Fib = Fib(n - 1) + Fib(n - 2)
End If
End Function

Of course, Ruby can do it with a ternary operator.

def fib(n)
n < 2 ? n : fib(n-1) + fib(n-2)
end

And VB6 has only IIF() for that so we get this

Public Function Fib(ByVal n As Integer) As Integer
Fib = IIf (n < 2, n, Fib(n-1) + Fib(n-2))
End Function

Sure VB6 had/has its problems, but this was a great environment a LONG time ago and even though a lot of unskilled people created a lot of crap, a lot of skilled people created a lot of useful apps that are still running today. And I understand why.

The things that Visual Basic 6 did still need doing. - David Platt

Disclaimer - I currently work for Microsoft on the Web Team but this post has nothing to do with that. I have worked here about 5 years but I worked elsewhere for much, much longer. I dabble in Ruby and other languages on the side so don't get my grudging respect for Visual Basic 6's special brand of cheesy pragmatism twisted.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Windows Azure - No Kidding

June 07, 2012 Comment on this post [51] Posted in Azure | Open Source
Sponsored By
Last year when ScottGu moved over to the Azure group and brought the ASP.NET and IIS teams with him, I'll be frank, I wasn't a fan. I didn't really appreciate Azure or its first iteration. The management portal was obtuse and confusing to use, the service was primarily a PAAS (Platform as a Service) offering and focused on (I thought) confusing terms like Cloud Services and slow deployments. The underlying infrastructure was strong but the developer experience didn't feel "right" to me. I really wasn't feeling it.

So I continued to work on ASP.NET and Visual Studio 2012 and the things that were interesting to me. Then, some months ago Scott and some folks showed us the concepts for the new experience and the new management stuff. It clicked. I saw that Scott and his team "gets" it. I started working with it, giving feedback and filing bugs. We had weekly full-day long team app-building sessions. One particular day I sent 52 different pieces of feedback to the Portal team.

I've talked before about how sometimes development on a platform can be "death by a thousand tiny cuts." It doesn't hurt in general but the little things poke at you. That's not the case with Windows Azure and this release. I'm not embarrassed to say I work for the Azure Team now, as it is pretty darned sweet.

Check out Scott's post but I'll mention a few things that are new just to make the point for you that Azure is something you'll want to check out now.

New Administration Portal and Tools

The management portal has been completely redone with a focus on usability and speed. It works on all browsers but the best part is that it's actually using a REST-based management API so anything you can do on the portal you can do from the API.

There are command line tools to talk to the REST API so you can automate anything you like from both PowerShell on Windows or Bash on Mac and Linux. If you go to the Downloads page on the Azure site you can get .NET, node.js, PHP, Java or Python tools for Windows, Mac and Linux.

Just to make the point, I'll use my Mac and download the Mac SDK on a fresh system. You can do anything from the command line be it in PowerShell or Bash. If I'm on Linux and I have npm, I can just

sudo npm install azure -g

And there's lots of stuff to explore.

The Azure Command Line on a Mac

Freaked out yet? You should be. ;) The Azure SDK is also open source under Apache 2 and available on GitHub.

Azure SDK on a Mac

After the install is done I'm sent to a "what's next" page that shows me how to get node, PHP or Python running (Given that I'm on a Mac). I'll install node.js and git, then I'll make a node.js application on Azure on my Mac.

Now, my point isn't about node nor is it about Macs. It's about choice and it's about the ability to build what you want the way you want it with the tools that make you happy.

I'll make a Web Site...

Creating a node application for Azure

Then I'll setup a git repository along with a name and password for deployment.

My git repository is ready

I'll make a folder, put an app.js in there, initialize the git repo, add "Azure" as a remote repo, and then push. The Azure management site actually notices the push and automatically refreshes without me having to do anything.

I just deployed my node app with git to Windows Azure

Boom, website in the cloud, easy as it should be.

image

Check out the YouTube video I did (embedded above also) on how to do the same thing with .NET and Visual Studio. You can use Web Deploy as I do in the video, Git, TFS or FTP. For example, I can use TFS and do Continuous Deployment if I like.

Virtual Machines

Azure has durable Virtual Machines (VMs) in the cloud now as well. You can make your own image and upload it or you can use a gallery of images that includes not only Windows but also Ubuntu, CentOS and SUSE images.

Linux on Azure. It's freaking me out.

Web Sites

You can make a web site in Azure yourself in a minute. You can make up to 10 small websites for free to play and experiment and then later reserve instances and scale up.

NOTE: To start using Preview Features like Virtual Network and Web Sites, request access on the 'Preview Features' page under the 'account' tab, after you log into your Windows Azure account. Don't have an account?  Sign-up for a free trial here.

Maybe go try one out and create a new Web Site from the Gallery:

You can make a website quickly from the gallery

Feel free to publish in a number of ways as I mentioned, using Web Deploy, TFS, Git or FTP. You can manage everything in the portal or you can automate stuff from the command line.

I like that I have real choice. Use whatever tools I like, whatever OS I like to publish whatever apps I like talking to the backend that I like. I'm personally really happy with the way things are going and I'm looking forward to building all sorts of things with all sorts of tools on Azure.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

ASP.NET for Mobile, One ASP.NET and Realtime ASP.NET with Signalr - Video of Scott Hanselman's talks in Russia

June 06, 2012 Comment on this post [24] Posted in ASP.NET | ASP.NET MVC | Javascript | SignalR | Speaking
Sponsored By

Hey that says Scott Hanselman in Russian!I was outside Moscow last week speaking at Microsoft DevCon 12 in Russia. They did a great job with the event and not only filmed everything but did picture in picture as well as real-time translation into Russian. It was also live streamed at the team and later edited for download. Very cool. Big thanks to the team for putting the videos up so fast!

The English versions of my three talks (plus one open Q&A sesssion) are now all up for your viewing pleasure. If it seems I'm speaking ever so slightly slower than usual, that was at the request of the translators, and is a good practice when speaking English to non-native speakers.

You can also download and view the Russian versions if you like as well.

ASP.NET for Mobile Phones and Tablets

The ASP.NET for Mobile Phones and Tablets video

Download links:

SignalR and the Realtime Web

The SignalR and the Realtime Web video

Many problems, many solutions: One ASP.NET

The Many problems, many solutions: One ASP.NET keynote video

Open question and answer session – Ask Scott Hanselman

The Open question and answer session – Ask Scott Hanselman video

Hope you enjoy them!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Visual Studio 2012 RC is released - The Big Web Rollup

June 01, 2012 Comment on this post [124] Posted in ASP.NET | ASP.NET MVC | Open Source | VS2012
Sponsored By

Today Visual Studio 2012 RC (Release Candidate) came out. (It's 2012, so 11 make less sense than 2010+2) There's a lot of nice improvements for Web Development in this release candidate as we march towards a final release. Here's some of my favorite new features from the "Angle Brackets Team." That's my name for the Web Platform and Tools team. I hope it sticks.

Web Optimization

There's been some significant changes to the web optimization (minification and bundling) framework since beta. There wasn't enough control over what was bundled and in what order in the beta, so that's been moved into a BundleConfig.cs (or .vb) where you have total control, but everything just works out of the box. The API has been simplified and is slightly more fluent which means it's easier to read and easier to write.

Rendering bundles in Beta required some goofy syntax and a lot of repetitive namespaces. In RC it's nice and simple:

@Styles.Render("~/Content/themes/base/css")
@Scripts.Render("~/Scripts/js")

And you can change with a params array:

@Styles.Render("~/Content/themes/base/css", "~/Content/css")

Also, bundles aren't bundled when you're in debug mode but are when released without you having to change your markup. The regular compilation flag in web.config controls it and you can certainly override with the BundleTable.EnableOptmizations property if you have specific needs.

The best part is that you can plug in custom libraries. If you don't like the included minification technique or perhaps want to add your own, you can. Howard and the team showed me this small example to add support for LESS files and turn them into CSS as a transform, then minify the results.

public class LessTransform : IBundleTransform
{
public void Process(BundleContext context, BundleResponse response)
{
response.Content = dotless.Core.Less.Parse(response.Content);
response.ContentType = "text/css";
}
}

Then bundle up the *.less files and transform them as you like.

var lessBundle = new Bundle("~/My/Less").IncludeDirectory("~/My", "*.less");
lessBundle.Transforms.Add(new LessTransform());
lessBundle.Transforms.Add(new CssMinify());
bundles.Add(lessBundle);

Templates and more

Having good Templates is very important and we'll have even more additions and improvements to templates between now and the final release. Also, because the Web Team has externalized the templates (the web templates themselves are extensions that can be updated out of band) you can expect cool and useful updates even beyond the final release. The Web tends to move fast and we'd like to move fast as well.

There's an Empty template introduced for ASP.NET MVC. Like really empty. Folks asked for it! The markup is cleaner in all templates and as before, is HTML5 by default.

The ASP.NET Web Forms template includes support for the Web Optimization framework as mentioned above. ASP.NET Web Forms (like it or not, haters! ;) ) continues to share features with ASP.NET MVC because, as I've said before, it's all One ASP.NET. That means Routing, Providers, Model Binding, HTML5 support, Web Optimization and more are all features you can count on. They are part of ASP.NET no matter which framework you're choosing to use.

Web API now includes scaffolding support (and Web Forms will soon as well) so you can easily make a CRUD (Create, Read, Update, Delete) API from your model. As with all scaffolding, you can customize it as you like.

Web API has Scaffolding too!

I also like that we're shipping Modernizr, Knockout, jQuery, jQuery validation and jQuery Mobile in our templates and you can bring it hundreds more with NuGet as you like.

Tiny Happy Features for Front End Web Developers

Take note, front end people. The team has looked at the complete experience from File | New Project, through development and debugging and tried to (and continues to tyy to) improve the "tiny cuts" that hurt you when developing web apps. Big new features are fun, but sometimes little features that fit into the middle of your workflow make life better and smooth the way. I like tiny happy features.

If you pull the Debug menu down you'll see it finds all your browsers so you can not only use the one you like without hunting but also change your default quickly. Plus, they've added a Browse With menu to this pull down so ASP.NET MVC folks don't have to go digging for it in right-click context menus.

The debug dropdown now include a Browse With option

If you select Browse With it'll bring up this familiar dialog. Now, try Ctrl-clicking on multiple browsers and click Browse.

Browse With supports multiple selection

The toolbar will change so now you can startup more than one browser with one click, with with F5 or Ctrl-F5.

Multiple Browsers is a choice now for launching your app

When you click it, you can select a specific browser for step-through debugging, then the other browser will launch as well.

Pick a browser for debugging

This is a small, but happy feature that I appreciate.

CSS, JavaScript, and HTML Editor Improvements

Dozens and dozens of improvements and new "smarts" have gone into the CSS, JavaScript and HTML editors. For example, the HTML editor is updated with the latest HTML5 intellisense and validation based on the latest W3C standards. All the attributes and tags that you want are there.

aria and data attributes are available

If I type a hyphen (dash) in the CSS editor I get a smart list of all the vendor specific prefixes, even Opera! These lists include help text as well for properties which was no small amount of work.

We love you Opera, honest.

There's drop-downs and pickers for fonts and colors (my favorite) as well as a color picker.

That's a color picker, my friend

These are just a few bits of polish. There's lots of new snippets and expansions as well.

Publishing

Be sure to sign up for the 6/7 Meet Windows Azure event with Scott Gu online to see some VERY cool improvements to publishing in Visual Studio. Before then, you can check out new features for Publishing like:

  • Updated cleaner and simpler publish UI
  • Running EF Code First migrations on the publish dialog
  • Incremental database schema publish and preview
  • Update connection strings in web.config on publish (including complex EF connection strings)
  • Prompting for untrusted certificates on publish dialog during publish
  • Automatically convert VS2010 publish profiles to the new VS2012 format
  • You can easily publish from the command line using a publish profile:
    • msbuild mywap.csproj /p:DeployOnBuild=true;PublishProfile=MyProfileName
  • You can also create profile specific transforms, i.e. web.Production.config, but we haven’t updated the tooling yet to create these. In this case if you have a profile specific transform we will execute the build config one first and then the profile one.

ASP.NET and ASP.NET Web Forms

In addition to the new features I've talked about before like Model Binding and better HTML5 support there's:

  • Updates to assist in async ASP.NET development:
    • HttpResponse.ClientDisconnectedToken: A CancellationToken that asynchronously notifies the application when a client has disconnected from the underlying web server.
    • HttpRequest.TimedOutToken: A CancellationToken that asynchronously notifies the application when a request has run longer than the configured request timeout value.
    • HttpContext.ThreadAbortOnTimeout: Allows applications to control the behavior of timed out requests. Defaults to true. When set to false ASP.NET will not Thread Abort the request but rather leave it to the application to end the request.
    • Protection against race conditions and deadlocks that can be introduced by starting async work at invalid times in the request pipeline
  • Added ability for applications to forcibly terminate the underlying TCP connection of a request via HttpRequest.Abort()
  • Improved support for async in Web Forms including support for async page & control event handlers
  • ScriptManager support for the new ASP.NET bundling & minification library
  • Improvements for extending the Web Forms compilation system:
    • New ControlBuilderInterceptor class to enable customization of the Web Forms page & control compilation output
    • TemplateParser.ParseTemplate method that allows the application to generate an ITemplate instance from a string of ASPX markup
  • Support for Entity Framework enums and spatial data types in Dynamic Data

ASP.NET Web API and MVC

Both ASP.NET MVC and ASP.NET Web API have had a number of improvements since Beta.

  • We now use and support the open source Json.NET serializer for handling of JSON data.
  • You now can easily build custom help and test pages for your web APIs by using the new IApiExplorer service to get a complete runtime description of your web APIs.
  • ASP.NET Web API now provides light weight tracing infrastructure that makes it easy to integrate with existing logging solutions such as System.Diagnostics, ETW and third party logging frameworks. You can enable tracing by providing an ITraceWriter implementation and adding it to your web API configuration.
  • Use the ASP.NET Web API UrlHelper to generate links to related resources in the same application.
  • ASP.NET Web API provides better support for IoC containers through an improved dependency resolver abstraction
  • Use the Add Controller dialog to quickly scaffold a web API controller based on an Entity Framework based model type.
  • Create a unit test project along with your Web API project to get started quickly writing unit tests for your Web API functionality.
  • EF 5 database migrations included out of the box in the ASP.NET MVC 4 Basic Template
  • Add Controller to any project folder
  • Bundling and minification built in
  • The configuration logic For MVC applications has been moved from Global.asax.cs to a set of static classes in the App_Start directory. Routes are registered in RouteConfig.cs. Global MVC filters are registered in FilterConfig.cs. Bundling and minification configuration now lives in BundleConfig.cs.

Visual Studio Theme

Ah, the controversial theme change. They've added a bunch of splashes of color, brightened the background and made the status bar change color depending on your status. I'm not sure what I think about the ALL CAPS menus but I honestly don't look at them much. They seem to be the last thing that folks are freaking out about. My guess (I am NOT a designer) is that there's an implied horizontal rule along the top edge of the letters and if you used mixed case they'd just be floating words. We'll see what happens, maybe it'll be a option to change, maybe not. I'm more worried about the web functionality than the look of the menus. I think the RC looks way way better than the initial Beta, myself, and I understand there are more changes coming as well as clearer icons in the dark theme for the final release. You can read more and look at side by side examples and decide for yourself at the Visual Studio Blog. It's growing on me.

Visual Studio Light Theme

I've even tried out the Dark Theme along with Rob's Wekeroad Ink theme from http://studiostyl.es. While I'm not sure if I'm ready to fully make the dark theme switch, it's pretty nice.

My Visual Studio Dark Theme

Other non-Webby Features

Some other features and cool things of note to me (there are lots more than this) are:

  • Customization is back to make for a smaller installation.
  • Install the RC directly over the Beta. No need to uninstall. Whew!
  • Windows Vista support for .NET Framework 4.5
  • XAML compiler incremental builds in Metro apps is now twice as fast as beta.
  • Go-Live license, which means you can publish apps live today and get support if you need it.

Obscure Gotchas and Known Issues

Be sure to go through the readme to make sure that there aren't known issues that might mess you up. As with all pre-release software, be careful. Test things and don't blindly install on systems you care about. I'm installing this "on the metal" but I'm keeping a Visual Studio 2010 SP1 virtual machine around just in case something obscure is discovered.

One gotcha that I know of so far for those of you who are totally riding the beta train. If you install Visual Studio 2012 RC on Windows 8 Release Preview and are trying to get an ASP.NET 3.5 (that's 3.5, be aware) application to work, you'll have trouble with IIS Express. You can work around it by installing IIS8 from the Windows 8 Add Features control panel. Just installing IIS8 will fix a bad registry key created by IIS8 Express. This will be fixed in release. Obscure, but worth noting.

Related Links

All The Download Links - including OFFLINE installers inside ISOs

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.