- Boolean Logic
- Side effects
- OO Design patterns
- TDD (Test Driven Development)
- Stack
- Threading
- Concurrency
- References
- Information Hiding/Encapsulation
- Single Responsibility Principle
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
;; -*- mode: emacs-lisp -*- | |
;; This file is loaded by Spacemacs at startup. | |
;; It must be stored in your home directory. | |
(defun dotspacemacs/layers () | |
"Configuration Layers declaration. | |
You should not put any user code in this function besides modifying the variable | |
values." | |
(setq-default | |
;; Base distribution to use. This is a layer contained in the directory |
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
trait Query<'a, 'b: 'a, X: 'b, Y: 'a> { | |
fn execute(&self, f: X) -> Y; | |
} | |
#[derive(Default)] | |
struct ToBeQueried { | |
inner: String | |
} | |
struct GetInnerSlice; |
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
russia, translation and website hosting: https://www.patreon.com/mkpankov | |
newrustacean: https://www.patreon.com/newrustacean | |
tomaka: https://www.patreon.com/tomaka | |
QuietMisdreavus: https://www.patreon.com/QuietMisdreavus |
Link list to yesterdays talk:
The MongoDB problem, illustrated:
https://gist.github.com/skade/33ef03948ff280dd2a44
A very good post on Postgres full text. Make sure to read the final paragraphs, discussing limits and flaws.
http://blog.lostpropertyhq.com/postgres-full-text-search-is-good-enough/
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
extern crate tokio_core; | |
extern crate futures_cpupool; | |
extern crate futures; | |
use futures::future::lazy; | |
use std::sync::Arc; | |
// Make sure data is not copy | |
#[derive(Debug)] | |
struct Data { |
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::fmt::Debug; | |
fn wrap<A, B>(item: A, f: fn(A) -> B) -> B { | |
f(item) | |
} | |
fn main() { | |
println!("{:?}", wrap(1, Hoge::Fuga)); | |
println!("{:?}", wrap(1, Foo::Bar)); | |
} |
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
import http.client | |
import json | |
conn = http.client.HTTPConnection("localhost:9200") | |
conn.request("GET", "/my_index/_search?size=10000") | |
r1 = conn.getresponse() | |
result = json.loads(r1.read().decode('utf-8')) | |
for hit in result["hits"]["hits"]: | |
print(json.dumps({ "index" : { "_type": hit["_type"], "_id" : hit["_id"] }})) |
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
extern crate itoa; | |
use std::io::Write; | |
use std::io::BufWriter; | |
pub fn main() { | |
let stdout = std::io::stdout(); | |
let mut stdout = BufWriter::new(stdout); | |
let mut acc = 810092048; |
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
#![feature(rust_2018_preview, async_await, await_macro, futures_api, pin, arbitrary_self_types)] | |
use std::future::{Future, FutureObj}; | |
use std::mem::PinMut; | |
use std::marker::Unpin; | |
use std::sync::{Arc, Mutex}; | |
use std::sync::mpsc::{sync_channel, SyncSender, SendError, Receiver}; | |
use std::task::{ | |
self, |