This file contains hidden or 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
source "http://rubygems.org" | |
octokit | |
This file contains hidden or 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 <ostream> | |
#include <algorithm> | |
void save_8bpp_image_as_PGM( | |
std::ostream& out, | |
const uint8_t* image_data, | |
size_t width, | |
size_t height, | |
size_t bytes_per_row | |
) { |
This file contains hidden or 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
#ifdef GL_ES | |
precision mediump float; | |
#endif | |
uniform vec2 resolution; | |
uniform sampler2D tex0; | |
const vec4 luminance_vector = vec4(0.3, 0.59, 0.11, 0.0); | |
void main() { |
This file contains hidden or 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
precision mediump float; | |
uniform vec2 resolution; | |
uniform sampler2D tex0; | |
const vec2 n = vec2(1.0/1024.0, 1.0/512.0); | |
const vec4 luminance_vector = vec4(0.3, 0.59, 0.11, 0.0); | |
void main(void) { | |
vec2 uv = vec2(1.0) - (gl_FragCoord.xy / resolution.xy); |
This file contains hidden or 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
Afternoon break | |
Beer | |
Dinner | |
Lunch | |
PicNic | |
Tea | |
Esthe | |
Gym | |
Hammam |
This file contains hidden or 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 python | |
# -*- coding: UTF-8 -*- | |
"""RAM disk creation (MacOS X only for now). | |
Usage: | |
with ramdisk(10240000, 'テスト1番') as x: | |
print "Mountpoint is: %s" % x.path | |
# use it | |
print 'Closing...' |
This file contains hidden or 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
(function() { | |
if (window.crotte_is_loaded) { | |
return; | |
} | |
window.crotte_is_loaded=true | |
var crotte_load_script = function(cnd, src, cb) { | |
if (cnd) { | |
var s = document.createElement('script'); | |
s.type = 'text/javascript'; |
This file contains hidden or 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
var store = function(k,v) { | |
try { | |
localStorage[k] = v; | |
} | |
catch(e) { } | |
}; |
This file contains hidden or 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
/// @brief The usual PI/180 constant | |
static const double DEG_TO_RAD = 0.017453292519943295769236907684886; | |
/// @brief Earth's quatratic mean radius for WGS-84 | |
static const double EARTH_RADIUS_IN_METERS = 6372797.560856; | |
/** @brief Computes the arc, in radian, between two WGS-84 positions. | |
* | |
* The result is equal to <code>Distance(from,to)/EARTH_RADIUS_IN_METERS</code> | |
* <code>= 2*asin(sqrt(h(d/EARTH_RADIUS_IN_METERS )))</code> | |
* |
This file contains hidden or 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
// V=(sphere.center - cone.apex_location) | |
// dotProduct_V_V = dotProduct(V, V) | |
// a = dotProduct(V, cone.direction_normal) | |
int cbloom_test(float dotProduct_V_V, float a, float sphere_radius, float cone_sin, float cone_cos) { | |
const float x(cone_cos*sqrt(dotProduct_V_V - a*a) - a*cone_sin); | |
return (fabsf(x)>=sphere_radius)?(x<0):-1; | |
} | |
int jcayzac_test(float dotProduct_V_V, float a, float sphere_radius, float cone_sin, float cone_cos) { | |
const float p(a*cone_sin); |
OlderNewer