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
<html> | |
<head> | |
<script src="jquery.min.js"></script> | |
<link rel="stylesheet" href="bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"> | |
<script> | |
var xmlns = "http://www.w3.org/2000/svg"; | |
window.$$ = function(tag) { | |
var el = document.createElementNS(xmlns, tag); |
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
# This file is a part of Julia. License is MIT: http://julialang.org/license | |
module GMP | |
export BigInt | |
type Hi | |
end | |
import Base: *, +, -, /, <, <<, >>, >>>, <=, ==, >, >=, ^, (~), (&), (|), ($), |
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/python | |
def cut(lst): | |
return lst[:5] | |
with open("words") as f: | |
all_words = f.read().split("\n") | |
common = filter(lambda word: all(c.islower() for c in word), all_words) | |
fours = filter(lambda s: len(s)==4, common) |
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
print = console.log.bind(console); | |
err = console.error.bind(console); | |
function Dispatcher(name) { | |
function evtname(evt) { | |
return name + '.' + evt; | |
} | |
this.fire = function() { | |
evt = arguments[0]; | |
args = Array.prototype.slice.call(arguments, 1); |
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
initTrap() { | |
TRAPCMD="initTrap" | |
} | |
pushTrap() { | |
if [ -z "$TRAPCMD" ]; then | |
initTrap | |
fi | |
TRAPCMD="$TRAPCMD;$1" | |
trap "$TRAPCMD" SIGINT # overrides previous trap |
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
PS1='\[\e[1;33m\][\u@\h \W \t]\$\[\e[0m\] ' | |
PATH=~/bin:/usr/local/bin:$PATH | |
if [ -f ~/.bash_aliases ]; then | |
. ~/.bash_aliases | |
fi | |
if [ -f ~/.bashrc_local ]; then | |
. ~/.bashrc_local | |
fi |
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 | |
CMD_STR="" | |
for I in $@; do | |
CMD_STR="$CMD_STR $I" | |
done | |
TMP_FILE=/tmp/note-$$ | |
touch $TMP_FILE || echo "meed write permissions to $TMP_FILE" |
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
diff --git a/mymalloc/mdriver.c b/mymalloc/mdriver.c | |
index edbd17d..6bea5f8 100644 | |
--- a/mymalloc/mdriver.c | |
+++ b/mymalloc/mdriver.c | |
@@ -502,6 +502,9 @@ static double eval_mm_util(const malloc_impl_t *impl, trace_t *trace, int tracen | |
char *p; | |
char *newp, *oldp; | |
▫ | |
+ double U_numerator, U_denominator, U; | |
+ double peak_U = 1; // peak util: min U_numerator/U_denominator over time |
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
/*ID: ohs.han1 | |
TASK: contact | |
LANG: C++ | |
*/ | |
#include<iostream> | |
#include<cstdio> | |
#include<cstring> | |
#include<map> | |
#include<algorithm> |
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
var rpc = require('node-json-rpc'); | |
var colors = require('colors'); | |
var serv = new rpc.Server({ port: 7000, strict: false }); | |
var logger = (function() { | |
var logger = {}; | |
logger.red = function() { | |
console.log(Array.from(arguments).join(' ').red); | |
}; | |
logger.blue = function() { |
OlderNewer