Anyone Help me to explain how does this code works DataInputStream in= new DataInputStream(new FileInputStream(steg.getFile())); in.read(byteArray, 0, fileSize); in.close(); Cipher cipher= Cipher.getInstance("DES"); cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(password.substring(0, 8).getBytes(), "DES")); byteArray= cipher.doFinal(byteArray);
it's a forum another person had answered for this question. so if u know programming u can explain ,,,, how does this code process... it's Audio steganography using LSB technique by this u wouls have answered.
HI im tryin to implement dijkstra's algorithm in java but my output is not correct. The output should be [0,492,665,114,452,999] but i keep getting a different range.Can anybody help please as i need this for my assignment. Thnks
public ArrayList <Integer> dijkstra (int start, int end) // start = 0 & end = 999
int N = adj.length;
HashMap <Integer,Double> Q = new HashMap <Integer,Double>(); // key,value
ArrayList <Integer>  paths = new ArrayList [N]; // paths 1000//System.out.println( "paths.Length" + paths.length); for (int i=0;i<N;i++) // end = 999
Q.put(i,Double.POSITIVE_INFINITY); // blank i = 0 to 999(keys/vertex)//System.out.println("Q @ " +Q.get(999));
paths[i]=new ArrayList <Integer>();
paths[i] = new ArrayList<Integer>(start); // blank distances
HashSet <Integer> S= new HashSet(); // contains unique elements
S.add(start); // blank
Q.put(start,Q.get(start)); //blank while (!Q.isEmpty())
int v = findSmallest(Q); // blank//System.out.println("key of Q " + v)if (v==end && Q.get(v)!= Double.POSITIVE_INFINITY) // blank Q ! map to vreturn paths[end]; // blankdouble w = Q.get(v); // blank
S.add(v); // blankfor(int u: neighbours(v))
double w1= adj[u][v] + w; // adj contains all the weigths of the graphif (w1 < Q.get(u))
returnnew ArrayList <Integer> ();
You prevent yourself from getting help because we don't have the input data and we don't have actual result.
When you don't understand what your code is doing or why it does what it does, the answer is debugger. Use the debugger to see what your code is doing. Just set a breakpoint and see your code performing, the debugger allow you to execute lines 1 by 1 and to inspect variables as it execute, it is an incredible learning tool.
The debugger is here to show you what your code is doing and your task is to compare with what it should do. There is no magic in the debugger, it don't find bugs, it just help you to. When the code don't do what is expected, you are close to a bug.
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
Also, you cannot convert C# code to Java code because there is a lot of difference in the standards of C# language and Java. Even if you could find a tool that converts the bytecodes to nearest Java code, there will be a lot of problems.
The problems will be more tough to solve, compared to creating the new application. You can easily create a new application, in NetBeans if you just look at what was done in C# and do the same in Java.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
In my workplace we have an application that requires us to enter a unique tracking code into a java input field. We normally do this by scanning a barcode on an item until all items are scanned.
We already have a list of the unique tracking codes in excel so rather than scan each barcode when we have 100 or so items we copy from excel, paste into the field press tab to add the item and then copy paste tab repeat until all 100 items are added.
Is there a way to automate the copy cell --> paste id into input box --> Have the script press tab after id is pasted and repeat until all 100 items are added?
Posting this in Java as I am needing to put the data into a java application that is embedded in a web page but maybe I can paste the list into a Windows Form or a C++ application and then have that program perform the copy paste tab function for all items in the list.
Appreciate anyone's help I have no idea where to start.
Just an idea (which depends on the format of multiple selected cells).
Create a multi line input field where the content of all selected and copied cells can be inserted at once. Create a button that reads the input field content, splits it (depending on the separation characters provided by Excel when putting the data on the clipboard), and adds the items.
Excel puts the data in multiple formats to the clipboard but the form usually uses only the text format with line feed terminated rows and space (or tab?) separated columns. To check this just paste into any text editor.
Last Visit: 31-Dec-99 19:00 Last Update: 27-Mar-17 0:16