I hereby claim:
- I am deepanjanroy on github.
- I am deepanjan (https://keybase.io/deepanjan) on keybase.
- I have a public key whose fingerprint is 4EF0 99A8 6EB2 577D 0F73 0F8A A4A4 089D 9925 F1BB
To claim this, I am signing this object:
// ==UserScript== | |
// @name Time to Interactive Polyfill | |
// @namespace http://developers.google.com/ | |
// @version 0.1 | |
// @description Polyfill to detect Time to Interactive | |
// @author Deepanjan Roy | |
// @include http://* | |
// @include https://* | |
// @run-at document-start | |
// @noframes |
{Slice Title} : {Total cumulative self time ms spent across 10k pages in test run} | |
TaskQueueManager::RunTask : 45799357.7984 | |
LocalFrameView::prePaint : 22831219.588 | |
ProxyMain::BeginMainFrame::commit : 16157595.614 | |
TaskQueueManager::ProcessTaskFromWorkQueue : 16034099.1022 | |
V8.NewContext : 15784434.0443 | |
TaskQueueManager::DoWork : 9825634.4282 | |
V8.RunMicrotasks : 7687400.93465 | |
content::mojom::URLLoaderClient : 7076002.57597 | |
ImageResourceContent::updateImage : 6806556.24597 |
{Slice Title} : {Total cumulative self time ms spent across 10k pages in test run} | |
LocalFrameView::performLayout : 77859682.3385 | |
TaskQueueManager::RunTask : 45631790.6605 | |
Document::recalcStyle : 42088368.0356 | |
Document::rebuildLayoutTree : 23380524.8535 | |
LocalFrameView::prePaint : 22698465.596 | |
WebURLLoaderImpl::loadSynchronously : 19509370.842 | |
ProxyMain::BeginMainFrame::commit : 16127438.698 | |
TaskQueueManager::ProcessTaskFromWorkQueue : 15972163.7861 | |
V8.NewContext : 15733717.8783 |
{ | |
"traceEvents": [ | |
{ | |
"pid": 54113, | |
"tid": 775, | |
"ts": 0, | |
"ph": "M", | |
"cat": "__metadata", | |
"name": "thread_name", | |
"args": { |
startTime endTime | |
1462522325143 1462522573681 | |
1462522350094 1462522606162 | |
1462522479957 1462522658064 | |
1462522553779 1462522693764 | |
1462522590651 1462522743941 | |
1462522627242 1462522743941 | |
1462522672757 1462522790259 | |
1462522692097 1462522790259 | |
1462522711007 1462522829463 |
I hereby claim:
To claim this, I am signing this object:
Today I spent about half an hour trying to figure out a mysterious bug in my Python code. The reason turned out to be quite unexpected, so I decided to write up a small post about it both as a reminder to my future self and as an cautionary tale to other unsuspecting victims.
This is a minimal reproduction of the bug:
class Node(object):
def __init__(self, children={}):
"""
By default children is an empty dict, but you can set
children directly by supplying them as a value to the keyword argument.
import numpy as np | |
from scipy.misc import comb | |
import matplotlib.pyplot as plt | |
S = np.array([[ 0.97, 0.01, 0.01, 0.01], | |
[ 0.01, 0.97, 0.01, 0.01], | |
[ 0.01, 0.01, 0.97, 0.01], | |
[ 0.01, 0.01, 0.01, 0.97]]) | |
pchange = lambda M: M[0,0] |
# Yay! High voltage and arrows! | |
prompt_setup_pygmalion(){ | |
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " | |
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_CLEAN="" | |
base_prompt='%{$fg[magenta]%}%n%{$reset_color%}%{$fg[cyan]%}@%{$reset_color%}%{$fg[yellow]%}%m%{$reset_color%}%{$fg[red]%}:%{$reset_color%}%{$fg[cyan]%}%0~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}' | |
post_prompt='%{$fg[cyan]%}⇒%{$reset_color%} ' |
// ==UserScript== | |
// @name FastFacebookLogout | |
// @namespace http://deepanjanroy.me/ | |
// @version 0.1 | |
// @description Log out of facebook by pressing only backtick (`). One-keypress exit during impulsive facebook visits. | |
// @match https://www.facebook.com/ | |
// @copyright 2012+, Deepanjan Roy | |
// ==/UserScript== | |
window.onkeypress = function (evt) { // document.onkeypress doesn't seem to work on Facebook and Tampermonkey |