Pull to refresh

The Microsoft company has temporarily suspended it’s blog on Habr

Show first

Checklist for writing great Visual Studio extensions

Reading time3 min
Views1.1K
Great Visual Studio extensions share a few key features that sets them apart from the rest. They look and feel well crafted, are performant and reliable, do what they advertise to perfection, and blend in naturally among Visual Studio’s own features.

To make it easier to write great extensions, we’ve worked with the extensibility community to come up with a simple checklist to follow. There’s even a GitHub issue template you can use so you remember to go through the checklist.

Read more →
Total votes 10: ↑10 and ↓0+10
Comments0

Write Better Code Faster with Roslyn Analyzers

Reading time3 min
Views4.6K
Roslyn, the .NET compiler platform, helps you catch bugs even before you run your code. One example is Roslyn’s spellcheck analyzer that is built into Visual Studio. Let’s say you are creating a static method and misspelled the word static as statc. You will be able to see this spelling error before you run your code because Roslyn can produce warnings in your code as you type even before you’ve finished the line. In other words, you don’t have to build your code to find out that you made a mistake.



Roslyn analyzers can also surface an automatic code fix through the Visual Studio light bulb icon that allows you to fix your code immediately.

Read more →
Total votes 9: ↑9 and ↓0+9
Comments2

GitHub Package Registry will support Swift packages

Reading time1 min
Views1.2K
On May 10, we announced the limited beta of GitHub Package Registry, a package management service that makes it easy to publish public or private packages next to your source code. It currently supports familiar package management tools: JavaScript (npm), Java (Maven), Ruby (RubyGems), .NET (NuGet), and Docker images, with more to come.

Today we’re excited to announce that we’ll be adding support for Swift packages to GitHub Package Registry. Swift packages make it easy to share your libraries and source code across your projects and with the Swift community.

Read more →
Total votes 7: ↑6 and ↓1+5
Comments0

C# or Java? TypeScript or JavaScript? Machine learning based classification of programming languages

Reading time6 min
Views1.6K
GitHub hosts over 300 programming languages—from commonly used languages such as Python, Java, and Javascript to esoteric languages such as Befunge, only known to very small communities.


Figure 1: Top 10 programming languages hosted by GitHub by repository count 

One of the necessary challenges that GitHub faces is to be able to recognize these different languages. When some code is pushed to a repository, it’s important to recognize the type of code that was added for the purposes of search, security vulnerability alerting, and syntax highlighting—and to show the repository’s content distribution to users.

Linguist is the tool we currently use to detect coding languages at GitHub. Linguist a Ruby-based application that uses various strategies for language detection, leveraging naming conventions and file extensions and also taking into account Vim or Emacs modelines, as well as the content at the top of the file (shebang). Linguist handles language disambiguation via heuristics and, failing that, via a Naive Bayes classifier trained on a small sample of data. 

Although Linguist does a good job making file-level language predictions (84% accuracy), its performance declines considerably when files use unexpected naming conventions and, crucially, when a file extension is not provided. This renders Linguist unsuitable for content such as GitHub Gists or code snippets within README’s, issues, and pull requests.

In order to make language detection more robust and maintainable in the long run, we developed a machine learning classifier named OctoLingua based on an Artificial Neural Network (ANN) architecture which can handle language predictions in tricky scenarios. The current version of the model is able to make predictions for the top 50 languages hosted by GitHub and surpasses Linguist in accuracy and performance.
Read more →
Total votes 6: ↑5 and ↓1+4
Comments0

Take your Linux development experience in Windows to the next level with WSL and Visual Studio Code Remote

Reading time2 min
Views2.1K
Using VS Code Remote and the Windows Subsystem for Linux (WSL) gives you a fully featured Linux development environment on a Windows laptop or desktop. Let’s look at how using these tools will completely change how you develop with Linux tools in Windows.

image
Total votes 12: ↑10 and ↓2+8
Comments0

Simplify Your Code With Rocket Science: C++20’s Spaceship Operator

Reading time8 min
Views2.1K
C++20 adds a new operator, affectionately dubbed the «spaceship» operator: <=>. There was a post awhile back by our very own Simon Brand detailing some information regarding this new operator along with some conceptual information about what it is and does. The goal of this post is to explore some concrete applications of this strange new operator and its associated counterpart, the operator== (yes it has been changed, for the better!), all while providing some guidelines for its use in everyday code.

Read more →
Total votes 13: ↑11 and ↓2+9
Comments0

How AI, drones and cameras are keeping our roads and bridges safe

Reading time4 min
Views908
«It's a dangerous business, Frodo, going out your door. You step onto the road, and if you don't keep your feet, there's no knowing where you might be swept off to.»

― J.R.R. Tolkien, The Lord of the Rings

Europe’s roads are the safest in the world. Current figures show that there are 50 fatalities per one million inhabitants, compared to the global figure of 174 deaths per million. Despite this, each loss remains a tragedy. In 2017, 25,300 people lost their lives on European roads.

The cause of these accidents can vary from human error and weather conditions, to damaged structures and surfaces. While some things are beyond the realms of control, road and bridge conditions are a variable which can be governed.

As soon as a road is paved, a combination of traffic and weather conditions begin to degrade and erode the surface. Undetected cracks, abrasions or defects can quickly lead to bigger problems, such as costly repairs, major traffic delays, and in the worst cases, unsafe condition. These problems are also shared by bridges, particularly when concrete is critical in maintaining the integrity of the structure. The earlier faults are detected, the sooner they can be addressed, saving time and money, while minimising disruption. Ultimately, this helps ensure that the roads themselves are safer for those travelling on them.

The detection of these faults, however, can be very difficult to carry out manually, especially as early-forming cracks are hard to spot with the naked eye. Predicting where faults are likely to occur ahead of time so that appropriate measures can be taken in advance also possess a massive challenge. Thankfully, technology is here to help.

Read more →
Total votes 13: ↑11 and ↓2+9
Comments0

Tutorial: Update interfaces with default interface members in C# 8.0

Reading time5 min
Views1.4K

Beginning with C# 8.0 on .NET Core 3.0, you can define an implementation when you declare a member of an interface. The most common scenario is to safely add members to an interface already released and used by innumerable clients.


In this tutorial, you'll learn how to:


  • Extend interfaces safely by adding methods with implementations.
  • Create parameterized implementations to provide greater flexibility.
  • Enable implementers to provide a more specific implementation in the form of an override.

Read more →
Total votes 10: ↑9 and ↓1+8
Comments0

Python in Visual Studio Code – June 2019 Release

Reading time2 min
Views2.3K
We are pleased to announce that the June 2019 release of the Python Extension for Visual Studio Code is now available. You can download the Python extension from the Marketplace, or install it directly from the extension gallery in Visual Studio Code. If you already have the Python extension installed, you can also get the latest update by restarting Visual Studio Code. You can learn more about Python support in Visual Studio Code in the documentation.

In this release we made improvements that are listed in our changelog, closing a total of 70 issues including a plot viewer with the Python Interactive window, parallel tests with pytest, and indentation of run selection in the terminal.

Read more →
Total votes 9: ↑9 and ↓0+9
Comments0

Visual Studio tips and tricks

Reading time3 min
Views3.5K
Whether you are new or have been using Visual Studio for years, there are a bunch of tips and tricks that can make you more productive. We’ve been sharing tips on Twitter using the hashtag #vstip for a while, and this is a collection of the best ones so far.

Debugger


Hitting F10 to build, run, and attach debugger instead of F5 will automatically break on the first time your own code is being executed. No breakpoints needed.

image

Supported from Visual Studio 2005

Reattach to process (Shift+Alt+P) is extremely helpful when you have to attach to the same process again and again.

image

Supported from Visual Studio 2017 v15.8

A blue dot in the margin indicates a switch of threads while stepping through debugging.

image

Supported from Visual Studio 2013
Read more →
Total votes 8: ↑7 and ↓1+6
Comments0

Airbus reaches new heights with the help of Microsoft mixed reality technology

Reading time4 min
Views1.1K

It took Airbus 40 years to build its first 10,000 aircraft. Over the next 20 years, the aerospace giant aims to build 20,000 more—aformidable challenge that will require cutting-edge innovation.


Holographic technology from Microsoft, known as “mixed reality” because it combines physical and digital worlds, will be key to helping Airbus reach this ambitious goal.


An aerial view of Airbus jets.
Read more →
Total votes 4: ↑4 and ↓0+4
Comments0

Dynamically generating robots.txt for ASP.NET Core sites based on environment

Reading time3 min
Views1.9K

I'm putting part of older WebForms portions of my site that still run on bare metal to ASP.NET Core and Azure App Services, and while I'm doing that I realized that I want to make sure my staging sites don't get indexed by Google/Bing.


I already have a robots.txt, but I want one that's specific to production and others that are specific to development or staging. I thought about a number of ways to solve this. I could have a static robots.txt and another robots-staging.txt and conditionally copy one over the other during my Azure DevOps CI/CD pipeline.


Then I realized the simplest possible thing would be to just make robots.txt be dynamic. I thought about writing custom middleware but that sounded like a hassle and more code that needed. I wanted to see just how simple this could be.


Read more →
Total votes 9: ↑8 and ↓1+7
Comments0

A drawing bot for realizing everyday scenes and even stories

Reading time6 min
Views1.6K

Drawing bot


If you were asked to draw a picture of several people in ski gear, standing in the snow, chances are you’d start with an outline of three or four people reasonably positioned in the center of the canvas, then sketch in the skis under their feet. Though it was not specified, you might decide to add a backpack to each of the skiers to jibe with expectations of what skiers would be sporting. Finally, you’d carefully fill in the details, perhaps painting their clothes blue, scarves pink, all against a white background, rendering these people more realistic and ensuring that their surroundings match the description. Finally, to make the scene more vivid, you might even sketch in some brown stones protruding through the snow to suggest that these skiers are in the mountains.


Now there’s a bot that can do all that.

Read more →
Total votes 5: ↑4 and ↓1+3
Comments0

WSL 2 is now available in Windows Insiders

Reading time3 min
Views4.1K

We’re excited to announce starting today you can try the Windows Subsystem for Linux 2 by installing Windows build 18917 in the Insider Fast ring! In this blog post we’ll cover how to get started, the new wsl.exe commands, and some important tips. Full documentation about WSL 2 is available on our docs page.


Read more →
Total votes 19: ↑18 and ↓1+17
Comments1

How Moovit improved its app to help people with disabilities ride transit with confidence

Reading time4 min
Views858

Alexandr Epaneshnikov, a 19-year-old Russian student who is legally blind, recently decided he wanted to be more independent by commuting on his own and relying less on his mom for rides to school. It meant taking a streetcar to a subway to his high school in Moscow, a 30-minute trip that Epaneshnikov assuredly navigates with a cane and Moovit, an urban mobility app optimized for screen readers.


Read more →
Total votes 15: ↑15 and ↓0+15
Comments0

Announcing .NET Core 3.0 Preview 6

Reading time8 min
Views1.2K

Today, we are announcing .NET Core 3.0 Preview 6. It includes updates for compiling assemblies for improved startup, optimizing applications for size with linker and EventPipe improvements. We’ve also released new Docker images for Alpine on ARM64.



Read more →
Total votes 11: ↑9 and ↓2+7
Comments0

Who put Python in the Windows 10 May 2019 Update?

Reading time3 min
Views1.9K

Some days ago the Windows team announced the May 2019 Update for Windows 10. In this post we’re going to look at what we, the Python team, have done to make Python easier to install on Windows by helping the community publish to the Microsoft Store and, in collaboration with Windows, adding a default “python.exe” command to help find it. You may have already heard about these on the Python Bytes podcast, at PyCon US, or through Twitter.


The header of the Python 3.7 page in the Microsoft Store
Read more →
Total votes 10: ↑9 and ↓1+8
Comments0

Porting desktop apps to .NET Core

Reading time5 min
Views2.6K

Since I’ve been working with the community on porting desktop applications from .NET Framework to .NET Core, I’ve noticed that there are two camps of folks: some want a very simple and short list of instructions to get their apps ported to .NET Core while others prefer a more principled approach with more background information. Instead of writing up a “Swiss Army knife”-document, we are going to publish two blog posts, one for each camp:


  • This post is the simple case. It’s focused on simple instructions and smaller applications and is the easiest way to move your app to .NET Core.
  • We will publish another post for more complicated cases. This post will focus more on non-trivial applications, such WPF application with dependencies on WCF and third-party UI packages.

If you prefer watching videos instead of reading, here is the video where I do everything that is described below.


Total votes 8: ↑7 and ↓1+6
Comments0

How a School in Puerto Rico Brings Chemistry to Life with Minecraft: Education Edition

Reading time3 min
Views1.4K

The San Juan Math, Science, and Technology center in Puerto Rico is using game-based learning to pave the way for a new level of engagement among their students. The institution is part of San Juan’s municipal education system and is recognized by Microsoft alongside a global community of other schools engaged in K-12 education transformation. The school decided to integrate Minecraft: Education Edition into their curriculum and have seen exciting results in STEM learning.


image
Total votes 11: ↑10 and ↓1+9
Comments0