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
[bits 32] | |
section .data | |
username db \"morad\", 0 | |
username_len equ $-username | |
password db \"morad\", 0 | |
password_len equ $-password |
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
his program is a simple web server written in assembly language. | |
; It will listen for incoming connections on port 80 and serve | |
; static web pages. | |
section .text | |
global _start | |
_start: |
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
#!/usr/bin/env bash | |
# Exit on error | |
set -e | |
# Ensure script is running as root | |
if [ "$EUID" -ne 0 ] | |
then echo "WARN: Please run as root (sudo)" | |
exit 1 | |
fi |
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; | |
public class JSON { | |
public static HashMap<String, String> QHM(String Q) { | |
HashMap<String, String> HM = new HashMap<String, String>(); | |
Q = Q.replaceFirst("\\{", "").substring(0, Q.length()-2); // {“user”:”x”,”pass”:”y”} -> “user”:”x”,”pass”:”y” | |
String[] pairs = Q.split(","); // ["user":"x" , "pass":"y"] | |
for(int i = 0;i < pairs.length;i++) { | |
String[] pair = pairs[i].split(":"); // "user" , "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
public List<byte[]> tokens(byte[] array, byte[] delimiter) { | |
List<byte[]> byteArrays = new LinkedList<>(); | |
int begin = 0; | |
outer: for (int i = 0; i < array.length - delimiter.length + 1; i++) { | |
for (int j = 0; j < delimiter.length; j++) { | |
if (array[i + j] != delimiter[j]) { | |
continue outer; | |
} | |
} |
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 DTFromID { | |
static HashMap<String, String> GovIDMap = new HashMap<String, String>(){ | |
{ | |
put("01","Cairo"); put("02","Alexandria"); put("03","Portsaid"); put("04","Suez"); put("11","Damietta"); put("12","Daqahlia"); put("13","Sharkia"); put("14","Qalyobia"); put("15","Kafr El-sheikh"); | |
put("16","Gharbia"); put("17","Monufia"); put("18","Beheira"); put("19","Ismailia"); put("21","Giza"); put("22","Bani Suef"); put("23","Fayum"); put("24","Menya"); put("25","Asuit"); | |
put("27","Qena"); put("28","Aswan"); put("29","Luxor"); put("31","Red Sea"); put("32","Alwady Algaded"); put("33","Matrouh"); put("34","North Sinai"); put("35","South Sinai"); put("88","N/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
/* | |
* This code proofs my own proof of collatz, on Sunday Oct.24 2021 at 2:52AM Cairo Local Time | |
* Since 4,2,1 is a ending hole for any positive number, it belongs to f(x) = 2 ^ x | |
* Since x can go to infinity, any number that lands on the series of 2 ^ x can also go infinity. | |
* for example, 138829902545689665 falls to 16 (which belongs to 2^x series) after 384 iterations. | |
*/ | |
public class CollatzProof { | |
public static void main(String[] args) { | |
long numberStart = 92233720368547758L; // HUGE TIT- I MEAN NUMBER |
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.ArrayList; | |
import java.util.HashMap; | |
import java.util.Map; | |
public class UnaryAI { | |
/* | |
* AI using Unary Logical Gates | |
* Dataset in hashmap goes to a train function, iterate to PatternFinder, test | |
*/ | |
public static void main(String[] args) { |
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.) | |
} | |
/* |
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 = ""; |
NewerOlder