A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
using UnityEngine; | |
using System.Collections; | |
public class SimplexNoiseGenerator { | |
private int[] A = new int[3]; | |
private float s, u, v, w; | |
private int i, j, k; | |
private float onethird = 0.333333333f; | |
private float onesixth = 0.166666667f; | |
private int[] T; |
MIT License | |
Copyright (c) 2018 Jason Sperske | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
emulator -list-avds | cat -n | |
printf "Select AVD: " | |
read index | |
avd=$(emulator -list-avds | sed "${index}q;d") | |
echo "Selected $avd" | |
emulator -netdelay none -netspeed full -avd $avd |
Run this command to install MG-CLI: | |
sudo apt-get update && wget https://minergate.com/download/deb-cli -O minergate-cli.deb && sudo dpkg -i minergate-cli.deb | |
to start miner (4 cores for BCN) use this command: | |
minergate-cli -user <[email protected]> -bcn 4 | |
Feel free to send some of your earnings to me: | |
BTC (Don't attempt to send other coins to this address!): 17f77AYHsQbdsB1Q6BbqPahJ8ZrjFLYH2j |
import keras.backend as K | |
from keras.layers import Dense, Activation, Multiply, Add, Lambda | |
import keras.initializers | |
def highway_layers(value, n_layers, activation="tanh", gate_bias=-3): | |
dim = K.int_shape(value)[-1] | |
gate_bias_initializer = keras.initializers.Constant(gate_bias) | |
for i in range(n_layers): | |
gate = Dense(units=dim, bias_initializer=gate_bias_initializer)(value) | |
gate = Activation("sigmoid")(gate) |
import click | |
import hashlib | |
import requests | |
from pathlib import Path | |
from tqdm import tqdm | |
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help']) |
# Flutter (https://flutter.io) Developement Environment for Linux | |
# =============================================================== | |
# | |
# This environment passes all Linux Flutter Doctor checks and is sufficient | |
# for building Android applications and running Flutter tests. | |
# | |
# To build iOS applications, a Mac development environment is necessary. | |
# | |
FROM debian:stretch |
from pathlib import Path | |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
class TanhNet(nn.Module): | |
def __init__(self, in_features, h_units): | |
super(TanhNet, self).__init__() | |
self.fc1 = nn.Linear(in_features, h_units) |
import sys | |
import pandas as pd | |
from PyQt5.QtWidgets import QApplication, QTableView | |
from PyQt5.QtCore import QAbstractTableModel, Qt | |
df = pd.DataFrame({'a': ['Mary', 'Jim', 'John'], | |
'b': [100, 200, 300], | |
'c': ['a', 'b', 'c']}) | |
class pandasModel(QAbstractTableModel): |