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 <iostream> | |
#include <concurrent_vector.h> | |
#include <thread> | |
#include <algorithm> | |
#include <cstdlib> | |
#include <atomic> | |
#include <vector> | |
#include <mutex> | |
int counter = 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
#include <iostream> | |
#include <algorithm> | |
#include <vector> | |
#include <assert.h> | |
#include <time.h> | |
#include "vectorclass/vectorf128.h" | |
#include "alignedallocator.hpp" |
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
install_name_tool -change $oldlib $newlib $programname |
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
// hit point | |
float eta = 1.01; | |
ray.origin = h.p; | |
// entering or leaving | |
if( dot(ray.dir, h.n) < 0 ) | |
// entering ray | |
ray.dir = refract(ray.dir, h.n, 1.0/eta); | |
else | |
// leaving ray | |
ray.dir = refract(ray.dir, -h.n, eta); |
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
function B = jfa(n, w, h, nsamples) | |
sites = round([rand(n, 1)*(w-1)+1, rand(n,1)*(h-1)+1]); | |
rawsites = sites; | |
if nargin < 4 | |
nsamples = 16; | |
end | |
offsets=zeros(nsamples, 2); | |
sqrtNSamples = round(sqrt(nsamples)); |
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
function licimg = lic(field) | |
[height, width, ~] = size(field); | |
noise = rand(height, width); | |
% lic length | |
L = 20.0; | |
licimg = zeros(height, width); |
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 twitter | |
# == OAuth Authentication == | |
# | |
# This mode of authentication is the new preferred way | |
# of authenticating with Twitter. | |
# The consumer keys can be found on your application's Details | |
# page located at https://dev.twitter.com/apps (under "OAuth settings") | |
C_K="..." |
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
function testSampling(n) | |
samples = zeros(n, 3); | |
samples2 = zeros(n, 3); | |
for i=1:n | |
xi1 = rand(); | |
xi2 = rand(); | |
samples(i, :) = hemi(xi1, xi2); | |
samples2(i, :) = hemi_stratified(xi1, xi2); |
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 <iostream> | |
#include <fstream> | |
#include <vector> | |
#include <algorithm> | |
#include <set> | |
#include <stack> | |
using namespace std; | |
struct Node { |
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 <iostream> | |
#include <stdlib.h> | |
#include <vector> | |
using namespace std; | |
vector<int> solve(vector<int>& A) { | |
int n = A.size(); | |
int a, b, c; |
OlderNewer