Skip to content

Instantly share code, notes, and snippets.

View synopse's full-sized avatar
🏠
Working from home

ab synopse

🏠
Working from home
View GitHub Profile
@zhongwen
zhongwen / eudist_sse.cc
Created November 2, 2012 18:25
Euclidean distance with SSE
static inline float euclidean_baseline_float(const int n, const float* x, const float* y){
float result = 0.f;
for(int i = 0; i < n; ++i){
const float num = x[i] - y[i];
result += num * num;
}
return result;
}
static inline float euclidean_intrinsic_float(int n, const float* x, const float* y){
@OrangeTide
OrangeTide / showif.c
Created April 8, 2011 02:59
example to list network interfaces on linux/bsd/osx/etc
/* showif.c : PUBLIC DOMAIN - Jon Mayo - August 22, 2006
* - You may remove any comments you wish, modify this code any way you wish,
* and distribute any way you wish.*/
/* finds all network interfaces and shows a little information about them.
* some operating systems list interfaces multiple times because of different
* flags, modes, etc. if you want to use this code you should be aware that
* duplicate interfaces is a possibility */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>