Hello Devz, Here is a simple tutorial of how to use ML.Net to make a prediction based on regression. ML.Net is an open source and cross-platform machine learning framework. A regression is a statistical method to find the relation between variables. Let’s use a budget context. We have a list of expenses with a cost […]
C# – Decision Tree – Simple Example
Hello Devz, Sometimes it is hard to take a decision. And to represent the possibilities of complex decisions, it is usefull to use a Decision Tree. Instead of having all the parameters at once, you can simply take small decision at a time and then go further. In this simple tutorial we will show an […]
WPF – Paste Clipboard content from Excel to a GridView
Hello Devz, Manipulating the clipboard content is pretty easy. But it can become handy when pasting it in a GridView. Here a simple example on how to paste the content of the clipboard from Excel to a GridView. First things first! Here is how to use the clipboard: var clipboardContent = Clipboard.GetText(); Obviously you could use […]
WPF – MVVM TextBox Validation with IDataErrorInfo
Hello Devz, This post will describe how to do a simple MVVM TextBox validation with IDataErrorInfo. UI Data Validation is an important part of the FrontEnd creation. The FrontEnd should always be backed up by the BackEnd validation! But here we will focus only on the FE part. Before showing the code, you have to […]
WPF – Enum Binding With Description in a ComboBox
Hello Devz, In my two previous posts, I was talking about how to bind an enum (the classic way and the other way). But these have two major issues. First, all the items from the Enum will be bound and displayed. And sometimes you don’t want to display all of them (like ‘None’). Secondly, you […]
WPF – Enum Binding in a ComboBox – The Other Way
Hello Devz, In a previous post I was talking about the fact that there is no “out-of-the-box” solution to bind an Enum to a ComboBox. And I described the WPF way of doing it with the ObjectDataProvider defined in the XAML. Here is another way, more code oriented than XAML. This is the XAML part: […]
WPF – Enum Binding in a ComboBox – The Classic Way
Hello Devz, I had to write this post about how to do an Enum binding to a ComboBox, because everytime I need it, I’m surprised there is no “out-of-the-box” solution provided in WPF or Xamarin.Forms. <Window x:Class=”EnumBinding.MainWindow” xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation” xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml” xmlns:d=”http://schemas.microsoft.com/expression/blend/2008″ xmlns:mc=”http://schemas.openxmlformats.org/markup-compatibility/2006″ xmlns:local=”clr-namespace:EnumBinding” xmlns:sys=”clr-namespace:System;assembly=mscorlib” mc:Ignorable=”d” Title=”MainWindow” Height=”350″ Width=”525″> <Window.Resources> <ObjectDataProvider x:Key=”dataFromEnum” MethodName=”GetValues” ObjectType=”{x:Type sys:Enum}”> <ObjectDataProvider.MethodParameters> <x:Type TypeName=”local:StatusEnum”/> </ObjectDataProvider.MethodParameters> […]
C# – Aspose.Cells – Create Excel files without Excel
Hello Devz, It is common to have to export data to an Excel file. But sometimes the code have to run on a server where Excel is not or can’t be installed. And anyway, to be honest the Excel Interop is a real piece of crap to use… So Aspose did a good work by […]
C# – SI prefixes for metric units – because size matters
Sometimes you will have to play with numbers, BIG numbers… Or teeny-tiny ones! To avoid having too many zeros you can use the SI prefixes (like metric units: mm, cm, m, km, …). Here are the results of our code: 123,460000 -> 123,460 w (1000) 123,460000 -> 123,460 w (1024) 1.234,560000 -> 1,235 kw (1000) 1.234,560000 […]
Google Dialogflow – create your own AI in a few clicks
Hello Devz, Having a Google Home at home and a Google Assistant in my pocket, I wanted to go further and create my own Actions. Pretty easy with Google DialogFlow! DialogFlow is a free web interface that allows you to create a, wait for it… dialog flow! Let’s say I want to add an expense […]