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 cv2 | |
import sys | |
import numpy as np | |
def hide(carrier_file, message_file, output_file = 'result.png', bit_plane = 0, channel = 0): | |
carrier = cv2.imread(carrier_file) | |
message = cv2.imread(message_file) | |
output = carrier.copy() | |
cw, ch, _ = carrier.shape |
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
apt-get update | |
apt-get install openssh-server git zsh | |
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k | |
echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc | |
zsh | |
echo "syntax on\nset si\nset ai\nset tabstop=2\nset shiftwidth=2\nset expandtab" >> ~/.vimrc |
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
nootropics | |
noometries | |
amoebocyte | |
amoebiasis | |
amoralisms | |
amoralists | |
amorphisms | |
adulterant | |
zymometers | |
zymologist |
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 <math.h> | |
#include <iomanip> | |
#include <vector> | |
#include <string> | |
using namespace std; | |
class Helper { | |
private: |
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
# Run cp-tmux.sh <problem-name> | |
# cpp.sh script is here https://gist.github.com/pythagore1123/0962c6f018b153b9697372219d455f68 | |
# The 4 panes of tmux is config as below: | |
# ---------------------------------------- | |
# | | | |
# | .cpp editor | | |
# | | | |
# |--------------------------------------- | |
# | runner | .inp editor | | |
# | + |-------------------| |
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
#!/bin/bash | |
# To create workspace, run ./judge.sh --prepare <file_name>, it will create a main code file <file_name>_ans.cpp, a judger file <file_name>.cpp and a test generator file <file_name>_gen.cpp | |
# To start judging, run ./judge.sh <file_name> and sit back, enjoy ;) | |
if [[ $1 == "--prepare" ]]; then | |
echo -e "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n\t// Main source code here\n}" > "./$2.cpp"; | |
echo -e "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n\t// Bruteforce solution here\n}" > "./$2_ans.cpp"; | |
echo -e "#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n\t// Test generator here\n}" > "./$2_gen.cpp"; | |
else |
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
#!/usr/bin/env python3 | |
import math | |
import sys | |
# Usage: ./main.py a b | |
# Prints out result of division a/b in format x.y(z) | |
# Example: 13/12 = 1.08(3) | |
a, b = [int(c) for c in sys.argv[1:]] | |
# turn a / b into x.y(z) |
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
#!/bin/bash | |
# A simple bash script to automate compiling and running CP codes for vim enthusiasts | |
# === HOW TO USE === | |
# It is recommended to split up to 4 screens: code editor (1), gcc output (2), input editor (3), output watch (4) | |
# and create 3 files: <name>.cpp, <name>.inp, <name>.out | |
# - Run "cpp.sh <name>" in gcc output (2) | |
# - Run "tail -f -v <name>.out" in output watch (4) | |
# - Code as you like in <name>.cpp file and edit input in <name>.inp, any save action in vim would trigger the script to compile and run the code | |
# Disclaimer: Use standard I/O, the script've already piped input and output to the program. |
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
const score=$("#score"); | |
const question=$("#question"); | |
var contestants=[]; | |
var questions=[]; | |
var socket = io.connect("http://"+document.domain+":"+location.port); | |
var idq=-1; | |
var ids=0; | |
var sfx = new Audio(); | |
sfx.type="audio/wav"; |