|
That's a ton of text....What's the error?
|
|
|
|
|
well I have been working on an assigment and it states::
A program has to be developed, and coded in C language, to decipher a document written
in Italian that is encoded using a secret key. The secret key is obtained as random
permutation of all the uppercase letters, lowercase letters, numbers and blank space. As
an example, let us consider the following two strings:
Plain: “ABCDEFGHIJKLMNOPQRSTUVXWYZabcdefghijklmnopqrstuvwxyz0123456789 ”
Code: “BZJ9y0KePWopxYkQlRjhzsaNTFAtM7H6S24fC5mcIgXbnLOq8Uid 3EDv1ruVGw”
The secret key modifies only letters, numbers, and spaces of the original document, while
the remaining characters are left unchanged. The document is stored in a text file whose
length is unknown.
The program has to read the document, find the secret key (which by definition is
unknown; the above table is just an example and it is not the key used for preparing the
sample files available on the web course) using a suitable decoding algorithm, and write
the decoded document to a new text file.
And I know that I have to upload an English dictionary into the program but I don't why it has been asked.(may be not in that statement but I have to dO THAT). My question is , while I can do that program using simple encryption/decryption algorithm then what's the use of uploading the english dictionary in our program? So is there any decryption algorithm that uses a dictionary to decrypt an encrypted file? or can somebody tell me what approach or algorithm should I use to solve that problem???
An early reply (and also authentic one) will be highly appreciated from you.
Thank you guys.
|
|
|
|
|
Hi. On your second line you specifically wrote that this has to be written in C. This is the Java forum. At the end of your problem statement, your question is a request for an Algorithm.
So either post this in the C forums, or the algorithm one. This should not be here.
|
|
|
|
|
yes, but i POSTED IT HERE. So if to seek help from any of the Java programmers who has already worked on this encryption decryption program or related to that one.
|
|
|
|
|
i'd tried to make image from the given file name.but i failed..
can you tell me how to do it.
i use this as my code
fc = new FileChooser("image", "Open");
_fnSrcCom = fc.getFileName();
Image pic = Toolkit.getDefaultToolkit().createImage(_fnSrcCom);
int width=pic.getWidth(null);
int height=pic.getHeight(null);
int Size = width * height;
i get width = 240
height=-1
and size = -240
the original width of the image is 180x240
|
|
|
|
|
Hi all,
A bit of advice required. I have been contacted by a client who has an iPhone application that talks to web services hosted on a J2EE Application Server. We are entertaining the idea of offering him a hosting solution on our existing server.
Our server is Windows 2003 Standard running IIS6 and Sql Server 2005. We already host a nubmer of websites (all .NET).
Firstly, are there any implications for trying to run a J2EE application server alongside IIS, and does anyone have any recommendation for an application server.
I know this question is vague but I'm just trying to figure out if its even worth pursuing at this point.
Thanks
The only thing unpredictable about me is just how predictable I'm going to be.
|
|
|
|
|
Of course, IIS & J2EE application server reside in the same host. You may install - Apache Tomcat 6.x or GlassFish.
A DATAPOST COMPUTER CENTRE
(K.V Prajapati)
|
|
|
|
|
could any one tell me how to do zigzag scanning in java. i was doing it in c++
i was use this in c#
struct zigzag
{
int row;
int col;
} ZigZag[8*8] =
{
{0,0},
{0,1},{1,0},
{2,0},{1,1},{0,2},
{0,3},{1,2},{2,1},{3,0},
{4,0},{3,1},{2,2},{1,3},{0,4},
{0,5},{1,4},{2,3},{3,2},{4,1},{5,0},
{6,0},{5,1},{4,2},{3,3},{2,4},{1,5},{0,6},
{0,7},{1,6},{2,5},{3,4},{4,3},{5,2},{6,1},{7,0},
{7,1},{6,2},{5,3},{4,4},{3,5},{2,6},{1,7},
{2,7},{3,6},{4,5},{5,4},{6,3},{7,2},
{7,3},{6,4},{5,5},{4,6},{3,7},
{4,7},{5,6},{6,5},{7,4},
{7,5},{6,6},{5,7},
{6,7},{7,6},
{7}
}
i use this in java..
//the initiation
protected int zigzag[][] = {
{0, 1, 5, 6,14,15,27,28},
{2, 4, 7,13,16,26,29,42},
{3, 8,12,17,25,30,41,43},
{9,11,18,24,31,40,44,53},
{10,19,23,32,39,45,52,54},
{20,22,33,38,46,51,55,60},
{21,34,37,47,50,56,59,61},
{35,36,48,49,57,58,62,63},
};
//the method
public void zigZagScan(int blkIn[][],int buffOut[])
/* Desk: Method for zigzag scanning as a pattern of scanning in RLE
I.S : array 2D of 8x8
F.S : array 1D of 64
*/
{
int row, col;
for (i=0;i<64 ;i++ )
{
row = zigzag[i]; //i want to use row = zigzag[i].row
col = zigzag[i]; //i want to use col = zigzag[i].col
buffOut[i]=blkIn[row][col];
}
}
could any one tell me what is the suitable sintax in java?
thanx
|
|
|
|
|
In a Class, I have a move method. This Class is going to draw a graphic by lines using drawOval() and drawLine(). When the graphic is still, it is drawn correctly. When I try to use the move(), hide(), draw() methods it doesn't hide it completely, it leaves a few lines in its trail. Is there a way I can group it all before I start moving it? otherwise how do I go about making sure it's all hidden before moving?
|
|
|
|
|
What do your methods do?
How does the repaint get called?
Some code snipits might just help in getting an answer. There are some very clever people here, but no-one can second guess the code you have written.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
|
I take it you didn't write this because if you did you would know how to do it.
What letters are given to the axes on 2d graphs?
X and Y.
Which axis controls horizontal movement?
The X axis.
Which axis controls the vertical movement?
The Y axis.
How would someone go about stopping the vertical movement of an object on a graph?
Remove the commands(lines of code) which control the Y axis.
My failometer is detecting vast quantities of FAIL!
"Its SQL - hardly programming..." (Caslen)
|
|
|
|
|
i m working on a rpoject..and i need to save the image in a directory with name as current date and time...but problem is this that ":" i.e. the colon is not suppoted in name....so can anyone suggest me how can i name the image file with date and time??
|
|
|
|
|
replace colons with underscores (or something else), remove all of the colons, use epoch time . . .
|
|
|
|
|
i found the code for sending e-mail , but my problem is that mail is not received by the recipient .
public void postMail(String recipients[], String subject, String message, String from) throws MessagingException {
boolean debug = false;
Properties props = new Properties();
props.put("mail.smtp.host", "smtp.gmail.com");
System.out.println("step 1 ");
Session session = Session.getDefaultInstance(props, null);
session.setDebug(debug);
Message msg = new MimeMessage(session);
InternetAddress addressFrom = new InternetAddress(from);
msg.setFrom(addressFrom);
InternetAddress[] addressTo = new InternetAddress[recipients.length];
for (int i = 0; i < recipients.length; i++) {
addressTo[i] = new InternetAddress(recipients[i]);
}
msg.setRecipients(Message.RecipientType.TO, addressTo);
msg.addHeader("MyHeaderName", "myHeaderValue");
msg.setSubject(subject);
msg.setContent(message, "text/plain");
Transport.send(msg);
}
i call this method with
String [] st = new String[1];
st[0] = "nuwan";
this.postMail(st, "test", "prasadbuddhika42@gmail.com", "prasadbuddhika42@gmail.com");
can anyone tell me what is wrong in this code ?
|
|
|
|
|
Gmail SMTP server requires authentication and uses SSL.
You should add following to your properties:
mail.transport.protocol=smtps
mail.smtps.host=smtp.gmail.com
mail.smtps.user=your gmail username
mail.smtps.password=your gmail password
mail.smtps.auth=true
-------------
Gil Messerman
|
|
|
|
|
Im also developing an email client
adding the lines given by you it gave an error from gmail
Issue STARTTLS command
how to code for this??
|
|
|
|
|
hi all i am trying to implments a java method in which given a string of digits as a parameter, prints all the combinations of letters that string of digits could represent.
for combination of letter we are using mobile text pad 2 is for abc,3 is for cde
123 is entered then max length of words will be 3
adg, adh, adi, aeg, aeh, aei, afg, afh, afi,
bdg, bdh, bdi, beg, beh, bei, bfg, bfh, bfi,
cdg, cdh, cdi, ceg, ceh, cei, cfg, cfh, or cfi.
The 1 can be a, b or c
The 2 can be d, e or f
the 3 can be g, h or i
this method is to be implemted using recursion i m totally confused where to start of with can anyone help me with some algorithm of code ....
|
|
|
|
|
Please, check carefully the code, I'm a bit rusty with Java...
public class Main {
static String []_keys= {"abc", "def", "ghi", "jkl","mno","pqrs","tuv","wxyz"};
static char [] _out;
public Main() {
}
static private void comb(int [] iKeys, int iIndex)
{
int i;
int iKey = iKeys[iIndex]-1;
for (i=0; i<_keys[iKey].length(); i++)
{
_out[iIndex] = _keys[iKey].charAt(i);
if ( iIndex == iKeys.length-1)
{
System.out.println(_out);
}
else
{
comb(iKeys, iIndex+1);
}
}
}
public static void main(String[] args) {
_out = new char[100];
int [] iKeys = {1,2,3};
comb(iKeys, 0);
}
}
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]
|
|
|
|
|
yeah the code is not a problem but i m actually trying to input String of digits from user and the same String should be passed to the method in the above method we are passing array of integers... please help ....how do we get to change with that....
|
|
|
|
|
Just add the method StringToArray and change a bit main , for instance:
public static void StringToArray(String sKeys, int [] iKeys)
{
int i;
for (i=0; i<sKeys.length(); i++)
{
iKeys[i] = (int)(sKeys.charAt(i)-'0');
}
}
public static void main(String[] args) {
int [] iKeys;
String s = "123";
iKeys = new int[s.length()];
StringToArray(s, iKeys);
_out = new char[100];
comb(iKeys, 0);
}
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]
|
|
|
|
|
thx for help but my problem isnt solved yet...
the method comb is required to have the parameter passed as a String not integer of arays
thx in advance....
|
|
|
|
|
harshad bhatia wrote: the method comb is required to have the parameter passed as a String not integer of arays
Why?
Is it an assignment (i.e. homework?)?
Anyway you can easily figure out the necesary modifications, I suppose
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]
|
|
|
|
|
yeah it is part of assignment its is like where i m struck in makin the method plz if u can help me out....
|
|
|
|
|
i think i could do it now really thx for ur help......
|
|
|
|
|