This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HelloWorld{ | |
// formula: x^2+dx+c, You gonna input d and c | |
public static void main(String []args){ | |
double b=1; | |
double c=12; | |
double d=-8; | |
for(double a=-2147483647;a<2147483647;a++) { | |
if(a==0) { | |
a++; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Video: https://www.youtube.com/watch?v=WvzIZ-JH-7k | |
// UPnP should be enabled for the target side | |
// UPnP default port is 52869 | |
// Credits: Morad Abdelrasheed and Zeyad Azima | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.io.PrintWriter; | |
import java.net.HttpURLConnection; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class main { | |
public static void main(String[] args) { | |
int[] a = new int[] {250,93,105,314,7,80,92}; | |
int REPEAT = (int) Math.round(Math.pow(a.length,3.0103821378)); | |
int REAL_LENGTH = a.length - 2; | |
int i = 0; | |
while(i < REPEAT) { | |
int DaNumber = RandomNumber(0,REAL_LENGTH+1); | |
if(a[DaNumber]>a[DaNumber+1]) { | |
int tmp = a[DaNumber+1]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.swing.JOptionPane; | |
public class main { | |
public static void main(String[] args) { | |
// B.M.I = Mass (kg) / (Height (M))^2 | |
String Mass = JOptionPane.showInputDialog("Input your mass in kilograms"); | |
String Height = JOptionPane.showInputDialog("Input your height in Centimeters"); | |
double MassD = Double.valueOf(Mass); | |
double HeightD = Double.valueOf(Height); | |
HeightD = HeightD/100.0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.Map.Entry; | |
public class FOR_MR_AMR { | |
public static void main(String[] args) { | |
// X x Y = ? | |
int[] X = {1,2,3}; | |
int[] Y = {4}; | |
Map<Integer,Integer> RES = new HashMap<Integer,Integer>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
import java.util.concurrent.ConcurrentHashMap; | |
public class main { | |
public static int NumOfQ = 5000000; | |
public static void main(String[] args) { | |
Map<Integer, Integer> x = new TreeMap<Integer, Integer>(); | |
System.out.println("Warming up.."); | |
warmup(x); | |
x = new ConcurrentHashMap<Integer, Integer>(); | |
warmup(x); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.io.PrintStream; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.concurrent.ConcurrentHashMap; | |
import java.util.concurrent.ThreadLocalRandom; | |
public class DBMAPI_Test { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.HashMap; | |
public class main { | |
public static void main(String[] args) { | |
String in = "عملت كود عشان لغة غريبة بجافا"; | |
String[] in_arr = in.split("\\s+"); | |
String out = ""; | |
for(int i = 0;i<in_arr.length;i++) { | |
String word = in_arr[i]; | |
String letter = word.substring(0,1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package lib; | |
import java.io.DataInputStream; | |
import java.io.DataOutputStream; | |
import java.math.BigInteger; | |
import java.util.Random; | |
public class DH { | |
public static String Server(DataInputStream DIS , DataOutputStream DOS) { | |
String secret = ""; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class sine { | |
/* | |
* This Class does sine function without any need to use Math.sin | |
* @author Morad A. | |
*/ | |
static double PI = 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679d; | |
public static void main(String[] args) { | |
System.out.printf("%.19f\n",sin(30d)); // print the result to 19 decimal places of sin(30 deg.) | |
} | |
/* |
OlderNewer