My Visual Studio Code Extensions

I have many extensions on Visual Studio Code. The most impressive are Docker (ms-azuretools.vscode-docker , ms-vscode-remote.remote-containers ) , export extensions to a gist (Shan.code-settings-sync ) and various languages extensions ( powershell, csharp).

 

Anyway, this is the whole list:

 

  • christian-kohler.npm-intellisense
  • CoenraadS.bracket-pair-colorizer
  • dbaeumer.vscode-eslint
  • donjayamanne.githistory
  • DotJoshJohnson.xml
  • eamodio.gitlens
  • eg2.tslint
  • eg2.vscode-npm-script
  • esbenp.prettier-vscode
  • formulahendry.auto-close-tag
  • formulahendry.auto-rename-tag
  • hoovercj.vscode-dimmer
  • humao.rest-client
  • johnpapa.vscode-peacock
  • karigari.chat
  • ms-azure-devops.azure-pipelines
  • ms-azuretools.vscode-azurefunctions
  • ms-azuretools.vscode-docker
  • ms-mssql.mssql
  • ms-vscode-remote.remote-containers
  • ms-vscode-remote.remote-ssh
  • ms-vscode-remote.remote-ssh-edit
  • ms-vscode-remote.remote-ssh-explorer
  • ms-vscode-remote.remote-wsl
  • ms-vscode-remote.vscode-remote-extensionpack
  • ms-vscode.azure-account
  • ms-vscode.csharp
  • ms-vscode.powershell
  • ms-vscode.vs-keybindings
  • ms-vsliveshare.vsliveshare
  • ms-vsliveshare.vsliveshare-audio
  • ms-vsliveshare.vsliveshare-pack
  • ms-vsts.team
  • msjsdiag.debugger-for-chrome
  • oderwat.indent-rainbow
  • quicktype.quicktype
  • redhat.vscode-yaml
  • sdras.night-owl
  • Shan.code-settings-sync
  • TzachOvadia.todo-list
  • vchristian-kohler.npm-intellisense
  • CoenraadS.bracket-pair-colorizer
  • dbaeumer.vscode-eslint
  • donjayamanne.githistory
  • DotJoshJohnson.xml
  • eamodio.gitlens
  • eg2.tslint
  • eg2.vscode-npm-script
  • esbenp.prettier-vscode
  • formulahendry.auto-close-tag
  • formulahendry.auto-rename-tag
  • hoovercj.vscode-dimmer
  • humao.rest-client
  • johnpapa.vscode-peacock
  • karigari.chat
  • ms-azure-devops.azure-pipelines
  • ms-azuretools.vscode-azurefunctions
  • ms-azuretools.vscode-docker
  • ms-mssql.mssql
  • ms-vscode-remote.remote-containers
  • ms-vscode-remote.remote-ssh
  • ms-vscode-remote.remote-ssh-edit
  • ms-vscode-remote.remote-ssh-explorer
  • ms-vscode-remote.remote-wsl
  • ms-vscode-remote.vscode-remote-extensionpack
  • ms-vscode.azure-account
  • ms-vscode.csharp
  • ms-vscode.powershell
  • ms-vscode.vs-keybindings
  • ms-vsliveshare.vsliveshare
  • ms-vsliveshare.vsliveshare-audio
  • ms-vsliveshare.vsliveshare-pack
  • ms-vsts.team
  • msjsdiag.debugger-for-chrome
  • oderwat.indent-rainbow
  • quicktype.quicktype
  • redhat.vscode-yaml
  • sdras.night-owl
  • Shan.code-settings-sync
  • TzachOvadia.todo-list
  • vscode-icons-team.vscode-icons
  • wayou.vscode-todo-highlight
  • zhouronghui.propertylist
  • scode-icons-team.vscode-icons
  • wayou.vscode-todo-highlight
  • zhouronghui.propertylist

 

You can find the list here: https://gist.github.com/ignatandrei/9edba23cc2ca5dc5e0971432c709fc9e

Of course, I should review each one. However, maybe in the tools list  I will explain each one this year  http://msprogrammer.serviciipeweb.ro/programmer-tools/

What are your extensions?

My take on battles in IT

 

First battle : VBScript vs JavaScript. Both were scripting on the browser. VBScript loose because NetScape did not implement it.

Second battle: Microsoft vs Java. Starts with a Microsoft Java implementation  – then C# takes over.

Third battle: MVC vs Silvelight . MVC wons – Silvelight does not work against Chrome.

Fourth battle : Desktop vs Mobile+Web   –  Web wins by large ,  And with Electron  + Cordova , web wins back

Now there are

  1. WebAssembly vs Web. I bet on Web.
  2. Odata vs GraphQL . I bet on GraphQL . OData was too linked to EF ( although now can work without)
  3. DataScience: Python vs R . I hope to win either ML.NET, either JavaScript.

 

What are the battles that you observe ?

C# WebAPI and NotFound with message in MVC .NET 4.5

Usually, WEBAPI should return correct HTML status code ( read also https://damienfremont.com/2017/11/23/rest-api-maturity-levels-from-0-to-5/ ) . Let’s say we are saving an entity  – the OK result could return a meaningful message. How about querying for an id that you cannot find ? Easy: NotFound :  .But –the NotFound does NOT show an message. How a client can make a difference between the fact that the entity is not found for a specific id and the fact that ,maybe, the whole site is not deployed / a route does not exists  ? What we need is a NotFound with a specific message. ( In .NET Core we have NotFoundObjectResult )

I have found 2 solutions: one complicated and one simple.

The complicated one:

var err = Request.CreateErrorResponse(
HttpStatusCode.NotFound,
new HttpError("my message”)
);
return new ResponseMessageResult(err);

The simple one

//this is for APIController only, not usual controller in .NET 4.5
return Content(HttpStatusCode.NotFound, "my message");

Enjoy!

[PostEvent]Verint Bucharest

I was a presenter at Verint Romania .

The agenda ( you can find at https://www.eventbrite.com/e/intelligence-technology-in-action-registration-62969053133 

18:00 -18:30 – Beer & Pizza

18:30 – 18:50 – Opening: Amit Daniel, Senior VP Marketing at Verint – CIS overview

18:50 – 19:40 – Keynote Speaker: Ignat Andrei, Tech leader- NET Core and Angular Everywhere => Mobile, Desktop & Web

19:40 – 20:00 – Live Product Demos – Intelligence Technology in Action

*the event is free and open to R&D audience.

It was a great evening, with people interested in technology and good software.

My presentation was about Angular and .NET Core that you can find at https://github.com/ignatandrei/angNetCoreDemo/ .

Thanks to Verint to invite me!

Use the right language for the job–if you know

Many years ago I have done a site that lists the exchange rates from BNR and BCE ( www.infovalutar.ro ). It reads the exchanges from BNR html page and then put into a database. The use is for programmers – there are many methods to find latest exchange rates ( RSS, SOAP, url, by MVC, JSON… –  see  all there : http://infovalutar.ro/programatori )

I keep the values in a simple table like

IDMoneda    Valoare    DataValorii
EUR    3.5842    2006-07-07 00:00:00
EUR    3.5892    2006-06-29 00:00:00
EUR    3.5887    2006-07-13 00:00:00
EUR    3.5942    2006-07-19 00:00:00
EUR    3.5642    2006-07-20 00:00:00
EUR    3.5672    2006-07-24 00:00:00

As you see . the value of the date is not contiguous – in the weekends is not a new exchange rate.

Now, the problem:  How can we detect if there is an error with parsing the values  ? The usual error is putting different values from NBR ( maybe they have also some csv file to parse ?). For example take this

IDMoneda    Valoare    DataValorii
RSD    0.0396    2019-01-17 00:00:00
RSD    0.0397    2019-01-18 00:00:00
RSD    0.0398   2019-01-21 00:00:00
RSD    3.98E-06    2019-01-22 00:00:00
RSD    4.02E-06    2019-01-23 00:00:00
RSD    4.02E-06    2019-01-25 00:00:00

How can we find where the difference starts for the currency ? ( We assume a relatively stable Romanian economy …. not like Venezuela )

The answer how to calculate where the problem is relatively easy: the percentage of how much the value has varied : ( CurrentValue  – Last_Value)/ Last_Value * 100 .  It should not pass 1 or , maximum 2 % .

But how to calculate this ?

For C# – or any other OOP programs- it is normal to read record by record , order by IDMoneda and DataValorii – and calculate the percentage. However , C# is not made for this kind of calculus.

Then we can see that is a database involved – and we  think about SQL . It is a complicated SQL –because of the fact that the dates are not contiguous – because of the Weekends. However , there is a simple SQL construct, LAG:https://docs.microsoft.com/en-us/sql/t-sql/functions/lag-transact-sql?view=sql-server-2016

select
abs(LAG(Valoare,1,0)Over(Partition BY IDMoneda Order BY DataValorii) – Valoare)/Valoare *100 ,Valoare , from CV_Valori

order by 1 desc

This query executes in seconds and we can see the problems fast

Sq- if you know the tool , please use in your current task!((

If you ask me about functional programming(F#) my answer it will be DSL)

VSCode and Docker

I am super-excited about Docker – because it gives a new meaning about “ it works on my PC”! ( I have a presentation ready –   https://github.com/ignatandrei/presentations/tree/master/2019/shorts/DockerForDevs/ )

However, I want to state something more important: VSCode is now ready to open Docker Containers!

You have to install:

1.

Name: Docker
Id: ms-azuretools.vscode-docker
Description: Adds syntax highlighting, commands, hover tips, and linting for Dockerfile and docker-compose files.
Version: 0.6.4
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker

2. 

Name: Remote – Containers
Id: ms-vscode-remote.remote-containers
Description: Open any folder inside (or mounted into) a container and take advantage of Visual Studio Code’s full feature set.
Version: 0.59.0
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers

Or this extension:

Name: Remote Development
Id: ms-vscode-remote.vscode-remote-extensionpack
Description: An extension pack that lets you open any folder in a container, on a remote machine, or in WSL and take advantage of VS Code’s full feature set.
Version: 0.15.0
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack

I have tried with dotnet try the extensions ( for your reference, you can generate the docker image and run the container by using the files from https://github.com/ignatandrei/Presentations/tree/master/2019/shorts/NetCoreGlobalTools/dotnetTry . Then use the externsion to open the dotnet try files under usr folder )

However, the VSCode has now capabilities over SSH, VSL and Docker. It is a wonderfull world, and now we can say : : it works on my Docker!

( My only regret is that VS 2019 has not  those capabilities)

Andrei Ignat weekly software news(mostly .NET)

* indicates required

Please select all the ways you would like to hear from me:

You can unsubscribe at any time by clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp's privacy practices here.