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
def loop_f(n) | |
collect_div_2 = [] | |
collect_div_3 = [] | |
collect_div_5 = [] | |
collect_div_7 = [] | |
div_r = n | |
while true | |
div_r /= 2 | |
if div_r == 0 || div_r == 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
#include <stdio.h> | |
#include <stdlib.h> | |
#define true 1 | |
#define false 0 | |
typedef struct { | |
unsigned long long buff[65535]; | |
int size; | |
} collection; |
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
<!DOCTYPE html> | |
<html> | |
<style> | |
div.progressbar { | |
background-color: #6188F5; background-repeat: repeat-x; | |
background-position: 0 0; background-size: 16px 9px; | |
background-image: -webkit-linear-gradient(315deg,transparent,transparent 33%, | |
rgba(0, 0, 0, 0.12) 33%, rgba(0, 0, 0, 0.12) 66%, transparent 66%, | |
transparent); | |
background-image: -moz-linear-gradient(315deg,transparent,transparent 33%, |
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/python2.6 | |
# -*- coding: utf-8 -*- | |
import sys, os, re, unittest | |
test = re.compile("test\.py$", re.IGNORECASE) | |
def get_test_files(dir, files): | |
""" recursion search test module | |
Args: dir: search root directory, files: result container """ | |
for file in os.listdir(dir): |
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 | |
auth='--ntlm --user xxmu\xxyxy:1234567' | |
host="http://www.xxmu.edu.cn" | |
dir=$host"/tpxz/2012%E5%B1%8A%E6%9C%AC%E7%A7%91%E6%AF%95%E4%B8%9A%E7%94%9F%E6%AF%95%E4%B8%9A%E5%85%B8%E7%A4%BC%E7%85%A7%E7%89%87/" | |
function get_href { | |
grep -io 'href="[^"]*"' | sed -r 's/href="([^"]*)"/\1/i' |
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 | |
function tip { echo -e '\E[37;44m'"\033[1m$1\033[0m"; } | |
set +h | |
umask 022 | |
export LFS="/srv/lfs/6.6" | |
export LC_ALL=POSIX | |
export LFS_TGT=$(uname -m)-lfs-linux-gnu | |
export PATH=/tools/bin:/bin:/usr/bin |
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
--- | |
Type: | |
Bacteria: Most common cause of Plague. Unlimited potential | |
Virus: A rapidly mutating pathogen which is extremely hard to control | |
Fungus: Fungal spores struggle to travel long distances without special effort | |
Parasite: Parasitic lifestyle prevents DNA alteration from everyday infection | |
Prion: Slow, subtle and extremely complex pathogen hidden inside the brain | |
"Nano-Virus": Out of control, microscopic machine with a built in kill switch | |
"Bio-Weapon": Exceptionally lethal pathogen that kills everything it touches | |
"Neurax Worm": Manipulative organism that burrows into the brain |
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
function obj2str(obj) { | |
var fString = function(objj) { | |
if (!objj) return objj; | |
var newObj = Array.isArray(objj) ? [] : {} | |
Object.keys(objj).map(function(k) { | |
if (typeof(objj[k]) == "function") newObj[k] = objj[k].toString(); | |
else if (typeof(objj[k]) == "object") newObj[k] = fString(objj[k]); | |
else newObj[k] = objj[k]; | |
}) | |
return newObj; |
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
x, y = "CATCGA", "GTACCGTCA" | |
table = [ ] | |
(0..x.length).each { table << row = [ ]; (0..y.length).each { row << 0 } } | |
x.chars.each_with_index { |xc, xi| | |
y.chars.each_with_index { |yc, yi| | |
pxv = table[xi][yi + 1] | |
pyv = table[xi + 1][yi] | |
pvg = pxv > pyv ? pxv : pyv | |
pvl = pxv <= pyv ? pxv : pyv |
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
window.setInterval(function() { var vx = document.getElementById("task_x").innerText, op = { "+": "+", "–": "-", "×": "*", "/": "/" }[document.getElementById("task_op").innerText], vy = document.getElementById("task_y").innerText, res = document.getElementById("task_res").innerText, r_btn = document.getElementById("button_correct"), w_btn = document.getElementById("button_wrong"); console.log(vx, op, vy, res, r_btn, w_btn); if (eval(vx + op + vy) == res * 1) r_btn.click(); else w_btn.click() }, 500) |
OlderNewer