How to install Java on Windows 10

To develop Java programs you need to install the Java Development Kit (JDK). It contains the Java compiler and other tools. The following steps will show you how to install OpenJDK on Windows 10. OpenJDK is a free and open-source implementation of Java SE (Standard Edition). Download Go to the OpenJDK landing page. Navigate to … Read more How to install Java on Windows 10

How to set a timeout for TcpClient.ConnectAsync()

TcpClient has no direct way to set the connection timeout. It doesn’t have any parameters that allow you to control it, and SendTimeout / ReceiveTimeout don’t apply to the initial connection. The way I control the connection timeout is by awaiting a Task.WhenAny() with TcpClient.ConnectAsync() and Task.Delay(). Task.WhenAny() returns when any of the tasks complete. … Read more How to set a timeout for TcpClient.ConnectAsync()

How to update UI from another thread

I often need to be able to run multiple threads and update the UI based on the results. For example, I may need to execute GET requests to 10 different endpoints concurrently, and then report their results in a datagrid as they come back. The problem is you can’t just update the UI from any … Read more How to update UI from another thread

How to sort data into groups then further sort within each group using SQL

I recently came across a complex sorting problem that required sorting the data into groups, then further sorting the data within each group. Requirement My requirement is to sort a list of orders for users in charge of approving orders. Here is a list of orders with their status and department: Here is a list … Read more How to sort data into groups then further sort within each group using SQL

Export Trello board and extract the card names and links using C#

I have a Trello board with tons of cards, most of them archived, and I want to go through all of them and determine which ones are worth documenting. In order to that I need to export the board as JSON and extract out the relevant data for each card – which for me is … Read more Export Trello board and extract the card names and links using C#

Improve your code and design intuition

You should be able to develop your code and design sense to the point where you can look at anyone’s code (including your own) and intuitively know if it’s good or not. This is a critical skill to have if you are responsible for doing code and design reviews. Here’s some suggestions based on what … Read more Improve your code and design intuition

C# – Attribute constructor parameter is not a valid attribute parameter type

Problem I have created a custom attribute class and I am trying to pass in a value. It looks like this: I’m getting the following error message: Attribute constructor parameter has type Color which is not a valid attribute parameter type I have also gotten this error message, which has the same underlying cause: An … Read more C# – Attribute constructor parameter is not a valid attribute parameter type

ReportViewer – How to format phone numbers

I am building a ReportViewer report and need to format phone numbers. For example, I want “5551234” to be formatted as “555-1234.” Specify the phone number format Use the following expression: Now when I run the report it looks like this: Other formatting examples In my example above I was using a very simple format. … Read more ReportViewer – How to format phone numbers