This Gist is about how I use PyAudio, NumPy, and Matplotlib to plot freqency spectrum of system sound or microphone.
You can read this blog post for more detail or watch this video:
This Gist is about how I use PyAudio, NumPy, and Matplotlib to plot freqency spectrum of system sound or microphone.
You can read this blog post for more detail or watch this video:
Sometimes a Python script will simply hang forever with no indication of what is going wrong. Perhaps it's polling a service that will never return a value that allows the program to move forward.
Here's a way to see where the program is currently stuck, using pyrasite a tool for injecting code into running Python processes.
Install gdb.
bin/kafka-topics.sh --zookeeper localhost:2181 --list
bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic
bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000
... wait a minute ...
from fastai.text import * | |
from fastai.structured import proc_df | |
import pandas as pd | |
import numpy as np | |
class MixedInputModelWithText(nn.Module): | |
def __init__(self, emb_szs, n_cont, emb_drop, out_sz, szs, drops, | |
y_range=None, use_bn=False, is_reg=True, is_multi=False, n_text=0): | |
super().__init__() | |
for i, (c, s) in enumerate(emb_szs): assert c > 1, f"cardinality must be >=2, got emb_szs[{i}]: ({c},{s})" |
Host *.gerardorf.org !bastion.gerardorf.org | |
User admin | |
IdentityFile ~/.ssh/gerardorf-private-key | |
ProxyCommand ssh -W %h:%p admin@bastion.gerardorf.org | |
Host bastion.gerardorf.org | |
Hostname XXX.XXX.XXX.XXX | |
User admin | |
IdentityFile ~/.ssh/gerardorf-private-key | |
ForwardAgent yes |
{ | |
"IAB1": "Arts & Entertainment", | |
"IAB1-1": "Books & Literature", | |
"IAB1-2": "Celebrity Fan/Gossip", | |
"IAB1-3": "Fine Art", | |
"IAB1-4": "Humor", | |
"IAB1-5": "Movies", | |
"IAB1-6": "Music", | |
"IAB1-7": "Television", | |
"IAB2": "Automotive", |
from sklearn.cross_validation import train_test_split | |
from keras.preprocessing import sequence, text | |
from keras.models import Sequential | |
from keras.layers import (Dense, Dropout, Activation, Embedding, LSTM, | |
Convolution1D, MaxPooling1D) | |
# Embedding | |
max_features = 20000 | |
maxlen = 100 | |
embedding_size = 32 |
#!/usr/bin/python2 | |
# Copyright (C) 2016 Sixten Bergman | |
# License WTFPL | |
# | |
# This program is free software. It comes without any warranty, to the extent | |
# permitted by applicable law. | |
# You can redistribute it and/or modify it under the terms of the Do What The | |
# Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See |