Skip to content

Instantly share code, notes, and snippets.

View kgryte's full-sized avatar
😃
Working on stdlib...

Athan kgryte

😃
Working on stdlib...
View GitHub Profile
@ashelly
ashelly / mediator.c
Created May 28, 2013 20:36
Running Median. Finds the median of the last K inputs in O(lg K). See http://stackoverflow.com/q/5527437/10396 for some details.
//Copyright (c) 2011 ashelly.myopenid.com under <http://www.opensource.org/licenses/mit-license>
#include <stdlib.h>
//Customize for your data Item type
typedef int Item;
#define ItemLess(a,b) ((a)<(b))
#define ItemMean(a,b) (((a)+(b))/2)
typedef struct Mediator_t
@xianyi
xianyi / time_dgemm_int64.c
Created June 14, 2013 00:30
timming dgemm with int64 interface.
#include "stdio.h"
#include "stdlib.h"
#include "sys/time.h"
#include "time.h"
extern void dgemm_(char*, char*, long*, long*,long*, double*, double*, long*, double*, long*, double*, double*, long*);
long main(long argc, char* argv[])
{
long i;
@xianyi
xianyi / time_dgemm.c
Created June 14, 2013 07:07
timming dgemm gcc -o time_dgemm time_dgemm.c /your/path/libopenblas.a ./time_dgemm <m> <n> <k> e.g. ./time_dgemm 1000 1000 1000
#include "stdio.h"
#include "stdlib.h"
#include "sys/time.h"
#include "time.h"
extern void dgemm_(char*, char*, int*, int*,int*, double*, double*, int*, double*, int*, double*, double*, int*);
int main(int argc, char* argv[])
{
int i;
@xianyi
xianyi / time_clbas_dgemm.c
Created June 14, 2013 16:17
timing cblas dgemm.
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <time.h>
#include "cblas.h"
int main(int argc, char* argv[])
{
int i;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pmeenan
pmeenan / user-timing-rum.js
Last active January 18, 2024 23:46
Support routine for adding W3C user timing events to a site. Includes some basic polyfill support for browsers that don't support user timing or navigation timing (though the start time for non-navigation timing support could be improved with IE < 9 to use IE's custom start event).
// Support routines for automatically reporting user timing for common analytics platforms
// Currently supports Google Analytics, Boomerang and SOASTA mPulse
// In the case of boomerang, you will need to map the event names you want reported
// to timer names (for mPulse these need to be custom0, custom1, etc) using a global variable:
// rumMapping = {'aft': 'custom0'};
(function() {
var wtt = function(n, t, b) {
t = Math.round(t);
if (t >= 0 && t < 3600000) {
// Google Analytics
@hlvoorhees
hlvoorhees / README.md
Last active March 12, 2023 07:55
3D scatter plot using d3, x3dom

Example 3D scatter plot implemented using d3 and x3dom.

@widged
widged / d3lib.md
Created October 4, 2013 03:29
d3 libraries

chartFactory

/affini-tech/ChartFactory

Based on D3.JS and Dimple, ChartFactory provide the ability to build quickly D3.JS charts without coding any lines of javascript. Just define your dashboard in a JSON and voila !

charts: [
        {id:'chart1',
         width:800,height:250,

xAxis:{type:'Category',field: "Month",orderRule:'Date'},

@panzi
panzi / portable_endian.h
Last active August 9, 2024 13:12
This provides the endian conversion functions form endian.h on Windows, Linux, *BSD, Mac OS X, and QNX. You still need to use -std=gnu99 instead of -std=c99 for gcc. The functions might actually be macros. Functions: htobe16, htole16, be16toh, le16toh, htobe32, htole32, be32toh, le32toh, htobe64, htole64, be64toh, le64toh. License: I hereby put …
// "License": Public Domain
// I, Mathias Panzenböck, place this file hereby into the public domain. Use it at your own risk for whatever you like.
// In case there are jurisdictions that don't support putting things in the public domain you can also consider it to
// be "dual licensed" under the BSD, MIT and Apache licenses, if you want to. This code is trivial anyway. Consider it
// an example on how to get the endian conversion functions on different platforms.
#ifndef PORTABLE_ENDIAN_H__
#define PORTABLE_ENDIAN_H__
#if (defined(_WIN16) || defined(_WIN32) || defined(_WIN64)) && !defined(__WINDOWS__)
# Dumb Guy's Statistical Analysis of the Diehard RNG Suite's Craps Test
## Test Description
Craps is a series of rolls of 2 dice, where you win on the first roll
when the sum of the dice is 7 or 11, or lose when it's 2, 3, or 12. If
you roll any other number on the first roll, that is the point you
have to make on subsequent rolls. If you hit that number again, you
win. Otherwise, if you roll 7 you lose.