Skip to content

Instantly share code, notes, and snippets.

@malmaud
malmaud / log
Created October 11, 2019 18:46
This file has been truncated, but you can view the full file.
Downloading https://pvsc.azureedge.net/python-language-server-daily/Python-Language-Server-osx-x64.0.4.67.nupkg...
Language server dowload complete
Unpacking archive... done
[Info - 2:43:08 PM] Microsoft Python Language Server version 0.4.67.0
[Info - 2:43:08 PM] Workspace root: /Users/malmaud/dropbox/code/qa
[Info - 2:43:08 PM] Analysis cache path: /Users/malmaud/Library/Caches/Microsoft/Python Language Server
[Info - 2:43:08 PM] GetCurrentSearchPaths /Users/malmaud/anaconda3/bin/python
[Info - 2:43:09 PM] Interpreter search paths:
[Info - 2:43:09 PM] /Users/malmaud/.vscode/extensions/ms-python.python-2019.10.41019/languageServer.0.4.67
@malmaud
malmaud / trace
Created September 19, 2019 19:49
[Info - 3:46:00 PM] Microsoft Python Language Server version 0.4.20.0
[Info - 3:46:00 PM] Workspace root: /Users/malmaud/tmp/ttest
[Info - 3:46:01 PM] Analysis cache path: /Users/malmaud/Library/Caches/Microsoft/Python Language Server
[Info - 3:46:01 PM] GetCurrentSearchPaths /anaconda3/bin/python
[Info - 3:46:01 PM] Interpreter search paths:
[Info - 3:46:01 PM] /Users/malmaud/.vscode/extensions/ms-python.python-2019.9.34911/languageServer.0.4.20
[Info - 3:46:01 PM] /anaconda3/lib/python3.7
[Info - 3:46:01 PM] /anaconda3/lib/python3.7/lib-dynload
[Info - 3:46:01 PM] /Users/malmaud/.local/lib/python3.7/site-packages
[Info - 3:46:01 PM] /anaconda3/lib/python3.7/site-packages
Starting Microsoft Python language server.
[Info - 3:25:16 PM] GetCurrentSearchPaths /anaconda3/bin/python
[Info - 3:25:16 PM] SearchPaths:
[Info - 3:25:16 PM] /private/var/folders/t6/ddh10c6j5r54sg19jlc59n580000gn/T/bmjcc2cm.oc2
[Info - 3:25:16 PM] /anaconda3/lib/python3.7
[Info - 3:25:16 PM] /anaconda3/lib/python3.7/lib-dynload
[Info - 3:25:16 PM] /Users/malmaud/.local/lib/python3.7/site-packages
[Info - 3:25:16 PM] /anaconda3/lib/python3.7/site-packages
[Info - 3:25:16 PM] /anaconda3/lib/python3.7/site-packages/aeosa
[Info - 3:25:16 PM] /Users/malmaud/anaconda3/lib/python3.7/site-packages
@malmaud
malmaud / async_io.py
Last active June 22, 2018 18:59
Demo of asynchronous programming in Python
import attr
from typing import *
from dataclasses import dataclass
import asyncio
import types
import re
class InputAwait:
target: str
@malmaud
malmaud / hi.proto
Created February 2, 2017 21:23
protobuf bug
syntax="proto3";
message Hi {
repeated int32 x = 1 [packed=true];
}
@malmaud
malmaud / hothand.jl
Last active September 29, 2015 10:45
hothand
function simulate(N_trials, N_runs)
outcomes=zeros(Bool, N_runs)
Σ=0.0
N=0
for trial=1:N_trials
pos=0
neg=0
for run=1:N_runs
outcomes[run]=rand(Bool)
end
git clone -q --mirror --branch v0.23.1 git://github.com/libgit2/libgit2.git /Users/malmaud/julia_cxx/deps/srccache/libgit2.git/
# try to update the cache, if that fails, attempt to continue anyways (the ref might already be local)
cd /Users/malmaud/julia_cxx/deps/srccache/libgit2.git && git fetch -q git://github.com/libgit2/libgit2.git v0.23.1:remotes/origin/v0.23.1
git clone -q --depth=10 --branch v0.23.1 /Users/malmaud/julia_cxx/deps/srccache/libgit2.git /Users/malmaud/julia_cxx/deps/srccache/libgit2
warning: --depth is ignored in local clones; use file:// instead.
Note: checking out 'f6dedf2c2eb806e2a6fdd4cf31f68386efc2ee0b'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
function f(x, N)
res = false
for n=1:N
res = res || (x==1 || x==2)
end
res
end
function g(x, N)
res =false
using Pandas
using PyPlot
function to_df()
issues = deserialize(open("issues.jld"))
df = DataFrame(issues)
for datecol in ["closed_at", "created_at"]
df[datecol] = to_datetime(df[datecol])
end
to_pickle(df, "issues.pickle")