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(block_found.isempty == 1) | |
{ | |
if(block_found.block_size == _length) | |
{ | |
//int p = 0; | |
//for(p = log2(_length) - log2(*BASIC_BLOCK_SIZE); p < log2(*TOTAL_BLOCK_LENGTH) - log2(*BASIC_BLOCK_SIZE) + 1; p++) | |
//{ | |
// printf("free_list_left[%d] isempty = %d \n", p, free_list_left[p].isempty ); | |
// printf("free_list_right[%d] isempty = %d \n\n", p, free_list_right[p].isempty ); |
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
double catmullrom(double t, double p0, double p1, double p2, double p3, int m1, int m2) | |
{ | |
std::vector<std::vector<double> > t_vec(1, std::vector<double>(4, 0.0)); | |
t_vec[0][0] = t * t * t; | |
t_vec[0][1] = t * t; | |
t_vec[0][2] = t; | |
t_vec[0][3] = 1; | |
Matrix t_matrix(1, 4, t_vec); | |
std::cout << "+++ Time Matrix +++\n" << t_matrix << std::endl << std::endl; |
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
// Taken from StackOverflow (http://stackoverflow.com/questions/11599113/dart-lang-how-to-load-image) | |
var image = new ImageElement(); | |
image.src = 'my_image.png'; | |
image.on.load.add((e) => /* draw image after it has loaded */ | |
// OR | |
context.drawIamge(image, x, y, width, height); |
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 <hxcpp.h> | |
#ifndef INCLUDED_hxMath | |
#include <hxMath.h> | |
#endif | |
#ifndef INCLUDED_com_haxepunk_Entity | |
#include <com/haxepunk/Entity.h> | |
#endif | |
#ifndef INCLUDED_com_haxepunk_Graphic | |
#include <com/haxepunk/Graphic.h> |
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
{ | |
"default_room": "hallway", | |
"rooms": [ | |
{ | |
"name": "hallway", | |
"url": "test_images/hallway.jpg", | |
"connections": [ | |
{ | |
"name": "living_room", | |
"coordinates": [ 0, 0, 10 ] |
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 () { | |
$("#controls > div").hide(); | |
$('<canvas id="viewport" width="140" height="65">') | |
.css("float", "left") | |
.appendTo("#controls"); | |
$("<button />", { | |
text: "Show", |
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 re, socket, time | |
from PIL import Image | |
def send(sock, msg): | |
print(">> {}".format(msg)) | |
sock.send(msg + "\r\n") | |
if __name__ == "__main__": | |
IMG = Image.new("RGB", (128, 128), "white") | |
PIXELS = IMG.load() |
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
local socket = require("socket") | |
function getNextMove(commands) | |
local max = { | |
command = "", | |
count = 0, | |
} | |
for command, count in pairs(commands) do | |
if count > max.count then |
NewerOlder