|
Figured it out - there is an error in my html form, it should be enctype , not type . Now I have a file content.
011011010110000101100011011010000110100101101110
0110010101110011
|
|
|
|
|
I would like to use a "Big Number" package for my application which I am writing on Windows using Visual Studio and C++. Therefore, I thought I would use GMP. However, I get the impression that compiling it under Windows is going to be a big job. Therefore, I am wondering if it is worth doing.
Could somebody suggest a different package that is more geared towards the windows environment?
Thanks
Bob
|
|
|
|
|
Depending on what you need libtommath[^] may do the job for you. It's a C library I've used in several projects along with libtomcrypt. These are in ansi C. Their source is clean. Public domain. Check out the libs of this guy, they are excellent.
The LICENSE file:
LibTomMath is hereby released into the Public Domain.
-- Tom St Denis
|
|
|
|
|
-1
down vote
favorite I have this program that needs to handle large numbers to factorize a number into primes.. Just like the RSA factorization challenge.
I got this list in a txt file with prime numbers. this is the piece of code I use to make that list:
int export_list (int lim = 50)
{
int last_in_txt = 0;
{
ifstream infile ("Primes.txt");
int k;
while(infile >> k)
{ last_in_txt = k; }
}
// Now last_in_txt is assigned properly, and Primes.txt is closed
cout << "\nLast number in \"Primes.txt\": " << last_in_txt << endl << endl;
cout << "Press <enter> to start appending primes... ";
cin.get();
cout << "\nAppend started:\n";
last_in_txt++;
ofstream file ("Primes.txt" , ios::app);
int x, counter;
if (file.is_open()) // if it opens correctly
{
for (x = last_in_txt , counter = 0 ; counter < lim ; x++ , counter++)
{
if (check_prime (x)) // returns 1 when x is prime, returns 0 when not
{
cout << "Appending " << x << "\t\t" << "Estimated time remaining: " << (lim - counter) / 1000 <
|
|
|
|
|
A software is executing some websites links (URLs) internally, Can I get to know which links are thses?
|
|
|
|
|
No. Unless the application offers some way of making them public.
Veni, vidi, abiit domum
|
|
|
|
|
john5632 wrote: Can I get to know which links are thses?
Look at the code.
Put a interceptor in place which catches http requests.
Both of those of course require that you have internal access. However the above applies if you are executing something on your machine rather than a remote server.
|
|
|
|
|
Why not use a packet sniffer?
Wireshark[^] would do the trick... it's a very mature product that's been around for ages (used to be called Ethereal) and is very reliable and used by many.
|
|
|
|
|
Hey there,
I have a C++ WIN32 DLL that acts as a server for a UI. Now i want to capture all keyboard inputs in the PC on the WIN32 dll, whenever the UI has active focus. If the user is typing something into another app, i don't care.
The trick is that, the keyboard can be both a software keyboard or a hardware keyboard. I want to be able to capture every keyboard input from the user on the PC in which the UI and DLL is running.
I would ideally like to get a little deeper on the Windows operating system level to do this. Rather than using WM_CHAR or something like that.
Is this possible to do? How can i implement this?
Any sample code will help.
Thanks in advance.
|
|
|
|
|
This[^] or this[^] could be a start, I'm sure there are plenty of others out there.
|
|
|
|
|
First I tried using kbhit() and getch() to recognize and capture the users input. I call the code below every frame (I tested in BL:R) but nothing happens.
PHP Code
if(kbhit())content += getch();
|
|
|
|
|
|
I'm working on Audio Capture of my system and I did it using loopback capture method to record my audio. I recorded the file and its fine in non compressed form.
I want to make it in small size or compressed form.
But from last two days I'm searching for a way to encode it into .aac format using ffmpeg or something else.
Do anyone having any idea for this?
Please share your opinions.
Thanks!
|
|
|
|
|
Are you looking to do these conversions within your program? If so, take a look at some of the responses in this [^] thread.
|
|
|
|
|
I've gone through this but not getting the exact info what I want to do.
Any other suggestion.
|
|
|
|
|
CodingHell wrote: what I want to do
Which is?
|
|
|
|
|
Semi-programming rant
Am I the only one who gets caught using someone else program only to find out it is limited to “click this and click that”?
After embarking on using FFT to analyze audio signals and getting strange results I found out that the basic “recorder” application I am using does not truly records the audio as I expected.
The data stream is padded with several 0 before the real data is recoded.
OK , I can figure this out , but I need to go to very root of this sample application.
For example – it uses PCMFORMAT and than builds WAVE “PCM”structures.
I cannot find anywhere where the PCMFORMAT is actually defined.
I don't need an explanation what “PCM” is / does, just like to know where this PCMFORMAT structure is defined. That's all.
Cheers Vaclav
|
|
|
|
|
PCMFORMAT is not in the Visual Studio headers.
Where does it come from ? what source file uses it ? I assume that if it compiles, then it should be defined somewhere ?
Are you certain it is not PCMWAVEFORMAT ?
I'd rather be phishing!
|
|
|
|
|
This seems pointless - you are just confirming what I already know.
And what makes you think I am not certain?
Sorry, not in the mood for exchanging stuff like this here.
Just for kicks - it is used in CRecorder class which does not have any info where it came from.
The class itself has #include <mmsystem.h> and
#pragma comment(lib,"winmm.lib").
Have a nice day anyway.
Grumpy old man Vaclav
|
|
|
|
|
When doing customer support, one always ask the obvious questions !
I'd rather be phishing!
|
|
|
|
|
And the obvious answer in my case - typedef struct _PCMFORMAT.... defining four basic PCM parameters later copied to PCMWAVAE....
Sorry to be so grumpy.
Vaclav
|
|
|
|
|
I don't know where the definition of PCMFORMAT is... but I can tell you what PCM is...
PCM stands for Pulse Code Modulation and is essentially a three step process for a encoding a real life signal into a digital form that can be used within a computer.
1. Sample (sample the analog signal)
2. Quantize (quantize to a level that can be encoded given the number of states you have available)
3. Encode (encode the quantized value into an appropriate numbering scheme)
It's really that simple to understand. Differences come in the variations available for these three variables. For example, your sampling rate could be 33KHz, or 48KHz, or something else. It depends on available hardware and what you expect to the highest frequency of interest. The quantization states are dependent on how many bits you are using and how many distinct possible values they can represent. Obviously, more states equals more values and therefore more fidelity in representing a signal (wider dynamic range). Third, the encoding can be an unsigned integer, a signed integer (common ones)... or can really have any arbitrary encoding a designer wishes.
|
|
|
|
|
I am having problem detecting when the waveOutWrite is finished when I specify number of loops to output. I output 1kHz test tone and it should be about 5 seconds long. The waveOutWrite returns WOM_DONE to the callback function immediately when it is executed.
In debug the code works as expected, the tone is there for 5 seconds.
The WOM_DONE is still returned before the “loop” is done.
Here is the code snippet:
pcm[i].lFreq = Freq;
pcm[i].dDelay = 1;
pcm[i].whdr.dwFlags = WHDR_BEGINLOOP | WHDR_ENDLOOP ;
pcm[i].whdr.dwLoops = 5; // about 5 seconds
if(!pcm[i].C_CreateSinus())
TRACE("\nFailed pcm[i].C_CreateSinus() %i ", i );
mmres = waveOutPrepareHeader(hwout, & pcm[i].whdr, sizeof(WAVEHDR));
if (mmres != MMSYSERR_NOERROR) {ASSERT(0); bOK = FALSE;}
mmres = waveOutWrite(hwout, & pcm[i].whdr, sizeof(WAVEHDR));
Any help would be appreciated.
Cheers
Vaclav
|
|
|
|
|
What does your call to waveOutOpen() look like?
Are you using a callback event?
Are you using a synchronous audio driver?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
David,
the output "device" is PC speaker and here is the
waveOutOpen:
mmres = waveOutOpen(&hwout, WAVE_MAPPER, &wfme,
(DWORD) CallbackWaveOutProc, 0x12345, CALLBACK_FUNCTION);
Correction - it works in "normal" non debug mode ( I got too many threads running amok most of the time) , but still returns WOM_DONE too soon for my app.I am trying to generate several frequencies and need to know when to advance to the next one.
Maybe I should get rid of the WAVE_MAPPER and specify the speaker.
Since it runs in its own thread , could that be the problem??
I am using AfxMessageBox to troubleshoot this and it is not the best way to keep track of timing of things.
|
|
|
|