.net

Controlling the Mono GC

Hi, Right now I'm experiencing lag spikes every 3-4 seconds where 500ms+ is spend on GCing. Does anyone have some pointers on controlling the Mono GC? I.e. get it to collect n% of the memory instead of 100% while increasing the collection interval. Thanks ...

I'm a .NET Programmer. What are specific uses of Python and/or Ruby for that will make me more productive?

I recall when I first read Pragmatic Programmer that they suggested using scripting languages to make you a more productive programmer. I am in a quandary putting this into practice. I want to know specific ways that using Python or Ruby can make me a more productive .NET developer. One specific way per answer, and even better if you ...

Possible to find TimeZoneById with TimeZoneDisplayName?

Hi I am using asp.net mvc and I am using a method that was on this site. http://stackoverflow.com/questions/442019/how-do-i-enumerate-all-time-zones-in-net So this is what I doing. I then display the results to the user. The user picks their timezone and I saved the display name in the database. However I am now trying to actually do...

0x00 in a binary file VB.NET

UPDATED BELOW I am reading a Binary file using BinaryReader in VB.NET. The structure of each row in the file is: "Category" = 1 byte "Code" = 1 byte "Text" = 60 Bytes Dim Category As Byte Dim Code As Byte Dim byText() As Byte Dim chText() As Char Dim br As New BinaryReader(fs) Category = br.ReadByt...

Source code statistics

Is there some free tool (preferably command line based) that you can give your root source directory and it will inspect all files and sub-folders and generate a set of nice "statistics"? Like... lines of code, number of classes, etc? I just thought it would be quite a nice and interesting way for us to keep track of the project's growt...

.NET CF 3.5: Adding GPS.NET 3.0 controls to my form

Hi, I am trying to add the GPS.NET 3.0 controls to my form in the designer. I have a .NET Compact Framekwork 3.5 project, I have added the Release assemblies CF35\GeoFramework.Gps.PocketPC.dll CF35\GeoFramework.PocketPC.dll to my references. In the toolbox I did this: Rightclick -> Choose toolbox items -> Browse and selected the CF3...

WPF: How to change the Foreground color of a Textbox depending on the Text property of another in XAML?

I want to make the Foreground property of a WPF Textbox red as long as its Text property does not match the Text property of another Textbox on the form. I can accomplish this in the code behind and through a binding with a converter. But is there a way to do it in XAML only? (I was thinking of a Trigger of some kind). ...

disposing of brushes

I am having a few memory problems with my long running application and I have been inspecting the paint methods to insure that brushes were properly disposed. In the case where the Brush is created in the argument to the functio will the brush be disposed of? such as the case below g.DrawString(valueText, Font, new SolidBrush(Colo...

How to get the Control for a Region in Prism

Hi, Does anyone know how to get the control associated with a region in Prism. For example, if I have the following code to register a region RegionManager.SetRegionName(Outlook.navigationContainer, "navigationContainer"); How can I get the control Outlook.navigationContainer via the name "navigationContainer"? Thanks heaps. ...

How do I determine who is the creator of an object

I have a class that is called regularly by serveral objects. I would like to include information in any exceptions as who the creater of the object is. What are my options? "Who" refers to an object or class ...

Help understanding Regex name patterns

I'm trying to understand how (?<name>pattern) works in Regex. Is there a good link or can someone offer a simple explanation? ...

How can I get the exact location of cursor on image in Picturebox

Hi every one. I have the picture box in which the image may be zoomed with different values. Then I try to find out the location of cursor on picture box. I write the following code on picture box mouse move event: int x = (2 * e.X - pictureBox1.Width + pictureBox1.Image.Width) / (2 * _scale / 100); int y = (2 * e.Y - pictureBox1.Height...

When does the .NET CLR evaluate security attributes?

I've just read the following in the CLI specification regarding SecurityExceptions upon method calls: The security check can occur when the CIL is converted to native code rather than at runtime. How does Microsoft's implementation handle this? If, for example, only a certain usergroup is allowed to access some class, and i have pla...

Directshow & .Net - Bitmap shows stripe from right on left side of image?

Sample Image: I'm using DirectShow.net to get webcam footage into my program. To accomplish this, I'm adding the source camera to the graph, and a VideoMixingRenderer9. That part is all working swimmingly, but the part where I extract a frame using GetCurrentImage(out lpDib) is having what I can only describe as an odd issue. What I ...

Can I safely rely on IsBackground in Threads when the application terminates?

I'm running some background threads in the GUI. Currently I'm implementing a personal Thread cancellation code but there is IsBackground property in threads and according MSDN they'll cancel themselves. I know that it's going to Thread.Abort() which is nasty but there is nothing going in this background threads that I need to keep a pro...

List Box databound problem

i bound the list box with data table.display member is "Code" and value member is "ID".no w i want to retrieve the all item of list box.but it return me system.data.datarow.how can i get all item from ListBox in this Case ...

Empty Worker Threads, What are they?

While debugging a .NET Framework 3.5, WinForms application I spotted some "Worker Thread"s without a name. I know when you open an application you've got a one worker thread by default. However in the middle of debugging when I pause the debugger and take a look at the "Threads" window I see about 5+ similar threads (priority=normal)....

Correct way to obtain base name of a generic type in .NET is through Substring?

If I have this: Type t = typeof(Dictionary<String, String>); How do I get "System.Collections.Generic.Dictionary" as a string? Is the best/only way to do this: String n = t.FullName.Substring(0, t.FullName.IndexOf("`")); Seems kinda hackish to me though. The reason I want this is that I want to take a Type object, and produce code...

timeout setting for SQL Server

Hello everyone, I am using VSTS 2008 + ADO.Net + C# + .Net 3.5 + SQL Server 2008. I am using ADO.Net at client side to connect to database server to execute a store procedure, then return result from the store procedure. Here is my code. I have two issues about timeout, If I do not explicitly set any timeout related settings, for the...

How to instantiate DataReceivedEventArgs or be able to fill it with data?

Im starting a process and redirecting it error stream to be able to parse it and know what happened. Im doing it in such a way: _proc.ErrorDataReceived += new DataReceivedEventHandler(NetErrorDataHandler); where NetErrorDataHandler have the following signature: private void NetErrorDataHandler(object sendingProcess, DataReceivedEvent...