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
#ifndef INCLUDE_SEMAPHORE | |
#define INCLUDE_SEMAPHORE 1 | |
#include <sys/types.h> | |
#include <sys/ipc.h> | |
#include <sys/sem.h> | |
#include <sys/shm.h> | |
#include <unistd.h> | |
class semaphore { |
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
#include <iostream> | |
#include <cstdio> | |
#include <cstring> | |
#include <vector> | |
#include <queue> | |
#include <algorithm> | |
using namespace std; | |
// data types |
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
#include <unistd.h> //_getch | |
#include <termios.h> //_getch | |
#include <cstdio> | |
#include <iostream> | |
using namespace std; | |
char getch(){ | |
char buf=0; | |
struct termios old={0}; | |
fflush(stdout); | |
if(tcgetattr(0, &old)<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
<!DOCTYPE html> | |
<html lang='en'><head> | |
<meta charset='utf-8'> | |
<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css'> | |
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js'></script> | |
<script src='https://code.jquery.com/ui/1.11.4/jquery-ui.min.js' integrity='sha256-xNjb53/rY+WmG+4L6tTl9m6PpqknWZvRt0rO1SRnJzw=' crossorigin='anonymous'></script> | |
<script src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js'></script> | |
<title>Index</title> | |
</head><body><main id='main' class='container-fluid'> | |
Hello World |
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
# coding=utf-8 | |
def hedetniemi(A, B): | |
return [[min(A[i][k] + B[k][j] for k in range(len(A))) for j in range(len(A))] for i in range(len(A))] | |
def hasse(D, k): | |
return reduce(hedetniemi, [D]*(k - 1), D) | |
def hasse_recovery(D, k): | |
if k == 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
#include <iostream> | |
#include <fstream> | |
using namespace std; | |
int main(int argc, char *args[]) { | |
if (argc < 3) { | |
invalid: cout << "usage: alias name \"command\"" << endl; | |
return 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
#/bin/bash | |
# kill current running processes first | |
kill $(ps -ax | grep "$(cat test.runformat)" | awk '{print $1;}' | paste -sd " " -) 2>> /dev/null & | |
echo "Running $0" | |
# compile first if argument is supplied | |
if [ $# -eq 1 ]; then | |
# compile and run file |
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
apply plugin: 'com.android.application' | |
android { | |
compileSdkVersion 25 | |
buildToolsVersion "25.0.2" | |
defaultConfig { | |
applicationId APPLICATION_ID // change this | |
minSdkVersion 19 | |
targetSdkVersion 25 |
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 sys | |
import os | |
import os.path | |
import time | |
JUDGE_INPUT_FORMATS = ['judge%04d.in', 'judge%d.in'] | |
JUDGE_OUTPUT_FORMATS = ['judge%04d.ans', 'judge%d.ans'] | |
TEST_OUTPUT_FORMAT = 'judge%04d.test.out' | |
def compare_files(a, b): |
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
GRUB_CMDLINE_LINUX_DEFAULT="video.use_native_backlight=1 acpi_backlight=native acpi_osi=" |