Thursday 14 August 2014

How to Replace characters at specified position and line in UNIX


sed -n -e 24p -e 24q | cut -c27-34
sed -n '24p;24q' | cut -c27-34
The -n option means 'do not print lines by default'; the 24p means print line 24; the 24q means quit after processing line 24. You could leave that out, in which case sed would continue processing the input, effectively ignoring it.

Thursday 7 August 2014

DoEvents in WPF

Below is the equivalent of Doevents in WPF

public static void DoEvents()
{
Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, new ThreadStart(delegate { }));
}


If you want to do it in a WPF UserControl Library or CustomControl Library then you can do as below:

controlname.Dispatcher.Invoke(DispatcherPriority.Background, new ThreadStart(delegate { }));