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
from math import * | |
# settings | |
n = 4 | |
radii = [1/2.0 * sqrt((2.0 ** i - 1) / (2.0 ** n - 1)) for i in range(1, n + 1)] | |
# calculate bezier |
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 <sys/ioctl.h> | |
#include <unistd.h> | |
#include "unicode_ascii_translation_table.c" | |
#define CSI "\x1B[" | |
int is_ascii_printable(char c) { | |
return (c > 0x1F) & (c != 0x7F); | |
} |
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/ruby | |
require 'rubygems' | |
installed_gems = Gem::Dependency.new '', Gem::Requirement.default | |
missing = [] | |
# mind the short-hand, looping over installed gem specs | |
specs = Gem.source_index.search installed_gems | |
specs.each do |spec| | |
gem = Gem::Dependency.new spec.name, spec.version | |
# looping over gem dependencies | |
specs = Gem.source_index.search gem |
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 "buffer.h" | |
/* statically allocate tests */ | |
#define TEST_MAX (2 << 8) | |
struct test { | |
struct test *next; | |
char *desc; | |
int pass; | |
} tests[TEST_MAX]; |
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
<?php | |
$link = mysql_connect('localhost', 'root'); | |
function mysql_results($result) { | |
$foos = array(); | |
while ($row = mysql_fetch_row($result)) { | |
$foo = $row[0]; | |
array_push($foos, $foo); | |
} |
NewerOlder