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 actix::prelude::*; | |
struct WithActor<A: Actor, T, F: FnOnce(&mut A, &mut A::Context) -> T> { | |
dlg: F, | |
_phantom: std::marker::PhantomData<A>, | |
} | |
fn with_actor<A: Actor, T: 'static, F: FnOnce(&mut A, &mut A::Context) -> T>(dlg: F) -> WithActor<A, T, F> | |
where A: Handler<WithActor<A, T, F>> | |
{ |
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 actix::prelude::*; | |
/// This actor needs to handle the message. | |
struct LeafActor; | |
impl Actor for LeafActor { | |
type Context = Context<Self>; | |
} | |
/// This actor needs to receive a message, pass it to the leaf actor, and then handle the result |
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
% Need to download http://u.cs.biu.ac.il/~kapaho/IP/Images/fftDemo1.tiff | |
% Uncomment this if you use Octave: | |
% pkg load image | |
im = imread('fftDemo1.tiff'); | |
im = double(im) / 255.0; | |
ff = fft2(im); | |
ff_abs = abs(ff); | |
ff_angle = angle(ff); |
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] | |
authors = ["IdanArye <idanarye@gmail.com>"] | |
name = "async-not-just-for-io" | |
version = "0.1.0" | |
[dependencies] | |
gfx = "0.17.1" | |
gfx_device_gl = "0.15.2" | |
piston2d-gfx_graphics = "0.50.0" | |
piston_window = "0.77.0" |
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 std::fs; | |
use std::io; | |
use std::io::BufRead; | |
use std::collections::HashMap; | |
type Prefixes = Vec<u64>; | |
type Counters = Vec<u64>; | |
struct ArgsContext { | |
filename: 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
#include<stdio.h> | |
int main() { | |
double a, b; | |
int choice; | |
do { | |
printf("Enter two numbers: "); | |
scanf("%lf %lf", &a, &b); | |
printf("%lf / %lf = %lf\n", a, b, a / b); |
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
#include<stdio.h> | |
int main() { | |
int sum = 0; | |
int digit; | |
digit = getchar(); | |
while ('0' <= digit && digit <= '9') { | |
sum += digit - '0'; | |
digit = getchar(); |
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
public class MySingleton { | |
private static MySingleton instance; | |
public static MySingleton getInstance() { | |
if (instance == null) { | |
instance = new MySingleton(); | |
} | |
return instance; | |
} |
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
foo # Why the hell does this even run? I didn't import Foo.cr! |
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
[info ] Import directories: [] | |
[info ] 0 symbols cached. | |
[info ] Startup completed in 0.748331 milliseconds. | |
[info ] Getting symbols for /usr/include/dlang/dmd/std/stdio.d | |
[info ] Getting symbols for /usr/include/dlang/dmd/std/zip.d | |
[info ] Getting symbols for /usr/include/dlang/dmd/std/outbuffer.d | |
[info ] Getting symbols for /usr/include/dlang/dmd/std/uuid.d | |
[info ] Getting symbols for /usr/include/dlang/dmd/std/socketstream.d | |
[info ] Getting symbols for /usr/include/dlang/dmd/std/exception.d | |
[info ] Getting symbols for /usr/include/dlang/dmd/std/uni.d |
NewerOlder