Spin up an Ubuntu 17.04 droplet, because nspawn containers are slightly more difficult with Ubuntu 16.04. Install systemd-container. (This will also work on your local workstation or laptop running Ubuntu 17.04.)
apt install systemd-container
Spin up an Ubuntu 17.04 droplet, because nspawn containers are slightly more difficult with Ubuntu 16.04. Install systemd-container. (This will also work on your local workstation or laptop running Ubuntu 17.04.)
apt install systemd-container
use std::collections::HashMap; | |
#[derive(Clone, Debug)] | |
struct Data { | |
values: Vec<i32>, | |
pass_to: Option<usize>, | |
} | |
impl Data { | |
fn has_complete_values(&self) -> bool { |
#[derive(Clone, Copy)] | |
struct Comp; | |
struct USB; | |
struct Card; | |
impl USB { | |
fn get_version(&self) -> Option<f64> { | |
Some(1.2) | |
} | |
} |
use std::fmt::Debug; | |
fn takes_two_things<T: Debug, U: Debug>(x: T, y: U) { | |
println!("{:?} {:?}", x, y); | |
} | |
fn main() { | |
takes_two_things(3, "ok"); | |
takes_two_things(3, 2); // fine if the same | |
} |
use std::str::FromStr; | |
#[derive(Debug)] | |
enum Version { Version1, Version2 } | |
#[derive(Debug)] | |
enum ParseError { InvalidSyntax, UnsupportedVersion } | |
struct NameValue { | |
name: String, |
use std::str::FromStr; | |
#[derive(Debug)] | |
enum Version { Version1, Version2 } | |
#[derive(Debug)] | |
enum ParseError { InvalidSyntax, UnsupportedVersion } | |
fn parse_version(line: String) -> Result<Version, ParseError> { | |
let mut split = line.split("="); |
me: | |
@true | |
a: | |
@true | |
sandwich: | |
@[ "$$(id -u)" -eq 0 ] && echo "Okay." || echo "What? Make it yourself." | |
.PHONY: me a sandwich |
this is a sample of output: | |
root@percona-db-2:~# iperf -s -u -B 226.94.1.1 -i 1 | |
------------------------------------------------------------ | |
Server listening on UDP port 5001 | |
Binding to local address 226.94.1.1 | |
Joining multicast group 226.94.1.1 | |
Receiving 1470 byte datagrams | |
UDP buffer size: 122 KByte (default) | |
------------------------------------------------------------ |
import Control.Monad | |
import Control.Concurrent | |
import Control.Concurrent.STM | |
import System.Random | |
import Text.Printf | |
-- Forks | |
type Fork = TMVar Int | |
newFork :: Int -> IO Fork |