.net

How do I communicate with an RNDIS attached device on Windows (.Net)?

I have a device that implements the RNDIS driver protocol for connection over USB. When this device is attached to the system, Windows recognizes it as an RNDIS device and creates a network adapter to represent it. My question: How do I communicate with a service running on the device at this point? What libraries in .Net would allow ...

Contains is faster than StartsWith?

A consultant came by yesterday and somehow the topic of strings came up. He mentioned that he had noticed that for strings less than a certain length, Contains is actually faster than StartsWith. I had to see it with my own two eyes, so I wrote a little app and sure enough, Contains is faster! How is this possible? DateTime start = D...

How is unmanaged code run in .NET?

How does unmanaged code run in .net? ...

SQL Server timeout exception when extending Linq partial methods

In .NET 4.0 and Linq to SQL, I am trying to use a partial class to "trigger" changes from within an update method (an existing DBML method). For simplicity, imagine a table Things with columns Id and Value The auto gen DBML contains a method OnValueChanged, I'll extend that and as an exercise try to change one value in one other row : ...

Killer benefit of Reactive Extensions?

What is the killer benefit of Reactive Extensions (for either .NET or JavaScript)? Why should a developer learn and use them? ...

breakpoints in SharpDevelop with IronPython

is it possible somehow to get the breakpoints to work in SharpDevelop with IronPython/Winforms? They work alright with other languages but with IronPython they just don't stop ...

Add event handler in derived class' constructor or override the OnX() method?

When designing a derived class, are there [dis]advantages to adding a handler to a base class event in the ctor vs overriding the OnEventName() method and adding some behaviour (as well as calling the base method), if one doesn't need to change the base method and doesn't care in what order things happen, but only wants a reusable compon...

Should I learn Java or should I learn C++?

I have a pretty good non-OOP background. I've done lots of Visual Basic coding, and a little SQL. I want to widen my skillset and be more marketable. Most of my experience has been working with scientific companies, and I've been supporting scientists a lot. I want to take some online classes from my local community college. Should I t...

Converting C# code to F# (if statement)

I'd like to know how to convert this code line by line from C# to F#. I am not looking to use any kind of F#'s idioms or something of the like. I am trying to understand how to map direcly C#'s constructs to F#. Here is the C# code: //requires l.Length > 0 int GetMinimumValue(List<int> l) { int minVal = l[0]; for (int i = 0; i...

Deploying ASP.NET MVC2 app Issue

I'm trying to deploy my new ASP.NET MVC 2.0 website to our Windows Server 2008 box and having some issues. I created a new website in IIS, made sure the application pool was set to Integrated. When I browse to the website I get the following error. Server Error in '/' Application. Configuration Error Description: An error occurred d...

Importing .NET XML doc comment files into Doxygen project

Anyone know if there is a way to importing .NET XML doc comment files into Doxygen project? I have a project that uses assemblies that that have XML comment files. I'd like Doygen to pick up that documentation and add it to my doc output. ...

How do you suggest I approach this unique problem?

I have a website where I allow businesses to register what products they sell individually. Then a consumer can online and search for a product and receive a list of all the shops where it's currently selling. Although they can upload one product at a time, I want to allow businesses to mass upload things they offer. I was thinking of ...

wcf duplex service issue

Hi all, i am new to WCF, i try to create a duplex service and i get an exception with this messge "HTTP could not register URL http://+:80/Temporary_Listen_Addresses/42be316a-0c86-4678-a61a-fc6a5fd10599/ because TCP port 80 is being used by another application." I will post the whole code in here and i hope you have time to take a look. ...

Can I tell if a string corresponds to either a file or a directory in .NET?

If I have a string, I know I can use If System.IO.File.Exists(mystring) or System.IO.Directory.Exists(mystring) to see which it is. Is there a method I can use to make a single call to determine which type it is? Since, at least in Windows, you can't have both a file and a directory with the same name, it seems like there should be a fun...

how to create windows7-styled message/dialog boxes with command links in c#?

How to create these beautiful message/dialog boxes (example: http://i.msdn.microsoft.com/dynimg/IC123363.png) in C#? Is there a function similar to MessageBox.Show in the .NET Framework? ...

What's the purpose of the Tuple(T1)/Singleton in .net?

One of the Tuple Types in .net 4 is a Single-Element Tuple. I just wonder what the purpose of this struct is? The only use I saw is when using in the 8+ Tuple as it can be assigned to TRest, where it actually makes sense. Is that it? Or is there any other purpose? ...

System.IO.FileNotFoundException

This one is a long story: i have recently built a win32 application in Visual Studio that uses DirectX and I sent it to some friends to verify that it works on other machines. They all had .NET installed, but the app didn't worked for all of my friends. In two cases there we're some "could not load file or assembly Microsoft.DirectX.Di...

Grouping in Regex

I'm trying to do a match in regex. It must match a string of characters of with the following formats: Start with a C or H, w/ 6 characters following. (Total 7 characters long) Start with KK and with 8 characters following. (Total 10 characters long) The field is limited to 10 typed characters. I have the following: (((C|H).{6})|(KK....

How can I make a WPF window maximized on the screen with the mouse cursor?

According to the MSDN documentation for the WindowStartupLocation Property: Setting CenterScreen causes a window to be positioned in the center of the screen that contains the mouse cursor. Although the MSDN doc for the CenterScreen Field itself defines it somewhat less clearly as: The startup location of a window is the center...

How to debug config files in .NET?

I've got a Visual Studio project that recently started throwing a ConfigurationErrorsException, and I can't figure out where it's coming from. I've hunted high and low, can't find anything like the error, and it doesn't appear for any of my teammates when they run the project on their PCs. Does anyone have any specific advice on how to ...