|
what about VVVVVVC+++++++++++++ compiler
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
Not so good, since the number of '+' should be some power of two.
Anyway, have a look at ***new*** WTF++ compiler as well.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: Anyway, have a look at ***new*** WTF++ compiler as well.
Seems you forgot the fact that it is only available in Italy.
|
|
|
|
|
You're wrong: it's a worldwide success.
The WTF Company is now planning to sell it to the other life forms out there.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
thats should be fantastic compiler.. so when it's planned release!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
ThatsAlok hats should be fantastic compiler..
Is is, actually.
ThatsAlok o when it's planned release!
Get your free copy at www.cpallini.free.productz.com[^]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
|
CPallini wrote: BTW: Thanks for the mirror site.
You're most welcome -- I can host several such mirror sites for you if needed. You deserve it man. *Rajesh pats Carlo on the back*
CPallini wrote: BTW2: Another smashing hit of the THHB (Tread Hijacking Happy Brigade)!
*Rajesh sips the tea*
|
|
|
|
|
ani_ikram wrote: tab->Create(IDD_DIALOG1);
you have to pass, parent pointer in the Create call!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
1. Please post the actual code (not a crappy-simulating one).
2. Whenever you create a child dialog window, you should pass a pointer to the parent as second parameter (from MSDN [^]):
virtual BOOL Create(
UINT nIDTemplate,
CWnd* pParentWnd = NULL
);
if you rely on the default parameter then dialog's GetParent will return NULL .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
ani_ikram wrote: ...but still it does not getparent...
Where are you setting the parent window at? If you don't set it, why would you expect anything other than NULL to be returned?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I implemented Ping(by ICMP) function and PortScan(by connect function).
it is to check that computer is on the network.
but these functions are spending too much time.
Ping function is delayed by recvfrom function and
PostScan function is delayed by connect function.
I wanna impove the speed.
script:
now it is single processing. so i think it implement multithread and
broadcasting method. but i have no idea receiving all broadcast respond
thank you for reading my article
|
|
|
|
|
CresShadow wrote: it is to check that computer is on the network.
Pinging a computer is not a reliable way of determining if it is available/online.
CresShadow wrote: now it is single processing. so i think it implement multithread...
Think again. Adding additional threads to an application may improve its design but it will surely slow it down. Too much context switching.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
CresShadow wrote: now it is single processing. so i think it implement multithread and
broadcasting method. but i have no idea receiving all broadcast respond
What? Are you suggesting you can use broadcasting to implement port scanning of remote machines if only you knew how to receive responses? You better do some more studying on Sockets because you are totally lost. Since the most frequent use of Port Scanning is for malicious purposes, why do you need to do this? We don't support hackers here at Code Project.
led mike
|
|
|
|
|
led mike wrote: We don't support hackers here at Code Project.
Thx sir, may I know, then, where do you support them (plz plz)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I wanna know that computers on the network are online or offline.
I do not have any malicious purpose. ^^;
|
|
|
|
|
CresShadow wrote: I wanna know that computers on the network are online or offline.
Define online
Define offline
led mike
|
|
|
|
|
Hi Guys,
I'm not much of a programmer, so bear with me please.
I'm trying to program a standard Ant Algorithm/Ant Colony Optimization in C++, to search through a basic maze of open and closed (1 for open, 0 for closed) nodes to simulate a basic network.
Now I have the program functioning correctly for one ant, just runs through it once until its had its maximum number of moves or it finds the destination node.
I am trying to convert this into a class, so I can have multiple instances of the class (multiple ants) going through the network at once. My question is; how do I accomplish something like this? Currently, for my Ant Class I have :
class ant {
coordStruct route[300];
pheremoneStruct location[1];
public:
void set_route (int,int);
void set_location (int,int);
void set_coordPheremone (int,int,int);
} ant;
Will this work? If I perform all of the calculations and such outside of the class via get/set functions? or should I move the actual methods themselves into the class like below?
class ant {
coordStruct route[300];
pheremoneStruct location[1];
public:
void set_route (int,int);
void set_location (int,int);
void set_coordPheremone (int,int,int);
} ant;
I hope I've explained this clearly... But any help is appreciated, or any links to the code of something similar to give me an idea of what to do would also be helpful!
Thanks a lot.
Roppa
|
|
|
|
|
Put the method in the class.
This is after all, what encapsulation is all about - encapsulating the data and functions used to operate on it all into one neat packaged unit.
If it were me, I'd make it a virtual function, so that if, for whatever reason, you then need to simulate a different species of ant that makes decisions on its path differently, just inherit from this class and re-write the nextMove method.
|
|
|
|
|
Ah alright, any chance you could give me a little example of encapsulation?
Doesnt have to be anything fancy, just like an if/for loop or something so I can get an idea of how they work.
Many thanks for your help.
Roppa
|
|
|
|
|
Encapsulation, you know - wrapping together.
Here's a dog-n-bird example (ruff,ruff - cheep,cheep)
Notice the way that all the functions & required to turn an input string into a serial number are wrapped up inside the class. I don't have to know anything about the internal particulars in order to use the class. I just give an input string and recieve from it an output string. This is what I mean with your code. To make the ant truly autonomous, wrap all of the required functions and data up into a single class.
#include <iostream>
using namespace std;
class myExample
{
public:
myExample(char *inputString = "default")
{
m_Str = new char[strlen(inputString)+1];
strcpy(m_Str, inputString);
m_SecretResult = NULL;
superSecretNumberGenerator();
}
~myExample()
{
delete m_SecretResult;
delete m_Str;
}
char *getResult()
{
return m_SecretResult;
}
void setString(char *inputString)
{
delete m_SecretResult;
delete m_Str;
m_Str = new char[strlen(inputString)+1];
strcpy(m_Str, inputString);
m_SecretResult = NULL;
superSecretNumberGenerator();
}
private:
char *m_Str;
char *m_SecretResult;
virtual void superSecretNumberGenerator()
{
int i;
int sLen;
int tmpNum;
char tmp1[100];
char tmp2[100];
char tmp3[100];
sLen = strlen(m_Str);
if (sLen > 50)
sLen = 50;
if (m_SecretResult)
free (m_SecretResult);
for (i=0; i<sLen; i++)
tmp1[i] = m_Str[i]+3;
sprintf(tmp2, "%d", 1234567890*sLen);
sprintf(tmp3, "%s-%s-Enzflep", tmp1, tmp2);
m_SecretResult = new char[strlen(tmp3)+1];
strcpy(m_SecretResult, tmp3);
}
};
int main()
{
myExample *test = new myExample;
cout << "Result is: " << test->getResult() << endl;
test->setString("enhzflep");
cout << "Result is: " << test->getResult() << endl;
delete test;
system("Pause");
return 0;
}
|
|
|
|
|
Ah, fantastic reply.
I get it now. Many thanks my friend!
|
|
|
|
|
We want to buy a RFID reader now.
If you are using RFID readers, please let me know which product and company developed it are better.
Basically, I hope the reader can read/write Tag ID and all user data properly.
We have bought 2 readers, but they can not do the basic requirements properly.
A RFID reader is around $2,000 normally, we can not buy more again before we know which product is better.
I think the best info is from C++ programmers, so I post here for getting your help.
Thanks.
|
|
|
|
|
check out this site, this might be very useful, my old company use hardware from this company! :-
http://www.esslindia.com/[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|