marți, 4 februarie 2020

Execute a Python script using C#

The evolution of the Python ecosystem of libraries dedicated to, among others, machine learning has been driven by the languages popularity among data scientists. In order to bring Python to large-scale business, data-driven applications, it is possible to run a python script by using C# and retrieving its output for further presentation or storage.
One of the best posts on the topic can be found on CodeProject:
https://www.codeproject.com/Articles/5165602/Using-Python-Scripts-from-a-Csharp-Client-Includin

luni, 15 mai 2017

WPF Recipes - Binding of the RichTextBox Text


<RichTextBox>
    <FlowDocument>
        <Paragraph>
            <Run Text="{Binding MyText}"/>
         </Paragraph>
     </FlowDocument>                      
</RichTextBox>

vineri, 4 decembrie 2015

Windows Search Indexer High CPU

After the latest upgrade to Windows 10, I saw very high CPU consumption from two processes, SearchProtocolHost.exe and SearchIndexer.exe.
The CPU was at 80-90%. I looked up for a solution and found it here:
http://answers.microsoft.com/en-us/windows/forum/windows_8-performance/microsoft-windows-search-filter-host-is-burning-my/bae4c974-5b47-4ab2-b17d-c599853f00f1?auth=1
It seems to be an older problem, prior to Windows 10.
To solve this I went to Control Panel and opened "Indexing Options". On the top of the window, I could see that the index was being built. I then went to "Advanced" and under the "Index Settings" tab, in the "Troubleshooting" section, I chose "Rebuild". This deletes the index and rebuilds it. Apparently there is "an error with the index" that causes the CPU consumption. As soon as I chose to rebuild, the CPU went down to reasonable values, below 5%.
These are the processes to look for in Task Manager:


vineri, 22 mai 2015