|
You've got access to the source, haven't you? That should make writing a raw image saver simple enough.
|
|
|
|
|
I might be wrong but it doesn't makes sense to write an image back to raw format. Raw file is supposed to contain the raw unprocessed data from a camera. If you process it then its no longer raw data, and you shouldn't save to as raw format.
-Saurabh
|
|
|
|
|
See here[^] for more info about RAW file format.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
How do you make a program in C++ that computes for this:
e^x = 1 + (x/1!) + ([x^2]/2!) + ([x^3]/3!) + ... + ([x^n]/n!)
where e is the euler's contant, x is the input
there should be 500 addends (so n = 499)
Thank you
|
|
|
|
|
#include <cmath>
::exp(x);
also, you could have a look here[^]
|
|
|
|
|
I don't understand what I have to do with the link you gave me. I really need this tonight. Please please please help me. I'm a noob in C++
|
|
|
|
|
I gave you the solution to get it calculated easily, by using the exp() function.
the link was an additional tip to see it used in a real context.
|
|
|
|
|
You need to use a bignum library to calc the large exponents/factorals and maintain precision.
http://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic[^]
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
Hi,
this is elementary.
as always, express each term of the series as a product of the previous term and some factors;
that will give you:
- the most efficient way to perform the calculations
- the fact that the terms decrease as soon as n exceeds x
- a reasonable test for early termination of the series (for small x that is)
there is no need for special libraries, just use doubles.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
(S)He stated (s)he wants to expand to ~500.
(S)He will likely exceed the precision of a double by the mid teens.
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
Hi everyone...
Could anyone please tell me how to check for an keyboard event in win32 consol application...
I have an while loop
while(1)
{
}
I need to check each time if I have pressed a particular key....say "h"
Thanks in advance
I am a learner Always
|
|
|
|
|
Are you looking for this [^]?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
thanks...
But those are blocked call.....I want something like this...
My while loop keeps running.....and it checks for a key...if it was pressd it exits....But if it wasnot pressed also, my while loop keep running(iterating..)
Basically i need a nonblocking function....asynchronous
Thanks
I am a learner Always
|
|
|
|
|
See here [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
himangshuS wrote: I need to check each time if I have pressed a particular key....say "h"
Use _kbhit() in combination with getch() .
|
|
|
|
|
thanks...
I am a learner Always
|
|
|
|
|
I need to get the domain name for the currently logged on user.
::GetUserName gets me the user name, but how do I get the domain name for that user?
Thanks!
|
|
|
|
|
With, Win32_LogonSession you will get 'LogonId' use this logonId to query the Win32_LoggedOnUser. After querying 'Win32_LoggedOnUser' you will get all the fields, like - Domain, Name etc
Supriya
|
|
|
|
|
Use NetWkstaUserGetInfo [^] and retrieve level 1 information, as below. Requires Windows NT 3.1, 2000, XP, Vista.
#include <Windows.h>
#include <lm.h>
std::wstring GetDomainName()
{
WKSTA_USER_INFO_1* workstationInfo;
const NET_API_STATUS status = NetWkstaUserGetInfo(NULL, 1, (LPBYTE*)&workstationInfo);
if (status == NERR_Success)
{
return workstationInfo->wkui1_logon_domain;
NetApiBufferFree((LPBYTE*)&workstationInfo);
}
return std::wstring();
}
|
|
|
|
|
Another option is the environment variables USERDNSDOMAIN and USERDOMAIN.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
I am facing a run time problem with the CString in Release builds in vc6.0
i observed that the memory wont be released for cstring object i checked in the task manager can any one help for this here i posted the code also
#include "stdafx.h"
#include "afx.h"
#include "afxwin.h"
#include <windows.h>
#include "fixalloc.h"
#pragma warning (disable:4786)
#pragma warning (disable:4503)
#include<list>
#include<string>
#include<vector>
using namespace std;
#include <afxtempl.h>
void test()
{
vector<CString> stldmlist;
CString a;
FILE *fp=fopen("E:\\log1.txt","r");
char str[1000];
while(!feof(fp))
{
fscanf(fp,"%s\n",str);
a=str;
stldmlist.push_back(a);
}
fclose(fp);
AfxMessageBox("Memory");
}
UINT32 main(int argc, char* argv[])
{
CString obj;
AfxMessageBox("Start ");
test();
AfxMessageBox("End");
return 1;
}
Hi this Ravinder
|
|
|
|
|
Ramasani wrote: memory wont be released for cstring object i checked in the task manager
Given that task manager doesn't tell you if objects released memory or not, I presume you were looking at an process's working set...
The behaviour I'm guessing you're talking about (the process's working set rising and not falling after test exits) is to be expected - when you start allocating memory, the C runtime requests large chunks of memory from the Windows memory manager. It will not necessarily bother releasing them when you release objects, as allocating and releasing memory with the Windows memory manager is quite expensive.
|
|
|
|
|
if i go for more number of CString calls it returns memory leak errors(no memory) is there any patches available for this? i need very urgent.
Hi this Ravinder
|
|
|
|
|
Ramasani wrote: memory leak errors(no memory)
Ummm - 'no memory' does not necessarily imply memory leaks. It could just be that you're allocating a *lot* of memory. How big is this log file you're reading in?
Ramasani wrote: is there any patches available for this?
Let's think about this - what's more likely to be at fault - MFC/C++ standard libraries or your code/understanding thereof? Mmmm.
|
|
|
|