Given points ABC, how could I find angle ABC? I'm making a feehand tool for a vector drawing application and to minimize the number of points it generates, I wont add a points unless the angle of the mouse position and the last 2 points is greater than a certain threshold.
Thanks
what I had:
int CGlEngineFunctions::GetAngleABC( POINTFL...
Hi,
I'm currently researching ways to hook a process and take control of it using mouse/keyboard events whilst it is in the background (Ala, not the active window). I guess you could think of it as a more advanced macro that doesn't require the targeted window/process to be active.
Now I know the process hooking code is abundantly well...
I've been able to solve the following problem using std::next_permutation (c++) etc,
but I'm now thinking about it in a more general and would very much like to form an
expression as this type of problem seems to lend itself - though I'm not having any luck as of yet.
Here is the question:
Given a running race with N contestants, wha...
Is there any way i could write MSYS commands inside netbeans IDE. IDE does compile c++ files using MSYS isn't it? And then it shows the output errors or warnings and stuff. Please answer.
...
I am programming a UDP proxy application for Windows in C++ that sends and receives UDP packets with Winsock. The problem is that I need to work with the ENTIRE packet, not just the data and UDP and/or IP header. I have tried raw sockets with IP_HDRINCL (might be misspelled), but it still chops off some information from the packet. Is th...
My code is segfaulting. I can't understand why. It might have to do with the "fermatPrimeTest()" function I made.
#include <iostream>
#include <cmath>
#include <cstdlib>
#include "fib.h"
using namespace std;
bool fermatPrimeTest( unsigned long int p )
{
if ( p % 2 == 0 ) { // if even
return false;
}
else if ( p == 1 || p == ...
Hi,
I have a question regarding memory deallocation and exceptions. when I use delete to delete an object created on the heap . If an exception occurs before this delete is the memory going to leak or this delete is going to execute ?
...
Dear PHP and Qt experts,
I want to create a Qt application that takes a random integer and sends to the server to a specific file (say to process.php) in order to that file to answer to that Qt application if the number is odd or even. And when the Qt application gets the answer from the process.php, it gives a message box that tells th...
is a c++ member array of struct thread safe using only one index per thread ?
using the following class:
typedef struct {
bool bFlag;
unsigned int uiNum;
} TC_MYSTRUCT;
class MyClass {
public:
MyClass();
~MyClass();
int GetFreeIndex();
void SetIndexDataNum(int idx, int num);
int GetIndexDataNum(int idx);
pr...
I'm working on a solution file (VS 2005) which contains multiple projects.
There are two projects of my concern right now - one called core and another called log.
The core project is the startup project and the log project has core ticked in its project dependencies.
I have two files in core project - AB.h(declarations) and AB.cpp(de...
Hi! I wanted to know if there's any way by which we can detect the position of an object in an image using some programming language ?
For example : If i have an image of a ball that is updating itself say every 100 milliseconds,is it possible to get the coordinate of the ball through some program,using something like C++ or Java ?
Tha...
hello everybody i am happy that in web world there exist such good programming forums
and now question
when i run only following code pragment
int *t;
std::cout<<sizeof(char)<<std::endl;
std::cout<<sizeof(double)<<std::endl;
std::cout<<sizeof(int)<<std::endl;
std::cout<<sizeof(t)<<std::endl;
it gives me result like...
I can't seem to get all Javascript functionality to work on the WebBrowser Control (linked below)
This could possibly be due to the same-domain issue - local html files have some ajax that calls address on external server. Is there a way to modify the control to omit the same domain?
http://msdn.microsoft.com/en-us/library/aa752040(V...
When debugging a C++ Boost.Test application inside VS2010 (VS2008), how to make the debugger stop at Boost.Test assertion failure points?
...
Hi,
I'm making a cross plateform program that embbed a small RARP server (implemented with winpcap/pcap) and runs 2 TCP IP servers. I have to use C++.
So i will have at least 4 threads, the main one wich countain the controller, 2 TCP/IP async socket, and the RARP server.
I planned to use c++ BOOST Asio and Thread, because i need to r...
Hi,
I have two char's and I want to "stitch" them bitwise together.
For example:
char c1 = 11; // 0000 1011
char c2 = 5; // 0000 0101
short int si = stitch(c1, c2); // 0000 1011 0000 0101
So, what I first tried was with bitwise operators:
short int stitch(char c1, char c2)
{
return (c1 << 8) | c2;
}
But this doesn't work: I'm...
Hi guys,
I have a question about how CoCreateInstnace() method locate and create an instance of a CoClass contained in a COM DLL.
Accroding to MSDN:
The CoCreateInstance function provides
a convenient shortcut by connecting to
the class object associated with the
specified CLSID, creating an
uninitialized instance, and rele...
Question: I need to fit the following structure into an int64
day 9 bit (0 to 372)
year 8 bit (2266-2010 = 256 y)
seconds 17 bit (24*60*60=86400 s)
hostname 12 bit (2^12=4096)
random 18 bit (2^18=262144)
How do I make such a structure fit in an int64 ?
All items are numberic, and of the specified bit size.
...
I'm implementing map for an excersise and I'm at the point where I would have to iterate over it (done and working) but the problem is that I don't know how to implement a last element (presumably an empty link). I was thinking that I would attach some special kind of link (descendant of base link) which would then be attached to the las...
Hi, how to create static library in Visual C++ Express 2010? When creating project, I cant find static library option. Thanks.
...