/dpt/ - Daily Programming Thread

Old thread: What are you working on, Jow Forums?

Attached: 1558965297424.jpg (800x880, 236K)

Other urls found in this thread:

youtube.com/watch?v=fxk1syuf5lo
docs.microsoft.com/en-us/cpp/build/x64-calling-convention?view=vs-2019
en.wikipedia.org/wiki/List_of_Lisp-family_programming_languages
repl.it/repls/FocusedGiganticKeyboardmapping
reddit.com/r/webdev/comments/8kq21d/new_to_web_development_is_it_normal_to_have_so/
twitter.com/SFWRedditImages

enterprise java

Anime girls and C#

so what's the consensus? dork or no?

How do I get this function to return the value?

(defn random-between
"Out put a random number between -theta and +theta"
[]
(let [theta 1.83948]
(- (* rand 2 theta) (theta))))


If I move the actual calculation at the end of the function then the variable theta isn't available.

let me go back to Haskell please
error[E0599]: no method named `send_all` found for type `futures::stream::map::Map` in the current scope
--> src/main.rs:17:28
|
17 | stream.send_all(sink)
| ^^^^^^^^
|
= note: the method `send_all` exists but the following trait bounds were not satisfied:
`&mut futures::stream::map::Map : futures::sink::Sink`
`futures::stream::map::Map : futures::sink::Sink`

FUCK anime girls (metaphorically)

that is the error when the sink/stream are switched:
use tokio::prelude::*;
use tokio::net::TcpListener;
use tokio::codec::{Decoder,LinesCodec};

fn main() {
let addr = "127.0.0.1:3000".parse().expect("err parse addr");
let listener = TcpListener::bind(&addr).expect("err bind listener");
let future = listener
.incoming()
.for_each(|socket| {
let lines_codec = LinesCodec::new();
let (sink, stream) = lines_codec.framed(socket).split();
sink
.send(String::from("Echo server"))
.and_then(|sink| {
let stream =stream.map(|x| format!("ECHO: {}", x));
sink.send_all(stream)
.map(|_| println!("Connection closed"))
})
})
.map_err(|e| eprintln!("Error: {:?}", e));

tokio::run(future)
}

>rand
>(theta)
I think you got those mixed up, you're calling a variable and not calling your function.

That's a nice looking JavaScript project, user. I like it!

Attached: 0908951c907feb0841d19693840c910e.jpg (682x1024, 53K)