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/env python | |
# https://github.com/mgronhol/infeasible | |
import Infeasible | |
solution = Infeasible.Solution() | |
## Find a set of parallels for a milling vise to get suitable clamping depths |
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/env python3 | |
import struct | |
miINT8 = 1 | |
miINT32 = 5 | |
miUINT32 = 6 | |
miDOUBLE = 9 | |
miMATRIX = 14 | |
mxDOUBLE_CLASS = 6 |
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/env python2.7 | |
nodes = ["A", "B", "C", "D"] | |
conns = {} |
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
module flapflap(d,clk,q,qn); | |
input d,clk; | |
output q,qn; | |
reg q,qn; | |
initial | |
begin | |
q=0; | |
qn=1; |
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
float servo( motor_t *motor, int target ){ | |
int pos_error = target - motor->enc.current_value; | |
int velocity = motor->enc.current_value - motor->prev_position; | |
float v_error, out, q; | |
motor->prev_position = motor->enc.current_value; | |
/* P for position */ | |
motor->v_target = 0.99f * pos_error; | |
/* P + lowpass for velocity */ |
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
GCC_BIN = C:\\Users\\marku\\Desktop\\arm-embedded-env\\gcc\\bin\\ | |
STM32CUBE = C:\\Users\\marku\\Desktop\\arm-embedded-env\\STM32Cube_FW_F7\\ | |
LINKER_SCRIPT = ./STM32F746ZGTx_FLASH.ld | |
INCLUDE_PATHS = -I$(STM32CUBE)Drivers/CMSIS/Device/ST/STM32F7xx/Include -I$(STM32CUBE)Drivers/STM32F7xx_HAL_Driver/Inc -I$(STM32CUBE)Drivers/BSP/STM32F7xx_Nucleo_144 -I. -IInc/ -I$(STM32CUBE)Drivers/CMSIS/Include | |
FLOAT_ABI = hard | |
############################################################################### | |
AS = $(GCC_BIN)arm-none-eabi-as |
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/env python3 | |
import math, random | |
def simuloi_nopanheittoa( d, N ): | |
out = [] | |
for i in range( N ): | |
out.append( random.randint( 1, d ) ) | |
return out |
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
// options | |
final int OPTION1 = 0; | |
final int OPTION2 = 1; | |
final int OPTION3 = 2; | |
// ad nauseam ... | |
// usage: if( getBit( flags, OPTION3 ) ){ .... | |
boolean getBit( int value, int pos ){ |
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/env python | |
import math | |
_next_id = -1 | |
def generate_id(): | |
global _next_id | |
_next_id += 1 | |
return _next_id |
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/env python3.4 | |
import sys | |
import shlex | |
class ParserError(Exception): | |
pass |
NewerOlder