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
wget https://aur.archlinux.org/cgit/aur.git/snapshot/package-query.tar.gz | |
tar xfz package-query.tar.gz | |
cd package-query && makepkg -rsi | |
wget https://aur.archlinux.org/cgit/aur.git/snapshot/yaourt.tar.gz | |
tar xfz yaourt.tar.gz | |
cd yaourt && makepkg -rsi |
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
\usepackage{tgpagella} % text only | |
\usepackage{mathpazo} % math & text |
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 = ... | |
idx = np.random.choice(np.arange(len(x)), 1000, replace=False) | |
x_sample = x[idx] | |
y_sample = y[idx] | |
""" | |
a : 1-D array-like or int | |
If an ndarray, a random sample is generated from its elements. If an int, the random sample is generated as if a was np.arange(n) | |
size : int or tuple of ints, optional | |
Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn. Default is None, in which case a single value is returned. |
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
\usepackage{graphicx} | |
\begin{figure}[p] | |
\centering | |
\includegraphics[width=0.8\textwidth]{image.png} | |
\caption{Awesome Image} | |
\label{fig:awesome_image} | |
\end{figure} |
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 | |
ipv4_addr=`ifconfig eth0 | grep 'inet addr' | cut -d : -f 2 | cut -d ' ' -f 1` | |
ipv6_base='2402:f000:1:1501' | |
ip tunnel add sit1 mode sit remote 166.111.21.1 local ${ipv4_addr} | |
ifconfig sit1 up | |
ifconfig sit1 add ${ipv6_base}::${ipv4_addr}/64 | |
ip -6 route add ::/0 via ${ipv6_base}::1 metric 1 dev sit1 |
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
%!TEX TS-program = xelatex | |
%!TEX encoding = UTF-8 Unicode | |
\documentclass[12pt]{article} | |
\usepackage[adobefonts]{ctex} | |
\usepackage{graphicx} | |
\usepackage{amssymb} | |
\usepackage{amsmath} | |
\begin{document} |
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/share/python | |
class ListInstance: | |
def __str__(self): | |
return '<Instance of %s, address %s:\n%s>' % ( | |
self.__class__.__name__, | |
id(self), | |
self.__attrnames()) | |
def __attrnames(self): | |
result = '' |
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/python | |
class simple_tracer_as_cls: | |
def __init__(self, func): | |
self.calls = 0 | |
self.func = func | |
def __call__(self, *args, **kargs): | |
self.calls += 1 | |
print('call %s to %s' % (self.calls, self.func.__name__)) |
NewerOlder