Skip to content

Instantly share code, notes, and snippets.

View Morendil's full-sized avatar

Laurent Bossavit Morendil

View GitHub Profile
@Morendil
Morendil / PyPad.py
Last active December 17, 2015 00:28
Pythonista code to grab a gravity vector and babble it to an HTTP endpoint
from urllib2 import urlopen
from time import sleep
from scene import gravity, Scene, run
class MyScene (Scene):
def setup(self):
self.frames = 0
def draw(self):
self.frames += 1
if (self.frames % 30) == 0:
#include <Servo.h>
Servo gripper;
Servo arm;
int pos = 120;
int target = pos;
void setup()
{
@Morendil
Morendil / quad.arduino
Created June 26, 2014 10:17
Quadruped code
#include <Servo.h>
struct ServoMove {
char cmd[3];
int angle;
int wait;
};
Servo joints[8];
// Front then back; right then left; hip then leg
@Morendil
Morendil / myprobe.scad
Created June 26, 2014 10:27
Compact Hall Effect Probe
// pcb dims
width = 18;
hwidth = 7.65;
swidth = 4;
module box() {
difference() {
boxshell();
translate([(20-swidth*1.1)/2,3,1.5+1.6])
@Morendil
Morendil / Mills.md
Last active February 16, 2016 07:12

Abstract

Structured programming can be used to develop a large system in an evolving tree structure of nested program modules, with no control branching between modules except for module calls defined in the tree structure. By limiting the size and complexity of modules, unit debugging can be done by systematic reading, and the modules can be executed directly in the evolving system in a top down testing process.

Introduction

Large systems programming today is dominated by the integration and debugging problem because it is commonly assumed that logic errors are inevitable in programming systems (in contrast to syntax errors, which are detected by translators). There is no doubt that programmers are fallible and always will be. But it now appears possible to organize and discipline the program design and coding process in order to (1) prevent most logic errors in the first place and (2) detect those errors remaining more surely and easily than before.

We will use the term "structured programming"

mkdir docker-alpine-bug
cd docker-alpine-bug
git init .
echo "Bug" > README
git add .
git commit -m "Bug"
git checkout -b somewhere
echo -e "One\nTwo\nThree" > README
git commit -am "Bug"
git checkout master
for V in One Two Three; do echo -n $V > word.txt && docker run -it -v $(pwd):/app envygeeks/alpine /bin/bash -c "sleep 1 && cat /app/word.txt" ; done

Keybase proof

I hereby claim:

  • I am morendil on github.
  • I am morendil (https://keybase.io/morendil) on keybase.
  • I have a public key ASD5WwUdb8DA0vDTOKkzlCI_5SQPGQQjjSOHYd84J7UcTQo

To claim this, I am signing this object:

import R from 'ramda'
import {expect} from 'chai'
import daggy from 'daggy'
describe('simplified tree walks', function() {
// Mon domaine peut se simplifier à une liste d'équations à trous:
// a: 45
// b: a + c
// d: a + 4
import R from 'ramda'
import {expect} from 'chai'
import daggy from 'daggy'
import {Maybe as M} from 'ramda-fantasy'
describe('simplified tree walks', function() {
// Notre domaine peut se simplifier à une liste d'équations à trous:
// a: 45
// b: a + c