Hi Banfa,
The threads are spawned using OpenMP we have roughly 9 -> 12 threads running. The instantiations of A occur many times per thread. The main app is running day and night.
The actual class "A" contains many more variables and methods. But let me spare you those details yet. Since I dont want to steer any hypothesis into a certain direction.
In the core dumps I did find that 'a1' got instantiated...
User Profile
Collapse
-
Brain-ache on this new operator
Hi,
I've recently seen something happening of which I'm sure is impossible.
I have an application running multi-threaded.
In 2 different threads at roughly exact same time a new class was instantiated using 'new classA(..)'
And both instantiated objects were given the exact same memory address.
I'm having brain-aches at the moment to understand how this is possible.
Can anyone hypothesize... -
dynamic object creation by string
Hi,
Is there a way to instantiate an object by string?
The current project I am working on is to create a set of php files, each containing a class derived(extende d) from 1 particular base class.
Each PHP's filename contains the name of the class it embeds. (e.g. "ClassABC.p hp" contains "class ABC extends")
With string manipulation I am able to extract the text "ABC"... -
MartijnHoekstra replied to why the line "int n =++i+ ++i+ ++i;" gives an compile time error in c languagein CAnd why do I get 24, when I run with i=5.
The next code gives 21. as it should
Code:n = ++i; n+= ++i; n+= ++i;
Leave a comment:
-
I ran out of suggestions, except for adapting your code:
Code:do { do { keypress = Console.ReadKey()); // read keystrokes } while (keypress.Key==255); ...Leave a comment:
-
255 or (0xFF) is or was commonly used for stating specific character being used.
The reading of keybuffer then held 2 characters.. the first being 0xFF and second one for a special key. Like UP or DOWN or Function Keys..
Ok.. that does not help you..
The input is certainly coming from somewhere. Either faulty hardware or fuzzy software.
While running your app, have you tried:
- disconnecting Keyboard?...Leave a comment:
-
MartijnHoekstra replied to which is the correct one 'he came to school by walk' or 'he came to school walking'.in C SharpI would suggest to try this:
Code:protected bool IsCorrect( string text ) { return ! text.Contains("by walk"); }Leave a comment:
-
MartijnHoekstra replied to a way to make just one event handler to handle multiple events from diff. objects ?in C SharpWhat I believe you want to do can be done like this:
...Code:private void textBox_GetFocus( object sender, EventArgs e) { TextBox tb = sender as TextBox; if (tb) tb.BackColor=System.Drawing.SystemColors.Info; } private void textBox_LoseFocus( object sender, EventArgs e) { TextBox tb = sender as TextBox; if(tb) tb.BackColor = System.Drawing.SystemColors.Window;Leave a comment:
-
Have you tried to add a column being a:
DataGridViewCom boBoxColumn
Easy approach would be to click the little arrow on the top right side of the datagridview. Where you can use the Add Column feature. There select the type of the column you wish to add.Leave a comment:
-
MartijnHoekstra replied to a way to make just one event handler to handle multiple events from diff. objects ?in C SharpYes that is possible..
Let all textboxes refer to the same eventhandler.
Within the handler, the 'sender' will refer to the Textbox sending the event.
Casting the sender being of type 'object' back to type 'Textbox', will allow you to query its name so you can see which one it was.
You could also make use of the 'Tag' member, place some number in there for your referenceLeave a comment:
-
MartijnHoekstra replied to Im trying to use Speech namespace to make voice recognition but it dosent work:in C SharpI dont directly see anything wrong with the code, nor have I any experience with this component.
There are how ever few things I would check:
- Is microphone recording anything at all
- Is this microphone set as default input device?
- or Must this app been told, which device to listen to?
- What is level of sound quality needed for recognition, and is this achieved?
- What happens if you try other words,...Leave a comment:
-
Another possibility is to make use of the, FocusedItem.
But if you are using multiselect; you may get better results by iterating through all the rows yourself. And check which of the ListViewItems have 'selected == true'
Also you can have a look at all ListView members and its possibilities. Check here:
ListView Members (System.Windows .Forms)Leave a comment:
-
Sender is by default of type object.
Textbox is derived from Object.
But Textbox contains more methods and properties than object does.
When you 'cast' the 'object sender' to the type 'textbox', while knowing it must be a textbox, you will be able to use all textbox'es methods and properties once more.
So why not put 'textbox sender' in first place?
That is because the event, or handler is not part of textbox,...Leave a comment:
-
I would check the following 2 things:
1) What happens with the "Click" event handler instead of "Command" handler
2) What happens if you make the handler public instead of protected.Leave a comment:
-
-
the best way to find difference is to use: difftime
also you can just make diff a time_t type.
Then to display the difference exactly, you can make use of the gmtime function and strftime to display.
See example:
...Code:time_t diff=(time_t)difftime(l_secs,gmt_secs); char str[[B]10[/B]] ; tptr=gmtime(&diff); strftime(str, [B]10[/B], "%H %M ",tptr); printf("%s",str);Leave a comment:
-
Few things you could double check:
1)
The exact folder where you are downloading the ping.txt file ? Maybe you are downloading to another folder and you keep checking the other.
2)
Once you downloaded first file, is p2 able to 'overwrite' the already existing file? Have you checked that part to have any exceptions or error messages? Try remove the existing file, run p2 again and see whether it appears then with correct...Leave a comment:
-
assuming PL_Info.Nodes[i] are of type TreeNode.
Then this should work:
Code:TreeNodeCollection collection = PL_Info.Nodes[index].ChildNodes;
Leave a comment:
-
Can you post your sources?
I have rough feeling that the minutes are shown in 0.5 * 100 instead of 0.5 * 60 = 30Leave a comment:
No activity results to display
Show More
Leave a comment: