I want to have a enumerator/generator that will always provide me with the next value whenever I call say GetNext? Is this possible?
Examples:
myStringEnumerator.GetNext()
-> returns "Identifier01.xml"
myStringEnumerator.GetNext()
-> returns "Identifier02.xml"
myStringEnumerator.GetNext()
-> returns "Identifier03.xml"
myStringEnu...
Is there a fast/simple way to calculate the frequency distribution of a .Net collection using Linq or otherwise?
For example: An arbitrarily long List contains many repetitions. What's a clever way of walking the list and counting/tracking repetitions?
...
I have a gridview, the contents of which are provided by accessdatasource the data displayed is dependant on a dropdown list which has a postback event
The page loads
User selects an item from the dropdown
page reloads with new data in the gridview
So far so good
I have then added a textbox to the grid view (no I can't to use the ...
WeakReference implementation in .NET has an IsAlive Property.
1) Are there any performance/behavior differences between using the IsAlive property or testing whether the Target property is not null?
2) IsAlive is a redundant property?
Thanks.
...
I followed a blog post here to use a custom validator to validate a list of emails. However, the Regex expression in the article:
Regex emailRegEx = new Regex(@"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*",
RegexOptions.IgnoreCase);
allows this email address through:
"[email protected] [email protected]"
which is ...
So I am embarking on creating a desktop WCF service that, at its core, access hardware attached to a serial port. Obviously there is only one port, and several entities that are derived from that hardware (nodes in a Zigbee network if you care) need to be shared with all service clients equally.
A quick look at Chapeter 8 of Juval Lowy...
Hi,
Could anyone help me with the line where TEntity : class, IEntity, new() in the following class declaration.
public abstract class BaseEntityManager<TEntity>
where TEntity : class, IEntity, new()
Thanks for your help in advance.
...
i created a small tool in windows application using (.net language C#).
i created setup for my tool and also when we click on minimize button it will be in system tray. My requirement is i want to place my tool in start up (start>All Programs>Start up)
when i start my system automatically my tool is open this is my requirement please hel...
Hello everyone,
I am using VSTS 2008 + C# + .Net 3.5 to develop a console application and I send request to another server (IIS 7.0 on Windows Server 2008). I find when the # of request threads are big (e.g. 2000 threads), the client will receive error "Unable to connect to remote server fail" when invoking response = (HttpWebResponse)r...
I am getting the following error on one of our production servers. Not sure why it is working on the DEV server?
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Erro...
Hi All,
I am wondering, how would one write a file (say for instance, from a Console Application in a scheduled task) to another computer on a different domain? How would one set the Username and Password, such as with the "Log on to..." dialog to authenticate?
Couple of prerequisites exist, obviously:
The machines can see each other...
Getting DocumentSteam for html websites without using a Winforms WebBrowser control for parsing?
Is this possible? I would like to create some types like:
HtmlDocument doc = new HtmlDocument ("http://www.ms.com");
DocumentStream ds = doc.GetFullStream();
...
Also if possible, please post code.
...
I have the following code which works on Windows XP and Vista - both 32 and 64 bit:
public static Icon GetFolderIcon(IconSize size, FolderType folderType)
{
// Need to add size check, although errors generated at present!
uint flags = Shell32.SHGFI_ICON | Shell32.SHGFI_USEFILEATTRIBUTES;
if (FolderType.Open == folderType)
...
I have a class where it's problematic to relay on the properties being serialized in alphabetical order at design time.
In other words, property Z must be serialized before property A.
The problem arises because property property Z clears property A whenever it changes - which happens in InitializeComponent.
I work around this problem b...
my code extracts file icons(or even thumbs). however if i have many files it may take a while. I've tried to use background thread to load icons.
Bitmap created from icon extracted form file and stored in list. It seems that for each native bitmap it handle exist only in owner thread (that is in thread where bitmap created).
In UI thr...
I'm building a physics engine and i had some sort of "pseudo-verlet" thing going and i wanted to upgrade it to "real" verlet. So i found an article and set to work. After i added what i think is a good approximation, the engine doesn't work anymore. Can someone help me understand what i'm doing wrong?
My main physics body class's update...
I need to upload large files of atleast 1GB file size.
I am using ASP.Net, C# and IIS 5.1 as my development platform.
I am using
HIF.PostedFile.InputStream.Read(fileBytes,0,HIF.PostedFile.ContentLength)
before using File.WriteAllBytes(filePath, fileByteArray)(doesnt go here but gives System.OutOfMemoryException' exception)
Currently ...
How have I to implement IEqualityComparer<DataRow> to remove duplicates rows from a DataTable with next structure:
ID primary key, col_1, col_2, col_3, col_4
The default comparer doesn't work because each row has it's own, unique primary key.
How to implement IEqualityComparer<DataRow> that will skip primary key and compare only data...
My understanding is, that .NET doesn't really 'do' config files for DLLs - only the main Executable or Web App gets a config file, and all DLLs referenced by the Executable/Web App read from that.
But in VS2008, if you add a Web Reference to a Class Library (DLL) project, it adds a Settings.Settings file and an app.config file to the pr...
If i control a pool of resources with a semaphore, what is the clean shutdown sequence for this resource pool?
class ResourcePool
{
Semaphore resourceSemaphore;
Stack<ResourceClass> resources;
public ResourcePool()
{
resources ... // Init some Resources in the stack
resourceSemaphore= new Semaphore(resou...