Skip to content

Instantly share code, notes, and snippets.

type ErrorInfo =
| Unauthorized
| InternalServerError
type SendValue<'T> =
| Uninitialized
| Initial of 'T
| Sending of 'T
| Sent of 'T
| SendFailed of 'T * ErrorInfo
type ErrorInfo = HttpResponseStatusCode of int
type ReceiveValue<'T> =
| Available of 'T
| Unavailable
| ReceiveFailed of ErrorInfo
@vschep
vschep / EmbeddedSystemUiLetChargingPermission.fs
Created December 4, 2023 15:42
represent the received value of the charging permission
let (chargingPermission: ReceiveValue<ChargingPermission>) = Unavailable
@vschep
vschep / EmbeddedSystemUiReceiveOnly.fs
Created December 4, 2023 15:38
EmbeddedSystemUiReceiveOnly.fs
[<ReactComponent>]
static member RadioInputReceiveOnly
(inputValue: ChargingPermission)
(chargingPermission: ReceiveValue<ChargingPermission>)
=
let inputValueStr = $"%A{inputValue}"
Html.div [
prop.classes [ "flex"; "gap-2" ]
prop.children [
#I __SOURCE_DIRECTORY__
#r @"bin/Debug/EvalWrapper.dll"
open Microsoft.MSR.CNTK.Extensibility.Managed
open System.Drawing
open System.Collections.Generic
open System
let createModel modelPath =
let model = new IEvaluateModelManagedF()
@vschep
vschep / ReadADValue.c
Last active February 28, 2016 17:16
Snippet regarding reading A/D values for my automobile blog
volatile unsigned char * adValue = (unsigned char *) 0xFFB00000;
void battVoltStatemachine() {
unsigned char battVolt = *adValue;
if (battVolt < 10) {
// change state
}
}