Skip to content

Instantly share code, notes, and snippets.

View adragomir's full-sized avatar

Andrei Dragomir adragomir

View GitHub Profile
#define _CRT_SECURE_NO_WARNINGS
#include <string.h>
#include <stdio.h>
#include <windows.h>
#pragma warning (disable: 4146)
#include <stdint.h>
#ifdef _DEBUG
#define Assert(x) \
if (!(x)) { MessageBoxA(0, #x, "Assertion Failure", MB_OK); __debugbreak(); }
@adragomir
adragomir / api.md
Created August 13, 2017 13:42 — forked from vurtun/api.md
API Design: Modular Data-oriented processes

API Design: Modular Data-oriented processes (June-2017)

This is the second entry in my series about API design. While I wrote about granularity and request based APIs in my last post I want to write about API design and code architecture for modular data-oriented process this time. This is basically the write up of my findings while writing and finishing the core of my current GUI research quarks.

Actually sparking my interest for writing up my findings however was rasmusbarr@github (rasmusbarr@twitter) releasing his small data-oriented and SIMD-optimized 3D rigid body physics library. I noticed a lot of overlap in design between his physics and my GUI library and wanted to write up some general thoughts about what seems

things I don't know

I took this list from What CS majors should know.

I think it is fun to list things I don't know so I did it =D. I actually found it to be a cool exercise -- maybe I should do a fun graphics project and learn about Open GL!

i wrote this because, while i think the things on this list are potentially worth knowing, and I actually think it's an awesome list of project ideas as well as good food for thought for people developing CS curricula (many of the things I don't know are great exercises!) -- I thought it was really weird to say that every CS student should know all of them. I have a CS degree and I learned very few of the things I do know inside my degree.

I classify "do know" as anything that I have a reasonable grasp of or at least some basic experience with -- the kind of experience I'd expect a CS student to be able to get. If I say I don't know something, it means either I know pretty much nothing about it (for "gr

#include <assert.h>
#include <stddef.h>
#include <stdio.h>
#include <stdint.h>
#define tag(x) ((ptrdiff_t)&Tag##x)
#define is(x, T) ((x)->tag == tag(T))
#define as(x, T) ((struct T *)variant_cast((void *)(x), tag(T)))
static inline void*
@adragomir
adragomir / vex.s
Created July 10, 2017 21:48 — forked from pervognsen/vex.s
.globl _parse
.align 4, 0x90
_parse: ## @parse
.cfi_startproc
## BB#0:
push rbp
Ltmp8:
.cfi_def_cfa_offset 16
Ltmp9:
.cfi_offset rbp, -16
The Mosh and Quake 3 Networking Models and State Synchronization Algebra
========================================================================
Mosh is a new remote shell program and protocol: https://mosh.org/
You may read technical details about its internals here:
https://www.usenix.org/system/files/login/articles/winstein.pdf
https://mosh.org/mosh-paper.pdf
@adragomir
adragomir / interview-questions.md
Created July 10, 2017 21:30 — forked from jvns/interview-questions.md
A list of questions you could ask while interviewing

A lot of these are outright stolen from Edward O'Campo-Gooding's list of questions. I really like his list.

I'm having some trouble paring this down to a manageable list of questions -- I realistically want to know all of these things before starting to work at a company, but it's a lot to ask all at once. My current game plan is to pick 6 before an interview and ask those.

I'd love comments and suggestions about any of these.

I've found questions like "do you have smart people? Can I learn a lot at your company?" to be basically totally useless -- everybody will say "yeah, definitely!" and it's hard to learn anything from them. So I'm trying to make all of these questions pretty concrete -- if a team doesn't have an issue tracker, they don't have an issue tracker.

I'm also mostly not asking about principles, but the way things are -- not "do you think code review is important?", but "Does all code get reviewed?".

#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include <windows.h>
typedef struct {
char *start;
char *current;
char *end;
@adragomir
adragomir / gob.h
Created July 10, 2017 19:56 — forked from pervognsen/gob.h
gob.h
// My investigations on the C standard compliance of Gob and related techniques:
// https://gist.github.com/pervognsen/5249a405fe7d76ded1cf08ed50fa9176
#pragma once
#include <stdint.h>
#pragma pack(push, 8)
#if __cplusplus >= 201103L || (__cplusplus && _MSC_VER >= 1900)
//Projection Matrix
mat4x4 mP = perspective_matrix(45.0, 1, 0.1, 100);
//Translation
mat4x4 mT = mat4x4::translation(float3(0, 0, -14));
//Rotation
mat4x4 mR = rotation_matrix_degrees(Rotation, float3(0, 1, 0));
//View matrix
mat4x4 mV = lookat_matrix(float3(0.0, 0.0, -3.0), float3(0, 0, -3), float3(0, 1, 0));
mV = transpose(mV);
//WorldViewProjection