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
print('Running the code from Gist passed in the url') | |
print() | |
print('Triangle Numbers:') | |
for i = 1, 13 do | |
print(i, i * (i+1) / 2) | |
end |
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
from random import random | |
import math | |
def dot(a, b): | |
return sum([k * v for k, v in zip(a, b)]) | |
def sig(x): | |
return 1 / (1 + math.exp(-x)) |
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
// эффекты описываются отдельными массивами | |
// в каждом несколько строчек по 5 символов | |
// соответствующих 5 светодиодам | |
// каждая строчка - следующее состояние (шаг) | |
// для данного эффекта | |
// (в принципе они могут быть собраны в один массив) | |
// первый эффект просто перемигивается | |
// четными и нечетными светодиодами | |
char* effect0[] = { |
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
#define NAVG 128 | |
#define SENSOR_INPUT A3 | |
#define SENSOR_INPUT2 A1 | |
#define NORMAL_BUTTON 13 | |
#define FILTER_BUTTON 2 | |
#define PULSE_BUTTON 3 | |
#define RED_LED 9 |
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
{erl_opts, [debug_info]}. | |
{deps, []}. | |
{profiles, [ | |
{test, [ | |
{deps, [ | |
{meck, "0.8.8"} | |
]}, | |
{plugins, [ | |
{rebar3_lint, {git, "https://github.com/project-fifo/rebar3_lint.git", {tag, "0.1.2"}}} | |
]}, |
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
ideal | |
p386 | |
SCR_W = 320 | |
SCR_H = 200 | |
STARTLINE = 70 | |
assume cs:code,ds:code | |
segment code public |
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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>restdemo</groupId> | |
<artifactId>rest-testing</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<packaging>jar</packaging> | |
<name>rest-testing</name> |
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 | |
function loadData() { | |
$file = file_get_contents('data.json'); | |
if ($file === false) { | |
$file = '[]'; | |
} | |
$data = json_decode($file); | |
return empty($data) ? array() : $data; | |
} |
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 void generate(String path) { | |
System.out.println("Creating " + cores + " threads..."); | |
ExecutorService service = Executors.newFixedThreadPool(cores); | |
prepareWords(false); | |
for (int i = 0; i < numFiles; i++) { | |
String name = String.format("%s/%08d.txt", path, i); | |
service.execute(new FileGenerator(name)); | |
} | |
service.shutdown(); | |
try { |