Skip to content

Instantly share code, notes, and snippets.

@t-bltg
t-bltg / stacktrace.cxx
Created December 5, 2021 12:26 — forked from fmela/stacktrace.cxx
A C++ function that produces a stack backtrace with demangled function & method names.
/*
* Copyright (c) 2009-2017, Farooq Mela
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
@t-bltg
t-bltg / Test.md
Last active September 5, 2021 13:15

UnicodePlots

License Coverage Status

Julia CI
v1 CI
nightly CI (Julia nightly)
@t-bltg
t-bltg / gist:267242115cae05cd7526ff2a475eb723
Last active February 3, 2021 18:17
strace.py --trace-clone --trace-exec --fork -o log ./test.py
execve($SRC_DIR/test.py, ['$SRC_DIR/test.py'], [/* 40 vars */]) = 2215191
[2215191] brk(0) = 94771182006272 (0x00005631a2a37000)
[2215191] arch_prctl(0x0000000000003001, 0x00007fffd1e448a0, 0x00007fba205712c0, 0x00007fba205798b8, 0x0000000000000003, 0x00007fba20571fb1) = -22 EINVAL (Invalid argument)
[2215191] access('/etc/ld.so.preload', <R_OK> (4)) = -2 ENOENT (No such file or directory)
[2215191] openat(AT_FDCWD, '/etc/ld.so.cache', O_RDONLY|O_CLOEXEC (0o2000000)) = 3
[2215191] fstat(3, 0x00007fffd1e43aa0) = 0
[2215191] mmap(0, 122605, <PROT_READ> (1), 2, 3, 0) = 140437382983680 (0x00007fba20537000)
[2215191] close(3) = 0
[2215191] openat(AT_FDCWD, '/lib/x86_64-linux-gnu/libc.so.6', O_RDONLY|O_CLOEXEC (0o2000000)) = 3
[2215191] read(3, 0x00007fffd1e43c48, 832) = 832 (0x0000000000000340)
@t-bltg
t-bltg / OOP_F2003_Part_1.md
Created February 2, 2018 16:10 — forked from n-s-k/OOP_F2003_Part_1.md
Object-Oriented Programming in Fortran 2003 Part 1: Code Reusability
@t-bltg
t-bltg / OOP_F2003_Part_2.md
Created February 2, 2018 16:10 — forked from n-s-k/OOP_F2003_Part_2.md
Object-Oriented Programming in Fortran 2003 Part 2: Data Polymorphism

Object-Oriented Programming in Fortran 2003 Part 2: Data Polymorphism

Original article by Mark Leair, PGI Compiler Engineer

Note: This article was revised in March 2015 and again in January 2016 to bring it up-to-date with the production software release and to correct errors in the examples.

This is Part 2 of a series of articles:

@t-bltg
t-bltg / X264Encoder.cpp
Created November 17, 2017 15:37 — forked from roxlu/X264Encoder.cpp
X264 encoder example
#include <roxlu/core/Log.h>
#include <roxlu/core/Utils.h>
#include <video/X264Encoder.h>
X264Encoder::X264Encoder()
:in_width(0)
,in_height(0)
,in_pixel_format(AV_PIX_FMT_NONE)
,out_width(0)
,out_height(0)
@t-bltg
t-bltg / pca_animation.m
Created October 29, 2017 11:52 — forked from anonymous/pca_animation.m
Matlab code to produce PCA animations
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Matlab code to produce PCA animations shown here:
% http://stats.stackexchange.com/questions/2691
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Static image
clear all
rng(42)
@t-bltg
t-bltg / static_server.py
Created August 20, 2017 14:21
simple http server from providing lcoal files
#!/usr/bin/env python3.6
'''
Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
see: https://gist.github.com/UniIsland/3346170
'''
@t-bltg
t-bltg / static_server.js
Created May 25, 2017 17:14 — forked from ryanflorence/static_server.js
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
// stackoverflow.com/a/13635318
// gist.github.com/ryanflorence/701407
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
@t-bltg
t-bltg / cs.h
Created March 3, 2017 22:37 — forked from rmcgibbo/LICENSE
Parallel Sparse Matrix Dense Matrix Product in C/Cython/Python.
#ifndef _CS_H
#define _CS_H
#include <stdlib.h>
// #include <stdint.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stddef.h>
#ifdef MATLAB_MEX_FILE
#include "mex.h"