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
use arduino_hal::{clock::Clock,port::{mode::Output, Pin, PinOps}}; | |
/// Pull an arduino's output pin to specified Hertz for microseconds duration. | |
/// This is essentially manual PWM, without avr-hal's clock prescaling. | |
/// Useful to make buzzers oscillate at 440 hertz. | |
/// This is not measured to be precise but works well enough. | |
/// | |
/// example: | |
/// let dp = arduino_hal::Peripherals::take().unwrap(); | |
/// let pins = arduino_hal::pins!(dp); |
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 MondayTutorial where | |
{- class MyList<T> { | |
private T value; | |
private MyList<T> next; | |
MyList(){} | |
MyList(T value, MyList<T> next){ | |
Objects.requireNonNull(next); | |
this.value = value; |
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
{- | Author: Arne Winter | |
| Date: 01/07/2022 | |
| Description: Haskell implementation of interval tree clocks, as per the paper | |
Almeida, Paulo & Baquero, Carlos & Fonte, Victor. (2008). Interval Tree Clocks: A Logical Clock for Dynamic Systems. 5401. 259-274. 10.1007/978-3-540-92221-6_18. | |
-} | |
module ITC ( | |
Stamp (..), | |
ITCId (..), | |
ITCEvent (..), | |
fmtStamp, |
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 : Database.Redis.Redlock | |
-- Copyright : (c) 2022 Arne Miles Winter | |
-- | |
-- License : MIT | |
-- | |
-- Maintainer : https://github.com/arnemileswinter | |
-- Stability : experimental | |
-- Portability : portable | |
-- |
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
import Data.Time.Clock.POSIX (getPOSIXTime) -- from `time` package. | |
import Control.Concurrent (threadDelay) | |
{- | Repeats IO action repeatedly on single thread, taking action running-time into account when waiting for next repetition. | |
__Examples__: | |
@ | |
secondsToMicros = (*) (10 ^ 6) | |
millisToMicros = (*) (10 ^ 3) |
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
import com.badlogic.gdx.graphics.Color; | |
import com.badlogic.gdx.graphics.VertexAttributes; | |
import com.badlogic.gdx.graphics.g3d.Material; | |
import com.badlogic.gdx.graphics.g3d.Model; | |
import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute; | |
import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder; | |
/** | |
* Used to render boxes with their faces seperated. | |
*/ |