Demo of sending raw bytes over ZMQ sockets with C++.
This assumes you are using miniconda and have installed cppzmq:
conda install -c conda-forge cppzmq
Demo of sending raw bytes over ZMQ sockets with C++.
This assumes you are using miniconda and have installed cppzmq:
conda install -c conda-forge cppzmq
"""Examples of how to bind a socket to a random port and have that port number | |
accessible to other processes. Useful for interprocess communications. | |
""" | |
import time | |
import socket | |
from socket import AF_INET, SOCK_STREAM | |
from multiprocessing import Process, Queue, Event | |
from contextlib import contextmanager |
I hereby claim:
To claim this, I am signing this object:
import random | |
import time | |
from tornado import gen | |
from tornado.concurrent import run_on_executor, futures | |
from tornado.ioloop import IOLoop | |
class TaskRunner(object): | |
def __init__(self, loop=None): | |
self.executor = futures.ThreadPoolExecutor(4) | |
self.loop = loop or IOLoop.instance() |
"""Demonstration of using Tornado to send updates to a Bokeh plot | |
without using the bokeh-server. | |
""" | |
import json | |
import numpy.random as npr | |
from tornado.ioloop import IOLoop, PeriodicCallback | |
from tornado.web import Application, RequestHandler |
import sys | |
from PyQt5.QtWidgets import * | |
from PyQt5.QtGui import * | |
class MainWindow(QWidget): | |
def __init__(self, *args, **kwargs): | |
super().__init__(*args, **kwargs) | |
self.setWindowTitle('Multiline lambdas') |
/* | |
Simple jQuery calls to replace RST admonitions with Bootstrap | |
alerts. | |
This is intended to work with the pelican-bootstrap3 Pelican theme, | |
but may also work with others. | |
This script is public domain. | |
*/ |
import codecs | |
import json | |
from typing import Union | |
import h5py | |
import numpy as np | |
import pandas as pd | |
vlen = np.vectorize(len) | |
vencode = np.vectorize(codecs.encode) |
Testing using Pygal to render plots server-side and embed them in a
web page via a <canvas>
.
With the Mercurial convert
extention, you can rename branches, move,
and filter files. As an example, say we have a repo with only the
default
branch which is to be imported into a super-repository.
For starters, we will want all our files in the child repo to be in a subdirectory of the parent repo and not include the child's