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
func Reverse <type Element> (s []Element) { | |
first := 0 | |
last := len(s) - 1 | |
for first < last { | |
s[first], s[last] = s[last], s[first] | |
first++ | |
last-- | |
} | |
} |
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
var iotaSeedGenerator = (function(){ | |
const arr = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',9] | |
function getRandomChars(){ | |
var str = ""; | |
for(var i=0; i<81;i++){ | |
str += arr[rand(0,26)]; | |
} | |
return str; |
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
panda@pandaHQ~: $ wrk http://localhost:3000 | |
Running 10s test @ http://localhost:3000 | |
2 threads and 10 connections | |
Thread Stats Avg Stdev Max +/- Stdev | |
Latency 0.00us 0.00us 0.00us -nan% | |
Req/Sec 16.20 20.49 40.00 60.00% | |
30 requests in 10.01s, 3.43KB read | |
Socket errors: connect 0, read 0, write 0, timeout 30 | |
Requests/sec: 3.00 | |
Transfer/sec: 350.55B |
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
// https://github.com/itsmontoya/hello_world_rs/blob/master/src/main.rs#L43 | |
#[async] | |
fn fooResp() -> Result<Response, i32> { | |
let mut rx_set = Vec::new(); | |
rx_set.push(greeting()); | |
rx_set.push(greeting()); | |
rx_set.push(greeting()); |
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
#![feature(proc_macro, conservative_impl_trait, generators)] | |
extern crate futures_await as futures; | |
use futures::prelude::*; | |
#[async] | |
fn foo() -> Result<i32, i32> { | |
Ok(1 + await!(bar())?) | |
} |
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] | |
name = "hello_world" | |
version = "0.1.0" | |
authors = ["itsMontoya <josh@montoya.io>"] | |
[dependencies] | |
hyper = "0.11.2" | |
futures_await = { git = "https://github.com/alexcrichton/futures-await" } | |
// |
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
const io = @import("std").io; | |
pub fn main(args: [][]u8) -> %void { | |
var g = Greeter{ | |
.greeting = "hello world", | |
}; | |
g.Greet(); | |
} |
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 fn main(args: [][]u8) -> %void { | |
var g = Greeter{ | |
greeting: "hello world", | |
} | |
} | |
const Greeter = struct{ | |
greeting: string, | |
} |
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
const io = @import("std").io; | |
pub fn main(args: [][]u8) -> %void { | |
var g = Greeter{ | |
greeting: "hello world", | |
} | |
%%io.stdout.printf(g.greeting + "\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
/tmp/yaourt-tmp-panda/aur-zig/src/zig/src/codegen.cpp:4850:68: error: ‘LLVMGetTargetMachineData’ was not declared in this scope | |
g->target_data_ref = LLVMGetTargetMachineData(g->target_machine); | |
^ | |
[9/25] Building CXX object CMakeFiles/zig.dir/src/parser.cpp.o==> ERROR: A failure occurred in build(). |
NewerOlder