Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ruoyu0088
ruoyu0088 / bokeh_subprocess_test.py
Created May 12, 2018 04:23
a demo for zmq process with bokeh server
from os import path
from bokeh.models import Button, Div
from bokeh.layouts import column
from bokeh.document import without_document_lock
from bokeh.io import curdoc
from zmq_subprocess import ZmqSubProcessClient
ok_button = Button(label="ok")
div = Div()
import numpy as np
from collections.abc import Sized, Iterable, Iterator
from itertools import product, count, combinations, permutations
from collections import defaultdict
from typing import Optional
import cycosat
BlocksColor = [
'#ffb631',
'#f0ea4b',
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import taichi as ti
ti.init(arch=ti.gpu)
StatusSearch, StatusAtFood, StatusGoHome, StatusAtHome = 1, 2, 3, 4
pi = 3.1415926
width = 80
height = 60
N = 1000
ant_length = 1
@ruoyu0088
ruoyu0088 / taichi_zoo_life.py
Last active September 19, 2022 08:52
taichi_zoo_life.py
import taichi as ti
Category10_10 = ('#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd',
'#8c564b', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf')
ti.init(arch=ti.gpu)
N = 2000
N_COLOR = 10
COLORS = [int(c[1:], 16) for c in Category10_10]
from kiwisolver import strength
import taichi as ti
import numpy as np
Category10_10 = ('#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf')
ti.init(arch=ti.gpu)
N = 5000
N_COLOR = 10
. ....... .......,,,.......*(* /%/
.. . .... .,,... .*//, /&/
... ... ....,,,,,,,,. ,*//, /&/
.. .....,,,,.*/*,. *%*
. .. ..,,,*,,. *(,
..... ..,*,,.. *#*
..,***,. *#*
.,*(*,. *%/.
. .,/#* *(*.
.. .,**,**,