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
use regex::Regex; | |
use std::{ | |
collections::{HashMap, HashSet}, | |
hash::Hash, | |
str::FromStr, | |
}; | |
// const INPUT: &str = REAL; | |
const INPUT: &str = TEST2; |
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
use crate::user::UserReply; | |
use serde::{Deserialize, Serialize}; | |
#[derive(Serialize, Deserialize)] | |
#[serde(remote = "UserReply")] | |
pub struct MyUserReply { | |
pub id: String, | |
pub first_name: String, | |
pub last_name: String, | |
pub date_of_birth: String, |
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
#![no_std] | |
#![no_main] | |
use core::f32::consts::PI; | |
use core::fmt::Write; | |
use arduino_mkrzero::atsamd21g18a::{CorePeripherals, Peripherals}; | |
use arduino_mkrzero::clock::{GenericClockController, ClockGenId, ClockSource}; | |
use arduino_mkrzero::delay::Delay; | |
use arduino_mkrzero::prelude::*; |
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
#[entry] | |
fn main() -> ! { | |
let mut peripherals = Peripherals::take().unwrap(); | |
let mut core = CorePeripherals::take().unwrap(); | |
let mut clocks = GenericClockController::with_internal_32kosc( | |
peripherals.GCLK, | |
&mut peripherals.PM, | |
&mut peripherals.SYSCTRL, | |
&mut peripherals.NVMCTRL, | |
); |
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
// It should support any combination of {Covariant, Contravariant, Invariant} × {AlwaysSendSync, NeverSendSync, InheritSendSync}. | |
use core::marker::PhantomData; | |
/// Is Covariant and Send/Sync | |
/// ``` | |
/// use rich_phantoms::*; | |
/// use core::marker::PhantomData; | |
/// let _x: PhantomCovariantAlwaysSendSync<&'static str> = PhantomData; | |
/// let _y: &(dyn Send + Sync) = &_x; |
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
use na::*; | |
use na::allocator::Allocator; | |
use std::vec::IntoIter; | |
/// An n-dimensional point with a defined n-vector from the origin | |
pub trait NPoint: Clone | |
where | |
DefaultAllocator: Allocator<f64, Self::N>, | |
{ |
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
use na::*; | |
use na::allocator::Allocator; | |
/// A kd tree | |
pub struct KdTree<N: DimName>(Box<kd_tree::KdTreeImpl<N>>) | |
where | |
N: DimName, | |
DefaultAllocator: Allocator<f64, N>; | |
impl<N: DimName> KdTree<N> | |
where |
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
mod kd_tree { | |
use na::*; | |
use na::allocator::Allocator; | |
/// kd-Tree implementation structure | |
pub(super) enum KdTreeImpl<N> where N: DimName, DefaultAllocator: Allocator<f64, N> { | |
Node(usize, Box<KdTreeImpl<N>>, Box<VectorN<f64, N>>, Box<KdTreeImpl<N>>), | |
Empty() | |
} |
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
package akkahttptest | |
import akka.http.Http | |
import akka.stream.ActorFlowMaterializer | |
import akka.actor.ActorSystem | |
import akka.stream.scaladsl.{Sink, Source} | |
import akka.http.model._ | |
object TestClient extends App { |