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
class Player | |
def play_turn(warrior) | |
# cool code goes here | |
if warrior.feel.enemy? | |
warrior.attack! | |
elsif warrior.feel.captive? | |
warrior.rescue! | |
else | |
if @health.nil? |
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/ruby | |
require 'kramdown' | |
puts " .md ===========> .html " | |
header = <<HERE | |
<html> | |
<head> | |
<meta charset='utf8'> |
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/sh | |
# Usage : md-to-pdf filename | |
# | |
# Do not use extension name | |
# md-to-pdf README ( O ) | |
# md-to-pdf README.md ( X ) | |
# md-to-pdf README.html ( X ) | |
echo "Transforming .md files into .pdf files" |
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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.UI; | |
public class DialogueManager : MonoBehaviour { | |
public GameObject dialogueBox; | |
public Text dialogueText; | |
private static int dialogueIndex; |
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
# coding: utf-8 | |
a=[] | |
b=Hash.new(0) | |
c=Hash.new(0) | |
d=Hash.new(0) | |
keys = [] | |
vals = [] | |
list = [] | |
num = 0 |
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 os | |
import sys | |
import subprocess | |
import copy | |
traces = [ '../mtraces/'+ a for a in os.listdir('../mtraces') ] | |
len_traces = len(traces) | |
pass_count = 0 | |
fail_count = 0 |
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
with open('scratch.txt', 'r') as f: | |
lines = f.read().strip().split('\n\n') | |
for line in lines: | |
print('=' + line + '=') | |
f.close() |
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
# Usage bash run_many_clients.sh <SERVER_IP> <# of clients> <input textfile> | |
# EX) bash run_many_clients.sh 192.168.0.2 16 fakelog.txt | |
echo "" > output.txt | |
for (( i=1; i<$2; i++ )) | |
do | |
echo "[$(($i/10))$(($i%10))]" $(/usr/bin/time ./tcpcli02 $1 < $3 2>&1 >/dev/null) >> output.txt & | |
done | |
echo "[$(($2/10))$(($2%10))]" $(/usr/bin/time ./tcpcli02 $1 < $3 2>&1 >/dev/null) >> output.txt |
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
p gets.split(',').count |
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
s=gets.chomp | |
(s.size/10.0).ceil.times {|x| puts s[(10*x)..(10*x+9)]} |
OlderNewer