.net

C#: Perform Operations on GPU, not CPU (Calculate Pi)

Hello, I've recently read a lot about software (mostly scientific/math and encryption related) that moves part of their calculation onto the GPU which causes a 100-1000 (!) fold increase in speed for supported operations. Is there a library, API or other way to run something on the GPU via C#? I'm thinking of simple Pi calculation. I h...

DDL for SQL Membership/Roles Provider

Where can I get the DDL to add SQL Roles and Membership to an existing SQL Server database? I want to use the providers but I'd like to manually run the scripts. ...

Differences between Visual Studio Modes (General, Web Dev, C#)?

Hello, what exactly are the differences between the different Visual Studio install modes (General, Web Development, C#)? This is also confusing because I do Web Development in C#. Which one should I use? ...

Read and write to the registry with VB .Net

Hello, I made a game and I would like to store the high score and other values in the windows registry. It's made in vb .net. Could someone give me a sample code example of simple reading and writing to the registry. Thanks ...

Silverlight deep zoom composing issue

Hello everyone, Deep zoom composer itself is very nice tool. I am wondering if there are any automatic ways to compose? For example, I have 100 images, and I want to compose automatically as 10 * 10 deep zoom effect. I am implementing a background workflow and automatically composing deep zoom and publish. The Output Type I prefer is "I...

Embed Dictionary into vb .net application

I want to embed a dictionary.txt which my program uses a streamreader object to parse. I tried to add it to resources but then the streamreader had an error. How can it be properly done? Thanks ...

Why doesn't the Union function in LINQ remove duplicate entries?

I'm using VB .NET and I know that Union normally works ByRef but in VB, Strings are generally processed as if they were primitive datatypes. Consequently, here's the problem: Sub Main() Dim firstFile, secondFile As String(), resultingFile As New StringBuilder firstFile = My.Computer.FileSystem.ReadAllText(My.Computer.FileSyste...

How to pass a variable from one app domain to another

Hello. I'd like to know, if I have a variable,for example, a string, how to pass its value to my new app domain: static string _str; static void Main(string[] args) { _str = "abc"; AppDomain domain = AppDomain.CreateDomain("Domain666"); domain.DoCallBack(MyNewAppDomainMethod); AppDomain.Unload(domain); Console.Write...

Schema validation error in DataSet

I have created a DataSet using Visual Studio 2008. When I opened the DataSet in source mode and then I get the following error while I compiling. "Could not find schema information for the attribute 'urn:schemas-microsoft-com:xml-msdata:UseCurrentLocale'" (not only for 'UseCurrentLocale' but for many other similar usages. When I looke...

Passing values back and forth appdomains

Hello. I have the following code: public class AppDomainArgs : MarshalByRefObject { public string myString; } static AppDomainArgs ada = new AppDomainArgs() { myString = "abc" }; static void Main(string[] args) { AppDomain domain = AppDomain.CreateDomain("Domain666"); domain.DoCallBack(MyNewAppD...

How to match this strings with Regex?

Basically I have music filenames such as: <source> <target> "Travis - Sing" "Travis - Sing 2001.mp3" "Travis - Sing" "Travis - Sing Edit.mp3" "Travis - Sing" "Travis - Sing New Edit.mp3" "Mission Impossible I" "Mission Impossible I - Main Theme.mp3" "Mission Impossible I" "Mission Impossible II - Main Theme.mp3" "Mesrine - De...

Examples of ORMs which use a single table for the entire hierarchy and those which don't ?

From http://blogs.tedneward.com/2006/06/26/The+Vietnam+Of+Computer+Science.aspx "developers typically adopt one of the other two approaches, more complex in outlook but more efficient when dealing with relational storage: they either create a table per concrete (most-derived) class, preferring to adopt denormalization and its costs, or ...

How to disable Partial Views ViewState?

Hi I keep getting this error System.Web.HttpException was unhandled by user code Message="Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster." Source="Sy...

C#: Extend Static Class across Projects

Hello, I have a static class in a shared project, which I want to extend with further methods in another project. Because the method I want to extend the static class with is only applicable to the 2nd project and also dependent on other classes in that different project, I can't just move it to the shared project. Basically I have cla...

How to sort out numeric strings as numerics?

If you have strings like: "file_0" "file_1" "file_2" "file_3" "file_4" "file_5" "file_6" "file_11" how can you sort them so that "file_11" doesn't come after "file_1", but comes after "file_6", since 11 > 6. Do I have to parse the string and convert it into a number for this? Windows explorer in Win7 sorts files out the way I wanted...

How to match 2 lists most effectively (fast)?

I have 2 lists<string> of items, source and target. The items in the source list will have 0 to n matches in the target list, but there will not be duplicate matches. Considering both lists are sorted, how would you do the matching most effectively in terms of performance. Example: source = {"1", "2", "A", "B", ...} target = {"1 - new...

how can i draw and give motional property in cube?

How to rotate cube? without silverlight and flash? is it javascript? how can i do with ajax+C#? http://library.wolfram.com/explorations/webUnrisk/CheckCap.jsp ...

ReadConsoleOutput, WriteConsoleOutput, ReadConsoleInput functionality in Mono under Linux

I use in .Net version of my program three native WinApi functions through P/Invoke: ReadConsoleOutput, WriteConsoleOutput, ReadConsoleInput. How to implement this functionality in Mono counterpart under Linux? I know about standart System.Console class. But this class for some strange reason does not support functionality of previously ...

Proper localization of a WinForms application

I have a WinForms application which I want to translate into multiple languages. However, I do not have any experience with localizing a WinForms app, and I find very contradictory information about this subject. Basically, what I want is: In the source code, I want only one file per language this file gets compiled into the main appl...

.NET code contracts: can it get more basic than this?

I was just messing around to answer someone's question here on Stack Overflow, when I noticed a static verification warning from inside my Visual Studio (2008): string[] source = { "1", "A", "B" }; var sourceObjects = Array.ConvertAll(source, c => new Source(c)).ToArray(); I'm getting the message requires unproven source != null. It s...