|
In my efforts to teach myself the C# programming code, I want to collect as many C# Algorithms as I can
in my database, so I can develope as many small but useful programs as I can for my self and others who wish to share with me , and me with them.
Any great algorithms just sitting around, that I can capture and use.
Psudocode as well if possible.
Thanks much in advance.
Ron in Minneapolis, MN USA
Much success to you.
|
|
|
|
|
|
HI,
Hope i will be one in making your such database. That will certainly help to C# self Learners.
Could u please give me Name of few algorithm that u desirous to put in your database, So that i may send u some Code with Algorithm.
All the Best.
Binod K.
|
|
|
|
|
I want to add a dll, an API belongs to the software NETICA,i add him in References > Add References > Comtab > Netica object Library Ver 1.0;
What is that I has to not use the other thing? Knowing that this library is used C and C ++ there, there is an example C ++ which uses Netica.h, Netica.lib, Netica.dll and NeticaEx.h, the problem that when i write net_bn* net; who was true in C++, but he undeline error:The type or namespace name 'net_bn' could not be found (are you missing a using directive or an assembly reference?) , i know that they are a difference on C++ and C# syntax but the API was for C , C++ and C#
Thank you
|
|
|
|
|
The error message gives you the solution. It suggests that there is a reference or a using directive missing. As you have added the reference, it's the using directive that is missing.
---
single minded; short sighted; long gone;
|
|
|
|
|
Can you explain me, i don't know how i resolve this problem, thank you very mutch
|
|
|
|
|
Did you happen to notice all the using directives at the top of your code? You're missing the one that imports the namespace in the .DLL you referenced.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
You don't create a pointer in C#. Probably net_bn is wrapped in a namespace which you need to reference.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
Hello everyone,
I have created a Windows Application which have TabControl. I was wondering how I can fire a particular TabControl once a Button is clicked.
Thank you very much for your help.
Khoramdin
|
|
|
|
|
Hello,
Khoramdin wrote: I was wondering how I can fire a particular TabControl
I have no idea what you mean with "fire".
Let me give an answer out in the blue.
If you mean "activate" when you say "fire", and if you mean TabPage instead of TabControl,
then you could use the TabControl property "SelectedIndex".
Hope it helps!
All the best,
Martin
|
|
|
|
|
|
Well, it's plainly not 1 or 3. I'm not sure what 4 means, but I doubt it's that. It must be 2, although I have no idea what that means, either.
Reflection allows you to look at private variables, I believe. But, a type safe variable just means a variable that is typed. A variable is just
int x;
that has no features at all, it's just a variable. So, I assume they mean a property, not a variable. The question itself is retarded, IMO.
If it's a property, then you can do this:
int x
{
get
{
return myPrivateInt;
}
}
but, type safety has nothing to do with it, this would work if x was of type object. And, if this is called 'code access control', that's not a term I've ever heard.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
Zealous_Me wrote: Which feature of a type safe variable allows the variable to access a value from the private field of an object ?
Zealous_Me wrote: 2.) Code access control
I agree with Christian - The question is CAC
|
|
|
|
|
Hello experts,
I've written a producer/consumer class which I will be using in my current project.
Here's a snippet of my class:
private Queue<NextDataReply> packs;
private bool productionDone;
private void Enqueue(NextDataReply pack)
{
lock (packs)
{
packs.Enqueue(pack);
Monitor.PulseAll(packs);
}
}
public NextDataReply Dequeue()
{
lock (packs)
{
while (packs.Count == 0 && !productionDone)
Monitor.Wait(packs);
if (productionDone) return null;
return packs.Dequeue();
}
} AFAIK, this is the accepted and prefered way to go about synchronizing queue access.
However, I can't figure out something...
Consider the following scenario:
The consumer has called Dequeue() , and is now blocking on Monitor.Wait() , waiting for data to be added to the queue.
The producer has now called Enqueue() and has reached the lock statement.
Isn't this a deadlock situation?
The way I see it, the consumer has aquired the lock for the packs object, and calls to lock would block until the consumer has exited the critical section of Dequeue() (which never happens, as it is blocking on Wait() ).
Explain it to me please...
|
|
|
|
|
Wait() actually "toggles" the lock, so the other thread can enter the lock while Wait is running. After receiving the Pulse, Wait re-acquires the lock.
|
|
|
|
|
shyagam wrote: Isn't this a deadlock situation?
No. If you read the documentation for Monitor.Wait , you'll see that it blocks the calling thread after releasing the lock. When some other thread pulses the lock, the blocked thread reacquires the lock. If it didn't, then it would be useless, as Wait can only be called after acquiring a lock and no other thread will be able to acquire the lock to release/wait on it.
|
|
|
|
|
I see... Now it makes sense.
Thank you both!
Regards,
Shy.
|
|
|
|
|
I want to create my own collection of elements. I do it so:
public class MyCollectionName : IEnumerable
{
List<string> m_Collection = new List<string>();
public int Count
{
get { return m_Collection.Count; }
}
public IEnumerator GetEnumerator()
{
return m_Collection.GetEnumerator();
}
}
Is it possible to use instance of MyCollectionName like array and
what should I change in MyCollectionName class for it?
for example:
for(int i = 0; i < myCollectionInstance.Count; i++)
{
myCollectionInstance[i];
}
|
|
|
|
|
yes, thats called an indexer; it is like a property that takes an integer argument.
Example:
public Record this[int index] {
get {return (Record)currentRecords[index];}
}
gives the containing class a getter that returns an item of type Record.
|
|
|
|
|
Add a default indexer:
public string this[int index] {
get { return m_Collection[index]; }
}
---
single minded; short sighted; long gone;
|
|
|
|
|
|
Hi All
I want to link the data result set from the database, to a DataGrid. I want to display it other than just columns as it comes from the database.
ie. The usual DataGrid format
------------------------------------------------------
Column Data | Column Data | Column Data | Column Data
------------------------------------------------------
I want to display like this:
-------------------------------
Column Data |
------------|
Column Data | Column Data
------------|
Column Data |
-------------------------------
Hope that makes sense.
Thanks in advance.
|
|
|
|
|
|
We don't do other peoples exams here.
---
single minded; short sighted; long gone;
|
|
|
|
|
if you don't have a clue to the answer then just keep your ugly ass out of here and if yiu know the answer reply it to the question.
|
|
|
|