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
#!/usr/bin/sh | |
pipe=/tmp/out | |
#if [[ ! -p $pipe ]]; then | |
# echo "Reader not running" | |
# exit 1 | |
#fi | |
while true | |
do | |
ip=`hostname -i` |
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
#!/usr/bin/sh | |
pipe=/tmp/out | |
#if [[ ! -p $pipe ]]; then | |
# echo "Reader not running" | |
# exit 1 | |
#fi | |
while true | |
do | |
ip=`hostname -i` |
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
#!/usr/bin/sh | |
while true | |
do | |
ip=`hostname -i` | |
date=`date +"%d/%b/%Y:%k:%M:%S %z"` | |
r=$RANDOM; | |
random=$(($r+10000000)) | |
time=$[RANDOM % 200 + 10] | |
echo "[$ip [$date] \"$random\" time=${time}ms]"; | |
done |
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
#!/usr/bin/sh | |
pipe=/tmp/out | |
#trap "rm -rf $pipe" EXIT | |
#if [[ ! -p $pipe ]]; then | |
# mkfifo $pipe | |
#fi | |
out=1 | |
while true | |
do |
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
#!/usr/local/bin/python2.7 | |
section = "" | |
ini_dict = {} | |
with open("input.txt") as f: | |
for l in f: | |
x = l.strip() | |
if not x: |
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
#!/usr/local/bin/python2.7 | |
grad = {} | |
stu = {} | |
with open("input.txt") as f: | |
for l in f: | |
name, score = l.strip().split() | |
if name not in grad: | |
grad[name] = 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
#!/usr/local/bin/python2.7 | |
x = [ | |
{ "a": "hoooooo", | |
"b": "wo", | |
"c": "rrrruuu", | |
}, | |
{ | |
"a": "en?", | |
"b": "wwwwlllllyyy", |
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
#!/usr/bin/env python | |
import threading | |
import urllib2 | |
import time, random | |
class GrabUrl(threading.Thread): | |
def __init__(self, arg0): | |
threading.Thread.__init__(self) | |
self.host = arg0 |
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 time | |
import random | |
class Customer: | |
def __init__(self, id): | |
self.id = id | |
self.foods = [] | |
self.start = time.time() | |
def choose_foods(self): | |
self.foods = random_choose(5) |
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 -*- | |
import os | |
import sys | |
from Queue import Queue | |
import random | |
import threading | |
import time |