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
"""This is free and unencumbered software released into the public domain. | |
Anyone is free to copy, modify, publish, use, compile, sell, or | |
distribute this software, either in source code form or as a compiled | |
binary, for any purpose, commercial or non-commercial, and by any | |
means. | |
In jurisdictions that recognize copyright laws, the author or authors | |
of this software dedicate any and all copyright interest in the | |
software to the public domain. We make this dedication for the benefit |
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 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') |
import asyncio | |
from threading import Event, Thread | |
class EventLoopThread(Thread): | |
def __init__(self): | |
super().__init__() | |
self.loop = None | |
self.ready = Event() |
from multiprocessing import Event, Process, Queue | |
import time | |
import zmq | |
class BaseActor(Process): | |
ready = Event() | |
def handle(self, msg): | |
print("dt =", time.time() - msg['timestamp']) |
class Manager(object): | |
classes = set() | |
class Meta(type): | |
def __new__(cls, name, bases, d): | |
print("name:", name, "\nbases:", bases, "\ndict: ", d) | |
if name is not "Base": | |
Manager.classes.add(d['data']) | |
return type.__new__(cls, name, bases, d) |
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) |