View gist:e9b072c5314d3d5d2507aba8a86b0d6e
>>> df = pd.DataFrame([{'id': 1, 'price': 123, 'name': 'anna', 'amount': 1},
... {'id': 1, 'price': 7, 'name': 'anna', 'amount': 2},
... {'id': 2, 'price': 42, 'name': 'bob', 'amount': 30},
... {'id': 3, 'price': 1, 'name': 'charlie', 'amount': 10},
... {'id': 3, 'price': 2, 'name': 'david', 'amount': 100}])
>>> df
amount id name price
0 1 1 anna 123
1 2 1 anna 7
View .config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = git@github.com:MartinThoma/scipy.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
View gist:67b67875acf038b1a01a4af30a02cb1c
i Asana-Math: A font to typeset maths in Xe(La)TeX and Lua(La)TeX
i Type1fonts: Font installation guide
i academicons: Font containing high quality icons of online academic profiles
i accanthis: Accanthis fonts, with LaTeX support
i accfonts: Utilities to derive new fonts from existing ones
i accfonts.x86_64-linux: x86_64-linux files of accfonts
i addfont: easier use of fonts without LaTeX support
i adforn: OrnementsADF font with TeX/LaTeX support
i ae: Virtual fonts for T1 encoded CMR-fonts
i aecc: Almost European Concrete Roman virtual fonts
View output.txt
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et
dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet
clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet,
consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea
takimata sanctus est Lorem ipsum dolor sit amet.
• Lorem ipsum 123456789 foo bar
• Lorem ipsum 123 456 789 foo bar
• Lorem ipsum 123 456 789 foo bar
• Lorem ipsum 123 456 789 foo bar
View output.txt
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et
dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet
clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet,
consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea
takimata sanctus est Lorem ipsum dolor sit amet.
• Lorem ipsum 123456789 foo bar
• Lorem ipsum 123 456 789 foo bar
View table_gen.py
#!/usr/bin/env python
import random
random.seed(0)
rows = 100
cols = 15
word_file = "/usr/share/dict/words"
WORDS = open(word_file).read().splitlines()
View gist:8ea9d4013f5e782fe8979c3271f6d761
x = (1/3, 2/3)
y = (1/2, 1/2)
z = (1/2, 1/2)
d(x, y) = 1 - (1/3 + 1/2)
= 1/6
d(x, z) = d(x, y)
d(y, z) = 0
d(x, z) = 1/6 = 1/6 = d(x, y) + d(x, z)
View download_pdf_test.py
#!/usr/bin/env python
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
def get_browser():
"""
Get a chrome browser with disabled PDF viewer.
View selenium_example.py
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
def get_browser():
path_to_chromedriver = '/usr/lib/chromium-browser/chromedriver'
chrome_options = webdriver.ChromeOptions()
prefs = {"plugins.plugins_disabled": ["Chrome PDF Viewer"]}
View custreg.py
import numpy as np
from keras import backend as K
from keras.models import Sequential
from keras.layers import Dense, Activation
def fro_norm(w):
"""Frobenius norm."""
return K.sqrt(K.sum(K.square(K.abs(w))))