Skip to content

Instantly share code, notes, and snippets.

View ncorgan's full-sized avatar

Nicholas Corgan ncorgan

View GitHub Profile
@ax3l
ax3l / CXXdefaults.md
Last active February 26, 2025 14:50
Compiler C++ Version Defaults

C++ -std=... default of various commonly used C++ compilers

Compiler Version __cplusplus
g++ 4.7.4 199711L
5.5.0 199711L
6.1.0 201402L
10.2 201402L
11.1.0 201703L
clang++ 3.4.2 199711L
@GaryLee
GaryLee / fft_analyze.py
Last active October 11, 2020 15:45
Do DFT and plot with Bokeh.
from bokeh.plotting import figure, output_file, vplot, show
import numpy as np
import random
n = 1024
a = 1.0
sample_period = 0.001
t = np.linspace(0, n * sample_period, n)
dt = t[1] - t[0]
data = np.abs(np.sin(t * 2 * np.pi) * a)
@charz
charz / Sample for p4python
Created December 18, 2013 02:47
Login to Perforce server, create a workspace and sync code to specific changelist number.
#!/env/bin/python
from P4 import P4, P4Exception
import json
p4 = P4()
p4.user = "charz"
p4.password = "mypassword"
p4.port = "tcp:192.168.1.2:1666"
p4.client = "auto-build"
@kazupon
kazupon / Makefile
Created September 25, 2012 17:16
lua: native C-API coroutine sample
INCDIR = $(HOME)/opt/local/include/luajit-2.0
LIBDIR = $(HOME)/opt/local/lib
LIB = -lluajit-51
all: native
native:
cc --std=c99 -o native-co native.c -I$(INCDIR) -L$(LIBDIR) $(LIB) -pagezero_size 10000 -image_base 100000000
clean:
@andref
andref / main.cpp
Created May 30, 2012 19:47
Calling QMetaMethods with QVariant arguments and best-effort type conversion
#include <QtCore>
#include <QtDebug>
QVariant call(QObject* object, QMetaMethod metaMethod, QVariantList args)
{
// Convert the arguments
QVariantList converted;
// We need enough arguments to perform the conversion.