Skip to content

Instantly share code, notes, and snippets.

# run this directly in the db console
# for example for hungarian fidesz:
# for m, s, e, p in vote_ratio('Fidesz-Magyar Polgári Szövetség-Kereszténydemokrata Néppárt'): print(f"{m} {p:.2f}%")
# for more info how to play with parltrack data locally see
# https://parltrack.org/blog/playing-with-the-data-locally.html
# and other follow-up blogposts
def vote_ratio(target):
return [(m['Name']['full'],
c['start'],
c['end'],
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
CLIntercept (64-bit) is loading...
CLIntercept file location: /home/s/qwer/opencl-intercept-layer/build/cliloader/../intercept/libOpenCL.so
CLIntercept URL: https://github.com/intel/opencl-intercept-layer
CLIntercept git description: v3.0.0-23-g25557bb
CLIntercept git refspec: refs/heads/master
CLIntercept git hash: 25557bbc018308923975efeeb481e51521ea61df
CLIntercept optional features:
cliloader(supported)
cliprof(supported)
Number of platforms 2
Platform Name Intel(R) OpenCL HD Graphics
Platform Vendor Intel(R) Corporation
Platform Version OpenCL 3.0
Platform Profile FULL_PROFILE
Platform Extensions cl_khr_byte_addressable_store cl_khr_fp16 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_icd cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_intel_subgroups cl_intel_required_subgroup_size cl_intel_subgroups_short cl_khr_spir cl_intel_accelerator cl_intel_driver_diagnostics cl_khr_priority_hints cl_khr_throttle_hints cl_khr_create_command_queue cl_intel_subgroups_char cl_intel_subgroups_long cl_khr_il_program cl_intel_mem_force_host_memory cl_khr_fp64 cl_khr_subgroups cl_intel_spirv_device_side_avc_motion_estimation cl_intel_spirv_media_block_io cl_intel_spirv_subgroups cl_khr_spirv_no_in
TbxServer = 127.0.0.1
ProductFamilyOverride = unk
HardwareInfoOverride = default
ForceCompilerUsePlatform = unk
AUBDumpBufferFormat = unk
AUBDumpImageFormat = unk
AUBDumpCaptureFileName = unk
AUBDumpFilterKernelName = unk
AUBDumpToggleFileName = unk
OverrideGdiPath = unk
cmake_minimum_required(VERSION 3.8)
project(clenabled-intel-racecond-trigger)
include_directories(
${GNURADIO_ALL_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
)
set(GR_LIBRARIES
boost_system
aW1wb3J0IHJlcXVlc3RzCmZyb20gdXJsbGliMy5leGNlcHRpb25zIGltcG9ydCBJbnNlY3VyZVJl
cXVlc3RXYXJuaW5nCmltcG9ydCByYW5kb20KaW1wb3J0IHN0cmluZwppbXBvcnQgc3lzCgoKZGVm
IGlkX2dlbmVyYXRvcihzaXplPTYsIGNoYXJzPXN0cmluZy5hc2NpaV9sb3dlcmNhc2UgKyBzdHJp
bmcuZGlnaXRzKToKICAgIHJldHVybiAnJy5qb2luKHJhbmRvbS5jaG9pY2UoY2hhcnMpIGZvciBf
IGluIHJhbmdlKHNpemUpKQoKaWYgbGVuKHN5cy5hcmd2KSA8IDI6CglwcmludCgiVXNhZ2U6IHB5
dGhvbiBQb0MucHkgPHRhcmdldD4gPGVtYWlsPiIpCglwcmludCgiRXhhbXBsZTogcHl0aG9uIFBv
Qy5weSBtYWlsLmV2aWwuY29ycCBoYXhvckBldmlsLmNvcnAiKQoJZXhpdCgpCnJlcXVlc3RzLnBh
Y2thZ2VzLnVybGxpYjMuZGlzYWJsZV93YXJuaW5ncyhjYXRlZ29yeT1JbnNlY3VyZVJlcXVlc3RX
YXJuaW5nKQp0YXJnZXQgPSBzeXMuYXJndlsxXQplbWFpbCA9IHN5cy5hcmd2WzJdCnJhbmRvbV9u
YW1lID0gaWRfZ2VuZXJhdG9yKDMpICsgIi5qcyIKdXNlcl9hZ2VudCA9ICJNb3ppbGxhLzUuMCAo
@stef
stef / racecond.py
Created March 8, 2021 16:24
gnuradio3.8/gr-clenabled/intel-opencl-icd runtime crash test-cases
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# SPDX-License-Identifier: GPL-3.0
#
# GNU Radio Python Flow Graph
# Title: trigger cl racecondition
# GNU Radio version: 3.8.1.0
{
"cells": [
{
"cell_type": "code",
"execution_count": 80,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
@stef
stef / onedir.py
Last active August 29, 2015 14:15
implements simple one-way encryption pipe using rsa and keccak-based spongewrap
#!/usr/bin/env python
#
# implements simple one-way encryption pipe using rsa and keccak-based
# spongewrap
#
# useful at least in the following use-case: you have an untrusted
# host on which plaintext data arrives, which you want to encrypt
# before it is forwarded in a hostile environment to the final
# recipient holding a private key in a safe location. In this one-way
# setting the recipient is never talking to the host doing the
@stef
stef / mlint.py
Last active October 26, 2015 21:08
analyzes emails for netiquette
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# (c) 2014, stf - AGPLv3+
# analyzes emails for netiquette
#
# invoke with mlint <emailcontainer> [<format>]
#
# where format is "mail" for raw mails, "mbox" for mbox files, if
# omitted the default is Maildir containers
#