Using perf:
$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg
NOTE: See @GabrielMajeri's comments below about the
-g
option.
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """ | |
import numpy as np | |
import cPickle as pickle | |
import gym | |
# hyperparameters | |
H = 200 # number of hidden layer neurons | |
batch_size = 10 # every how many episodes to do a param update? | |
learning_rate = 1e-4 | |
gamma = 0.99 # discount factor for reward |
Using perf:
$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg
NOTE: See @GabrielMajeri's comments below about the
-g
option.
Ripgrep is a fast search tool like grep
. It's mostly a drop-in replacement for ag
, also know as the Silver Searcher.
helm-ag
is a fantastic package for Emacs that allows you to display search results in a buffer.
You can also jump to locations of matches. Despite the name, helm-ag
works with ripgrep (rg
) as well
as with ag
.
use std::io::{Read, Write}; | |
use std::fs::File; | |
fn main() { | |
let args = ::std::env::args().collect::<Vec<_>>(); | |
// skip the program name | |
if args.len() != 5 { | |
println!("Usage: {} <filename> <columnname> <replacement> <output_filename>", args[0]); | |
} | |
First. Run this:
export STEAM_COMPAT_DATA_PATH=~/.local/share/Steam/steamapps/compatdata
Second. Now in the same terminal, run your game (this example: Raft)
~/.local/share/Steam/steamapps/common/Proton\ 5.13/proton run ~/.local/share/Steam/steamapps/common/Raft/Raft.exe