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
function _draw() | |
cls(8) | |
srand(5) | |
-- Iterate every 8 square pixels of the screen. | |
-- The `.5` is to make sure the points are at the center of each pixel. | |
-- We'll draw one wall of the maze in each square. | |
for y=.5,129,8 do | |
for x=.5,129,8 do | |
-- Progress in the rotation cycle. One rotation is [0..1] |
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
#!/bin/bash | |
# | |
# record from video grabber | |
VIDEO=${VIDEO:-/dev/video1} | |
AUDIO=${AUDIO:-hw:1} | |
AUDIO_RATE=48000 | |
VIDEO_IN="-f video4linux2 -video_size 720x576 -thread_queue_size 1024 -framerate 25 -i $VIDEO -vsync 1" | |
AUDIO_IN="-f alsa -sample_rate $AUDIO_RATE -channels 2 -thread_queue_size 2048 -itsoffset 0.3 -i $AUDIO" |
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
type Set struct { | |
list map[int]struct{} //empty structs occupy 0 memory | |
} | |
func (s *Set) Has(v int) bool { | |
_, ok := s.list[v] | |
return ok | |
} |
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
OpenHAB Heating Example | |
======================== | |
This heating example shows three rooms in my house with 1 radiator valve, 1 temperature sensor per room and a single boiler. It could be adapted for different situations. | |
The rules allow for simple addition of items in rooms as long as they follow the naming convention and have at least a valve, a thermometer, setpoint and a demand switch. | |
The demand switch is purely internal and is used to indicate if the room requires heat or not. All rooms are OR'd together to define the boiler status and each room demand (On/Off) is applied to the radiator valves. | |
It could be more generic for multiple thermometers/valves per room - but it suits my needs for now. If I make it more generic I will update it accordingly. |