Shengwen Blog

Break it down, make it simple.

WinForm recording app with a volume level meter

Record speech from mic to WAV file

Prerequisites: Install NAudio, an open-source .NET library written by Mark Heath. After that, see this tutorial, figure it out and implement the code. Our code will be based on that. Now you have ...

MySQL 8.0 Access Denied for root

Steps to access MySQL 8.0 as root from localhost or remote client

Connect to MySQL from localhost After installation, you may find yourself unable to connect to MySQL: “Access denied for user ‘root’@’localhost’…”. Here’s the solution that works for me (MySQL 8.0...

Linear regression with sklearn example

Machine learning with python

The plan is to review the Stanford Machine Learning course and to complete the homework projects using python instead of Matlab. Data source: Stanford Machine Learning course. Linear regression w...

Use AjaxPro in Web Form and prevent timeouts for time-consuming requests

Add reference of the AjaxPro.2 dll in project; Add following lines to <system.webServer> node in Web.config; Add AjaxNamespace attribute on the web form class, reg...

Render custom error page in ASP.NET MVC

Below are 3 situations where an error page can be shown in an ASP.NET MVC Web App and what we should do to set custom error page. 1. Exceptions For instance: manually throw an exception in an act...

How to: use the zoom slider to scroll on Microsoft Natural Ergonomic 4000 keyboard

Ergonomic keyboard save your wrist

I’ve been using Filco Majestouch as my coding keyboard for 2 years and was satisfied with it. But recently I’ve been suffering from pain in my left wrist and I realized maybe it’s time to get an er...

SQL Server concurrent transactions

Isolation levels and concurrent problems

Catalog Isolation Levels Concurrent Problems Dirty Read Lost Update Nonrepeatable Read Phantom Read Difference between repeatable read and serializable ...

Dreams

1804070408hug0414holdhands&wedding0810dinner190403touchjtyhandjealous0529phonecall

Read data from Excel using NPOI in C#

Read a column from Excel sheet

In this example, we simply read a column from an Excel sheet and print each value in console. NPOI is the C# implementation of Java POI. The index of row and column (cells in a row) starts from 0...

Entity Framework handbook

Catalog Handle model change Seed database with test data Use stored procedures for inserting/editing/deleting in EF Use stored procedure for inserting/editing/deleting in code first approa...