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 <stdint.h> | |
#include <stdlib.h> | |
#include <zlib.h> | |
#include <assert.h> | |
static size_t get_atom_size(uint8_t* atom) | |
{ | |
return (atom[0] << 24) | (atom[1] << 16) | (atom[2] << 8) | atom[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
My 4-GPU Titan / Titan Black Setup is like this: | |
PSU: www.newegg.com/Product/Product.aspx?Item=N82E16817182251 | |
Motherboard: http://www.newegg.com/Product/Product.aspx?Item=N82E16813132262 (You have to switch the PCI-e port to at x8 speed and change boot parameter to include "pci=nomsi irqpoll" to get stable performance). | |
CPU: http://www.newegg.com/Product/Product.aspx?Item=N82E16819117402 | |
Memory: http://www.newegg.com/Product/Product.aspx?Item=N82E16820231793 |
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
var sum = parallable("sum.js", function (list) { | |
if (this.shared !== undefined) { | |
this.shared.list = list; | |
} | |
var pre = function (worker_num) { | |
var list = this.shared.list; | |
var part = new Array(worker_num); | |
var i; | |
var len = Math.ceil(list.length / worker_num); | |
for (i = 0; i < worker_num; i++) |
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
def alphabet_range(start_with, limit): | |
alphabet = '$abcdefghijklmnopqrstuvwxyz' # alphabet set, don't modify it | |
i = 0 | |
n = 0 | |
while n < limit: # from 1 to some number | |
w = [] | |
k = i | |
while k > 0: | |
w.append(alphabet[k % 27]) # shortcut for enumeration, covert to 27-ary number | |
k = k / 27 |
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 random; | |
def alphabet_range(start_with, limit): | |
alphabet = '$abcdefghijklmnopqrstuvwxyz' # alphabet set, don't modify it | |
i = 0 | |
n = 0 | |
while n < limit: # from 1 to some number | |
w = [] | |
k = i | |
while k > 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
<?php | |
require_once 'odm.php'; | |
require_once 'util.php'; | |
class Atomic | |
{ | |
private $identifier; | |
public function get($pipe) | |
{ |
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 "case.h" | |
TEST_CASE("fail test") | |
{ | |
REQUIRE_EQ(1, 2, "should fail %d", 1024); | |
} | |
TEST_CASE("fail array test") | |
{ | |
int a[3] = {1,2,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
public static class Map extends | |
Mapper<ImageHeader, FloatImage, IntWritable, FloatImage> { | |
public void map(ImageHeader key, FloatImage value, Context context) | |
throws IOException, InterruptedException { | |
if (value != null && value.getWidth() > 100 && value.getHeight() > 100) { | |
float[][] tp = new float[100][32 * 32]; | |
for (int i = 0; i < 10; i++) { | |
int x = (value.getWidth() - 32) * i / 10; | |
for (int j = 0; j < 10; j++) { |
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 ruby | |
require "rexml/document" | |
prng = Random.new Random.new_seed | |
objfiles = Hash.new | |
objtrainfiles = Hash.new | |
objvalfiles = Hash.new |
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 ruby | |
exit unless ARGV.length == 1 | |
file = File.new ARGV[0] | |
residual = 0 | |
filename = nil | |
file.each do |line| | |
case residual | |
when 0 then |