Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Waaaaaaaaaaaaaaaaaaaa:'(

Nick Evan commented: :D hilarious! +9
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

lol....i dont get it!!!!...what the ....really LOL.....

We don't get your post either. So there :twisted:

VernonDozier commented: Awesome! +7
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Dumbass Bush

Dumbass democrats in congress for ignoring his warnings.

Aia commented: And we are the smartass that will pay for it. +9
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I don't normally quote scripture, but can't help it this time: "Its easier for a camel to go through the eye of a needle than for a rich man to enter the kingdom of God." (Matthew 19:24) That means: I don't give a rats ass about all that much money. I'm perfectly happy with what I have now.

sittas87 commented: One of the best posts and quotes since joining DW ;) +3
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

If you just want to compare the two lines you don't need to split them into words. Just compare the entire line

std::string line1;
std::string line2;
getline(myfile, line1);
getline(myfile, line2);
if( line1 == line2 )
{
    // the two lines are identical
}
Alex Edwards commented: Very true =P +4
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I think we need Jimmy Carter to organize a group of UN troops to oversee elections in USA. He does it in other countries, so why not here?

VernonDozier commented: Yep. We need to clean up our own house first. You'd think that after 200+ years of elections, we would have solved this? +7
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

What will they do with all those dead people who like to vote? We had quite a few of them here in St Louis the past few elections - and they all voted Democrats.

Dave Sinkula commented: It's too hard for me not to try to crack a joke. Must. Avert. Eyes. +16
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The moderators are alive and well. The OPs post was just too damed funny to warrent deletion. I wanted everyone to share in his humor. Sounds like it might be a good start to a winning game.

jasimp commented: Good point +8
Rashakil Fol commented: yase :) +9
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I've had enough of it because every little thing that happens I loose the sound. So tonight I got rid of it and went back to XP Pro. Glad I had duel booted the two operating systems because it was very easy to get rid of the duel boot option. Right now I'm reformatting my D drive where I had it installed. I also had to uninstall a lot of stuff from XP because they were installed on D drive, which I am now reformatting.

Anyone considerinstalling Vista -- don't. You will have nothing but headaches.

Salem commented: Hasta la VISTA baby +20
Nick Evan commented: Good advice! +8
The Dude commented: Xcellent thread and good advice Dragon :) +8
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Linky here

I thought that is pretty funny -- but I hope some of you don't get pissed off at me for this :)

~s.o.s~ commented: Nice one. :-) +23
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Blah, I've lived in AZ for most of my life, can't wait to get outa here.

The grass is always greener on the other side of the fense :)

R0bb0b commented: Ya it is +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

jibber jabberjibber jabberjibber jabberjibber jabberjibber jabberjibber jabberjibber jabberjibber jabberjibber jabberjibber jabberjibber jabberjibber jabberjibber jabberjibber jabberjibber jabberjibber jabberjibber jabberjibber jabberjibber jabberjibber jabberjibber jabberjibber jabberjibber jabberjibber jabber :) :) :)

scru commented: lol +3
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

One way to do it is to write your own malloc() and free() functions which keep track of the allocated pointers in a linked list. Then just before program exit run through the linked list to find the pointers that have not been freed.

struct node
{
    unsigned int line_number;
    char* file;
    void* ptr;
    struct node* next;
};

void* mymalloc(unsigned int size, unsigned ine line_number, const char*filename)
{
    void* ptr = malloc(size);
     // now add the pointer to the linked list, not shown 

    return ptr;
}

void myfree(void* ptr)
{
    // search list for ptr and when (and if) found delete the node
    // code is not shown here

    free(ptr);
}

int main()
{
     // example use.  Note:  I don't know if all compilers support __LINE__ and
     // __FILE__ macros or not.  __LINE__ is a preprocessor directive that 
     // returns the current line number of the file being compiled, and
     // __FILE__ is a preprocessor directive that returns the file name
     //  of the current file being compiled.
     int* array = mymalloc( sizeof(int * 10), __LINE__, __FILE__);

}
jephthah commented: solid advice. this is the best way to handle memory allocation/deallocation +4
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>so what will be the alternate software for
>>Visual basic 2005

Visual Studio 2008

>>etc etc
I never heard of that one :)

Alex Edwards commented: =P +3
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Ehh ?? Those aren't errors.

Oops! you are right -- I didn't read it close enough.

William Hemsworth commented: Hehe, you make me laugh :) +3
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>nd unfortunately it doesn't seem as if clear or resize properly deletes or destructs the pointers

>>I'm sorry... where did I use erase? O_O
clear() is the same as erase(begin, end)

>>I got a lot of errors from attempting to cast the object referenced by the iterator to a ManagedClass
No casting necessary. I did not use a cast in the code I posted.

Alex Edwards commented: Thanks a million =) +3
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

use setw() to force column width. cout << setw(2) << 12 << setw(6) << "Hello";

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

why don't you ask your "friend" how to compile it, afterall he wrote it.

Alex Edwards commented: My thoughts exactly XD +3
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Click on the Welcome Guide at the top of every page and you will get a tutorial.

peter_budo commented: That is correct too ;) +9
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

After six months he's back, and he claims to be you, Ancient Dragon (see post 44 below).

I don't know why he said that, but it isn't true. I couldn't insult people like he did, and I doubt he could keep from doing it either.

John A commented: Nice try, but you still can't hide the fact that you are, in fact, DaWei. +15
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

AD - What is working for W-M like? - I may have to look there myself.

Where I work it seems that's where all old retirees move :) There are quite a few of us 65+ people there, and some 75+ people. We are all part-time because we want to be part time. We don't get rich working there, but its something to do and pays the gas bills. The most difficult part is standing on my feet for long periods of time. We get 15 minute breaks every two hours or so.

Also they have really radical work schedules. They publish the work schedules three weeks in advance, and I can never count on when or what times I'll work until the schedule comes out. For example I worked 12:30 pm (noon) - 5:00 pm today, and tomorrow I'll work 7:00 a.m. to 3:00 pm.

Sulley's Boo commented: Wish you all the best .. +5
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I think he wants our support...?

why? our support for what? Ok, so he has my support (clap! clap! applause!)

I'm moving this thread to Geek's Lounge because it is just a lot of unexplained dribble. Perfect for Geek's Lounge :)

Nick Evan commented: *standing ovation* +6
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The best way to do that is to call that function many times then take the average time. For example, start timer, call the function 1,000,000 times, get end timer, (end-start)/1000000 = average. Of course you'll have to use floats for all calculations.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

This compiles without error -- did not attempt to run it. I actually got a hint how to do it from the compiler's error message : error C2440: '=' : cannot convert from 'FARPROC' to 'void (__cdecl *)(char *)'

int main(void)
{
 char szMsg[]="Hello, World!";
 HINSTANCE hIns;
 void (*pFn)(char*) = 0; 
 hIns=LoadLibrary("dllWork.dll");
 if(hIns)
 {
    pFn = (void (__cdecl *)(char *))GetProcAddress(hIns,"Prt");
    pFn(szMsg);    
    FreeLibrary(hIns);
 }
 system("PAUSE");
  
 return 0;
}
Unimportant commented: Really no one upvotes this? +4
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Why would I go into a C++ reference and go looking for the command when someone like you could clearly help me quicker

Because, give you bread and you may eat for one day, but teach you how to grow food and you will eat forever. Yes, Narue, or anyone else here, could easily just give you the answer and the next time you have another question you will have no clue how to get the answer so you will be right back here asking again. But if you learn how to look up the answers to your questions you will be able to answer your question yourself, saving you lots of time and effort. Its to your own benefit that you learn how to look up the answers to your questions, and ask us only when you can't find the answers somewhere else.

William Hemsworth commented: nicely said :) +2
Salem commented: Mmmm - fish +18
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

STL does nothing for MS-Windows programming. The intent of STL is portability not anything os-dependent. MFC and STL are not either or situation -- learn both. If I were going to begin a new project today I don't think I would use MFC because there are several other alternatives such as C#, CLR and wxWindows. MFC is a really old class developed by Microsoft as a wrapper for win32 api functions many years before any of those other languages were invented. IMO the only reason to use MFC today is for maintaining old code. If you want to learn MFC, fine, but you should probably concentrate your learning efforts on other previously mentioned languages and wrapper classes.

iamthwee commented: Good advice especially coming from someone who uses MFC +15
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Actually, now that I look at your program closer, your program doesn't write anything to those files. In post #5 above, the program opens the file on line 16 and closes it on line 53, never writes anything to it inbetween those two lines. So, somewhere before line 53 you have to add code to write the data to the file. What to write? Look at line 60 -- you have to write those entries (name, course title, id number, dob, and average) to the file. Then after line 59 you have to insert another line or so that reads those same variables from the file. Use fscanf() or fgets() to do that.

raja289 commented: THANKS ALOT FOR UR USEFUL SUGGESTIONS +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

And I suspect a camara is also a good thing to have :) I suspect you have a pretty good one too, not one of those throw-aways we can buy from Kodak.

jasimp commented: you don't need a camera ;) +7
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Hello Casper. Glad to see you joined DaniWeb. I don't know diddly squat about PHP or web development, so you will rarely see me in any of those boards. But don't hesitate to help others when needed.

casper_wang commented: Thank you for the welcome +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

how in the world did you think you can stuff that structure into a short int ? I'd like to wear a size 32 pants too but my fat butt won't fit into it.

Perform the checksum calculation on the individual members of the structure.

Nick Evan commented: haha, nice explanation +6
jephthah commented: lol +4
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The extern keyword is used to tell the compiler that a data object is declared in a different *.cpp or *.c file (code unit). Its required for data objects but optional for function declarations. For example, you have two *.cpp files named A.cpp and B.cpp. B.cpp has a global int that needs to be used in A.cpp.

// A.cpp
#include <iostream>
// other includes here
...
extern int hours; // this is declared globally in B.cpp

int foo()
{
     hours = 1;
}
// B.cpp
#include <iostream>
// other includes here
...
int hours; // here we declare the object WITHOUT extern
extern void foo(); // extern is optional on this line

int main()
{
    foo();
}
Alex Edwards commented: Thank you for the clarification. It was never really explained in this way. +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

One link -- if you dare to read it.

techbound commented: The link was a good read. +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I just don't understand why many white people are so afraid of Obama -- So what that he is black (or half black) ? Does skin color make white men superior Presidents than blacks, or red, or yellow, or brown. Biggots would have the same problem if Obama were of Chinese descent, or Japanese, Korean, French, or you-name-it. Many white people are simply white-supremist-biggots (to put it nicely). They are scared to death, and will crap in their pants, when Obama, a black man, is elected to the most powerful and most elete position in the world. Obama could be the reincarnation of Jesus Christ and they would still do anything to keep him from getting elected. And the smear campaigns, such as Obama is a Marxist, Communist, Muslem, or terrorist presented in this thread as well as on the internet just proves my previous statements here.

There are many reasons that anyone can legatimately NOT vote for Obama this November. But race is not among them.

jephthah commented: but they'll paint him as a socialist so they can avoid being accused +4
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Look at the Rep Power you have -- its 0. You can not give green rep until you get it to 1. I think when you make 10 posts your rep power will go up to 1.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>BS, PH, CIB
In your signature, what is CIB ? Here is a list of 43 possibilities

Aia commented: Most dissapointing. Specially your reaction to my criticism. What's that bad rep comment necessary? +8
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Welcome to Daniweb. You're in luck today because there are quite a few java experts here. All you have to do is post your questions in the Java Software Development board.

jasimp commented: I like that, Daniweg, ;) +7
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
majestic0110 commented: Hehe :) +3
scru commented: now i know what it means! +3
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I believe both -- God created everything, how he did it was through evolution.

jephthah commented: makes the most sense to me. just don't tell richard dawkins :P +10
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I tried using sizeof() and all occurrences returned 4. sizeof(argv), sizeof(argv[0]) and sizeof(argv[1]) all returned four resulting in a size of 1 even though argc was equal to 5.

Re-read my previous post carefully about that sizeof operator -- I even said you can not use it for pointer arrays that are parameters to functions, such as argv. Why? Because sizeof(any pointer) = 4. All that is doing is taking the size of a pointer, not the size of an array of pointers.

Instead of an array of strings why don't you make a vector of strings. With vectors you don't have to know how many strings there are in advance.

int main(int argc, char* argv[])
{
    vector<string> ay;
    for(int i = 0; i < argc; i++)
        ay.push_back(argv[i]);
}

I know how to overload operators, but how do you access the operators in the string class in order to overload it or is that possible? Thanks for your help.

I suppose here is one way to overload the string's = operator. I'm certain others can give you even better examples.

template <class T>
class MyString : public std::string
{
public:
    MyString& operator=(MyString& ms)
    {
        cout << "Hello World\n";
        return *this;
    }
};

int main()
{
    MyString<string> s1;
    MyString<string> s2;

    s1 = s2;

}
Salem commented: Hooray for vectors +16
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I don't need no stinking "stupid test" to prove I'm stupid :)

majestic0110 commented: hehe! +2
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
jephthah commented: you're way too nice +1
Salem commented: Oh so simple, why didn't they think of that? +16
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Why don't you ask your school's principal or some other teacher what you want to do and why. Does your school have any computer programming classes ? Yes, then maybe you can use one of their computers to do your work.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

IBM -- Its Better Manually.

hammerhead commented: good one +2
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

i've always been able to look past the color of hair, but I do have to admit that regardless of the color of hair color, they all get angry the same and take away what you value the most ;)

That's probably because you were a jerk.

jbennet commented: :) +29
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

try this:

string s1 = "abdxyzdxyz";
string s2 = "xyz";
size_t pos;
while( (pos = s1.find(s2)) != string::npos)
{
      string s3 = s1.substr(0,pos);
      if( (pos+s2.length() + 1) < s1.length())
        s3 += s1.substr(pos+s2.length()+1);
      s1 = s3;
}
Vishal_36 commented: after running your program its showing s1 still has "a" in it +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I was thinking the same thing as vmanes when I watched that. All fluff and zero substance. Totally useless in business except maybe for flashy presentations.

When is someone going to develop a hollagram monitor ? They've been around in sci fi movies for many years.

vmanes commented: Yes, let's go build one! +3
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>> need to know what I need to start my first server ...
A computer with a monitor and a keyboard -- Oh yea, you'll also need a building to put it in and some electricity to run it.

A server can also be a waiter in a resturant. So I'd suggest you get a job in a resturant if you want to be a server.

Salem commented: :) anyone for tennis? +15
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
int main()
{
    string str = "0x0002,A5651QPR87GBZ094RTF52,D,A,000001,ABC ,10000.00 , EOT";
    string word;
    stringstream stream(str);
    while( getline(stream, word, ',') )
        cout << word << "\n";
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

private variables can only be accessed by the class .

class A
{
private:
   int x;
public:
   void SetX(int n) { x = n; } // <<< this is ok
};

int main()
{
    A aobj;
    aobj.x = 0; // << error because not inside the class
}

protected is similar to private but can also be accessed by inherited classes

class A
{
protected:
   int x;
public:
   void SetX(int n) { x = n; } // <<< this is ok
};

class B : public A
{
public:
    void ShowX() { cout << A::x << "\n"; } /// this is ok
};

public can be accessed by anybody

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

So if you want to talk about heat why not leave that nice chair and join the your men in Iraq or Afganestain and then tell me about heat.

Been there, and done that (VietNam). I serverd 23 years in USAF (1962-1985) but I admit I was never shot or a POW. We have no greater respect than for our military and civilians now serving in Iraq and elsewhere around the world. That was not the kind of heat I was talking about.

But this comment will never be seen by you because you turned tail and ran at the first sign of criticism. Oh well.

VernonDozier commented: Well said. +2