Skip to content

Instantly share code, notes, and snippets.

View VioletGiraffe's full-sized avatar

Violet Giraffe VioletGiraffe

View GitHub Profile
@VioletGiraffe
VioletGiraffe / main.cpp
Last active May 2, 2023 15:38 — forked from cos-public/main.cpp
classic win32 app with raii style window
#include <Windows.h>
#include <assert.h>
#include <cstdint>
#include <memory>
class main_window;
template <class WndT, class ParamsTuple>
LRESULT CALLBACK main_window_proc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
if (message == WM_CREATE) {
@VioletGiraffe
VioletGiraffe / install.sh
Last active March 10, 2024 17:23 — forked from adduc/install.sh
My installation of tortoisehg on Ubuntu 20.04 and newer
#!/bin/bash
TARGET_DIR=~/Downloads/repos/third-parties
TORTOISEHG_VERSION=${5:-stable}
prepare() {
sudo apt-get -y update
sudo apt-get -y install \
curl \
@VioletGiraffe
VioletGiraffe / linpack_bench.ino
Last active February 17, 2018 22:07 — forked from projectgus/linpack_bench.ino
Linpack Floating Point benchmark that runs as an Arduino sketch. (Yes, I know...)I wanted to generically measure Arduino Floating Point performance, this seemed like a reasonable(ish) way to do it. Runs with N=10, single precision, but produces sane looking results & residual. (89 Linpack kFLOPS on a Freetronics Eleven, ie Arduino Uno compatible…
#include <Arduino.h> // Not required for successful compilation, but required for PlatformIO/VS Code indexer to see symbols from this header
#include <math.h>
double benchmark ( void );
double cpu_time ( void );
void daxpy ( int n, double da, double dx[], int incx, double dy[], int incy );
double ddot ( int n, double dx[], int incx, double dy[], int incy );
int dgefa ( double a[], int lda, int n, int ipvt[] );
void dgesl ( double a[], int lda, int n, int ipvt[], double b[], int job );
void dscal ( int n, double sa, double x[], int incx );