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 | |
from bottle import route, error, post, get, run, static_file, abort, redirect, response, request, template | |
@route('/') | |
@route('/index.html') | |
def index(): | |
return '<a href="/hello">Go to Hello World page</a>' | |
@route('/hello') | |
def hello(): |
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
nodemailer = require "nodemailer" | |
smtpTransport = nodemailer.createTransport "SMTP", | |
service: "Gmail" | |
auth: | |
user: | |
pass: | |
mail = | |
from: "" |
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 <iostream> | |
using namespace std; | |
// .data - read-write data | |
int rwdata = 100; | |
// .rodata - read-only data | |
const char* rodata = "hello, world"; |
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
#Newbie programmer | |
def factorial(x): | |
if x == 0: | |
return 1 | |
else: | |
return x * factorial(x - 1) | |
print factorial(6) | |
#First year programmer, studied Pascal |
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
% fonts | |
\usepackage{xeCJK} | |
\usepackage{xltxtra} | |
% beamer | |
% \usefonttheme{default} % sans serif | |
\usefonttheme{professionalfonts} | |
\usefonttheme{serif} | |
% \usefonttheme{structurebold} | |
% \usefonttheme{structureitalicserif} | |
% \usefonttheme{strucutresmallcapsserif} |
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
\begin{diagram} | |
& & X & & \\ | |
& \ldTo^{f_1} & \dDashto_f & \rdTo^{f_2} & \\ | |
A & \lTo_{\pi_1} & A\times B & \rTo_{\pi_2} & B \\ | |
\end{diagram} | |
\begin{diagram} | |
& & X & & \\ | |
& \ruTo^{f_1} & \uDashto_f & \luTo^{f_2} & \\ | |
A & \rTo_{i_1} & A\oplus B & \lTo_{i_2} & B \\ |
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 id_mathjax_plugin; | |
(function() { | |
var mjp = id_mathjax_plugin = { | |
load_mathjax: function() { | |
function e(e){var t='.MathJax .mn {background: inherit;} .MathJax .mi {color: inherit;} .MathJax .mo {background: inherit;}',n=e.createElement('style');n.innerText=t;try{n.textContent=t}catch(r){}e.getElementsByTagName('body')[0].appendChild(n);var i=e.createElement('script'),s;i.src='https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML.js',i.type='text/javascript',s='MathJax.Hub.Config({skipStartupTypeset:true,tex2jax:{inlineMath:[[\'$\',\'$\']],displayMath:[[\'\\\\[\',\'\\\\]\']],processEscapes:true}});MathJax.Hub.Startup.onload();',window.opera?i.innerHTML=s:i.text=s,e.getElementsByTagName('head')[0].appendChild(i)}function t(t){t.MathJax===undefined?e(t.document):t.MathJax.Hub.Queue(new t.Array('Typeset',t.MathJax.Hub))}var n=document.getElementsByTagName('iframe'),r,i;t(window);for(r=0;r<n.length;r++)i=n[r].contentWindow||n[r].contentDocument,i.document||(i=i.parentN |
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
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script> |
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 numpy.lib | |
import numpy as np | |
import pandas as pd | |
import cPickle as pickle | |
def save_pandas(fname, data): | |
'''Save DataFrame or Series | |
Parameters | |
---------- |
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 qrcode | |
from PIL import ImageFont, ImageDraw | |
def generate_qrcode_from_url( | |
info = 'http://www.quxiaofeng.me/about', | |
text_position = (43,10), | |
code_version = 1, | |
code_error_correction = qrcode.constants.ERROR_CORRECT_H, | |
code_box_size = 10, | |
code_border = 4, |
OlderNewer