Skip to content

Instantly share code, notes, and snippets.

View ac101m's full-sized avatar

Alexander Cramb ac101m

  • r3
  • UK
View GitHub Profile
@ac101m
ac101m / camera-rotate.cpp
Created April 22, 2019 03:13
Camera rotation opengl
// member function changes direction camera is looking
void Camera::MoveLook(const float dx, const float dy, const float dr) {
// rotate cam.fwd & cam.right around cam.up by dx
this->fwd = glm::rotate(this->fwd, dx, this->up);
this->right = glm::rotate(this->right, dx, this->up);
// rotate cam.up & cam.fwd around cam.right by dy
this->up = glm::rotate(this->up, dy, this->right);
this->fwd = glm::rotate(this->fwd, dy, this->right);
@ac101m
ac101m / mpi-infiniband-stress.c
Last active December 11, 2018 05:27
stress test for the infiniband network
#include "stdio.h"
#include "stdlib.h"
#include "mpi.h"
#define ITERATION_COUNT 8192
#define BUFFER_SIZE 268435456
int main(int argc, char **argv) {
MPI_Init(&argc, &argv);
@ac101m
ac101m / dhcp-conf
Created December 1, 2018 18:57
The full configuration file for my dhcp server
# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;
# option definitions common to all supported networks.
option domain-name "my.lan";
option domain-name-servers 8.8.8.8, 8.8.4.4;
#include "mpi.h"
#include "stdio.h"
int main(int argc, char **argv) {
MPI_Init(&argc, &argv);
int totalRanks, myRank, nameLen;
char myName[MPI_MAX_PROCESSOR_NAME];
MPI_Comm_rank(MPI_COMM_WORLD, &myRank);