Skip to content

Instantly share code, notes, and snippets.

View xiaoqiangwang's full-sized avatar

Xiaoqiang Wang xiaoqiangwang

  • Paul Scherrer Institut
  • Villigen PSI
View GitHub Profile
@xiaoqiangwang
xiaoqiangwang / gentl.py
Last active May 16, 2025 17:47
GenTL access wrapped in Python CFFI
import re
import sys
from cffi import FFI
ffi = FFI()
ffi.cdef("""
typedef uint8_t bool8_t;
@xiaoqiangwang
xiaoqiangwang / default_gcc_glibc_in_distros.md
Last active February 25, 2025 13:19
Default GCC and GLIBC version in major Linux distributions
DISTRO GCC GLIBC KERNEL
Debian 10 8.3.0 2.28 4.19
Debian 11 10.2.1 2.31 5.10
Debian 12 12.2.0 2.36 6.1
Debian 13 14.2.0 2.40 6.12
Ubuntu 18.04 7.5.0 2.27 4.15
Ubuntu 20.04 9.3.0 2.31 5.4
Ubuntu 22.04 12.2.0 2.35 5.15
@xiaoqiangwang
xiaoqiangwang / sidebar_demo.qml
Last active December 3, 2021 07:42
QtQuick ListView used as a sidebar
import QtQuick 2.7
import QtQuick.Layouts 1.12
import QtQuick.Controls 2.12
import QtQuick.Templates 2.12 as T
Rectangle {
border.color: 'black'
width: 500
height: 400
anchors.centerIn: parent
RF 433MHz
=========
RCSwtich
pulse length 500us
On: 9867397
Off: 9867393
Min: 9867398
Max: 9867395
@xiaoqiangwang
xiaoqiangwang / client.py
Created May 16, 2017 07:08
python object via channel access
#!/usr/bin/env python
import pickle
from CaChannel import ca, CaChannel
chan = CaChannel('MTEST:OBJECT')
chan.searchw()
a = chan.getw(ca.DBR_STRING)
pvdb = pickle.loads(a)
from CaChannel import CaChannel
names = []
for i in range(1, 17):
for s in ('F', 'B'):
for j in range(1, 4):
names.append('S%d%s:TEMP:TEMP%02d' % (i, s, j))
names.append('S%d%s:RH' % (i, s))
# create the PVs
@xiaoqiangwang
xiaoqiangwang / ca_sg_test.cpp
Created March 9, 2017 12:10
test of ca sync group
#include "cadef.h"
int main(int argc, char **argv)
{
CA_SYNC_GID gid;
chanId chid;
double value;
int status;
// preemptive disabled, no hang up
Skip to content
All gists
GitHub
0
@xiaoqiangwang xiaoqiangwang/devDxp diff Secret
Created 13 seconds ago
#include <stdlib.h>
#include <iostream>
#include <vector>
#include <list>
#include "wseswrappermain.h"
#include "werror.h"
int main(int argc, char **argv)
{
if (argc != 3) {