Skip to content

Instantly share code, notes, and snippets.

View Zelakolase's full-sized avatar
🏠
Working from home

Zelakolase Zelakolase

🏠
Working from home
  • Ottawa
View GitHub Profile
@Zelakolase
Zelakolase / HelloWorld.java
Last active January 17, 2020 22:33
Java code to solve Quadratic Trinomials by Factorization
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++;
}
@Zelakolase
Zelakolase / main.java
Last active August 19, 2020 20:30
ZTE ZXHN H108N V2.5 UPnP Exploitation code
// 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;
@Zelakolase
Zelakolase / main.java
Last active October 18, 2021 09:30
A Sorting Method using Randomization
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];
@Zelakolase
Zelakolase / main.java
Last active September 5, 2020 23:25
B.M.I Calculator in java
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;
@Zelakolase
Zelakolase / FOR_MR_AMR.java
Created September 9, 2020 03:08
How to غش Legally in the Math Class
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>();
@Zelakolase
Zelakolase / main.java
Last active September 21, 2020 10:51
Map<Double,Double> Tester
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);
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 {
@Zelakolase
Zelakolase / main.java
Created March 18, 2021 00:26
لغة غريبة
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);
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 = "";
@Zelakolase
Zelakolase / sine.java
Last active August 27, 2021 10:43
sine function btw
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.)
}
/*