|
Glad I could help.
/ravi
|
|
|
|
|
Unrelated: I recommend creating the Random instance once (as a static field perhaps) rather than instantiating a new one on each call.
|
|
|
|
|
Hi guys!
In one of my applications I use UDP multicast to broadcast event notifications to an arbitrary number of clients.
This works nicely, except for one system where the application is running on Windows Server 2008R2.
On this machine, the call to Send() for a newly created UdpClient hangs.
I'm trying to send around 2K of data, well below the maximum size of 16K for UDP packages.
The process of sending is quite straightforward (at least from my point of view):
- Create a UdpClient
- Join the corresponding multicast group
- Serialize the event data
- Send this data (in row to several destination ports, if this makes any difference)
- Leave the multicast group
I couldn't find anything about Send() hanging so far, but perhaps someone here has an explanation?
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi,
Kindly let me know the method or any related link that, How may I insert IMAGE files or JPG,BMP file into MS-ACCESS TABLE using C#
Thank you
(Riaz)
|
|
|
|
|
|
Thank you very much Mr. Peter..
I got the solution from your kind help....
(Riaz)
|
|
|
|
|
hello everyone!!
Help me!!! i want to do the program in the same wiimote but i don't know. if you know, please, help me
Thank you very much
|
|
|
|
|
I think you are a little confused: a wiimote is a controller, not a (normally) programmable device...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Google for wiimote hacks[^] and that will show you what sort of things are possible with the controller.
|
|
|
|
|
There's an article on Coding4Fun[^] that comes with a managed library.
Bastard Programmer from Hell
|
|
|
|
|
Hi All !
I want to use a crystal report ,so i want to add a new data source . when i want to add , i get this Error :
Could not retrieve schema information for table or view
Please help how can i do ?
thanks for any help !
modified on Friday, August 12, 2011 9:15 PM
|
|
|
|
|
|
Hey everyone,
I am kinda junior and was wondering if I could get some assistance with a log class that I am writing.
I am having an issue of file contention when writing/appending to the log from my app while someone else is. Is there a way to get around this?
Everything works fine, the only problem is when multiple people write as described above.
Using: VS2010 C#.
Type : Windows app calling a class library.
Let me know if more information is needed.
Thanks in advance!!
|
|
|
|
|
Typically you don't have multi-user log files for this very reason. Each user has his own personal log file. Each log write operation should open file, write, close file so it is not locked. However, if you are doing a lot of logging, you'll still have multi-user contention. I'd go with a seperate log file for each user.
|
|
|
|
|
sheldons wrote: I am having an issue of file contention when writing/appending to the log from my app while someone else is
The only real solution to that is to stop doing it.
Attempting multiple writes at the same time is not deterministic. And there is no way to make it so.
Multiple apps can use the same file but that requires some mechanism to insure that only one is writing to the file at one time.
|
|
|
|
|
It might be a bit complex for the application, but I work with a SCADA system that has to collect log entries from multiple devices and is at risk from the same potential problem. The solution in my situation is a small log server that runs on its own. When devices come online, they register with the server, then maintain a queue of events internally. The free-running server adds each active device to its polling list, and sequentially requests a dump of queued events from each device, one at a time. Since each device includes a time stamp for each entry, the complete set of events is easily sorted by the log server so that all events appear in the log sequentially.
You could implement something similar in your app, with each instance of it generating an event when it has something to log, and the separate log server subscribing to the events. The server component would retrieve log events from the sending instance of your program and manage the log file itself, eliminating contention. Just a thought...
Will Rogers never met me.
|
|
|
|
|
sheldons wrote: when writing/appending to the log from my app while someone else is.
Just to verify - this is because multiple applications are writing and not just because there are multiple places in one app that does it?
Also have you looked at nlog? Or log4net?
|
|
|
|
|
I don't see a reason why you want to use a single log file for multiple user, this problem will definitely happen. A separate log file for each user will be advisable.
|
|
|
|
|
Sounds like your logger class needs to implement a queue based approach - each call to AddLog() or whatever you've called your main logging method doesn't attempt to do the write there and then, but puts the details of what to write onto the queue....the queue then proesses each one in turn, meaning that you shouldn't get mulipe write attemps....
C# has already designed away most of the tedium of C++.
|
|
|
|
|
I'm somewhat new to OOP & having a little trouble setting up some classes. Here's a quick little background on my project:
--------------------------------------------
Basically, I need to create some objects for working with excel similar to that of the excel objects within the "Microsoft Office Object Library" (I'm using the ms open xml sdk kit, which seems to require a little more work than the ms object library). In particular, I'm looking to create 3 objects:
-Workbook
-Worksheet
-Range
-My Workbook class would contain methods such as "OpenWorkbook" and "Save".
-My Worksheet class would contain methods such as "OpenWorksheet", "InsertWorksheet", and "CopyWorksheet".
-My Range class would take a range of cells and contain methods for formatting that range such as "FontColor", "FontSize", etc.
-----------------------------------------------------
My issue:
I need to pass around properties from object to object but unsure on how to do so in the cleanest fashion. For example, within my Workbook class, I declare the following property:
public WorkbookPart WbPart { get; set; }
I will then need to use this "WbPart" property within my Worksheet class. For example, to insert a new worksheet, I need to use the following:
WbPart.AddNewPart<worksheetpart>();
My question
What's the best way to pass around these properties from class to class? Should I create a base class for this or something, and if so, how would I create this base class (I'm unfamiliar with base classes)?
Thanks.
|
|
|
|
|
I don't understand the purpose of the WookbookPart.
The simple approach to this is that there are ownership relationships here (a sheet belongs to a book, and a range to a sheet), which implies classes like:
class Workbook {
List<Worksheet> Sheets;
}
class Worksheet {
Workbook Owner;
List<Range> Ranges;
Cell GetCell(int x, int y);
}
class Range {
Worksheet Owner;
List<Cell> Cells;
}
class Cell {
Worksheet Sheet;
object Value;
}
I'm not sure that the list of ranges actually makes sense as ranges are dynamically created (correct?) so there isn't a fixed list to add to and read back from. I've given each class a reference to its owner, which can be null if you have 'orphaned' references (creating a sheet dynamically and not yet added to the book, etc). You'd then want to make sure that when adding things to the list in the parent, they had their Owner property updated accordingly.
|
|
|
|
|
|
hi to everyone
i want to loading a big image(350 m) in my application how can i do it?
when i try to load it from normal way it's take 900m of my memory
|
|
|
|
|
You are trying to load image with size 350MB?!
I Love T-SQL
"VB.NET is developed with C#.NET"
If my post helps you kindly save my time by voting my post.
www.cacttus.com
|
|
|
|
|
It's a fairly common to have large file sizes when doing print or other work requiring high resolution graphics.
|
|
|
|