.net

C# - Is "volatile" really needed as a keyword?

As I read deeper and deeper into the meaning of the volatile keyword, I keep saying to myself "this is way into implementation, this should not be a part of a high level programming language". I mean, the fact that CPUs cache the data should be interesting for the JIT compiler, not to the C# programmer. A considerable alternative might ...

strstr() equivalent in C#

Hi, I have two byte[] and I want to find the first occurrence of the second byte[] in the first byte[] (or a range in it). I don't want to use strings for efficiency (translating the first byte[] to a string will be inefficient). Basically I believe that's what strstr() does in C. What is the best way to do that (so it be efficient a...

Easy Transfer Cable .NET

Hi I have searched the web intensly for the last days trying to find some information regarding the use of the Easy Transfer Cable in .NET, this search has came up with little result. So I wondered if any one here has some experience using this cable in .NET I'm looking for: * Some general info such as the protocol, dataflow, formats ...

Sync Framework 2.0 Error: The specified change tracking operation is not supported.

I'm fairly new to the MS Sync framework and have been beating my head against the wall for about four hours now to no avail. I'm simply trying to sync my databases (one "master" SQL Server 2008 with a SQL Server CE, the client) with: Dim syncAgent As DataCacheSyncAgent = New DataCacheSyncAgent() Dim syncStats As Microsoft.Synchronizati...

what is practical use of System.Transactions?

I have seen System.Transactions namespace, and wondered, can I actually make a RDMBS with this namespace usage? But when I saw some examples, I do not understand how System.Transactions does anything beyond simple try catch and getting us success/failure result? This is the example on MSDN's website, I know it may be very simple but I...

WCF Service didn't reply, timeout encounters on a system behind firewall with NAT

I am encountering a strange problem, here is my scenario One WCF Service (named WCF1) is deployed on Web Server with basicHttpBinding (streaming enabled) I've a Windows Service Application which consumes WCF1, and hosts a WCF Service (named WCF2) with namedPipeBinding (duplex). A Windows Application which consumes WCF2, and handles e...

Which ComponentModel.DataAnnotations attributes are used in the Dynamic Data metadata classes?

This namespace contains a lot of attributes for use in, I'm sure, many different applications. I'm curious to know which subset of the attributes in this namespace can be and are used in the Dynamic Data proxy class system, where the entity class is given an attribute that specifies a metadata type. That type contains properties with t...

20 bit integer math

How do I add/subtract/multiply and divide integers using only 20 bits instead of 32 bits in C#? Will these operations be faster than 32bit precision? For example this .NET library is featuring 20 and 30 bit arithmetic with different speeds: http://complex-a5.ru/polyboolean/index.html Thanks. ...

how can i dynamically change the connection string

I am using vb.net and SQL server 2005 I have a project with database classes which are generated from database objects. That is I add a dataset to the project and drag and drop a database object onto it. The problem with this is that I have to give a connectionstring which is stored in the code. This is ok while developing the applicati...

Which language/framework for HPC: Java/.Net/Delphi/C/C++/Objective-C?

I have deliberated endlessly over which language/framework best suits the following. I need to develop a HPC framework. All processing will be completely OO. It will pass objects between instances (external) and internally between threads & engines. The Objects will be an extension of Active Messages. These instances could run on mobile...

VB.NET: Populating a list in Linq

Assume I have the following XML file: <Movies> <Movie ownerName="Ryan"> <Title>The Lord of the Rings Trilogy</Title> <Title>Saving Private Ryan</Title> <Title>etc</Title> </Movie> <Movie ownerName="Rynina"> <Title>Foo</Title> <Title>Bar</Title> </Movie> </Movies> Wh...

C# on Linux: How to enumerate the computers on the local network ?

How can I enumerate all machine names and IPs of remote computers in the local network ? Note: NOT on Windows (how to do that one finds via google), I need something that works on Linux ! Or a C/C++ sample would also do it, I can call libc from C#. ...

F# upcasting TextBlock to UIElement

What is wrong with: let (x:UIElement) = upcast new TextBlock() The error is: The type 'System.ComponentModel.ISupportInitialize' is required here and is unavailable. You must add a reference to assembly 'System, Version=4.0.0....' TextBlock is a subtype of UIElement... Note that doing what the error message says does solve the issue...

Working with SharpUSBLib

Hi, i'd like to connect my Android smartphone from an .NET application. Anyway, SharpUSBLib looks like it can do this. Does anyone know so good tutorials about working with SharpUSBLib? I did't find any and don't know how to use it. Tanks! ...

Objective C for .NET

Any other package like this http://code.google.com/p/oscompiler/downloads/detail?name=OSCv0.1.4.zip&amp;can=2&amp;q= I'm surprised by the very small size. Do I need to install Gnustep for the headers file ? ...

Why can't the profiler attach?

I wrote a small profiler for .NET applications. It uses the ICorProfilerCallback2 interface. The profiler attaches and works well for .NET 2.0 application but doesn't work for .NET >2.0 (3.0, 3.5, 4.0). When I start an exe compiled with .NET 4.0 nothing happens, however for .NET 2.0 the profiler starts. I'm setting the following variabl...

Repository integration tests

I want to implement integration tests of my Entity Framework driven repositories. The problem is how to rollback database state after tests are done. At the moment I'm planning to start transaction at test SetUp and roll it back at test TearDown. Are there any other solutions excepting manual database clearing? ...

Read/Write binary file with structure of fixed length

I need to read/write file which as light as possible and with super-fast read and write access. In other words, I cannot use serialization or binary serialization. I have to be able to update a single records and seek in the file quickly. Essentially, I need a file structure similar to what I would do in C/C++ (i.e. fixed size structure...

blank page with iis7 when using .NET 4.0

hi, i am having strange problem, when i change the default app pool to use .Net 4.0 from .Net 2.0 i get blank page with no HTML, strangely enough i have VS 2010 installed with Net4.0 thanks in adavanced ...

How do I get an XML attribute with XmlReader.Create?

I am using XmlReader.Create to retrieve data from an RSS xml file. Then I am putting this data into a DataSet and binding it to a ListView: XmlReader xmlReader = XmlReader.Create(this.RssUrl); XmlDataDocument xdoc = new XmlDataDocument(); xdoc.DataSet.ReadXml(xmlReader, XmlReadMode.InferSchema); The problem is that one of the fields I...