Skip to content

Instantly share code, notes, and snippets.

View warmwaffles's full-sized avatar
🛠️
Code Wrestling

Matthew Johnston warmwaffles

🛠️
Code Wrestling
View GitHub Profile
#pragma once
#include <stdlib.h>
#include <stdio.h>
#define MU_ANSI_BLACK "\033[0;30m"
#define MU_ANSI_RED "\033[0;31m"
#define MU_ANSI_GREEN "\033[0;32m"
#define MU_ANSI_YELLOW "\033[0;33m"
#define MU_ANSI_BLUE "\033[0;34m"
FROM nfnty/arch-mini
# This is a dockerfile meant for people who are trying to cross compile their C projects
# into windows binaries to ensure things actually compile correctly
RUN pacman -Syyu --noconfirm
RUN pacman -S --noconfirm git curl jshon expac yajl wget unzip cmake
RUN pacman -S --noconfirm --needed base-devel
RUN useradd -mg root travis

Object Files (.obj)

Object files define the geometry and other properties for objects in Wavefront's Advanced Visualizer. Object files can also be used to transfer geometric data back and forth between the Advanced Visualizer and other applications.

Object files can be in ASCII format (.obj) or binary format (.mod). This appendix describes the ASCII format for object files. These files must have the extension .obj.

@warmwaffles
warmwaffles / latency.markdown
Created December 9, 2015 06:36 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

require 'pp'
class Model
def initialize(args={})
set(args)
end
def set(attributes={})
return if attributes.nil? || attributes.empty? || !attributes.is_a?(Hash)
attributes.each do |k, v|
#ifndef _COMMON_H
#define _COMMON_H
#include <math.h>
#define square(v) ((v) * (v))
#define cube(v) ((v) * (v) * (v))
#define deg_to_rad(deg) ((deg) * (M_PI / 180.0))
#define rad_to_deg(rad) ((rad) * (180.0 / M_PI))
#include <stdint.h>
#include <string.h>
uint32_t float_to_raw_bits(float x)
{
uint32_t y;
memcpy(&y, &x, 4);
return y;
}
/*
* Generic hashmap manipulation functions
* SEE: http://elliottback.com/wp/hashmap-implementation-in-c/
*/
#ifndef __HASHMAP_H__
#define __HASHMAP_H__
#define MAP_MISSING -3 /* No such element */
#define MAP_FULL -2 /* Hashmap is full */
.
├── assets
├── build
│   ├── book.epub
│   ├── book.epub3
│   └── book.html
├── Rakefile
├── scratch
├── src
│   ├── backmatter
#ifndef UTILS_LOGGING_H
#define UTILS_LOGGING_H
#include <stdio.h>
/**
* Default logging level will be INFO
*/
#ifndef LOGLEVEL
#define LOGLEVEL 4