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
pub type Fun<'a> = Box<FnOnce(u8) -> Res<'a> +'a>; | |
pub enum Res<'a> { | |
Done(u8, u8), | |
Incomplete(Fun<'a>) | |
} | |
pub trait FMap { | |
fn fmap<'y,F: Fn(u8) -> u8 + 'y>(self, f: &'y F) -> Res<'y>; | |
} |
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
pub type Fun<'a> = Box<FnMut(u8) -> Res<'a> +'a>; | |
pub enum Res<'a> { | |
Done(u8, u8), | |
Incomplete(Fun<'a>) | |
} | |
pub trait FMap { | |
fn fmap<'y,F: Fn(u8) -> u8 + 'y>(&'y mut self, f: F) -> Res<'y>; | |
} |
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
pub type Fun<'a, I, O> = Box<FnMut(I) -> Res<'a, I, O> +'a>; | |
pub enum Res<'a, I, O> { | |
Done(I, O), | |
Incomplete(Fun<'a, I, O>) | |
} | |
pub trait FMap<I, O, N> { | |
fn fmap<'y,F: Fn(O) -> N>(&'y self, f: F) -> Res<'y, I, N>; | |
} |
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
fn prod<'a,'b>(a:uint) -> Box<FnMut(&'b[u8]) -> &'b[u8] +'a> { | |
box move |&: input: &'b[u8]| -> &'b[u8] { | |
input.slice_from(a) | |
} | |
} | |
fn main() { | |
let mut a = prod(2); | |
println!("a1: {}", a("abcdefgh".as_bytes())); | |
// -> a1: [99, 100, 101, 102, 103, 104] |
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
MacBook-de-Geo:phpinclude geal$ cat Dockerfile | |
# -*- sh -*- | |
FROM base/archlinux | |
MAINTAINER Geoffroy Couprie, [email protected] | |
RUN echo -e "[multilib]\nInclude = /etc/pacman.d/mirrorlist" > /tmp/multilib | |
RUN cat /etc/pacman.conf /tmp/multilib > /tmp/pacman.conf | |
RUN mv /tmp/pacman.conf /etc/pacman.conf | |
RUN pacman -Syu --noconfirm | |
RUN pacman -S --noconfirm curl unzip lib32-zlib lib32-ncurses lib32-bzip2 |
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
fn main() { | |
let a = |input: &[u8]| { | |
input.slice_from(1) | |
}; | |
println!("a: {}", a("abc".as_bytes())); | |
} |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <pthread.h> | |
#include <unistd.h> | |
#include <stdbool.h> | |
#include <time.h> | |
#include <stdarg.h> | |
#include <string.h> | |
#include "future.h" |
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
package epsi.com.phototest; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.content.pm.PackageManager; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.hardware.Camera; | |
import android.media.MediaScannerConnection; | |
import android.net.Uri; |
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
#![crate_type = "lib"] | |
#![crate_id = "conveyor"] | |
#![desc = "A conveyor belt for bytes"] | |
#![license = "MIT"] | |
use std::str; | |
pub trait Producer<T> { | |
fn take(&mut self, nb: uint) -> & [T]; | |
} |
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
package main | |
import ( | |
"fmt" | |
"runtime" | |
"time" | |
) | |
type State struct { | |
counter int |