New project: Bingo for meetings–part 1

Bingo

Bingo is a small project, written in TypeScript , and developed with Alexandru Badita in launch break (one hour - more or less). You can find sources at https://github.com/alexandru360/PresentationBingoCards/ . Those are my blog posts for Bingo : ( scroll below for the post)
NrLink
1Create meeting
2Create Tests
3Finalize Create meeting
4Sharing meeting
5Keep Score
6Add obsolete
7Finalizing obsolete
8End meeting
9Dockerize tests
10Azure CI tests
11Yarn workspaces
12CLI
13Intermezzo - CLI improvements
14typescript compile run with node
15NestJS ,swagger and create a meeting
16Finalizing API
17Intermezzo - jest vs jasmine error
18Refactor WebAPI and test service
19Heroku Deploy NestJs
20Angular
21Deploy Angular to GitHub
22WebAPI and Web
23Documentation
24Documentation of the code
25Conclusions

I have decided to start a new project. The name is “Bingo for meetings”. What it does: Every time in a meeting that a participant hears a phrase (like “ Hi, can you hear me?” or “ can everyone see my screen?” or others …)  he can check one of the cards. In the final you can see for the meeting how many cards you have checked.

I am doing the project with Alexandru Badita (http://alexandru360.blogspot.com/) .  We agreed to be in ONLY in TypeScript .

We are doing at Starbucks the pair programming and exchange ideas. Total time: 1 hour

In the first meeting we have  put the specifications at https://github.com/alexandru360/PresentationBingoCards/projects/1

Create Meeting Bingo:

As a user, I want to create a new meeting bingo: I use an username and meeting name and the application generates an unique Id that I can access the bingo cards ( state :  not checked) for that meeting

Share Meeting Bingo:

As a User, I can receive the meeting Id( url) . When going to this url , I can ( optionally) enter my name and check cards

Checking cards:
A total score will be displayed when checking / unchecking

EndMeeting:
The score of how many cards/ what cards were checked will be available 1 hour and 5 minutes

Meeting Obsolete:
The meeting is available for 35 minutes. After that, meeting is not available anymore.

Also, we have created the classes Meeting, Participant,  Also, we have created a MeetingsFactory that can create a Meeting.

You can fist the result of our code at https://github.com/alexandru360/PresentationBingoCards/releases/tag/firstMeeting 

.

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)

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.