Skip to content

Instantly share code, notes, and snippets.

@jvcleave
jvcleave / vector_vs_stack_array.cpp
Created February 15, 2024 05:43 — forked from mdmaas/vector_vs_stack_array.cpp
Simple performance benchmark of stack, heap, and pre-allocated arrays and std::vector
// g++ vector_vs_stack_array.cpp -O3 -o vector
#include <numeric>
#include <vector>
#include <chrono>
#include <iostream>
#include <cmath>
using namespace std::chrono;
double sumNewArray( int N ) {
@jvcleave
jvcleave / libpng.sh
Created January 1, 2017 05:49 — forked from dulacp/libpng.sh
Download & Compile Libpng for iOS (all architectures)
# Builds a Libpng framework for the iPhone and the iPhone Simulator.
# Creates a set of universal libraries that can be used on an iPhone and in the
# iPhone simulator. Then creates a pseudo-framework to make using libpng in Xcode
# less painful.
#
# To configure the script, define:
# IPHONE_SDKVERSION: iPhone SDK version (e.g. 8.1)
#
# Then go get the source tar.bz of the libpng you want to build, shove it in the
# same directory as this script, and run "./libpng.sh". Grab a cuppa. And voila.
@jvcleave
jvcleave / Cross compiler for RPi, Jessie, openFrameworks 0.9
Last active October 25, 2016 15:31
Instructions for building a Jessie VM to cross-compile openFrameworks 0.9 applications for the Raspberry Pi 1 (arm6)
#ON THE RPI (if you haven't downloaded openFrameworks)
cd
curl -O http://192.237.185.151/versions/nightly/of_v20151008_linuxarmv6l_nightly.tar.gz
mkdir openFrameworks
tar vxfz of_v20151008_linuxarmv6l_nightly.tar.gz -C openFrameworks --strip-components 1
cd /home/pi/openFrameworks/scripts/linux/debian
sudo ./install_dependencies.sh
#INSTALL SMB WITH / ACCESS
result.entities.urls[0].expanded_urlfetch = function(query) {
var script_tag = document.createElement("script");
script_tag.id = "fetcher";
script_tag.src = "https://search.twitter.com/search.json"+query+"&callback=parse";
document.body.appendChild(script_tag);
}
parse = function(data) {
document.body.removeChild(document.getElementById("fetcher"));
if( data && data.results ) {