__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
// float->half variants. | |
// by Fabian "ryg" Giesen. | |
// | |
// I hereby place this code in the public domain, as per the terms of the | |
// CC0 license: | |
// | |
// https://creativecommons.org/publicdomain/zero/1.0/ | |
// | |
// float_to_half_full: This is basically the ISPC stdlib code, except | |
// I preserve the sign of NaNs (any good reason not to?) |
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
/* | |
* Copyright (c) 2012 Brandon Jones | |
* | |
* This software is provided 'as-is', without any express or implied | |
* warranty. In no event will the authors be held liable for any damages | |
* arising from the use of this software. | |
* | |
* Permission is granted to anyone to use this software for any purpose, | |
* including commercial applications, and to alter it and redistribute it | |
* freely, subject to the following restrictions: |
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
char* intToStr(int value) | |
{ | |
int divisor = 1; | |
int bufferLength = 1; | |
int isNegative = 0; | |
int bufferIndex = 0; | |
// Handle the negative value case by remebering that the number is negative | |
// and then setting it positive | |
if(value < 0) |
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
/** | |
* IE 5.5+, Firefox, Opera, Chrome, Safari XHR object | |
* | |
* @param string url | |
* @param object callback | |
* @param mixed data | |
* @param null x | |
*/ | |
function ajax(url, callback, data, x) { | |
try { |
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
/* | |
Check SSE/AVX support. | |
This application can detect the instruction support of | |
SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, SSE4a, SSE5, and AVX. | |
*/ | |
#include <iostream> | |
#ifdef _MSC_VER | |
#include <intrin.h> | |
#endif |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
</body> | |
</html> |
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
/** | |
* @author mrdoob / http://mrdoob.com/ | |
*/ | |
function html2canvas( element ) { | |
var range = document.createRange(); | |
function getRect( rect ) { |
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 <errno.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <assert.h> | |
#include <string.h> | |
#define streq(a, b) (!strcmp((a), (b))) | |
#ifndef __USE_GNU | |
#define __USE_GNU |
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
// ---- loading a font | |
static void load_font(void) | |
{ | |
hb_blob_t *blob; | |
hb_face_t *face; | |
size_t filelen = 0; | |
void *filedata = stb_file("c:/windows/fonts/arial.ttf", &filelen); | |
if (filedata == 0) stbpg_fatal("Couldn't load font"); |
OlderNewer