William Hemsworth 1,339 Posting Virtuoso

Crazy Japanese WII Manual :)
LINK HERE

William Hemsworth 1,339 Posting Virtuoso

>Please post in where you are having problems with your code

I do not understand anything! I do not even know how to start!!!

Im assuming she just wants it to be done for her with no effort what so ever.

William Hemsworth 1,339 Posting Virtuoso

I was amazed by some of the things I saw on this site.
http://www.topfive.com/arcs/t5050302.shtml
but I especially found these ones to be the weirdest :)

  • Male rhesus monkeys often hang from tree branches by their amazing prehensile penises.
  • SCUBA divers cannot pass gas at depths of 33 feet or below.
  • Silly Putty was "discovered" as the residue left behind after the first latex condoms were produced. It's not widely publicized for obvious reasons.
  • King Henry VIII slept with a gigantic axe.
  • Human saliva has a boiling point three times that of regular water.
  • To human taste buds, Zima is virtually indistinguishable from zebra urine.
  • Urine from male cape water buffaloes is so flammable that some tribes use it for lantern fuel.
  • Never hold your nose and cover your mouth when sneezing, as it can blow out your eyeballs.
  • In the weightlessness of space a frozen pea will explode if it comes in contact with Pepsi.
  • Smearing a small amount of dog feces on an insect bite will relieve the itching and swelling.
William Hemsworth 1,339 Posting Virtuoso

Yellowcard - Only one :)

William Hemsworth 1,339 Posting Virtuoso

A friend of mine just sent me this, I found it very funny! :icon_lol:
http://newmedia.funnyjunk.com/pictures/learnchinese.jpg

peter_budo commented: A good one +10
jasimp commented: hilarious +8
sittas87 commented: Hehe :) +3
William Hemsworth 1,339 Posting Virtuoso

Making the executable small can be surprisingly easier than you think, make sure all your resources are fairly small, keep the code short and simple, and you can even download an executable compressor, which can make huge differences to the size. I use this one, it has never failed me :) Its free and doesn't even require installation. LINK

William Hemsworth 1,339 Posting Virtuoso

Theres also another common mistake that people make, which can easily cause memory leaks, consider this example:

int *varPtr = new int[1000]; // Allocate 1000 int's
int intArray[] = {1, 2, 3, 4, 5}; // Make an array
varPtr = intArray; // Assign varPtr with the adress of intArray

In this example, you allocated 1000 int's, but then you made varPtr (pointing to the 1000 int's) point to intArray instead, so what just happened to those 1000 int's you just allocated? To remove the problem, make sure you call the delete[] operator before reassigning the pointer.

Ancient Dragon commented: Good one -- I've seen that here too :) +36
William Hemsworth 1,339 Posting Virtuoso

> but i still have to press twice because of the getline...:
My answer remains, it works perfectly for me x]

William Hemsworth 1,339 Posting Virtuoso

how about my first one :)
From my hotmail account:

Marie SOLO
Church Evangelique 7emeTranche
Angré
26 rue 12 Abidjan
Cote divoire


Dearest brother,

Please tell to your father to help me after you finish to read this message i know you have 15 years old.
I know this mail will come to you as a surprise since we have not had previous correspondence, please bear with me. I will really like to have a good relationship with you, and I have a special reason why I decided to contact you.
I am Miss Marie SOLO 19 years old girl from Cote dIvoire, the only daughter of Late Mr Robert SOLO.
Iam constrained to contact you because of the maltreatment I am receiving from my Uncles.
Theyplanned to take away all my late father's treasury and properties from me since the unexpected death of my beloved Parents.
Meanwhile I wanted to escape to anywhere i can have a good lifebut he hides away my international passport and other valuable travelling documents. Luckily he did not discover where I kept my fathers File which contains important documents.
So Idecided to run to an orphanage camp where I am presenty hiding under Church of God Evangelique 7è Tranche Abidjan-Cote D'Ivoire where my late father deposited some amount ofmoney in a bank.. I wish to contact you personally for a long term business relationship andinvestment assistance in anywhere in the …

William Hemsworth 1,339 Posting Virtuoso

Well, I dont know what to say o.O it works perfectly for me :)

William Hemsworth 1,339 Posting Virtuoso

Would you mind posting the entire code so I can understand it better then, I missing a large chunk which is obviously causing the problem. :P

William Hemsworth 1,339 Posting Virtuoso

>the problem is that i have to press enter twice when using getline.
Press twice for what to happen?
I enter a string, and press enter and the function hello deals with it, and then the same happends until I enter "0" as a string, isn't that what is supposed to happen?

William Hemsworth 1,339 Posting Virtuoso

I dont quite understand your problem, I ran this test program and everything seemed to run ok.

#include <iostream>
#include <string>
using namespace std;

void hello(string &str) {
   // Do something with str
}

int main () {
   string line;
   
   cout << "Welcome!" << endl;
   getline(cin, line);

   while (line != "0") {
      hello (line);
      getline(cin, line);
   }
   return 0;
}

Unless your version of hello is doing something different to mine, it should work.

William Hemsworth 1,339 Posting Virtuoso

Then again I suppose it's not hard...

const char *c_string = "c-string";

const char& refChar = c_string[0];

std::cout << &refChar << std::endl;

...though I'm not near a C or C++ compiler at the moment so I can't confirm if this will work or not @_@

Or even easier :)

std::cout << reinterpret_cast<void*>( c_string );

edit: that will only work if c_string isn't a const.

edit 2: in order to make that work with c_string as a const, change the cast like this:

std::cout << reinterpret_cast<const void*>( c_string );
Alex Edwards commented: Way too crafty XD +4
William Hemsworth 1,339 Posting Virtuoso

Im still using firefox as ive noticed 2-3 bugs, and you cant scroll by clicking the mouse wheel like FF can. But if they add this functionality to Chrome, I may consider switching. But what I do like is the tabbing (you can draw a tab out to make a seperate window) and incognito mode.

William Hemsworth 1,339 Posting Virtuoso

Click HERE.
Im up to level 23, currently stuck ;)
Have fun :)

William Hemsworth 1,339 Posting Virtuoso

Once you have the handle to the text box (should be defined like this)

HWND hEdit = ...;

you can use SetWindowText to edit the text in the text box.

William Hemsworth 1,339 Posting Virtuoso

Thats not the mistake, the problem is that your trying to send keypresses to the window itself, not the text box inside it, you will have to get the handle to the text box in order for that to work.

William Hemsworth 1,339 Posting Virtuoso

right..

William Hemsworth 1,339 Posting Virtuoso

That is still an error, date has the data type char[10], you can only use the >> operator on a class that has that particular operator.

William Hemsworth 1,339 Posting Virtuoso

You used the code tags correctly ;)

First:
There is a mistake on line 27.

while (date >> price)  
  {
    for (i=0; i < arraySize; i++)  // loop
      cout << setw (10) << a[i];
  }

date has the data type char[10] and price has the type double. What exactly are you trying to do here? If you want the variable date to convert to the variable price, either use stringstream, or a quick solution, atof.

William Hemsworth 1,339 Posting Virtuoso

Please add code tags.
[CODE] Code Here [/CODE]

William Hemsworth 1,339 Posting Virtuoso

I'm using it now, its good. Only a few things I have noticed:
- Doesn't allow you to scroll by clicking the mouse wheel
- Full screen flash applications run with a slightly slower FPS

William Hemsworth 1,339 Posting Virtuoso

Something I heard, "Life is too good and too short to waste on this filthy habbit, give it up, live a nice long life".

William Hemsworth 1,339 Posting Virtuoso

Well first, lets see your program's source code.

William Hemsworth 1,339 Posting Virtuoso

Why have you made two threads posting the exact same (badly presented) question.. its not going to make it get answered any quicker.

William Hemsworth 1,339 Posting Virtuoso

Look at this thread.
Manish_Singh just copied the first books its says on this thread.

William Hemsworth 1,339 Posting Virtuoso

"Weren't we the revolution that every night almost happened... almost happened... kept almost happening; but instead we just only crashed into eachother?"

William Hemsworth 1,339 Posting Virtuoso

Ive used it before, its an awsome program x]

William Hemsworth 1,339 Posting Virtuoso

> This will be just as much a piece of crap as vista is believe me!!
Out of curiosity, why is it that you hate Vista so much ?

William Hemsworth 1,339 Posting Virtuoso

>Does that mean i wrote a good code .. Hurray!!
I guess so :D

William Hemsworth 1,339 Posting Virtuoso

size_t is just a typedef'd unsigned int which can only hold absolute integers, because a string for example will never have a negative amount of characters. As for shortening the code, there really isn't that much you can do as far as I can see :P

William Hemsworth 1,339 Posting Virtuoso

Everything seems to work fine, although I don't particularly like the way you have formatted it (white space missed alot and its all very streched) but thats a matter of personal opinion. There were also a couple of compiler warnings to do with assigning l1 and l2 (int's) with size_t variables recieved from the strlen function. To fix that I just changed their data types to size_t aswell.

char *cstrstr(char s[],char ss[]) {
   size_t l1, l2, i, j, k;
   int flag = 0;
   char *p = NULL;
   l1 = strlen(s);
   l2 = strlen(ss);
   for (i = 0; i < l1; i++) {
      p = &s[i];
      if (ss[0] == s[i]) {
         for (k = i, j = 0; j < l2; j++, k++) {
            if (ss[j] == s[k]) {
               flag = 1;
               continue;
            } else {
               flag = 0;
               break;
            }
         }
      }
      if (flag) return p;
   }
   return NULL;
}

Hope this helps.

William Hemsworth 1,339 Posting Virtuoso

Oh my god... read the previous posts!

William Hemsworth 1,339 Posting Virtuoso

> wierd
thats "weird" :)

William Hemsworth 1,339 Posting Virtuoso

Eewwww :@

William Hemsworth 1,339 Posting Virtuoso

Can you post some more code, like the definition of soda_machine->dispenser[x], if the code isn't very long, just post it all.

William Hemsworth 1,339 Posting Virtuoso

Damn you for making me addicted to this game :angry:
I have to admit, this was one big fluke.. (1061ft)

William Hemsworth 1,339 Posting Virtuoso

"The spaces between your fingers were created so that another's could fill them in."

William Hemsworth 1,339 Posting Virtuoso

Iv'e been using vista ultimate (without SP1 for most of the time), and to tell you the truth, I think its great and easy to use. Iv'e never really had any problems with it, and I have only ever found 1 bug in it (you delete a file but the icon remains there..)

>Anyone considerinstalling Vista -- don't. You will have nothing but headaches.
So to be totally honest, I dont agree with this. I say try it out first, off a friend who has it, or in a store. But you shoulden't just jump to conclusions and just say "Vista is just plain crap" ;)

William Hemsworth 1,339 Posting Virtuoso

try imagining the shadow turning anti-clockwise, that helps to see it the other way :)

William Hemsworth 1,339 Posting Virtuoso

Ahh, its soo confusing, I could only see her turning clockwise for about 10 minutes at first, then I could only see her going anti-clockwise..
which way do you see her turning :confused: ??
http://www.news.com.au/perthnow/story/0,21598,22492511-5005375,00.html

William Hemsworth 1,339 Posting Virtuoso

Essh the amount of times this question has popped up.. :icon_exclaim:

William Hemsworth 1,339 Posting Virtuoso

I suggest to actually read the messages from all applications you look up windows hooks.

Sorry, I dont know what happened, but I just realised this sentence makes no sense at all ;)

William Hemsworth 1,339 Posting Virtuoso

A way to do this would be to record every relevant message and the time between this message and the last message. To record it you could do something like this:

#include <iostream>
#include <vector>
#include <windows.h>

using namespace std;

struct Action {
   HWND hwnd;   // Window Handle
   UINT msg;    // Message ID
   UINT delay;  // Delay to next message
};

// Use windows hooks to fill up this vector with actions
vector<Action> actions;

I suggest to actually read the messages from all applications you look up windows hooks.
For some information about hooks and how to use them go here.

As for playing them back, I would suggest you make a seperate thread because using the Sleep function stops all other messages from being handled on your application until the delay has finished.

For playing back the actual message, take a look at SendMessage or PostMessage.

I hope this helps.

William Hemsworth 1,339 Posting Virtuoso

Aperantly the actual number of the beast is 616 not 666 :)
It said on QI... they NEVER lie!

William Hemsworth 1,339 Posting Virtuoso

Try looking at vectors, it might be what your looking for.

William Hemsworth 1,339 Posting Virtuoso

>That will not help as you will loose members by forcing it that way
Loose members ?? I doubt it, and quite frankly any member who leaves the site after 20 seconds who cant be bothered to read the instructions doesn't really deserve to be here. :icon_wink:

William Hemsworth 1,339 Posting Virtuoso

>They manage to ignore all the other hints we throw at them, what makes you think they'd read this one?

Force them to read it :)
Make it appear for 20 seconds on the screen with no way to escape.

William Hemsworth 1,339 Posting Virtuoso

Except you didn't say how long compile times can be for massive projects! O_O

I recall my professors saying that compiling can take a very long time... so it's best to get things right the first time X_X

It took them 10+ minutes to compile the average of about 10 millions lines of C++ code that goes into one of their games. ;)

Alex Edwards commented: 10 minutes for 10 million lines is a good trade! =) +3