View .vimrc
" This just turns on per-filetype plugins. Vim ships with file
" indentation/plugin/syntax rules for highlighting. The highlighting
" is nice. Sometimes the indentation is a bit annoying though because
" it REINDENTS my stupid code when I didn't want it to. It's annoying
" to track down why it's doing that...
filetype indent on
filetype on
filetype plugin on
" This MUST be before highlight comment, see
" https://github.com/Valloric/YouCompleteMe/issues/2664
View accepted-by-osx-clang.cpp
#include <tuple>
struct T {};
void f(const std::tuple<T, T>&) {}
void g(T& x) {
f(x);
}
View gist:c8b307f6109da965a99c539042eb3ee0
mlstm(43): 108.806 msecs
mlstm(44): 108.450 msecs
mlstm(45): 109.188 msecs
mlstm(46): 108.555 msecs
mlstm(47): 108.345 msecs
mlstm(48): 108.452 msecs
mlstm(49): 108.334 msecs
mlstm(50): 137.128 msecs
mlstm(51): 147.267 msecs
mlstm(52): 150.047 msecs
View test.cpp
#include <pybind11/pybind11.h>
#include <iostream>
namespace py = pybind11;
int main() {
Py_Initialize();
auto gil = PyGILState_Ensure();
PyObject *l = PyFloat_FromDouble(3.14);
//PyObject *l = PyBytes_FromString("foo");
auto n = py::cast<py::bytes>(l);
std::cerr << "No problem yet...\n";
View travis-deploy-notes.md
  • Matrix DOES work with deploy; deploy gets run for each matrix entry, environment variables carry over
  • Non-tag releases behave strangely: Travis creates an "untagged" tag for each matrix entry (so you end up with multiple tags), and each show up as separate releases
  • If you tag the release, each matrix entry gets bundled up in the same release. Untagged releases and draft releases get done separately.

Conclusion: do tagged releases only

  • Bash condition is useful; you can use this to distinguish between matrix entries. This can help you filter out non-release matrix entries.

Is it a good idea to put the release build script and the regular build script together? You might think to create separate matrix entries for release and non-release.

  • Problem: you can't "disable" matrix builds conditionally: everything in the matrix always runs
View word.diff
diff --git a/word_language_model/main.py b/word_language_model/main.py
index c4ea458..7ff9b61 100644
--- a/word_language_model/main.py
+++ b/word_language_model/main.py
@@ -81,6 +81,8 @@ test_data = batchify(corpus.test, eval_batch_size)
ntokens = len(corpus.dictionary)
model = model.RNNModel(args.model, ntokens, args.emsize, args.nhid, args.nlayers, args.dropout, args.tied)
+import torch.jit
+model = torch.jit.verify_model(model)
View grad.py
import torch
from torch.autograd import Variable, Function
import torch._C as _C
import sys
class Add(Function):
def forward(self, a, b):
return a.add(b)
def backward(self, grad_output):
View gist:56a87cd1675d037c1d228c33db359c9f
New summary by @ezyang.
The goal of this task is to add a new command `Setup doctest`, which runs the doctest command on all of the modules of each component in a package, in much the same way `Setup haddock` runs `haddock` on all the modules of each component in a package.
There are a number of steps to implementing this:
1. You have to add the boilerplate for setting doctest up as a new command. Grepping for occurrences of haddock should give you an idea for what you have to edit; the key files are `Cabal/Distribution/Simple/Setup.hs`, adding a case to `defaultMainHelper` in `Cabal/Distribution/Simple.hs`, and a new file to actually contain the logic. I'd recommend against putting too many flags into `DoctestFlags` when starting off.
2. The overall logic of the driver should be something like this:
View .vimrc
" https://github.com/tpope/vim-pathogen
" Pathogen is good because you can keep plugins together in logical
" units, without blasting them throughout your directory structure.
execute pathogen#infect()
" This just turns on per-filetype plugins. Vim ships with file
" indentation/plugin/syntax rules for highlighting. The highlighting
" is nice. Sometimes the indentation is a bit annoying though because
" it REINDENTS my stupid code when I didn't want it to. It's annoying
" to track down why it's doing that...
View render.md

| Str.String| Str.Text| Str.Text.Lazy ---| ---| ---| --- Str | ✔| ✔| ✔ Chr | ✔| ✔| ✔ Index | ✔| ✔| ✔ empty | ✔| ✔| ✔ singleton | ✔| ✔| ✔ pack | ✔| ✔| ✔ unpack | ✔| ✔| ✔ cons | ✔| |