|
Hello Sirs.. I Have tried creating a program on the simulation of the Dining Philosophers.. I need help on creating it..
|
|
|
|
|
Solutions can be found on Wikipedia.
Standards are great! Everybody should have one!
|
|
|
|
|
Never heard of it. From the name, I'm guessing it's a common homework question, like towers of hanoi. We don't do homework, we help people who have tried to do their own homework and are stuck.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: Never heard of it. From the name, I'm guessing it's a common homework question
It is a basic concurrancy 101 problem.
Meanwhile the lecturer I had for concurrancy lectures all those years ago said that in 10 years all you would remember is the following story. It has been about 11-12 years ago now and he's right. It is the only thing I remember. The story goes:
There was a man who went into a sweet shop and went up to the counter and asked for a Mars bar. The shopkeeper had no Mars bars so he clonked the man over the head until he passed out, then he dragged the man to the corner of the shop to where the pile of other people who'd asked for Mars bars were lying.
Soon afterwards the Mars bar truck turned up and the shopkeeper filled his store with Mars bars. He then got out his smelling salts and revived all those that had requested a Mars bar. He sold them each a Mars bar and his customers left his shop contented.
|
|
|
|
|
The Shopkeeper was subsequenlty arrested on numerous accounts of GBH, and spent 7 years in Broadmoor after his lawyer pleaded "reduced responsibility".
Me: Can you see the "up" arrow?
User:Errr...ummm....no.
Me: Can you see an arrow that points upwards?
User: Oh yes, I see it now!
-Excerpt from a support call taken by me, 08/31/2007
|
|
|
|
|
martin_hughes wrote: The Shopkeeper was subsequenlty arrested on numerous accounts of GBH
WARNING: Pedantic hat too tight. Please adjust pedantic hat before...
Well, since I'm in Scotland and we don't have GBH I don't think that would happen. Our nearest equivalent is attempted murder.
... Pop! That's better.
|
|
|
|
|
Colin Angus Mackay wrote: Well, since I'm in Scotland and we don't have GBH I don't think that would happen. Our nearest equivalent is attempted murder.
I understand GBH is considered to be more of an affectionate greeting, than an attempt to harm, north of the border
Me: Can you see the "up" arrow?
User:Errr...ummm....no.
Me: Can you see an arrow that points upwards?
User: Oh yes, I see it now!
-Excerpt from a support call taken by me, 08/31/2007
|
|
|
|
|
Yes, it's a very common homework/teaching problem to learn about threading (producers/consumers).
|
|
|
|
|
Hello,
I'd like to enable antialiasing in WPF's Viewport3D control, under Windows XP.
I tried RenderOptions.EdgeMode="Aliased" (in XAML), but it does not seem to change anything.
Any ideas?
|
|
|
|
|
Quote from MSDN[^]: 3D anti-aliasing is only supported on Windows Vista.
Guess XP is starting to show it's age and it's time to move on
|
|
|
|
|
Well said, and thank you for your reply. I'll then suggest the upgrade to my prospective clients because on XP my WPF app will look ugly (or I'd rather look for some other gimmick ).
|
|
|
|
|
I'm experiencing a brain freeze and am battling to come up with an elegant design pattern for control break processing, i.e. grouping in a report. Can anyone please give me some pointers?
I do not believe they are right who say that the defects of famous men should be ignored. I think it is better that we should know them. Then, though we are conscious of having faults as glaring as theirs, we can believe that that is no hindrance to our achieving also something of their virtues. - W. Somerset Maugham
My New Blog
|
|
|
|
|
I would like to show a reminder message each time the user shutdown or logoff his machine. How can I achieve it.
|
|
|
|
|
.net provides "Windows Service" projects for these type of work.
jayasshc
|
|
|
|
|
Errm - no it doesn't. There's no guarantee that your service will be running when windows is shut down.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi
i want select a node from treeview nodes and call the form that i have selected its node.
here is my code.
node1 = "Company";
node2 = "Process";
node3 = "Script";
node4 = "Group";
node5 = "User";
if (node1 == "Company" )
{
cmsCompany.Show();
}
else if (node2 == "Process")
{
cmsProcess.Show();
}
else if (node3 == "Script")
{
cmsScript.Show();
}
else if (node4 == "Group")
{
cmsGroup.Show();
}
else if (node5 == "User")
{
cmsUser.Show();
}
Mamphekgo
|
|
|
|
|
Hello,
I think the 'AfterSelect' event will help you.
yourTreeView.AfterSelect+=new TreeViewEventHandler(yourTreeView_AfterSelect);
private void yourTreeView_AfterSelect(object sender, TreeViewEventArgs e)
{
switch(yourTreeView.SelectedNode.Text)
{
case "Company":
cmsCompany.Show();
break;
case "Process":
cmsProcess.Show();
break;
case "Script":
cmsScript.Show();
break;
default:
break;
}
}
All the best,
Martin
|
|
|
|
|
Whenever I see code like this, it makes me think that there's a Factory missing somewhere (and I'm not having a go at your code here - it's the OP requirement that is prompting me here). I hope that he's managing his form disposal as well, but I bet that he isn't.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hello Pete,
Pete O`Hanlon wrote: it makes me think that there's a Factory missing somewher
So true!!! (Got my 5 for that)
Pete O`Hanlon wrote: I hope that he's managing his form disposal as well
You are write, I should allways point this out at answers.
Pete O`Hanlon wrote: but I bet that he isn't.
Let's wait and see, what he is answering.
All the best,
Martin
|
|
|
|
|
I'm trying to use different functions like SendInput and SendKeys to send input for controlling a DOS program running in a Command Prompt window (very old DOS program - no source code). Both of the above functions work on a standard Command Prompt, but it doesn't work on the DOS program once I run it. It also seems that many of keyboard macro programs don't work on these types of DOS programs either.
Does anyone know of how to send the key input in the way that many DOS programs are reading input from the keyboard?
I solved this once a very long time ago using libs in Windows XP (still running this OS) but lost the code and my source of information .
|
|
|
|
|
It may be almost impossible. Some DOS programs talked directly to the hardware to get input and you can't do that in Windows unless you write a kernel mode driver. Even then it may still be infeasible. Get real and junk the DOS program - this is 2007!!!!
Phil
The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.
|
|
|
|
|
Actually it is totally possible with a project right here on CodeProject!!! http://www.codeproject.com/cpp/sendkeys_cpp_Article.asp
It took me this long to eventually find my functioning code, which led me back to the article. Now I just have to check that a C# version exists and if not I will convert the project myself.
I am real, and I can't junk the DOS program because I work in the real world where you can't just re-write software on a whim to meet the latest craze, especially where it would be dangerous to do so (people's limbs at risk).
|
|
|
|
|
I am glad you have found a solution that works in your particular case.
I am real too, I make my living writing programs for the real world. DOS programs started to die ten years ago and no critical applications should rely on such programs any longer - hardware and software support is non-existent; it is a matter of chance whether they can be made to run now and there are absolutely no guarantees for the future (i.e. next week). Development of an alternative to the DOS app should have started at least five years ago.
Whatever may be said against Windows there has never been a more universal, stable and consistent operating system on which to develop software for all sorts of applications. To speak of it as a "whim" and "the latest craze" is dangerously short-sighted, especially if people's limbs are at risk!
Phil
The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.
|
|
|
|
|
how should i use the parametercollection class , i mean i have the following information like
Stored procedure Parameter Name
Stored procedure Parameter direction (input/output)
stored procedure Parameter value
stored procedure Parameter Type (decimal , string)
Now how should i use the parametercollection class , in order to insert this information i the add function
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
i tried the following code
class abc
{
ParameterCollection p;
public ParameterCollection ab
{
get
{
return p;
}
}
}
public class waste
{
public waste()
{
abc a;
a = new abc();
a.ab.Add("ParameterName", TypeCode.Decimal, "ParameterValue");
a.ab[0].Direction = ParameterDirection.Output;
a.ab[0].Size = 100;
}
}
can i improve the code?
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|