Skip to content

Instantly share code, notes, and snippets.

@mr-fool
mr-fool / Makefile
Last active August 29, 2015 14:04
histogram in c
allFiles: histogram.c
gcc -Wall histogram.c -o histogram.out -lm
clean:
rm *.o histogram.out
@mr-fool
mr-fool / Makefile
Last active August 29, 2015 14:04
Statistic Tool
allFiles: statistic.c
gcc -Wall statistic.c -o statistic.out -lm
clean:
rm *.o statistic.out
@mr-fool
mr-fool / roulette.sh
Created August 31, 2014 23:59
Russian Roulette
[ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live”
@mr-fool
mr-fool / Makefile
Last active August 29, 2015 14:05
Russian Roulette
allFiles: roulette.c
gcc -Wall roulette.c -o roulette.out -lm
clean:
rm *.o roulette.out
@mr-fool
mr-fool / web_crawler.py
Created September 14, 2014 18:02
simple python 3 web crawler
import sys
import requests
import os
from bs4 import BeautifulSoup
def main():
os.system('clear') # on linux / os x
#Gathering necessary input from user
choice = int( input("1 to use the basic function, 2 for the advance crawling, 3 for exit\n") )
@mr-fool
mr-fool / yu_gi_oh.c
Last active August 29, 2015 14:06
yu gi oh card game
/*Yu Gi Oh Card Game*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
/* prototypes */
void introduction();
void game();
void credit();
@mr-fool
mr-fool / Makefile
Last active August 29, 2015 14:07
file i/o C practice
allFiles: fee.c
gcc -Wall fee.c -o fee.out -lm
clean:
rm *.o fee.out
@mr-fool
mr-fool / roulette.c
Created October 14, 2014 16:01
Add file i/o to my old russian roulette program
/* A Russian Roulette Game */
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include <termios.h>
#include <fcntl.h>
/* prototypes */
void introduction( int a);
@mr-fool
mr-fool / CipherText.java
Created October 15, 2014 21:22
Caesar cipher and Vigenère cipher
public class Ciphertext {
/* stores the encrypted message */
private String ctxt;
/*default constructor */
public Ciphertext()
{
import java.net.*;
import java.util.*;
import java.io.*;
import java.util.concurrent.*;
public class WebServer {
//to test http://localhost:portnumber/index.html
public static void main(String[] args) throws Exception {
//Creates 4 threads to handle new connections
final ExecutorService clientHandler = Executors.newFixedThreadPool(4);