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
function sma_original(avect, numPer) | |
numEle = length(avect) | |
tout = Array(Float32, numEle) | |
for ndx = 1:numEle | |
tsum = 0.0 | |
begndx = max(1, ndx - numPer) | |
for slicendx = begndx:ndx | |
tsum += avect[slicendx] | |
end | |
tout[ndx] = tsum / float32(numPer) |
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
set nocompatible " be iMproved, required | |
set hidden | |
filetype off " required | |
" line numbers | |
set number | |
set relativenumber | |
set backspace=2 "allow deleting any chars in insert mode | |
set laststatus=2 | |
set ruler " show the cursor position all the time |
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
use std::collections::HashMap; | |
fn main() { | |
// println!("{:?}", go(&[1, 2, 3])); | |
// println!("{:?}", go(&[1, 3, 4, 5, 6])); | |
println!("go_while {:?}", go_while(&[1, 3, -4, 4, 5, 6])); | |
println!("go_filter_map {:?}", go_filter_map(&[1, 3, 4, -4, 5, 6])); | |
let mut hm = HashMap::new(); | |
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(conservative_impl_trait, plugin)] | |
#![plugin(tarpc_plugins)] | |
extern crate futures; | |
#[macro_use] | |
extern crate tarpc; | |
extern crate tokio_core; | |
use app1::FutureServiceExt; | |
use app2::FutureServiceExt as F; |
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 = "serde_test" | |
version = "0.1.0" | |
[dependencies] | |
serde = "0.9" | |
serde_json = "0.9" | |
serde_derive = "0.9" |
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
#[macro_use] | |
extern crate diesel; | |
use diesel::{ | |
prelude::*, query_builder::{InsertStatement, UndecoratedInsertRecord}, | |
query_dsl::methods::ExecuteDsl, | |
}; | |
trait LoadTable { | |
type Insertable; |
OlderNewer