Posts
 
Reputation
Joined
Last Seen
Ranked #1K
Strength to Increase Rep
+3
Strength to Decrease Rep
-0
100% Quality Score
Upvotes Received
4
Posts with Upvotes
4
Upvoting Members
4
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
2 Commented Posts
0 Endorsements
Ranked #2K
~12.6K People Reached
Favorite Tags
Member Avatar for doug65536

I have a project that uses DirectSound to play streaming sound. I use SetThreadpoolWait to get a threadpool callback every time the notification (AutoReset) events are signalled. (To fill the streaming buffer with more audio). The new Win7 threadpool API requires you to use SetThreadpoolWait to schedule a new wait …

Member Avatar for Klaus_1
0
557
Member Avatar for ben1996123

You can't rely on Sleep to reliably sleep for one second. If you read the documentation for sleep, it will specifically say that it might (and in reality, often will) sleep for more than the specified time period. If the cpu is under load (like if there are processing intensive …

Member Avatar for PalashBansal96
0
291
Member Avatar for XodoX

Sounds an awful lot like he wants us to do his homework assignment for him. Sometimes I feel tempted to post a really sophisticated answer with templates and policy classes and inheritance so it is perfectly clear to the teacher that there's no way he wrote it.

Member Avatar for EskayJoe
0
1K
Member Avatar for bmanzana

Study operator precedence. I know it's boring as hell, think of it as the same kind of thing as learning your times tables -> boring as hell but great to know once you know. It helps a lot to be able to look at an expression and know what order …

Member Avatar for doug65536
0
131
Member Avatar for Labdabeta

Mike is talking about industrial strength optimal ways to handle it. A while ago I developed a very simple way of doing it that is not even close to optimal but isn't too bad: For triangle A B C calculate the vector N = crossproduct(normalize(B - A), normalize(C - A)) …

Member Avatar for Labdabeta
0
211
Member Avatar for Undertech

This is a bug that has been reported to Microsoft since visual C++ 4, and has not been fixed yet. Microsoft says it is fixed in VS 2011. We'll see.

Member Avatar for doug65536
0
2K
Member Avatar for Majestics

It's the other way around, right? Don't you have requirements that it run on a given operating system, or a requirement that it be portable across a lot of operating systems? The sockets API is my suggestion. It allows you to have code that is reasonably similar between unix and …

Member Avatar for doug65536
0
203
Member Avatar for Zssffssz

Real encryption algorithms (symmetric ones anyway) are mostly based on an extrememly strong random number generator that can be "seeded", which means made to generate the same sequence of random numbers, given a seed, often called the key. You take those extremely random numbers and xor them with the data, …

Member Avatar for doug65536
0
229
Member Avatar for anujthefuhrer
Member Avatar for anujthefuhrer

Never heard of "on the fly paging". The closest thing I can think of is "demand paging". It means that things like executable files and dlls are mapped to a range of memory, but it only goes and reads from disk if the program touches those areas of memory that …

Member Avatar for doug65536
0
98
Member Avatar for dospy

I think what you are asking is how to reverse engineer the protocol. Yes, reverse engineering is usually difficult. One approach is to make the program do known things and watch the data. Repeat the operation and see what changes and what doesn't. Then do something slightly different and see …

Member Avatar for dospy
0
181
Member Avatar for coolboym99

What windows is doing when that thing comes up is switching to another desktop. The "other" desktop is heavily secured so that it is very very difficult* for a program to be able to press the button for you (by moving the mouse pointer and clicking it from a malicious …

Member Avatar for doug65536
0
156
Member Avatar for Wootens

1) Do you need to put new objects at the end? Since you're using a singly linked list, the simplest/fastest way to add an object to the list is to put it at the beginning: [code] this->next = first; // The next of my new node points to the one …

Member Avatar for doug65536
0
111
Member Avatar for anujthefuhrer

It might be logical, it might be physical. Depends on the hardware and how it is configured. If the processor has no memory remapping capability (i.e. no MMU) then you ONLY have physical addresses. Ancient home computers (before 80286) had no MMU (memory management unit). The first commonly used desktop …

Member Avatar for doug65536
0
841
Member Avatar for meli123

The 'if' statement on line 16 only affects the cout << q. If you look carefully, you'll see that the 'break' is always executed and it will never loop. However, it's still wrong if you fix that. From what I can tell by running the code in my head, you …

Member Avatar for doug65536
0
113
Member Avatar for u8sand

There is a [B]lot [/B]more to it than blindly copying a block of code and expecting it to work. It depends very much on the processor and the instructions being used. For example, a switch statement might have a lookup table somewhere else. It might be using jump vectors for …

Member Avatar for doug65536
0
272
Member Avatar for marirs07

If you know the name of the *member* of the structure and you know the type of the structure, you can use offsetof(type,member) and do some pointer arithmetic. It is impossible to get the base of the structure in C (or C++) without knowing what member it is and what …

Member Avatar for marirs07
0
3K
Member Avatar for wnr78ta

There's nothing wrong with typedef double T. What is wrong with it? Does it HAVE to be a template argument? No! I am siding with the professor on this one. If you are typedef'ing inside a class scope, then doing typedef double T is perfectly fine - it enables you …

Member Avatar for wnr78ta
0
335
Member Avatar for OblibSystems

At the start of the fight, C would open up with a flurry of super high speed punches. After a while though, the C program would start to bog down, because the developer used simplistic algorithms - lots of linear searches and the like. C++ would maintain higher damage later …

Member Avatar for ddanbe
0
436
Member Avatar for elmar01

How do YOU think you would do it. Are you looking for someone to outright do your homework for you? I see absolutely no effort on your part. Did you even try to do it? Did you write any code? If you post code and perhaps show that you even …

Member Avatar for WhiZTiM
0
154
Member Avatar for hujiba

I have a suggestion to get better randomness from rand(). The high bits are the most random, the low bits are a lot less random. If you use modulus, you are effectively using the low bits - your random numbers won't be very random. To get optimal randomness from rand(), …

Member Avatar for doug65536
0
168
Member Avatar for SCass2010

For these kinds of problems, keep a toolbox of ways of thinking of the numbers in your mind. The trick that applies here is remembering that dividing by a lower number will give a higher result. 5/1 = 5, 5/0.5 = 10, 5/0.25 = 20, etc... So if you have …

Member Avatar for doug65536
0
737
Member Avatar for meli123

Not sure how you plan to write a program to prove that, since you already know it's false.

Member Avatar for doug65536
-1
267
Member Avatar for themarval

I did some quick web searches for "allegro page flipping" and found a page that shows how to do page flipping. For smooth animation of this sort, you can't just draw and hope for the best. You need two copies of the screen. The 'front' buffer is the one the …

Member Avatar for themarval
0
155