This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//// TODO :: 3. Clean up | |
//// 4. Events | |
//// 5. Create a colormap | |
//// 6. glx ? | |
#ifdef DEBUG | |
#include <sys/socket.h> | |
#include <sys/ioctl.h> | |
#include <sys/un.h> | |
#include <sys/select.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// by alex evans, 2011. released into the public domain. | |
// based on a first ever reading of the png spec, it occurs to me that a minimal png encoder should be quite simple. | |
// this is a first stab - may be buggy! the only external dependency is zlib and some basic typedefs (u32, u8) | |
// | |
// VERSION 0.02! now using zlib's crc rather than my own, and avoiding a memcpy and memory scribbler in the old one | |
// by passing the zero byte at the start of the scanline to zlib first, then the original scanline in place. WIN! | |
// | |
// more context at http://altdevblogaday.org/2011/04/06/a-smaller-jpg-encoder/. | |
// | |
// follow me on twitter @mmalex http://twitter.com/mmalex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Not sure whether it's faster than FindFirstFile, etc. - but it does it in one kernel call | |
#include <windows.h> | |
#include <stdio.h> | |
// to compile: | |
// cl fileinfo.c setargv.obj | |
void fileinfo(const char*name); | |
int main( int argc, const char* argv[] ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// float->sRGB8 conversions - two variants. | |
// by Fabian "ryg" Giesen | |
// | |
// I hereby place this code in the public domain. | |
// | |
// Both variants come with absolute error bounds and a reversibility and monotonicity | |
// guarantee (see test driver code below). They should pass D3D10 conformance testing | |
// (not that you can verify this, but still). They are verified against a clean reference | |
// implementation provided below, and the test driver checks all floats exhaustively. | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2275613/hack.sh | sh | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//based on code from http://www.arcfn.com/2009/03/y-combinator-in-arc-and-java.html and the generic version https://gist.github.com/2571928 | |
class YFact { | |
// T function returning a T | |
// T -> T | |
public static interface Func<T> { | |
T apply(T n); | |
} | |
// Higher-order function returning a T function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* --- Usage --- */ | |
g++ server.c -o server | |
g++ client.c -o client | |
./server | |
./client 127.0.0.1 | |
/* --- server.c --- */ | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use warnings; | |
use Getopt::Std; | |
getopt('xytGgwsf',\%opts); | |
# pcm file = $opts{f} | |
# samples per pixel x | |
$xscale = $opts{x} // 1200; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Data was collected with: | |
time caffeinate ./runall.sh 4d9bf949e0fd6976725dea12bcc254fd39da6490 master ./gettime.sh | tee time.csv | |
$ cat runall.sh | |
#!/bin/bash | |
# | |
# This script runs a given command over a range of Git revisions. Note that it | |
# will check past revisions out! Exercise caution if there are important |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MIT License | |
Copyright (c) 2019 endolith | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
OlderNewer