Author: the Joy of Tech by Nitrozac and Snaggy
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
orders = [] | |
for i in range(10): | |
purpose = raw_input("Would you like to buy or sell?") | |
if purpose not in ['buy', 'sell']: | |
print("You don't anyhow ah.") | |
exit() | |
try: | |
price = float(raw_input("At what price would you like to buy/sell?")) | |
quantity = float(raw_input("What is the quantity you would like to buy/sell?")) |
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/local/bin/python3 | |
# Convert all *.lrc files in current directory to UTF-8 encoding. | |
__author__ = 'Eana Hufwe <ilove@1a23.com>' | |
import glob | |
from chardet.universaldetector import UniversalDetector | |
detector = UniversalDetector() | |
import shutil |
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
# Translation of https://gist.github.com/MHeasell/bb9f7253da45b5140a83 | |
def vadd (s, o): | |
return {'x': s['x']+o['x'], 'y': s['y']+o['y']} | |
def vsub (s, o): | |
return {'x': s['x']-o['x'], 'y': s['y']-o['y']} | |
def vmul (s, o): | |
return {'x': s['x']*o, 'y': s['y']*o} | |
def vlen (s): | |
return (s['x']**2+s['y']**2)**0.5 |
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
{" ": " \t \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u205f\u3000", | |
"A": "\u0391A\u00c0\u0410\u00c1\u1e00\u1f08\u1f09\u1f0a\u1f0b\u1f0c\u1fb8\u1fb9\u1fba\u1fbb\u1f0d\u1f0e\u1f0f\u1ea0\u1ea2\u1ea4\u1ea6\u1ea8\u1eaa\u1eac\u1eae\u1eb0\u1eb2\u1eb4\u1eb6\u00c2\u00c3\u00c4\u00c5\u0100\u0102\u0104\u01cd\u01de\u01e0\u01fa\u0202\u0226\u24b6\ud83c\udd50\uff21\ud835\udc00\ud835\udd6c\ud835\udc68\ud835\udcd0\ud835\udd38\ud835\ude70\ud835\udda0\ud835\uddd4\ud835\ude3c\ud835\ude08\ud83c\udd30\ud83c\udd70\u00c1\ud835\udd04\u00c4\u1d00\u023a\u2090\u1d2c", | |
"B": "B\u0392\u03b2\u00df\u1e02\u1e04\u1e06\u0412\u0181\u24b7\ud83c\udd51\uff22\ud835\udc01\ud835\udd6d\ud835\udc69\ud835\udcd1\ud835\udd39\ud835\ude71\ud835\udda1\ud835\uddd5\ud835\ude3d\ud835\ude09\ud83c\udd31\ud83c\udd71B\ud835\udd05\u1e04\u0299\u0243\u1d2e", | |
"C": "C\u0421\u216d\u2103\u00c7\u0106\u0108\u010a\u010c\u1e08\u0187\u24b8\ud83c\udd52\uff23\ud835\udc02\ud835\udd6e\ud835\udc6a\ud835\udcd2\u2102\ud835\ude72\ud835\udda2\ud835\uddd6\ |
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
SELECT title, content, category, pub_time | |
FROM news | |
WHERE ( | |
SELECT count(*) FROM news AS f | |
WHERE f.category = news.category AND f.pub_time <= news.pub_time | |
) <= 2; | |
# Via http://www.xaprb.com/blog/2006/12/07/how-to-select-the-firstleastmax-row-per-group-in-sql/ |
This is an attendance checker dedicated to AJINC. When running it, it sends a notice to your Pushbullet account with your attendance status of the day.
It is recommended to run this script as a corn job every work day at around 0930, as your attendance is most likely confirmed by then.
Suggested cronjob line:
30 9 * * 1-5 python3 /path/to/script/ajinc_attendance.py
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
/* | |
使用方法: | |
在浏览器中打开JS终端,作用范围定位到contentFrame。 | |
将divider改成区分翻译的符号。 | |
然后将以下代码粘贴执行。 | |
协议:MIT | |
*/ | |
var divider = " / "; |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<link href='http://fonts.googleapis.com/css?family=Roboto:400,300' rel='stylesheet' type='text/css'> | |
<title>LRC_translation_conbiner. by Eana Hufwe</title> | |
</head> | |
<body> | |
<style> | |
body{ |
NewerOlder