Avoid multiple mouse move events in C#

in windows/wpf application, mouse move event is triggered multiple time. We will see how to avoid multiple mouse move events. if we want to do some time consuming task in mouse move event, that will affect the performance. Here we will see how to avoid that using timer. In the below logic, mouse move event will be triggered once the mouse move stopped. XAML <Window x:Class="MouseMoveAvoidMultipleEvents.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Border Name="brd" Background="LightBlue" MouseMove="brd_MouseMove" > </Border> </Window> C# using System; using System....

January 2, 2019 · 1 min · 153 words · M.Kumaran

Backtracking – 1000 locks and 1000 students problem

A high school has a strange principal. On the first day, he has his students perform an odd opening day ceremony: I’m sure I’ll write a lot more interesting things in the future. There are one thousand lockers and one thousand students in the school. The principal asks the first student to go to every locker and open it. Then he has the second student go to every second locker and close it....

January 1, 2019 · 2 min · 214 words · M.Kumaran