.net

how to set CPU affinity of a program?

限于喜欢 提交于 2021-02-06 10:47:30
问题 I have a program written in C#, I am using VSTS 2008 + .Net 3.5 + Windows Vista Enterprise x86 to develop a Windows Forms application. My current computer is dual-core CPU, I want to set CPU affinity of my program to run on a specific CPU and free another CPU to do some other job. Any ideas how to do this? Either through coding or configuration is ok. A little more background is, my program is CPU intensive, so I do not want to let it occupy all two CPU resources on my computer and I want to

how to set CPU affinity of a program?

∥☆過路亽.° 提交于 2021-02-06 10:45:07
问题 I have a program written in C#, I am using VSTS 2008 + .Net 3.5 + Windows Vista Enterprise x86 to develop a Windows Forms application. My current computer is dual-core CPU, I want to set CPU affinity of my program to run on a specific CPU and free another CPU to do some other job. Any ideas how to do this? Either through coding or configuration is ok. A little more background is, my program is CPU intensive, so I do not want to let it occupy all two CPU resources on my computer and I want to

What are the groups of four dashes in the .NET reference source code?

孤街醉人 提交于 2021-02-06 10:14:51
问题 I was browsing the source of the PluralizationService when I noticed something odd. In the class there are a couple of private dictionaries reflecting different pluralisation rules. For example: private string[] _uninflectiveWordList = new string[] { "bison", "flounder", "pliers", "bream", "gallows", "proceedings", "breeches", "graffiti", "rabies", "britches", "headquarters", "salmon", "carp", "----", "scissors", "ch----is", "high-jinks", "sea-bass", "clippers", "homework", "series", "cod",

Newtonsoft JSON.NET Security Vulnerability Implementation

落花浮王杯 提交于 2021-02-06 10:13:32
问题 The recently exposed security vulnerabilities regarding serialization in .NET have ambiguous recommendations. What is the correct way to securely use JSON.NET? Detailed guidance for JSON.NET: https://www.blackhat.com/docs/us-17/thursday/us-17-Munoz-Friday-The-13th-JSON-Attacks-wp.pdf#page=5 Should TypeNameHandling.All be used or should TypeNameHandling.None be used? General Explanation: https://www.bleepingcomputer.com/news/security/severe-deserialization-issues-also-affect-net-not-just-java/

Proper name space management in .NET XmlWriter

*爱你&永不变心* 提交于 2021-02-06 10:11:51
问题 I use .NET XML technologies quite extensively on my work. One of the things the I like very much is the XSLT engine, more precisely the extensibility of it. However there one little piece which keeps being a source of annoyance. Nothing major or something we can't live with but it is preventing us from producing the beautiful XML we would like to produce. One of the things we do is transform nodes inline and importing nodes from one XML document to another. Sadly , when you save nodes to an

Calculating Averages with Performance Counters

心不动则不痛 提交于 2021-02-06 10:11:23
问题 I have a service process, and I want to use performance counters to publish the average time that it takes to complete tasks. I am using the AverageTimer32 counter to do this. It's almost working the way I want, but not quite: When I increment the counter, it will briefly bump up to the value that I expect (watching in Performance Monitor), but then it drops right back down to zero. So, the counter is zero, I run a task, the task completes, the counter briefly bumps up (to the correct value),

Proper name space management in .NET XmlWriter

别来无恙 提交于 2021-02-06 10:10:41
问题 I use .NET XML technologies quite extensively on my work. One of the things the I like very much is the XSLT engine, more precisely the extensibility of it. However there one little piece which keeps being a source of annoyance. Nothing major or something we can't live with but it is preventing us from producing the beautiful XML we would like to produce. One of the things we do is transform nodes inline and importing nodes from one XML document to another. Sadly , when you save nodes to an

Calculating Averages with Performance Counters

末鹿安然 提交于 2021-02-06 10:08:21
问题 I have a service process, and I want to use performance counters to publish the average time that it takes to complete tasks. I am using the AverageTimer32 counter to do this. It's almost working the way I want, but not quite: When I increment the counter, it will briefly bump up to the value that I expect (watching in Performance Monitor), but then it drops right back down to zero. So, the counter is zero, I run a task, the task completes, the counter briefly bumps up (to the correct value),

Calculating Averages with Performance Counters

早过忘川 提交于 2021-02-06 10:07:47
问题 I have a service process, and I want to use performance counters to publish the average time that it takes to complete tasks. I am using the AverageTimer32 counter to do this. It's almost working the way I want, but not quite: When I increment the counter, it will briefly bump up to the value that I expect (watching in Performance Monitor), but then it drops right back down to zero. So, the counter is zero, I run a task, the task completes, the counter briefly bumps up (to the correct value),

Calculating Averages with Performance Counters

半世苍凉 提交于 2021-02-06 10:06:42
问题 I have a service process, and I want to use performance counters to publish the average time that it takes to complete tasks. I am using the AverageTimer32 counter to do this. It's almost working the way I want, but not quite: When I increment the counter, it will briefly bump up to the value that I expect (watching in Performance Monitor), but then it drops right back down to zero. So, the counter is zero, I run a task, the task completes, the counter briefly bumps up (to the correct value),