__m128 _mm_load_ps (float * a)
{
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
String.prototype.strspn = function (chars, start, length) { | |
var end; | |
if (start == undefined) | |
start = 0; | |
else if (start < 0) | |
start += this.length; | |
if (length == undefined) | |
length = this.length; |
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
import Foundation | |
/** | |
* CGAffineTransform | |
* | |
* var a = CGAffineTransformMakeRotation(45.0 * M_PI / 180.0) | |
* var b = CGPointMake(30.0, 43.3) | |
*/ | |
/** |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <Block.h> | |
/** | |
* Compare strings using natural ordering | |
* | |
* Interprets continuous digits as integers, e.g, the string "year 2015" will be | |
* greater than "year 308", although "3" has a higher character value than "2". | |
* [Trailing and pending whitespace is ignored.] Whitespace between tokens is |
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
/** | |
* Bitfield function collection | |
* | |
* Can be used to define variables which require more bits than the biggest data | |
* type can hold. Bits are organized within multiple `slots` which is an array | |
* of the biggest integer type available. | |
* | |
* However, multiple bits cannot overlap two slots: | |
* bit_get_field (mybits, 62, 8) will only contain bits from the first slot | |
* |
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
#include <cstdint> | |
#include <iostream> | |
struct Endian { | |
constexpr static bool is_big() { | |
union { | |
uint32_t i; | |
uint8_t c[4]; | |
} check = { | |
.i = 0x01000000 |
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
#if 0 | |
clang -Wall -O2 -o /tmp/`basename $0` $0 && /tmp/`basename $0` $@; exit | |
#endif | |
// | |
// sh run-in-shell.c `whoami` | |
// | |
#include <stdio.h> |
I hereby claim:
- I am detomon on github.
- I am detomon (https://keybase.io/detomon) on keybase.
- I have a public key ASDSgRQCCkC9JCQ1gus0l45K4_e73TPja93u5Xypmsq6Uwo
To claim this, I am signing this object:
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
#include <stdio.h> | |
/** | |
* Emulate Swift enum type. | |
*/ | |
typedef struct { | |
// define enum types | |
// (enums inside structs are not really private) | |
enum { | |
MyEnumInt, |
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
#define VALUE_REF(S) (&((struct { typeof(S) s; }) { (S) }).s) | |
typedef struct { | |
int a; | |
int b; | |
} value; | |
int* i = VALUE_REF(12); | |
float* f = VALUE_REF(45.6f); | |
value* v = VALUE_REF(((value) { .a = 12, .b = 13 })); |
OlderNewer