Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am cr1901 on github.
  • I am cr1901 (https://keybase.io/cr1901) on keybase.
  • I have a public key whose fingerprint is 5EA0 2E81 36AE 81BE 8EAA 90F5 F2F8 0EFE D694 6BC2

To claim this, I am signing this object:

@cr1901
cr1901 / main.c
Created October 14, 2015 18:57
OMF-LD Pattern Match
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
#define CHAR_ARRAY_2_SHORT_LE(_x) ((_x)[0] << 0) | ((_x)[1] << 8)
static char string_buf[256];
static char record_buf[1024];
@cr1901
cr1901 / gist:b3b527a070787e57873a
Created October 18, 2015 12:12
conda_h5py_errs.txt
[py35] F:\Consult\artiq\artiq>conda install h5py 1> ../conda_h5py_errs.txt 2>&1
Fetching package metadata: ........
Solving package specifications: ......
Error: Unsatisfiable package specifications.
Generating hint:
[ ]| | 0%
[ COMPLETE ]|##################################################| 100%
@cr1901
cr1901 / artiq-run.bat
Created October 22, 2015 10:21
artiq_master errors
set ARTIQ_ROOT=F:\Consult\artiq\artiq
start /b python %ARTIQ_ROOT%\artiq\frontend\artiq_master.py --device-db %ARTIQ_ROOT%\examples\master\device_db.pyon --dataset-db %ARTIQ_ROOT%\examples\master\dataset_db.pyon --repository %ARTIQ_ROOT%\examples\master\repository 2> master_err.log &
python %ARTIQ_ROOT%\artiq\frontend\artiq_gui.py
@cr1901
cr1901 / hdf518.log
Created October 22, 2015 10:54
hdf5 CMake log
[HANDLER_OUTPUT]
-- Found Subversion: C:/msys64/usr/bin/svn.exe (found version "1.8.13")
-- Dashboard script configuration:
CTEST_SITE=[WIN732-VS2015.XXXX]
CTEST_BUILD_NAME=[Windows-WIN7-vs2015-STATIC]
CTEST_SOURCE_DIRECTORY=[C:/Users/William/Downloads/HDF518CMake\hdf5-1.8.15-patch1]
CTEST_BINARY_DIRECTORY=[C:/Users/William/Downloads/HDF518CMake\build]
CTEST_CMAKE_GENERATOR=[Visual Studio 14 2015]
CTEST_BUILD_CONFIGURATION=[Release]
@cr1901
cr1901 / async.py
Last active January 11, 2019 17:34
quamash asyncio sample
import asyncio
import atexit
from quamash import QEventLoop, QtGui, QtCore
from pyqtgraph import dockarea # Will import PyQt5.QtGui.QApplication
class MainWindow(QtGui.QMainWindow):
def __init__(self, app, server):
QtGui.QMainWindow.__init__(self)
@cr1901
cr1901 / traceback.txt
Created November 17, 2015 18:16
ARTIQ Dock Error
===== 2015.11.17 12:11:55 =====
Traceback (most recent call last):
File "F:\Consult\artiq\artiq\artiq\frontend\artiq_gui.py", line 147, in <modul
e>
main()
File "F:\Consult\artiq\artiq\artiq\frontend\artiq_gui.py", line 138, in main
d_log0 = logmgr.first_log_dock()
File "f:\consult\artiq\artiq\artiq\gui\log.py", line 310, in first_log_dock
dock = self.create_new_dock(False)
File "f:\consult\artiq\artiq\artiq\gui\log.py", line 277, in create_new_dock
@cr1901
cr1901 / main.py
Last active December 10, 2015 13:04
PyQt4, 5, and quamash compatibility
import asyncio
import atexit
import os
from quamash import QEventLoop, QtGui, QtCore
from pyqtgraph import dockarea
# import scanwidget
class MainWindow(QtGui.QMainWindow):
def __init__(self, app, server):
@cr1901
cr1901 / main.py
Last active January 10, 2016 05:55
Debug Rebase for Scanwidget
import asyncio
import atexit
import os
import scanwidget
# First two are portable between PyQt4 and 5. Remaining are not.
from quamash import QApplication, QEventLoop, QtGui, QtCore, QtWidgets
@cr1901
cr1901 / freq_count.py
Last active January 27, 2016 08:49
Migen Frequency Counter
from migen.fhdl.std import *
from migen.genlib.fifo import AsyncFIFO
from migen.fhdl.bitcontainer import flen
from migen.fhdl import verilog
class FreqCounter(Module):
# measured_sig: Signal to measure frequency
# ref_clk: counts up to a gate_time number of cycles. It should be at least
# twice as fast as the maximum frequency of the measured signal to avoid