Azure Based COVID19 PPE Hospital Forecasting Using Azure Server-less Architecture

Introduction This project was born from Rush’s Medical Center development of the same project which was implemented using Jupyter Notebook & hosting it on a virtual machine using Voila. Rush’s Medical Center calculates forecasting based on 3 models: Exponential Regression Logistic Regression Polynomial Regression Deploy to Azure To deploy this solution to Azure click here to access … More Azure Based COVID19 PPE Hospital Forecasting Using Azure Server-less Architecture

Writing Data From .Net to Excel Interrupted by User Opening Excel Window

Problem I have an application that generates financial reports in excel. After installing Office 2013, if a user opens excel while the application is running, the application returns a error: System.Runtime.InteropServices.COMException with HRESULT: 0x800AC472 which interrupts the data from being written to the spreadsheet. After some research according to Microsoft this was done by design, the … More Writing Data From .Net to Excel Interrupted by User Opening Excel Window

OAuth2 – Get an Access Token – C#

What is OAuth2? OAuth 2.0 is the industry-standard protocol for authorization. OAuth 2.0 supersedes the work done on the original OAuth protocol created in 2006. OAuth 2.0 focuses on client developer simplicity while providing specific authorization flows for web applications, desktop applications, mobile phones, and living room devices. reference: https://oauth.net/2/ Who uses OAuth2? Among them … More OAuth2 – Get an Access Token – C#

Handy C#, VB.Net & SQL Code Snippets

Date time – how to initialize a date [code language=”csharp”] DateTime value = new DateTime(2017, 1, 18); [/code] Concatenate string list into comma separated string [code language=”csharp”] List<string> message = new List<string>(); message.Add("Record exists"); message.Add("Invalid data format"); message.Add("Duplicated record"); string output = String.Join(", ", message.Where( m=> (m.Length != 0))); Console.WriteLine(output); [/code] Initialize a string list … More Handy C#, VB.Net & SQL Code Snippets

This Recordset is not Updateable

Problem I have a Microsoft Access database application. When updating a record from the screen, users kept getting the error: This recordset is not updateable The form datasource is a query with two tables Solution This query was not updatable, here is a list of reasons why a query would not be updatable By Allen … More This Recordset is not Updateable

Refactoring IV – Finally There

On the previous post, we moved validation functionality to the Scraping object. The resulting function was this: [code language=”csharp”] private void btnStockSales_Click(object sender, RoutedEventArgs e) { TickerDataCollection = new ObservableCollection&amp;amp;amp;amp;lt;TickerData&amp;amp;amp;amp;gt;(); var stockList = ReadStockData(); foreach (var item in stockList) { Scraper y = new Scraper(); TickerData x = y.Scraping(item); TickerDataCollection.Add(new TickerData(x.Ticker) { High = x.High, … More Refactoring IV – Finally There

Refactoring III -Why is this here?

On the previous post I moved URL parsing code by extending the StockData class and creating a property called Url, now we are left with this code, but if you look at the highlighted code, there are way too many things happening here!. [code language=”csharp” highlight=”14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29″] private void btnStockSales_Click(object sender, RoutedEventArgs e) { TickerDataCollection = new ObservableCollection(); // … More Refactoring III -Why is this here?

Refactoring II- Encapsulating

On my previous post, I started refactoring a function that reads stock and dates, checks the data against Yahoo Finance and returns some data. In this function, I take the Stock Ticker and the data and parse the URL to be evaluated by our web scrapper object. [code language=”csharp” highlight=”13,14,15,16,17,18,19,20,21,22,23″] private void btnStockSales_Click(object sender, RoutedEventArgs … More Refactoring II- Encapsulating

Refactoring I -Convert Linq Anonymous Types to List

Refactoring is an important process to crafting readable and maintainable code. Functions should follow  the single responsibility principle – a function should do one thing and one thing only and should have few lines of code. Like with everything, you should apply this with measure and wisdom. I was asked to write a function that … More Refactoring I -Convert Linq Anonymous Types to List

Transact-SQL Server – Transposing a table

The Problem A client sent me an excel sheet with financial information classified in columns where each column header was a date and the values associated with that date were listed below I needed to insert the information to a normalized table with the following columns: Client Account EntryDate Value The Solution Step 1 Loaded … More Transact-SQL Server – Transposing a table

Books every software developer should read in 2016 – if you have not done so

The obligatory reflection on what have we accomplished in 2015 … always a sticky question. But if keep it to my book, training and research, it does not look that bad, I managed to keep the momentum going. Software Development Cracking the coding Interview – Gayle Laakman This is a great book with brain teasers and … More Books every software developer should read in 2016 – if you have not done so

Sum and Group Data Table Records Using Linq

The Problem You have a data table and you need to group and sum records dynamically. Solution I needed to group information by a field and the sum the values on a different field; For example, I want to group employees by department and then sum their salary. Below is the linq code to this: … More Sum and Group Data Table Records Using Linq

Basic Data Structures: AVL Trees

Basic Data Structures : AVL Trees Now to AVL trees, another neat data structure to store lists of information.. This my friends is a courtesy of communism (gasp!) yes, AVL trees were invented by these soviet guys: Georgy Adelson-Velsky and E. M. Landis; for the history lesson and more theory you can check WikipediA – … More Basic Data Structures: AVL Trees

Basic Data Structure: Linked Lists

Basic Data Structures: Linked Lists In a return to basics – and plenty of nothing to do – I implemented my own little linked list. Given the state of modern computing I have never really needed to implement a linked list, .Net framework has excellent libraries that manage lists and arrays, however, I guess it … More Basic Data Structure: Linked Lists