Is LinkedList Implementation Of .Net Threadsafe
Apr 26, 2011
I am working on an application which uses multiple threads to work on number of tasks and the parent application receives the output of the task,later to be written to files, currently I am using arraylist to append output to, but that happens to be slow when removing items from queue.I was thinking to convert arraylist part to linkedlist for optimized reads and clears,if linkedList Implementation of .Net is threadsafe or even using arraylist was threadsafe?
View 3 Replies
ADVERTISEMENT
Mar 18, 2010
So I've been doing some research on the singleton factory design pattern, and I am wondering if my example implementation is correct (warning I did get carried away creating animals):
[Code]...
View 6 Replies
Jan 30, 2010
I have a sub that handles onClick and a sub that handles onKeyDown so will the 2 functions ever run synchronously or will they be surely be asynchronous without me having to synclock both blocks of code?
View 8 Replies
Jan 19, 2011
I have a List(Of Byte) that is filled with bytes from the serial buffer on a SerialPort.DataRecieved Event. I then try to parse the data. Part of the parsing process involves deleting elements of the List(Of Byte). Should I be concerned about the List being modified by a DataRecieved Event that might be raised during the parsing process? I realize that probably depends on what I'm trying to do, but, assuming I should be concerned (e.g., the parsing process needs List.Count to not change until parsing is finished), how should I go about making sure any Add calls wait until the parser is done? I guess the answer is something like SyncLock, but I've never really understood how SyncLock works.
View 1 Replies
Apr 9, 2009
Does anyone have an extension method to quickly convert the types in a LinkedList<T> using a Converter<TInput, TOutput>?
View 3 Replies
Apr 4, 2011
I am converting java code to vb.net and this line of code gives me different output in enclipse than one in VS.
req1.set(req3, Integer.valueOf(((Integer)req1.get(req3)).intValue() ^ ((Integer)req6.get(req3 + 256)).intValue() & 0x1));
System.out.println(req1.get(req3));
[code].....
View 1 Replies
Apr 25, 2011
{"Value cannot be null. Parameter name: collection"}
Dim Data() As Integer
Dim SignalData As New LinkedList(Of Integer())(Data) ' <-- error thrown here
View 3 Replies
May 3, 2011
{"Value cannot be null. Parameter name: collection"}
Dim Data() As Integer
Dim SignalData As New LinkedList(Of Integer())(Data) ' <-- error thrown here
View 2 Replies
Oct 22, 2009
what the point of a Generic.LinkedList is in Visual Basic .NET 2010.I've heard that I can save sorting time with such a list, since it somehow sorts objects as they are added.How can I perform such sorting with this type of list?
View 1 Replies
Oct 20, 2009
I am a budding MCTS so I am not a 100% sure of whether I am correct in this instance.I am looking through a windows forms application created by a developer who has left our company some time ago. Within the code I have found a custom form derived from the standard form baseclass which explicity implements IDisposable.The custom form does not call any COM object or do any file IO operations and has only one database call which is closed and disposed off in the method that calls it. However within the code of the form there is the following,[code].....
Looking at this am I right in thinking that this should be removed including the implements IDisposable line at the top of the form since,
1. The listeners collection will go out of scope when the form does as the collection only references listener objects (which do not implement IDisposable).
2. The controls do not explicitly need disposing, since when the form goes out of scope this will be done anyway.
View 4 Replies
Aug 20, 2009
I have developed a C++ program code .Now, I want to access this code in VB.net .
View 2 Replies
Jan 19, 2011
I need to implement the IBindableComponent to the the following code:
Public Class InfragisticsToolStripBindableButton
Inherits Infragistics.Win.UltraWinToolbars.ButtonTool
Implements IBindableComponent
[CODE]...
1 problem: Warning: event 'Disposed' conflicts with property 'Disposed' in the base class 'DisposableObject' and should be declared 'Shadows'
2 problem: Error: Class 'InfragisticsToolStripBindableButton' must implement 'Property Site As ISite' for interface 'System.ComponentModel.IComponent'. Implementing property must have matching 'ReadOnly' or 'WriteOnly' specifiers.
Why should I implement "IComponent" if I implement "IBindableComponent"?
3 problem: How should I override "Dispose", if it's already implemented in the base class, but is not virtual apparently.
View 1 Replies
Jul 14, 2011
I'm sorting a collection of type "Document" (usually around 100k records). Sorting usually takes around 4-5 seconds, and I'm wondering if there's a way to speed up sorting by modifying my "DocumentComparer" class which implements IComparer(Of Document). Since the Compare() method would be called hundreds of thousands of times, are there any performance improvements that could be made here that I've overlooked?
[Code]...
View 2 Replies
Feb 8, 2011
I need to implement the IBindableComponent to the the following code:
Public Class InfragisticsToolStripBindableButton
Inherits Infragistics.Win.UltraWinToolbars.ButtonTool
Implements IBindableComponent
[code].....
View 2 Replies
Nov 6, 2010
After some research, I've decided to use the Liang-Barsky line clipping algorithm in my 2D game. Google did not deliver on any VB.NET implementations of this algorithm but plenty C/++ ones. Therefore, as I have knowledge in C++, decided to port one found on Skytopia over to VB.Net. Unfortunately, it does not work with:
Public Class PhysicsObject
Public Function CollideRay(ByVal p0 As Point, ByVal p1 As Point, ByRef clip0 As Point, ByRef clip1 As Point) As Boolean
Dim t0 As Double = 0.0
Dim t1 As Double = 1.0
[code]....
However, the CollideRay method fails on its 3rd edge iteration (edge = 3), r < t0, therefore the function returns false.
View 1 Replies
Nov 12, 2010
I created an array sorter to sort arrays like in Win Explorer in a DNN module. As in the answer to a preview question: Sorting an array of folder names like Windows Explorer (Numerically and Alphabetically) - VB.NET
[Code]....
View 1 Replies
Mar 1, 2010
The problems:
I can't use string.Format, I have C style format strings;I can't call the native printf (no P/Invoke);I can't use http://www.codeproject.com/KB/printing/PrintfImplementationinCS.aspx because of the license, I need something GPL-compatible.Is there a free implementation of printf/sprintf for the .net framework? Other than the above link, I couldn't find anything.
I cooked up a sprintf function that supports basic format strings, you can find it here: [URL].. I'll try to make it a complete implementation if I can.
View 3 Replies
Aug 23, 2010
I need to use some functions from a DLL written in C++. Problem is when I try to use those functions in VB (Visual Studio). The only way I get to pass the debugger without errors is if I use the VariantType type, but I get all screwed up values. Can anyone tell me how can I "translate" the use of char [6] into VB from C++? My problem when Implementing is with the variable INFO, the content comes back after execution with errors..This is the original code from the DLL Manual:
Code:
Int Get_Info(A Handle, char *IPAddr, InfoType *Info)
where the parameters:
A [IN] Handle.
IPAddr [IN] IP address
[code]....
View 4 Replies
Apr 11, 2012
I am trying to use some C# code that expands on the GridView functionality in a VB.NET project. The code I'm using is from here.
In the C# code there is an event definition for GroupHeader [code]...
View 2 Replies
Mar 8, 2009
I implemented IDisposable into one of my classes, but don't know if I did it correctly. Can someone tell me what will be cleared from memory and what will remain after calling .Dispose on an instance of this class? [Code]
View 5 Replies
May 21, 2010
What is the diference of using interfaces like ...I have an interface
Public Interface IProDataSource
Function read() As Integer
End Interface[co]....de
The only difference I have notice is that if the method is declare private it will be visible using the first approach only.
View 3 Replies
Mar 3, 2011
The middleware that manages talk between the mainframe and our app is blowing up randomly. It's a "such and such attempted to read/write protected memory..." error.The vendor is saying there we must be running some unmanaged code (I feel they're trying to worm out of it). I know VB's entirely managed, but does anyone know about the server portion of AJAX? Is there any server side javascript stuff that occurs before it actually gets into the .NET framework?
View 1 Replies
Dec 25, 2009
I have been reading about design patterns and application architecture and im told that I should program to an interface instead of implementation. This i understand. So I figured I would start with something small. Never programmed with an interface before. So I want to create an encryption program that will allow the user to select which method to encrypt it with, AES, DPAPI, etc. I started designing the Interface but I am unsure if I am doing this right. [Code] Also, when it comes to the DPAPI implementation, how is the client supposed to supply the Protection Scope? I didn't think this should be in the interface as it only applys to the DPAPI.
View 1 Replies
Jul 27, 2011
I basically want to remove the formula from the cells but want to retain the calculated values.
SO, I implemented it easily and it works great but REALLY SLOW. (About 2 mins for 1800 cells)
I have : Dim col As Excel.Range = getRange()For Each cell In col cell.Value = cell.Value Next
I tried to do this to the first cell and then autofill the rest, but that copied the value of 1st cell to the rest of the cells in column.
View 7 Replies
May 4, 2009
Can anyone point me towards a complete scenario using MSTest,vb.net, with or without mocks,MVP (supervising controller)
View 1 Replies
Oct 2, 2009
I need to create a monitoring mechanism using SNMP (in .Net). I think we'll be using an nsoftware component to handle most of the work. It appears we must use 'traps' to communicate from the agent to the server. We'll have a number of different traps and various information detailing each trap. What is the best way to implement custom traps? That is, what is the best way to not only send a trap, but also send the information describing the trap to our 'snmp manager'? I think this is done through "variable bindings". To use "variable bindings" do we need to create our own "enterprise number" and use an "enterpriseSpecific" trap? Should we implement our own, custom MIBs or can we just send the data we need with the trap (via variable bindings)?
View 2 Replies
Aug 17, 2010
In Flash 10 there are methods that require that they are triggered from user-initiated actions like button click, keyboard up/down keys, etc.Is it possible to implement this behaviour in .NET? For example, if we have this subroutine:
void SomeMethod() {
// Here some stuff
}
how to check inside it whether the method was called from a mouse click event handler?Also we can think of this methods like the protected functions in World of Warcraft.
EDIT: Looks like this behaviour is implemented in Silverlight — we can popup file dialogs (open, save) ONLY by mouse click or other user-initiated action, otherwise a SecurityException will be thrown. I want to achieve this bevaviour but in my case it's not a file dialog but our own methods.
View 2 Replies
Dec 30, 2009
just wondering if we could change the implementation functino of IDisposable.Dispose to a private. because the default i've got something like this:
[Code]...
Protected Overridable Sub Dispose(ByVal disposing As Boolean) or could i take away the the Protected Overridable and replace it with a Private access modifier?
View 9 Replies
Sep 11, 2010
This may seem like an obvious answer, but I can't seem to find an answer. I have this code in VB.NET[code]...
The problem with this is that in C#, it would seem you have to name the function the same as the interface function you are implementing. How can I call this method EncryptionVB instead of Encryption, but still implement the Encryption property?
View 5 Replies
Oct 16, 2009
How to implement explicit interface implementation in VB.NET?
View 3 Replies