Skip to content

Instantly share code, notes, and snippets.

View bitzhuxb's full-sized avatar
🐶

Zhuxiang Bin bitzhuxb

🐶
View GitHub Profile
@bitzhuxb
bitzhuxb / validate_tfrecords.py
Created August 26, 2020 02:53 — forked from ed-alertedh/validate_tfrecords.py
Utility functions to check for corruption in tfrecord files
import tensorflow as tf
def validate_dataset(filenames, reader_opts=None):
"""
Attempt to iterate over every record in the supplied iterable of TFRecord filenames
:param filenames: iterable of filenames to read
:param reader_opts: (optional) tf.python_io.TFRecordOptions to use when constructing the record iterator
"""
i = 0
@bitzhuxb
bitzhuxb / test
Created February 20, 2019 15:02
ddd
sdfasf
@bitzhuxb
bitzhuxb / ttt
Created February 20, 2019 14:59
tttt
tttttt
with expression
@bitzhuxb
bitzhuxb / gist:f39dafbf951416b1e1283d57adc13119
Created September 20, 2017 03:19 — forked from methane/gist:2185380
Tornado Example: Delegating an blocking task to a worker thread pool from an asynchronous request handler
from time import sleep
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from tornado.web import Application, asynchronous, RequestHandler
from multiprocessing.pool import ThreadPool
_workers = ThreadPool(10)
def run_background(func, callback, args=(), kwds={}):
def _callback(result):
@bitzhuxb
bitzhuxb / answers.md
Created December 22, 2013 13:16 — forked from jpsim/answers.md
  1. Plain Strings (207): foo
  2. Anchors (208): k$
  3. Ranges (202): ^[a-f]*$
  4. Backrefs (201): (...).*\1
  5. Abba (169): ^(.(?!(ll|ss|mm|rr|tt|ff|cc|bb)))*$|^n|ef
  6. A man, a plan (177): ^(.)[^p].*\1$
  7. Prime (286): ^(?!(..+)\1+$)
  8. Four (199): (.)(.\1){3}
  9. Order (198): ^[^o].....?$
  10. Triples (507): (^39|^44)|(^([0369]|([147][0369]*[258])|(([258]|[147][0369]*[147])([0369]*|[258][0369]*[147])([147]|[258][0369]*[258])))*$)