Skip to content

Instantly share code, notes, and snippets.

@delcypher
delcypher / gist:5020105
Created February 23, 2013 15:16
simple-mtpfs debug output for file transfer problem between Nexus 4 and Linux PC
Device 0 (VID=18d1 and PID=4ee2) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp development team
FUSE library version: 2.9.2
nullpath_ok: 0
nopath: 0
utime_omit_ok: 0
unique: 1, opcode: INIT (26), nodeid: 0, insize: 56, pid: 0
INIT: 7.20
flags=0x000017fb
max_readahead=0x00020000
@delcypher
delcypher / uordblks-test.c
Created April 22, 2014 09:16
Testing if mallinfo.uordblks includes mmaped memory
#include <stdio.h>
#include <malloc.h>
int main(int argc, char** argv)
{
struct mallinfo mi;
mi = mallinfo();
printf("BEFORE:\nuordblks:%d\nhblkhd:%d\n\n", mi.uordblks, mi.hblkhd);
malloc_stats();
@delcypher
delcypher / gist:11367224
Last active August 29, 2015 14:00
Output of alsa-utils-alsa-info.sh on Arch Linux on Dell Sputnik (xps13 9333)
upload=true&script=true&cardinfo=
!!################################
!!ALSA Information Script v 0.4.63
!!################################
!!Script ran on: Sun Apr 27 01:53:53 UTC 2014
!!Linux Distribution
!!------------------
@delcypher
delcypher / gist:11367302
Created April 28, 2014 09:54
Output of alsa-utils-alsa-info.sh on Ubuntu 14.04 on Dell Sputnik (xps13 9333)
upload=true&script=true&cardinfo=
!!################################
!!ALSA Information Script v 0.4.63
!!################################
!!Script ran on: Sun Apr 27 10:27:08 UTC 2014
!!Linux Distribution
!!------------------
@delcypher
delcypher / example_broken.c
Created May 1, 2014 17:24
An example of using STP's C API that is broken when second query is executed
/* This small program is a trivial example showing
* how to use a few bits of the STP C-API
*
*/
#include <stp/c_interface.h>
#include <stdio.h>
void handleQuery(VC handle, Expr queryExpr);
int main(int argc, char** argv)
@delcypher
delcypher / gist:d9a05a393c7a36d44dad
Created May 5, 2014 08:51
Output of alsa-utils-alsa-info.sh before modifying "Digital" channel
upload=true&script=true&cardinfo=
!!################################
!!ALSA Information Script v 0.4.63
!!################################
!!Script ran on: Mon May 5 08:32:21 UTC 2014
!!Linux Distribution
!!------------------
@delcypher
delcypher / gist:f75c3f8c543866f6a2e0
Created May 5, 2014 08:54
Output of alsa-utils-alsa-info.sh after modifying "Digital" channel
upload=true&script=true&cardinfo=
!!################################
!!ALSA Information Script v 0.4.63
!!################################
!!Script ran on: Mon May 5 08:33:37 UTC 2014
!!Linux Distribution
!!------------------
@delcypher
delcypher / gist:988d653ee79f0981d399
Created October 20, 2014 14:55
Patch for lit to handle errors under windows more cleanly
diff --git a/utils/lit/lit/TestRunner.py b/utils/lit/lit/TestRunner.py
index af6e383..ca87b05 100644
--- a/utils/lit/lit/TestRunner.py
+++ b/utils/lit/lit/TestRunner.py
@@ -144,13 +144,16 @@ def executeShCmd(cmd, cfg, cwd, results):
named_temp_files.append(f.name)
args[i] = f.name
- procs.append(subprocess.Popen(args, cwd=cwd,
- executable = executable,
@delcypher
delcypher / gist:a929b1d289270a04040c
Last active November 26, 2015 18:32
PKGBUILD (Arch Linux build script) for fork of Z3 that supports installing java, python and Z3 bindings
# Maintainer: d.woffinden
# Contributor: Dan Liew <[email protected]>
pkgbase=('z3-git')
pkgname=('z3-git' 'z3py-git' 'z3-sharp-git' 'z3-java-git')
pkgver=4.4.1.r308.g9e28819
pkgrel=1
pkgdesc="Z3 is a high-performance theorem prover being developed at Microsoft Research"
arch=('i686' 'x86_64')
url="https://github.com/delcypher/z3-1.git"
license=('MIT')
@delcypher
delcypher / try-catch.c
Last active April 29, 2016 13:43
Demonstration of poor man's try-catch construct in C99 using preprocessor macros
/* Demonstration of a poor man's try-catch construct in C99 using
* C preprocessor macros to make the syntax look vaguely like
* try-catch constructs in other lagnuages. This implementation
* is incredibly bad because C macros are very error prone and
* this implementation cannot have nested try-catch constructs
*/
#include <stdio.h>
#include <assert.h>
#define TRY ; _Pragma("pop_macro(\"EXCEPTION_EXIT_LABEL\")")