|
See here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
does anyone know how to convert FAT to CDFS?
give me some source code please
|
|
|
|
|
That sounds like an odd requirement. Please explain.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
how to replace '............344' with empty string from the string like:
'1. visual basic.net ............344'
i am using regular expression in vb.net
this is the sample code
sText = Regex.Replace(sText, " (\\.+)\\d+", "");
thanx
|
|
|
|
|
Im sorry but I dont understand what you said you have a string (...344) and now you want to replace this string with null string on c++ ?
|
|
|
|
|
This is a C++ forum!
Steve
|
|
|
|
|
After I've created a new resource (IDD_TBL_A_DLG) and open ClassWizard, ClassWizard tells me I have a new resource and do I want to create a new class for it. When I try to create the class for this resource, I get the following:
"Unable to open the files (C:\RetPlan\TableA.h, C:\RetPlan\TableA.cpp) for class CTableA".
However, the .cpp and .h files are created but the Wizard can not add to them!
Can anyone clue me in as to what is going on? This is a VC++ 6.0 Project and is 'dialog-based'.
John P.
|
|
|
|
|
jparken wrote: "Unable to open the files (C:\RetPlan\TableA.h, C:\RetPlan\TableA.cpp) for class CTableA".
However, the .cpp and .h files are created but the Wizard can not add to them!
Can anyone clue me in as to what is going on? This is a VC++ 6.0 Project and is 'dialog-based'.
Delete .aps, .clw, and .ncb files and restart IDE.
|
|
|
|
|
jparken wrote: Can anyone clue me in as to what is going on? This is a VC++ 6.0 Project and is 'dialog-based'.
It's a known bug with VS6. The files get created, but ClassWizard just doesn't know about them. Clean up the project's temporary files, and then restart the IDE.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks very much. This is the first time this had happened to me.
John P.
|
|
|
|
|
I am trying to hash a password using MD5 to get the resultant digest. These are taken from the example I am following (which is from a trusted authority):
• First get the bytes of the original password, assuming a "Latin-1" encoding. For the password "Baltimore1," these bytes are: 66 97 108 116 105 109 111 114 101 49 44 (i.e. the value of "B" is 66, "a" is 97, etc).
• Then get the MD5 hash of these bytes. MD5 is a standard, public algorithm. Once again, for the password "Baltimore1," these bytes work out as: 223 238 161 24 62 121 39 143 115 167 51 163 245 231 226 94
• Finally, create the new password by forming a string whose Latin-1 encoding is the bytes from the previous step. For the "Baltimore1," password, if this is string is written to the screen, it looks like: ßî¡_>y'?s§3£õçâ^(i.e. the 62 above is a ">", the 121 is a "y", etc).
However, whenever I perform the hash I don't get the same result, I get:
6, 156, 90, 148, 160, 205, 176, 131, 162, 231, 168, 208, 232, 207, 90, 241
and string: œZ” Í°ƒ¢ç¨ÐèÏZñ
The code extract I am using is:
...<br />
unsigned char* pszPwd = simple_digest( "md5", "Baltimore1", strlen("Baltimore1"), &len );<br />
...<br />
<br />
unsigned char* simple_digest( char* alg, char* buf, unsigned int len, unsigned int* olen )<br />
{<br />
const EVP_MD* m;<br />
EVP_MD_CTX ctx;<br />
unsigned char* ret;<br />
<br />
OpenSSL_add_all_digests();<br />
<br />
if ( !( m = EVP_get_digestbyname( alg ) ) )<br />
{<br />
return NULL;<br />
}<br />
<br />
if ( !(ret = (unsigned char*)malloc(EVP_MAX_MD_SIZE)) )<br />
{<br />
return NULL;<br />
}<br />
<br />
EVP_DigestInit( &ctx, m );<br />
EVP_DigestUpdate( &ctx, buf, len );<br />
EVP_DigestFinal( &ctx, ret, olen );<br />
<br />
return ret;<br />
}
This is using the OpenSSL library. I tried to do the hash with completely seperate code that performs a MD5 hash and it came to the same result!
Can anyone PLEASE point me to where I am going wrong?
|
|
|
|
|
For what it's worth i hashed "Baltimore1" with an MD5 algo i have and got 6, 156, 90, ...
I'd look at the source that tells you it should be 223, 238, 161, ...
...cmk
Save the whales - collect the whole set
|
|
|
|
|
I agree, you can check the hash on http://pajhome.org.uk/crypt/md5/[^] and the hash is 069c5a94a0cdb083a2e7a8d0e8cf5af1 which starts with 06, 156
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
Hi everyone
I am trying to write a code for an IIR filter. And for that purpose i need to implement the below function in C :-
out[n] = in[n] - ((b1 * e^jw * out[n-1]) + (b2 * e^2jw * out[n-2]))
Now, am facing problem ... well, rather i have no idea , as to how to implement the e^jw function in C. The value of w is known to me and n = the sample number.
It would be great if anyone could help me out.
Thanks a lot !!
|
|
|
|
|
Is this what you need?
exp (x) - returns e to the power x, where e is the base of the natural logarithm
Judy
|
|
|
|
|
hey Judy
I knew of exp(x) , but what i need is a solution for e^jx, j being the complex number.
|
|
|
|
|
Hazardcoder wrote: I knew of exp(x) , but what i need is a solution for e^jx, j being the complex number.
Ah, couldn't tell what j was - you didn't mention it in your original post and it's been way too long since I coded an IIR. Can't help with complex off the top of my head. I'd imagine someone somewhere has written a complex math library. Have you googled for that?
Judy
|
|
|
|
|
Yup , I did , there's a complex.h library available , but this library works only for C++ . I need for C.
|
|
|
|
|
The code depends on how you are representing your complex numbers in c, but what you need is
exp(jw) = cos(w) + j sin(w)
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
You can write your own funktions with a structur like:
sturct Complex
{
int r;
float phi;
//or with int rel and img
};
the exp(j*w) is only a rotation around the Point 0
it works like:
phi += w;
but i remember the form of an digital IIR filter is
out[n] = in[n] - ((b1 * out[n-1]) + (b2 * out[n-2]))
because the e^jw works like a delay, so
e^jw ^= out[n-1] and e^j2w ^= out[n-2]
but i'm not sure
i hope i can help you
|
|
|
|
|
I need to use Cryptographic API provided by Windows for my project. I am using the following:
CryptAcquireContext
CryptCreateHash
CryptHashData
CryptDeriveKey
After generating a session key using CryptDeriveKey, I am trying to export the key into a ket blob and saving it in a file in the followinng manner
CryptExportKey(hKey,0,PUBLICKEYBLOB,0,pbKeyBlob,&dwKeyBlobLen)
I get a NTE_BAD_KEY error. Can anyone please point out the error here and let me know the correct way of exporting the keys?
|
|
|
|
|
I didn't think you could export a hash key.
Maybe you need to use CryptDeriveKey (CRYPT_EXPORTABLE) on the hash key?
*edit* ack you already use that I can read, really.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I dont understand...the CryptDeriveKey() generates a session key and CryptExportKey() can export session/public/private keys. If I cannot export a hashed session key isn't MSDN contridicting itself?
|
|
|
|
|
If you reread my post I edited it
Something is going wrong before the CryptExportKey() call.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I am using KEYLENGTH|CRYPT_EXPORTABLE flag in CryptDeriveKey()....I should have mentioned in my earlier posting.
So do you mean the key is getting corrupted some where after CryptDeriveKey() and before CryptExportKey()? I have been debugging the code but cant find this?
|
|
|
|