TheBoox(Code, Linux, Hack,Security)
Coding, Linux, Hacking Security, Learning!
Coding, Linux, Hacking Security, Learning!
Apr 4th
In this example, end is used in an indexing expression.
A = magic(5)
A =
17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9
B = A(end,2:end)
B =
18 25 2 9
Mar 26th
Mar 22nd
<pre lang="java">
import java.io.*;
public class MyFirstFileWritingApp
{
// Main method
public static void main (String args[])
{
// Stream to write file
FileOutputStream fout;
try
{
// Open an output stream
fout = new FileOutputStream ("myfile.txt");
// Print a line of text
new PrintStream(fout).println ("hello world!");
// Close our output stream
fout.close();
}
// Catches any error conditions
catch (IOException e)
{
System.err.println ("Unable to write to file");
System.exit(-1);
}
}
}
</pre>
Mar 11th
update products set products_statues=’0′ where products_model >=’13888′ and products_model <= ‘13999′
Mar 7th
String[] mystr = {"c++", "java", "php"} int leng = mystr.length System.out.format("The Java array length is %d", leng);
Mar 6th
Generating random numbers is simple. Provided as part of the java.util package, the Random class makes it easy to generate numbers. Start by creating an instance of the Random class
// Create an instance of the random class Random r = new Random();
Now, you must request a number from the generator. Supposing we wanted an integer number, we’d call the nextInt() method.
// Get an integer int number = r.nextInt();
Often you’ll want numbers to fall in a specific range (for example, from one to ten). We can use the modulus operator to limit the range of the numbers. This will give us the remainder of the number when divided by ten (giving us a range -9 to +9). To eliminate negative numbers, if the number is less than one we’ll add ten to it. This gives us random numbers between one and ten!
// Accept only up to ten int random_number = number % 10; if (random_number < 1) random_number = random_number + 10;
Creating random numbers in an application or applet really isn’t that difficult. Just remember to limit the range of your numbers, and to import the java.util.Random class.
Mar 6th
java.util.Random;Random diceRoller = new Random();
Aug 2nd
1) kill your mysqld
2) mysqld_safe –skip-grant-table
3) login as: mysql –user=root mysql
4) update mysql.user set password=PASSWORD(‘new-pass’) WHERE User=’root’;
5) flush privileges;
6) exit;
you are done!