|
Thanx fr ur reply.
Here im able to replace with alphabets a letter by letter. and have a code for permutations even. But couldn't make it loop for replacing the character with all 26 alphabets..
CODE:
#include<stdio.h>
#include<string.h>
#include<conio.h>
main()
{
char *string = "dogood";
char zev[50];
int length = strlen(string);
printf("\n %d \n",strlen(string));
int i;
for(i=0;i<l;i++)
{
if(*string=='o')
string[i]='n';
else
zey[i] = *string;
*string++;
}
for(i=0;i<l;i++)
printf("%c",zey[i]);
printf("\n");
getch();
}
|
|
|
|
|
One solution would be to use a nested loop, like:
for (int i = 0; i < strlen(string); i++)
{
strcpy(zev, string);
for (char c = 'a'; c <= 'z'; c++)
{
zev[i] = c;
printf("%s\n", zev);
}
}
"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
|
|
|
|
|
And regarding that file generation part, im a able to use fprintf() and all to save the so generated strings to the new file. But the position where im stuck up is at the loops only to replace all the 26 alphabets at every character position. Here is where i use fprintf() function:
#include<stdio.h>
#include<conio.h>
main()
{
FILE *fr,*fw;
char ch;
fr = fopen("input.txt","r");
fw = fopen("output.txt","w");
fprintf(fw,"The sequence is:---> ");
while(1)
{
ch = getc(fr);
if(ch==EOF)
{
break;
}
else
putc(ch,fw);
}
fprintf(fw,"\aThe combinations generated are:\a");
fclose(fr);
fclose(fw);
getch();
}
|
|
|
|
|
I think if we are clear.
My program should be like:
-------> If we give some string of length 'n' (eg: GAVC here its length is 4)
-------> This program should read this string GAVC from an input file and generate the permutations of those substituted in to the other file.
-------> Then every position in the string are to be <b>substituted by 20 letters</b> (A, C, D, E, F, G, H, I, K, L, M, N, P, Q, R, S, T, V, W, Y ) and <b>not with 26 alphabets</b> and then permutations should be done on those individual characters in the given string.
-------> Such that if we give the above string GAVC of length 4, the program should generate 20^4 permutations ie., 160000 combinations.
Please find a solution for me on this........
Thanq..
|
|
|
|
|
The code i have so far is:
#include<stdio.h>
#include<conio.h>
#include<string.h>
main()
{
int i;
FILE *fr,*fw;
fr = fopen("input.txt","r");
fw = fopen("output.txt","w");
char *string="gavc",zev[50];
int length = strlen(string);
printf("\n %d \n",strlen(string));
char ch;
fprintf(fw,"The string is:---> ");
while(1)
{
ch = getc(fr);
if(ch==EOF)
{
break;
}
else
putc(ch,fw);
}
int *ipCount = new int[strlen(zev)];
for(int i= 0;i<strlen(zev);i++)
{
ipCount[i]=25;
}
while(ipCount[0]>=0)
{
for(int j=0;j<26;j++)
{
printf("%s\n",zev);
zev[strlen(zev)-1]++;
ipCount[strlen(zev)-1]--;
}
for(int i= 1;i<strlen(zev);i++)
{
if(ipCount[0]==0)
{
ipCount[0]=-1;
}
if(ipCount[i]==0 )
{
ipCount[i-1]=ipCount[i-1]-1;
zev[i-1]++;
for(int k=i;k<strlen(zev);k++)
ipCount[k]=25;
break;
}
}
}
fprintf("fw","\n %s \n",zev);
fprintf(fw,"\n combinations generated are:\n");
printf("\n %s \n",zev);
fclose(fr);
fclose(fw);
getch();
}
|
|
|
|
|
hello all .
Actually i want to catch a Wrong Password Attempt to logon a system. Is there any API that can lead me to that event. If there is no then how would i be able to catch that event.
|
|
|
|
|
Please do not post the same question in multiple forums.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
I assume the GINA dll could help you.
Or maybe have a look at the event viewer, maybe there's an API to read the event view ?
Watched code never compiles.
|
|
|
|
|
hi all,
waen i am sending AT+CPBR command to read phonebook entry,its reaturn value in UCS2 mode.
please help me decode this.
thanks.
|
|
|
|
|
|
I am trying to create a toolbar on my dialog, so I am creating it in the OnInitDialog() function, but the toolbar is not coming. please help me finding whats going wrong in this. Thanks Sujan
[code]
BOOL CDlgsViewDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CToolBar m_FirstToolBar;
if(!m_FirstToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD |
WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS |
CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_FirstToolBar.LoadToolBar(IDR_MAINFRAME))
{
EndDialog(IDCANCEL);
}
RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST,0);
return TRUE; // return TRUE unless you set the focus to a control
}
[/code]
|
|
|
|
|
As was mentioned in your previous post, did you refer the link.
Also, it was suggested that the variable m_FirstToolBar should be a member of the class, what about that?
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
|
Thanks a lot friend. I dint notice that before, now I made it as a member and toolbar is coming . Thanks a lot for help.
|
|
|
|
|
Hi,
I have an array of strings which contains the file names and I call a function in a loop.
char myFiles [20][50];
for(i=0;i<20;i++)
myFunc( myFiles[i]);
The challenge I am facing is that, I have to store all the files in a directory, say "input" folder.... and then call
myFunc( myFiles[i]);
which I am unable to do.
I used
mkdir("input"); to create a directory and move all my files into it also using
system("move *gen.txt input");
But now if I give that path in my function it has to be hardcoded which eventually cannot be run in a loop.
ie
for(i=0;i<=20;i++)
myFunc("C:\\input\\myFiles[i]");
I am using eclipse IDE.
Thanks in advance,
Faez
|
|
|
|
|
Have a look at the str... functions. To create a full file name, you may use strcpy and strcat :
char PathName[_MAX_PATH]; for (i = 0; <= 20; i++)
{
strcpy(PathName, "C:\\input\\");
strcat(PathName, myFiles[i]);
myFunc(PathName);
}
|
|
|
|
|
That worked
BTW I came up another method as below
system("copy input/*.txt ");
system("del *.txt");
Anyways, thanks for the nice logic
Regards,
Faez
|
|
|
|
|
It sounds to me like you need to concatenate the filename onto the foldername.
//In that case, you may choose to do something similar to this:
// 1. Get the filenames
// 2. Get the folder name
// 3. copy foldername to fullPath
// 4. concatenate (append) myFiles[i] onto fullPath
// 5. If curFileNum < maxFiles goto 3.
char filenames[4][50] = { "001.txt", "002.txt", "003.txt", "004.txt" };
char inputFolder[] = "inputFolder";
int i, maxFiles=4;`
for (i=0; i<maxFiles; i++)
{
strcpy(fullPath, inputFolder);
strcat(fullPath, "\\");
strcat(fullPath, myFiles[i]);
myFunc(fullPath);
}
[EDIT: oops! Too slow - someone has kindly furnished an answer already]
|
|
|
|
|
I want to insert and verify digital signatures in pdf,some one can help me?
|
|
|
|
|
Have you looked at the PDF Reference, as supplied by Adobe?
If you look at pg 684 in "pdfreference16.pdf", you'll find the subject is covered there. Sorry, I don't have a direct link - I downloaded it from Adobe quite some time ago.
|
|
|
|
|
Have you complete the relevant code to realize digital signatures
|
|
|
|
|
I'll assume that was supposed to be a question.
I'll also assume that it was you that gifted me the 2-vote for my last answer...
No. No need for me.
I've written code from scratch to create pdf documents containing text, line drawings, images and attachments - any/all of which may be deflated or ascii85 encoded.
One you can understand the format enough, you soon realize that a user can fairly easily remove your digital signature and the implied security it carries.
Hint: find a water-marked pdf and work out how to remove the watermark from _all_ pages.
Clearly, there's several parts to the task -
1. Decide whether you wish to create a 'byte range digest' or an 'object digest'
2. Implement a function (in your own app) to create this digest
3. Implement this same function again in a plug-in signature handler
[EDIT: Digital Signature Removal code added]
Here, a 10 line perl script to strip the digital signatures from a PDF
#!/usr/bin/perl
# Usage: perl invalidate-signing-certs.pl <in.pdf> out.pdf
#
binmode(STDIN);
binmode(STDOUT);
$/ = "\0";
while(<>) {
s#(/Perms<</DocMDP.*?>>)#' ' x length $1#ge;
s#(/Ff 1)(?=.*?/Lock )#' ' x length $1#ge;
s#(?<=/Lock)(.*?)(/Ff 1)#"$1" . ' ' x length $2#ge;
s#(/Lock .*?)(?=/)#' ' x length $1#ge;
print $_;
}
Source: http://ronin-group.org/misc_pdfsignatures.html[^]
|
|
|
|
|
I had a test that to insert "\n" or "\r\n" into a string,but not effective. Do not support this style in vc6 default ctrl?
Please help me.Thanks a lot!
下辈子美利坚。
|
|
|
|
|
The list control only supports single-line entries.
For multi-line, you'll need to use an edit control.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Have you seen this?
"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
|
|
|
|
|
Yes,I just need it. Oh,god,thank you very much,my friend!
|
|
|
|