How to print the values of each column in a matrix?
I have a nested for loop where I call some different methods. These methods need to be called in the sequence I have set as I trying to work with Rainbow tables.
So, I have a for loop, which generates a 3 bytes key - This is column 0
Inside this for loop, I have another for loop which encrypts some data with AES and then restricts the output to 3 bytes - AES-128 requires at least 16 bytes keys, so the last 13 bytes are 0
What I need help with is NOT cryptology, but how to print each column in each row with the set up of for loops.
What I want to achieve is to count the number of unique values in each column.
DecimalFormat df = new DecimalFormat(".##");
for (int i = 0; i < 6; i++) {
gKey(); // generates random 3 bytes
for (int j = 1; j < 6; j++)
aesResult = aes.encrypt(keySet); // encrypts with 16 bytes keya and fixed plaintext, where the key's first 3 bytes are randomly generated the first time
reduction(aesResult, j); // restricting the output
System.out.println("Covered points "+ kStore); // kStore is a HashSet - I chose to use that as it is not allowed to have duplicates in HashSet. I basically store the keys in this HashSet in the reduction method
EDIT:
Basically what I am asking is how I can print all the ROWS in each column, and not each column in each row. Sorry for misformulation
Example
Input:
byte keySet= 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ;
byte plaintext = 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xaa, (byte) 0xbb, (byte) 0xcc, (byte) 0xdd, (byte) 0xee, (byte) 0xff ;
java loops
|
show 2 more comments
I have a nested for loop where I call some different methods. These methods need to be called in the sequence I have set as I trying to work with Rainbow tables.
So, I have a for loop, which generates a 3 bytes key - This is column 0
Inside this for loop, I have another for loop which encrypts some data with AES and then restricts the output to 3 bytes - AES-128 requires at least 16 bytes keys, so the last 13 bytes are 0
What I need help with is NOT cryptology, but how to print each column in each row with the set up of for loops.
What I want to achieve is to count the number of unique values in each column.
DecimalFormat df = new DecimalFormat(".##");
for (int i = 0; i < 6; i++) {
gKey(); // generates random 3 bytes
for (int j = 1; j < 6; j++)
aesResult = aes.encrypt(keySet); // encrypts with 16 bytes keya and fixed plaintext, where the key's first 3 bytes are randomly generated the first time
reduction(aesResult, j); // restricting the output
System.out.println("Covered points "+ kStore); // kStore is a HashSet - I chose to use that as it is not allowed to have duplicates in HashSet. I basically store the keys in this HashSet in the reduction method
EDIT:
Basically what I am asking is how I can print all the ROWS in each column, and not each column in each row. Sorry for misformulation
Example
Input:
byte keySet= 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ;
byte plaintext = 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xaa, (byte) 0xbb, (byte) 0xcc, (byte) 0xdd, (byte) 0xee, (byte) 0xff ;
java loops
useprint("the value : "+value+" "); inner for loop,
– Deadpool
Nov 12 '18 at 4:50
Sorry for my misformulation, but I what I need is to print all the rows in each column. Have updated the OP.
– Bab
Nov 12 '18 at 4:54
1
Can you update small input and output example
– Deadpool
Nov 12 '18 at 4:55
@Deadpool: I don't really have an output as I am unable to print all the rows in each column
– Bab
Nov 12 '18 at 5:02
1
sorry i did not get this pointhow I can print all the ROWS in each column, and not each column in each row
just write sample output and update in post
– Deadpool
Nov 12 '18 at 5:07
|
show 2 more comments
I have a nested for loop where I call some different methods. These methods need to be called in the sequence I have set as I trying to work with Rainbow tables.
So, I have a for loop, which generates a 3 bytes key - This is column 0
Inside this for loop, I have another for loop which encrypts some data with AES and then restricts the output to 3 bytes - AES-128 requires at least 16 bytes keys, so the last 13 bytes are 0
What I need help with is NOT cryptology, but how to print each column in each row with the set up of for loops.
What I want to achieve is to count the number of unique values in each column.
DecimalFormat df = new DecimalFormat(".##");
for (int i = 0; i < 6; i++) {
gKey(); // generates random 3 bytes
for (int j = 1; j < 6; j++)
aesResult = aes.encrypt(keySet); // encrypts with 16 bytes keya and fixed plaintext, where the key's first 3 bytes are randomly generated the first time
reduction(aesResult, j); // restricting the output
System.out.println("Covered points "+ kStore); // kStore is a HashSet - I chose to use that as it is not allowed to have duplicates in HashSet. I basically store the keys in this HashSet in the reduction method
EDIT:
Basically what I am asking is how I can print all the ROWS in each column, and not each column in each row. Sorry for misformulation
Example
Input:
byte keySet= 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ;
byte plaintext = 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xaa, (byte) 0xbb, (byte) 0xcc, (byte) 0xdd, (byte) 0xee, (byte) 0xff ;
java loops
I have a nested for loop where I call some different methods. These methods need to be called in the sequence I have set as I trying to work with Rainbow tables.
So, I have a for loop, which generates a 3 bytes key - This is column 0
Inside this for loop, I have another for loop which encrypts some data with AES and then restricts the output to 3 bytes - AES-128 requires at least 16 bytes keys, so the last 13 bytes are 0
What I need help with is NOT cryptology, but how to print each column in each row with the set up of for loops.
What I want to achieve is to count the number of unique values in each column.
DecimalFormat df = new DecimalFormat(".##");
for (int i = 0; i < 6; i++) {
gKey(); // generates random 3 bytes
for (int j = 1; j < 6; j++)
aesResult = aes.encrypt(keySet); // encrypts with 16 bytes keya and fixed plaintext, where the key's first 3 bytes are randomly generated the first time
reduction(aesResult, j); // restricting the output
System.out.println("Covered points "+ kStore); // kStore is a HashSet - I chose to use that as it is not allowed to have duplicates in HashSet. I basically store the keys in this HashSet in the reduction method
EDIT:
Basically what I am asking is how I can print all the ROWS in each column, and not each column in each row. Sorry for misformulation
Example
Input:
byte keySet= 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ;
byte plaintext = 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, (byte) 0x88, (byte) 0x99, (byte) 0xaa, (byte) 0xbb, (byte) 0xcc, (byte) 0xdd, (byte) 0xee, (byte) 0xff ;
java loops
java loops
edited Nov 12 '18 at 5:01
Bab
asked Nov 12 '18 at 4:45
BabBab
12810
12810
useprint("the value : "+value+" "); inner for loop,
– Deadpool
Nov 12 '18 at 4:50
Sorry for my misformulation, but I what I need is to print all the rows in each column. Have updated the OP.
– Bab
Nov 12 '18 at 4:54
1
Can you update small input and output example
– Deadpool
Nov 12 '18 at 4:55
@Deadpool: I don't really have an output as I am unable to print all the rows in each column
– Bab
Nov 12 '18 at 5:02
1
sorry i did not get this pointhow I can print all the ROWS in each column, and not each column in each row
just write sample output and update in post
– Deadpool
Nov 12 '18 at 5:07
|
show 2 more comments
useprint("the value : "+value+" "); inner for loop,
– Deadpool
Nov 12 '18 at 4:50
Sorry for my misformulation, but I what I need is to print all the rows in each column. Have updated the OP.
– Bab
Nov 12 '18 at 4:54
1
Can you update small input and output example
– Deadpool
Nov 12 '18 at 4:55
@Deadpool: I don't really have an output as I am unable to print all the rows in each column
– Bab
Nov 12 '18 at 5:02
1
sorry i did not get this pointhow I can print all the ROWS in each column, and not each column in each row
just write sample output and update in post
– Deadpool
Nov 12 '18 at 5:07
use
print("the value : "+value+" "); inner for loop,
– Deadpool
Nov 12 '18 at 4:50
use
print("the value : "+value+" "); inner for loop,
– Deadpool
Nov 12 '18 at 4:50
Sorry for my misformulation, but I what I need is to print all the rows in each column. Have updated the OP.
– Bab
Nov 12 '18 at 4:54
Sorry for my misformulation, but I what I need is to print all the rows in each column. Have updated the OP.
– Bab
Nov 12 '18 at 4:54
1
1
Can you update small input and output example
– Deadpool
Nov 12 '18 at 4:55
Can you update small input and output example
– Deadpool
Nov 12 '18 at 4:55
@Deadpool: I don't really have an output as I am unable to print all the rows in each column
– Bab
Nov 12 '18 at 5:02
@Deadpool: I don't really have an output as I am unable to print all the rows in each column
– Bab
Nov 12 '18 at 5:02
1
1
sorry i did not get this point
how I can print all the ROWS in each column, and not each column in each row
just write sample output and update in post– Deadpool
Nov 12 '18 at 5:07
sorry i did not get this point
how I can print all the ROWS in each column, and not each column in each row
just write sample output and update in post– Deadpool
Nov 12 '18 at 5:07
|
show 2 more comments
1 Answer
1
active
oldest
votes
This code write rows of matrix in columns. Read every column and write in row of matrix.
int arr=new int[6][6];
for(int i = 0; i < arr.length; i++)
for(int j = 0; j < arr.length; j++)
System.out.print(arr[j][i]+" ");
System.out.println();
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53256088%2fhow-to-print-the-values-of-each-column-in-a-matrix%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
This code write rows of matrix in columns. Read every column and write in row of matrix.
int arr=new int[6][6];
for(int i = 0; i < arr.length; i++)
for(int j = 0; j < arr.length; j++)
System.out.print(arr[j][i]+" ");
System.out.println();
add a comment |
This code write rows of matrix in columns. Read every column and write in row of matrix.
int arr=new int[6][6];
for(int i = 0; i < arr.length; i++)
for(int j = 0; j < arr.length; j++)
System.out.print(arr[j][i]+" ");
System.out.println();
add a comment |
This code write rows of matrix in columns. Read every column and write in row of matrix.
int arr=new int[6][6];
for(int i = 0; i < arr.length; i++)
for(int j = 0; j < arr.length; j++)
System.out.print(arr[j][i]+" ");
System.out.println();
This code write rows of matrix in columns. Read every column and write in row of matrix.
int arr=new int[6][6];
for(int i = 0; i < arr.length; i++)
for(int j = 0; j < arr.length; j++)
System.out.print(arr[j][i]+" ");
System.out.println();
edited Nov 12 '18 at 7:35
Busy Bee
9571619
9571619
answered Nov 12 '18 at 5:59
Mohammad Aziz NabizadaMohammad Aziz Nabizada
1044
1044
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53256088%2fhow-to-print-the-values-of-each-column-in-a-matrix%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
use
print("the value : "+value+" "); inner for loop,
– Deadpool
Nov 12 '18 at 4:50
Sorry for my misformulation, but I what I need is to print all the rows in each column. Have updated the OP.
– Bab
Nov 12 '18 at 4:54
1
Can you update small input and output example
– Deadpool
Nov 12 '18 at 4:55
@Deadpool: I don't really have an output as I am unable to print all the rows in each column
– Bab
Nov 12 '18 at 5:02
1
sorry i did not get this point
how I can print all the ROWS in each column, and not each column in each row
just write sample output and update in post– Deadpool
Nov 12 '18 at 5:07