Skip to content

Instantly share code, notes, and snippets.

View cramja's full-sized avatar
💯

Marc S cramja

💯
View GitHub Profile
@cramja
cramja / example.cpp
Last active April 6, 2017 13:48
clang++ -std=c++14 example.cpp -o ex.out -lpthread
// A simple mutex-sharing scheme.
#include <assert.h>
#include <cstdlib>
#include <iostream>
#include <mutex>
#include <thread>
using namespace std;
@cramja
cramja / TestConcurrency.cpp
Created April 25, 2016 19:29
A snippet to show how to test the StorageManager interface using concurrency and brute-force. An even better test would be to automatically detect deadlock.
namespace storage_manager_test_internal {
static int client_id = 0;
static const int NUM_BLOBS_PER_CLIENT = 100;
static const int BLOB_SIZE_SLOTS = 1;
static const int CLIENT_CYCLES = 1000;
class StorageClient : public Thread {
public:
@cramja
cramja / remove_comments.py
Created June 10, 2016 19:32
This script removes unused header comments.
#!/usr/bin/python
# This script removes unused header comments. Notice that the file locations are hard coded,
# so change that.
import subprocess as sp
import re
import os
def main():
@cramja
cramja / gpdb_flags.py
Last active April 6, 2017 13:46
For manipulating GPDB/ORCA optimization flags
#! /usr/#!/usr/bin/env python
import subprocess
xforms = \
[
"CXformAntiSemiJoinAntiSemiJoinNotInSwap",
"CXformAntiSemiJoinAntiSemiJoinSwap",
"CXformAntiSemiJoinInnerJoinSwap",
"CXformAntiSemiJoinNotInAntiSemiJoinNotInSwap",
@cramja
cramja / ctest_diff.py
Last active August 12, 2016 13:50
usage: ctest -R your_test > test.out && python ctest_diff.py test.out
#!/usr/bin/env python
import sys
import re
import os
# regex for useful parts of the diff file
re_start_digits = re.compile(ur'^\d+: ', re.MULTILINE)
re_test_name = re.compile(ur'TRACE,"executing (.*mdp)",', re.MULTILINE)
re_actual = re.compile(ur'TRACE,"Actual:', re.MULTILINE)
@cramja
cramja / make-release.sh
Created February 20, 2017 22:17
Quickstep release alpha script
# Scripts for Releasing Quickstep
#
# Note: This script is a scratch pad with most of the relevent commands.
# Modify it to see fit. We'll finalize it when we understand the
# process better.
# PREREQS:
# - you must have previously created a gpg key using your apache username
# and uploaded it to a keyserver [http://quickstep.apache.org/release-signing/]
# - make sure someone in the group has validated your key
#
@cramja
cramja / qs-apache-rc-email-template.txt
Created March 4, 2017 15:53
Simple Apache Quickstep RC email template
Subject: [VOTE] Apache Incubating Quickstep {VERSION} RC{CANDIDATE}
This vote is for approval of the Quickstep-{VERSION} RC{CANDIDATE}.
Voters should download, unpack, build, and test the package before voting.
A +1 vote means that the package passes all tests and meets Apache guidelines.
A -1 vote should be accompanied with a short reason.
Votes will remain open for 3 days.
@cramja
cramja / d3_example_0.html
Created April 6, 2017 13:48
making some circles and lines in d3
<!DOCTYPE html>
<style>
button {
position: absolute;
top: 10px;
left: 10px;
}
circle {
@cramja
cramja / d3_example_1.html
Last active April 6, 2017 15:06
Example of updates with merging in d3
<!DOCTYPE html>
<meta charset="utf-8">
<style>
text {
font: bold 48px monospace;
}
.enter {
fill: green;
@cramja
cramja / LICENSE
Created June 15, 2017 03:21
auto
-------------------------- AUTONOMIC PROPRIETARY 1.0 --------------------------
Copyright (c) 2016, Autonomic Incorporated - All rights reserved
Proprietary and confidential.
NOTICE: All information contained herein is, and remains the property of
Autonomic Incorporated and its suppliers, if any. The intellectual and
technical concepts contained herein are proprietary to Autonomic Incorporated
and its suppliers and may be covered by U.S. and Foreign Patents, patents in