Skip to content

Instantly share code, notes, and snippets.

@PatWie
PatWie / update-tensorflow.sh
Last active December 4, 2019 18:24
simple cronjob script to frequently build TensorFlow from source automatically
#!/bin/bash
# Patrick Wieschollek
# =============================================================
# UPDATE SOURCE
# =============================================================
git checkout -- .
git pull origin master
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wesm
wesm / parquet-benchmark-20170210.py
Created February 10, 2017 18:07
Parquet multithreaded benchmarks
import gc
import os
import time
import numpy as np
import pandas as pd
from pyarrow.compat import guid
import pyarrow as pa
import pyarrow.parquet as pq
import snappy
from keras.models import Sequential
from keras.layers import Dense
from keras.utils.io_utils import HDF5Matrix
import numpy as np
def create_dataset():
import h5py
X = np.random.randn(200,10).astype('float32')
y = np.random.randint(0, 2, size=(200,1))
f = h5py.File('test.h5', 'w')
@jlinoff
jlinoff / mysshpass.py
Last active September 14, 2022 14:22
Simple python script to emulate sshpass using only pthon standard libraries, tested on python-2.7 and python-3.4.
#!/usr/bin/env python
# License: MIT Open Source
# Copyright (c) 2016 Joe Linoff
'''
The tool runs ssh or scp as a child process with a connected psuedo
terminal (pty).
It will automatically answer yes to the "Are you sure you want to
continue connecting (yes/no)?" if it comes up.
@crmne
crmne / download_zeal_user_docsets.py
Last active June 6, 2022 08:37
A solution to the lack of UI for Dash's user docsets in Zeal. Uses Python 3 and easygui (pip3 install easygui)
"""Download Dash User Docsets and install them in Zeal"""
import configparser
import json
import tarfile
import urllib.request
from pathlib import Path
from sys import platform
import easygui
typealias HANDLE Ptr{Void}
typealias DWORD Uint32
typealias WORD Uint16
typealias LPTSTR Cwchar_t
typealias LPBYTE Ptr{Char}
immutable STARTUPINFO
cb::DWORD
lpReserved::LPTSTR
lpDesktop::LPTSTR
@luw2007
luw2007 / 词性标记.md
Last active March 18, 2024 06:36
词性标记: 包含 ICTPOS3.0词性标记集、ICTCLAS 汉语词性标注集、jieba 字典中出现的词性、simhash 中可以忽略的部分词性

词的分类

  • 实词:名词、动词、形容词、状态词、区别词、数词、量词、代词
  • 虚词:副词、介词、连词、助词、拟声词、叹词。

ICTPOS3.0词性标记集

n 名词

nr 人名

@paulodeleo
paulodeleo / .tmux.conf
Last active July 15, 2022 10:16
Tmux configuration to enable mouse scroll and mouse panel select, taken from: http://brainscraps.wikia.com/wiki/Extreme_Multitasking_with_tmux_and_PuTTY
# Make mouse useful in copy mode
setw -g mode-mouse on
# Allow mouse to select which pane to use
set -g mouse-select-pane on
# Allow mouse dragging to resize panes
set -g mouse-resize-pane on
# Allow mouse to select windows
@why-not
why-not / gist:4582705
Last active February 1, 2024 00:44
Pandas recipe. I find pandas indexing counter intuitive, perhaps my intuitions were shaped by many years in the imperative world. I am collecting some recipes to do things quickly in pandas & to jog my memory.
"""making a dataframe"""
df = pd.DataFrame([[1, 2], [3, 4]], columns=list('AB'))
"""quick way to create an interesting data frame to try things out"""
df = pd.DataFrame(np.random.randn(5, 4), columns=['a', 'b', 'c', 'd'])
"""convert a dictionary into a DataFrame"""
"""make the keys into columns"""
df = pd.DataFrame(dic, index=[0])