View float2ieee754.c
This file contains 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
// Floating Point to IEEE 754 32-bit Converter | |
// this was written when i'm started to learn C | |
// code look suck, well, this shit is from 2 years ago :) (ahh unforgotten memories) | |
// hope you can learn somethings from this code | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <stdbool.h> // to use bool (c99 standard) |
View pi.c
This file contains 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
#include <stdio.h> | |
#include <math.h> | |
#define SIZE 100 | |
unsigned __int128 fact(int N) // calculate factorial with O(n) | |
{ | |
static unsigned __int128 memo[SIZE] = {-1}; | |
if(memo[N] > -1) return memo[N]; | |
else return memo[N] = (N <= 1) ? 1 : fact(N-1) + fact(N-2); |
View format_string_got.c
This file contains 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
/* | |
DISABLE ASLR & NX THROUGH COMPILATION: | |
$ echo 0 | sudo tee /proc/sys/kernel/randomize_va_space # disable ASLR | |
$ gcc -fno-stack-protector -z execstack -o format_string format_string.c -g # compile with NX (DEP protection) disabled | |
############# | |
# CODE POC | |
############# |
View winMain.cpp
This file contains 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
#include <Windows.h> | |
// function prototype | |
LRESULT CALLBACK wndProcedure(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); | |
// constant | |
LPCTSTR NAME = "My Window"; | |
/** | |
* |
View postfix.java
This file contains 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.*; | |
public class postfix { | |
public static void main(String args[]) { | |
String infix = "x-(y*a/b-(z+d*e)+c)/f"; | |
System.out.println("Infix : " + infix); | |
System.out.println("Postfix : " + inf2postf(infix)); |
View binary_heap.cpp
This file contains 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
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
class heap { | |
private: |
View z3_prime.py
This file contains 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
''' | |
Using Z3 to check if the number is prime | |
Original reference: https://stackoverflow.com/a/35653749/1768052 | |
''' | |
from z3 import * | |
def isPrime(x): | |
y, z = Ints("y z") |
View uncompyle6-recursive.sh
This file contains 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
find . -name "*.pyc" -execdir uncompyle6 -o . {} \; |
View fact128.c
This file contains 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
#include <stdio.h> | |
typedef unsigned __int128 uint128; | |
/* printing 128-bit value isn't official support yet | |
so here's implementation of converting 128-bit value into string */ | |
char *str_uint128(uint128 n) | |
{ | |
/* got confused about arithmetic operation with '0'? read more about ascii :) */ | |
static char buf[1000] = {0}, *buft = buf; |
View conkyrc
This file contains 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
#======================================================================== | |
# Conky-Serdar | |
#---------------------------------------------------------------------- | |
#sudo apt-get install conky | |
#extract the zip file and move files to .conky in your home folder | |
#---------------------------------------------------------------------- | |
#Run(Terminal): | |
# conky -c ~/.conky/conkyrc | |
#---------------------------------------------------------------------- | |
#Autostart(Openbox): |
NewerOlder