William Hemsworth 1,339 Posting Virtuoso

>i admire her
That's not just what you imply when you say you love someone and want to marry them, jeez.

William Hemsworth 1,339 Posting Virtuoso

>just join us
Never!

>one more person who responded to my post saying that each night before going to bad he reads some of Narue's poems.
If that's actually true, how pathetic.

>so now we are three
This really has to stop.

shadwickman commented: Thank you for your effort to put a stop to this Narue-admierer uprising :P +2
William Hemsworth 1,339 Posting Virtuoso

>If I'm doing something incredibly stupid
The truth is, you are doing lots of incredibly stupid things :P but that's normal for newbs, don't worry about it.

I'm not even going to bother trying to understand that code, but it's full of small bugs such as this:

if(number[i] [B]=[/B] pi || number[i] == PI || number[i] == Pi || number[i] == pI)

Not to mention the entire line is pointless anyway.

My advice for you is to start over, read a tutorial or book on C++, and scrap this code.

William Hemsworth 1,339 Posting Virtuoso

>What were you trying to accomplish?
The need for case-sensitive variables :P

William Hemsworth 1,339 Posting Virtuoso

Use code tags.

William Hemsworth 1,339 Posting Virtuoso

There's plenty of big-number libraries on the net, or if you have the programming ability, you can write your own big-number class.

struct BigInt {
  // ...
};

int main( void ) {
}
William Hemsworth 1,339 Posting Virtuoso

Cheesey, how about this. I know the exact problem you're facing, but I don't think I want to help you anymore.

Seems your attitude here isn't getting you anywhere.

Salem commented: Works for me +36
William Hemsworth 1,339 Posting Virtuoso

- Being a young kid, life just seemed so simple. :P

- Some nice holidays, I remember going to elba (a small island in italy) which was quite memorable. [link]

- Finishing my GCSE's and leaving school (about 1 week ago), it's such a relief and now I'm on holiday.

And a variety of other priceless things, hopefully many more to come.

Will Gresham commented: Ah yes, times with no worries :) +2
William Hemsworth 1,339 Posting Virtuoso

haha

Get a life.

William Hemsworth 1,339 Posting Virtuoso

Using commas is like cheating, it makes it easier :D

Nuts on mangos inside noodles always tastes especially delicious.

bapwiue

William Hemsworth 1,339 Posting Virtuoso

>William, I wasn't trying to put you down
I didn't assume you were ;)

What I meant is I wouldn't want to have to learn a new language or keep up with all the latest languages constantly. Perhaps a job that requires low level hardware programming would be easier, I'm not saying you wouldn't need to learn anything new, but i'm sure it would be easier.

I just want to have a life as well, is that too much for a programmer to ask for?.. :( Heh, I'm sure i'll think up something.

William Hemsworth 1,339 Posting Virtuoso

Nobody hates peanut butter and gets away with it.

I get away with it, so stfu :D

William Hemsworth 1,339 Posting Virtuoso

Of course, IMO it should be an official rule, but if he wants to go ahead and screw up his rep, he can feel free to do so :D I wouldn't worry about it, I think he will get bored of posting full solutions soon anyway.

William Hemsworth 1,339 Posting Virtuoso

It's not an official rule that you're not allowed to give away free solutions, so if he wants to give them away, he has that choice. He wont be given any warnings by a moderator.

On the other hand, if he wants to help the OP, he shouldn't be giving the poster full/nearly complete solutions. By doing so, he's ultimately making it harder for OP to write code independantly in the future. Also there will be the same debate on every thread he does this with, not to mention he will destroy his own reputation, so hopefully he will realize the smart thing to do now.

I believe I heard this for AD some time ago, "Give a man a fish and he will eat for a day. Teach a man to fish and he will eat for a lifetime", or something like that anyway :icon_lol:

tux4life commented: Good post! +9
William Hemsworth 1,339 Posting Virtuoso

Seems you are right, I had never heard of it in that way. [link]

Well, the first thing you have to do is read and uncompress the GIF image before you can change it to a binary image. Once you have the pixels in an array, you check each pixel with a threshold (127 I would assume) so if the pixel has a value higher than the threshold, it pixel would be 1, if it's lower, then it would be 0.

Both cases require reading and writing to bitmaps, so it would probably be easiest for you to use a bitmap library on the net.

William Hemsworth 1,339 Posting Virtuoso

Explain what you mean by "GIF image into binary". I'm assuming you mean to get an actual array of pixels instead of having them in a compressed format, but the question seems vague.

Marco93, if you want to play it that way, your post has no sense. GIF is an image compression format which handles a maximum of 8 bits per pixel and allows animation. Simply saying "GIF is binary" isn't helping, as you will find that pretty much anything on a computer breaks down to binary.

edit: I should really check for previous posts before I post mine.

William Hemsworth 1,339 Posting Virtuoso

I don't feel exhausted by learning new stuff, but for me it's not really such an obligation. I'm still in school and do have some free time on my hands which I try to never waste. Admittedly I haven't really learnt anything "new" on the computer recently, especially now that i'm on holiday :P But I do try to do a variety of things, like learning the piano, the japanese language (which is really quite time consuming), play icehockey, and be with my friends when I can. :icon_lol:

I know it does feel like alot of effort to keep up sometimes, but if you can't cope with it, perhaps it's time for you to think of something better suited for you. After all, nobody's forcing you to be in this line of work. In fact, if these are the kinds of problems I will face when i'm older, maybe it's time for me to think of a different career for the future. :icon_eek:

csurfer commented: Hey I vote for you dude !!! Same case here !!! +2
scru commented: Man up, you wimp. If we all gave up at the slightest sign of hardship to "try somethin else", we'd be in for a rude surprise. -1
William Hemsworth 1,339 Posting Virtuoso

Well, unless you're going to add some artificial intelligence to this, simply put a load of predetermined questions / answers in and apply them to an if / switch statement.

William Hemsworth 1,339 Posting Virtuoso

Try reading the documentation on how to install it perhaps?

Check your linker settings, make sure you have entered everything correctly.

William Hemsworth 1,339 Posting Virtuoso

One of the best (if not the best) free IDE and compiler you will find is Visual Studio Express.
[link]

If it were me, I would choose C++ because I find it the most useful and enjoyable, but the choice is all yours.

Hope this helps.

William Hemsworth 1,339 Posting Virtuoso

The language is optional, but the more popular ones are C/C++, or some .NET language such a C# or Visual Basic. Getting into programming isn't too difficult so long as you spend a good amount of time and put in some effort.

>It seems as though this is a free piece of software I can get on the internet
Pretty much, but it helps to pay for a good IDE, though it isn't really required.

>I intend on teaching myself with the help of this online forum and text books
Then take your language pick, and get going :]

William Hemsworth 1,339 Posting Virtuoso

One thing you could try:

long long num = 123456789123[B]ll[/B];

Just a guess though.

William Hemsworth 1,339 Posting Virtuoso

>If you want to code it in C#, the code is cleaner -- use an object[]
Don't bother suggesting another language, we're in the C forum and we can assume the OP wants to use C, unless he says so himself that he's undecided.

Either way, that post didn't solve his problem. I don't use Dev, but your best bet would be to search the problem on google.

William Hemsworth 1,339 Posting Virtuoso

What compiler are you using?

How could you not guess from post #5?

William Hemsworth 1,339 Posting Virtuoso
#include <stdio.h>

int main( void ) {
  // how can i store a 12 digit number?
  long long num = 123456789123;

  // print that number using a variable
  printf( "%lld", num );

  return 0;
}

I think that's right, hope this helps.

William Hemsworth 1,339 Posting Virtuoso

It's kinda hard to tell you how to fix the memory leak when we don't have the code, either post your code or keep searching yourself.

William Hemsworth 1,339 Posting Virtuoso

Trying using the long long or __int64 integer type.

William Hemsworth 1,339 Posting Virtuoso

Let me see your attempt first.

William Hemsworth 1,339 Posting Virtuoso

Don't worry about it, I get them all the time :D

William Hemsworth 1,339 Posting Virtuoso

yeah, i was going to quit posting for a month so it would stay 1337, but that lasted for all of about 2 hours :P

Would be kinda pointless considering almost all of us missed that out even when you created the thread :D

William Hemsworth 1,339 Posting Virtuoso

You will have to get the window resize message process, and update the cursor clip there instead. If you aren't using the Win32 API, then it's probably easier to do just do this every frame:

static RECT oldRect;
RECT newRect;
GetWindowRect( hwnd, &newRect );

if ( memcmp(&oldRect, &newRect, sizeof(RECT)) == 0 ) {
  ClipCursor( &newRect );
}

oldRect = newRect;

That should work, try it.

William Hemsworth 1,339 Posting Virtuoso

zomg lolwtfbbq u gt pwnd j00 n00b!!!!!!1

Your leet speak is actually kinda consistant, maybe I can make a special program just to deleetify your stuff :D

William Hemsworth 1,339 Posting Virtuoso

Most probably you're just missing a codec, try installing this codec pack [link], or try using VLC Player.

William Hemsworth 1,339 Posting Virtuoso

Great, but probably not appropriate for the 'Posting Games' forum.

William Hemsworth 1,339 Posting Virtuoso

>It can still be written more efficiently
I'm curious, how could it get more efficient than that?

William Hemsworth 1,339 Posting Virtuoso

Also for anyone reading this post. You will need to set the ClipCursor inside a loop to constantly update that cursor is infact still inside the window

No, you just have to freeze the thread after you've called it, you don't have to keep calling it. Example:

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

int main() {
  RECT r = {100, 100, 200, 200};
  ClipCursor( &r );
  std::cin.ignore();
}
William Hemsworth 1,339 Posting Virtuoso

>I challenge you to write a solution that doesn't start with something along those lines.
Well, I already gave a link to my code snippet I wrote some time ago which started differently, though I'm not sure if it's any better as it relies on the windows header and it seems a little excessive.

>you haven't given a good reason why it's a "lame" solution
He said it first :]

But as usual, I guess you're right :P

William Hemsworth 1,339 Posting Virtuoso

Ever heard of punctuation?

Anyway, I have to admit, that confused me.
This part: ~(~0 << n) will make a binary number containing however many 1's you tell it to, for example...

// ~(~0 << n);

0000001b == ~(~0 << 1)
0000011b == ~(~0 << 2)
0000111b == ~(~0 << 3)
0001111b == ~(~0 << 4)
0011111b == ~(~0 << 5)

I don't really understand what this part does: (x >> (p+1-n) , but maybe somebody else could enlighten both of us.

William Hemsworth 1,339 Posting Virtuoso
William Hemsworth 1,339 Posting Virtuoso

If your IDE requires that the project is to be opened on your hard drive and not a cd, then the only way is to do what your friend did.

Also, if it is a read-only cd, you wouldn't be able to make any changes to the project or even be able to compile it.

William Hemsworth 1,339 Posting Virtuoso

From msdn [link]

The retrieved handle identifies the child window at the top of the Z order, if the specified window is a parent window; otherwise, the retrieved handle is NULL. The function examines only child windows of the specified window. It does not examine descendant windows.

If the function succeeds, the return value is a window handle. If no window exists with the specified relationship to the specified window, the return value is NULL. To get extended error information, call GetLastError.

Try to find out more about the problem using the GetLastError function.

Hope this helps.

William Hemsworth 1,339 Posting Virtuoso

>Lame way to do it
You're right there, _getch() isn't part of the C++ standard, you can't backspace, and you're using conio.h.

William Hemsworth 1,339 Posting Virtuoso

Using the windows header, I managed it like this. [link]

William Hemsworth 1,339 Posting Virtuoso

That was an interesting watch.

William Hemsworth 1,339 Posting Virtuoso

I don't see why anybody would want a 'Slippery, Slimy, and Occasionally Erect' remote :X
You really do get some pointless things nowadays. Reminds me of this list I found a long while back. [link]

csurfer commented: Nice list !!! +2
William Hemsworth 1,339 Posting Virtuoso

Why don't you start by giving us a less vague question. What is the program supposed to do? What output are you expecting? Without these details it's hard for us to help.

William Hemsworth 1,339 Posting Virtuoso

Use an API such as the Win32 API or any other graphics library out there.

William Hemsworth 1,339 Posting Virtuoso

Off the top of my head... this should work.

HDC hdc = GetDC( NULL );
COLORREF rgb = GetPixel( hdc, 100, 50 );
William Hemsworth 1,339 Posting Virtuoso

Haha :)

William Hemsworth 1,339 Posting Virtuoso

>Isn't making a smoking section in a restaurant like making a peeing section in a swimming pool?
Not really.

>Why do croutons come in airtight packages? Aren't they just stale bread to begin with?
Nope, croutons are not stale, they are just rebaked bread.

>If Fed Ex and UPS were to merge, would they call it Fed UP?
I doubt it :P

>If it's true that we are here to help others, then what exactly are the others here for?
We are here to live, but life's more pleasant if people help eachother.