GPIO0: GPIO | Pin features |
---|---|
GPIO0 | PB11/DMIC-DATA0/PWM2/TWI0-SDA/SPI1-CLK/DBI-SCLK/CLK-FANOUT1/UART1-CTS/PB-EINT11 |
GPIO1 | PB10/DMIC-DATA1/PWM7/TWI0-SCK/SPI1-MOSI/DBI-SDO/CLK-FANOUT0/UART1-RTS/PB-EINT10 |
GPIO2 | PE9/NCSI0-D5/UART1-CTS/PWM3/UART3-RX/JTAG-DI/MDIO/PE-EINT9 |
GPIO3 | X |
GPIO4 | X |
GPIO5 | X |
GPIO6 | X |
GPIO7 | 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
%% Вычисляем PI методом Монте-Карло | |
-module(pi). | |
-export([calculate/1, parallel_calculate/2, start_worker/2]). | |
calculate(Hits) -> | |
Acc = test_hit(Hits, 0), | |
{ok, 4.0 * Acc / Hits}. | |
parallel_calculate(Hits, Workers) -> |
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
//! Unlimited Register Machine | |
//! https://proofwiki.org/wiki/Definition:Unlimited_Register_Machine | |
use std::collections::HashMap; | |
type Address = usize; | |
type State = HashMap<Address, usize>; | |
#[derive(Debug)] | |
enum Op { |
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
[alias] | |
hist = log --pretty=format:\"\t%C(red)%h%C(reset)%C(blue)%d%C(reset) : %C(yellow)%ad%C(reset) | %s [%C(green)%an<%ae>%C(reset)]\" --graph --date=short |
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
const { readFile } = require('fs') | |
const { isFuture, node, encase, after } = require('fluture') | |
const futurize = (handler) => async (req, res) => { | |
const result = await handler(req, res) | |
return isFuture(result) ? result.promise() : result | |
} | |
module.exports = futurize( | |
async (req, res) => { |
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
use byteorder::{BigEndian, ByteOrder}; | |
use eeprom24x::{ic, Eeprom24x, SlaveAddr}; | |
use hal::hal::blocking::delay::DelayMs; | |
use hal::hal::blocking::i2c::{Write, WriteRead}; | |
use hash32::{Hasher, Murmur3Hasher}; | |
// EEPROM: 512 pages * 32 bytes = 16,384 bytes | |
// Index size: 32 pages * 8 refs = 256 slots | |
// Max key size: 12 bytes | |
// Max record size: 4095 bytes |
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
use core::ops::*; | |
pub struct Regulator<F> | |
where | |
F: Default + Add<Output = F> + Sub<Output = F> + Mul<Output = F> + PartialOrd + Copy, | |
{ | |
kp: F, | |
ki: F, | |
kd: F, | |
last_error: F, |
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
GREEN="%{$fg_bold[green]%}" | |
YELLOW="%{$fg_bold[yellow]%}" | |
CYAN="%{$fg_bold[cyan]%}" | |
RED="%{$fg_bold[red]%}" | |
MAGENTA="%{$fg[magenta]%}" | |
RESET="%{$reset_color%}" | |
PROMPT='$RED◢◤ $CYAN%c $YELLOW$(git_prompt_info)$(git_prompt_status)$RESET' | |
RPROMPT='$MAGENTA%~ $RESET' |
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
// npm install telegraf telegraf-wit | |
var Telegraf = require('telegraf') | |
var TelegrafWit = require('telegraf-wit') | |
var app = new Telegraf(process.env.BOT_TOKEN) | |
var wit = new TelegrafWit(process.env.WIT_TOKEN) | |
app.use(Telegraf.memorySession()) |
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
_now_commands () | |
{ | |
local curcontext="$curcontext" state line | |
typeset -A opt_args | |
_arguments -C \ | |
":command:->command"\ | |
"*::options:->options" | |
case $state in |