Make first letter of a string upper case (with maximum performance)

Solution in different C# versions C# 8 with at least .NET Core 3.0 or .NET Standard 2.1 Since .NET Core 3.0 / .NET Standard 2.1 String.Concat() supports ReadonlySpan<char> which saves one allocation if we use .AsSpan(1) instead of .Substring(1). C# 8 C# 7 Really old answers This version is shorter. For a faster solution, take a look at Diego’s answer. Probably the fastest … Read more

SQL “select where not in subquery” returns no results

Update: These articles in my blog describe the differences between the methods in more detail: NOT IN vs. NOT EXISTS vs. LEFT JOIN / IS NULL: SQL Server NOT IN vs. NOT EXISTS vs. LEFT JOIN / IS NULL: PostgreSQL NOT IN vs. NOT EXISTS vs. LEFT JOIN / IS NULL: Oracle NOT IN vs. NOT EXISTS vs. LEFT JOIN / IS NULL: MySQL There are three ways to do such a query: LEFT JOIN … Read more

Laravel 5 MethodNotAllowedHttpException in RouteCollection.php line 201:

This is how I do it. Routes.php admin_login.blade.php dashboard.blade.php UsersController.php Your Code: In routes.php, you have only 1 route, i.e., And there is no declaration of post method, hence, the MethodNotAllowedHttpException Also, in your controller, you are returning the view first and then processing the form which is not going to work at all. You first need to process … Read more

serviceHub.Host.CLR.x86 taking a lot of memory and CPC

The serviceHub.Host.CLR.x86 is responsible for running some processes in the background for Visual Studio 2017/2019. Among other features, there are three Visual Studio features that run under this process and, in some cases, cause high CPU/Memory usage. They are: Full solution analysis. Live Unit Testing. (only in Visual Studio Enterprise) Code Lens. (only in Visual Studio Enterprise and Professional) Disable these features as … Read more

http-server command not found

You may not have your npm binaries in PATH. Make sure that your npm binaries are in path by running echo $PATH. You should see, somewhere in the printed output, something like: /home/bob/.npm-packages/bin is the directory where my npm binaries are installed whenever I run npm -g install whatever. If you don’t see something like that, read Fixing npm permissions which … Read more

jQuery posting JSON

‘data’ should be a stringified JavaScript object: To send your formData, pass it to stringify: Some servers also require the application/json content type: There’s also a more detailed answer to a similar question here: Jquery Ajax Posting json to webservice