As configured in my dotfiles.
start new:
tmux
start new with session name:
As configured in my dotfiles.
start new:
tmux
start new with session name:
Delimited continuations manipulate the control flow of programs. Similar to control structures like conditionals or loops they allow to deviate from a sequential flow of control.
We use exception handling as another example for control flow manipulation and later show how to implement it using delimited continuations. Finally, we show that nondeterminism can also be expressed using delimited continuations.
from IPython.kernel.zmq.kernelapp import IPKernelApp | |
from IPython.utils.frame import extract_module_locals | |
import sys | |
# Code lifted from IPython/kernel/zmq/embed.py | |
def embed_kernel_noloop(module=None, local_ns=None, **kwargs): | |
"""Embed and start an IPython kernel in a given scope | |
returning function that can be used to pump a single event | |
Parameters |
# Ruby is our language as asciidoctor is a ruby gem. | |
lang: ruby | |
before_install: | |
- sudo apt-get install pandoc | |
- gem install asciidoctor | |
script: | |
- make | |
after_success: | |
- .travis/push.sh | |
env: |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
import asyncio | |
@asyncio.coroutine | |
def factorial(name, number): | |
f = 1 | |
for i in range(2, number + 1): | |
print("Task %s: Compute factorial(%d)..." % (name, i)) | |
yield from asyncio.sleep(1) | |
f *= i |
COW, short for copy on write, is a way to implement mutable strings so that creating strings and logically copying strings, is reduced to almost nothing; conceptually they become free operations like no-ops.
Basic idea: to share a data buffer among string instances, and only make a copy for a specific instance (the copy on write) when that instance's data is modified. The general cost of this is only an extra indirection for accessing the value of a string, so a COW implementation is highly desirable. And so the original C++ standard, C++98, and its correction C++03, had special support for COW implementations, and e.g. the g++ compiler's std::string
implementations used COW.
So why was that support dropped in C++11?
In particular, would the same reason or reasons apply to a reference counted immutable string value class?
Code from PyCon India 2019 Keynote Talk | |
David Beazley (https://www.dabeaz.com) | |
====================================== | |
This code is presented "as is" and represents what was live-coded | |
during my closing keynote presentation at PyCon India, Chennai, | |
October 13, 2009. I have made no changes to the files. | |
Requires: Python 3.6+, numpy, pygame |