« first day (2292 days earlier)      last day (1208 days later) » 

12:59 AM
totally useless but yeah
 
 
9 hours later…
10:07 AM
@DenysSéguret Not sure if you made up your mind about the notebook thing, but maybe the M1 could be a viable option after all: How We Ported Linux to the M1?
(Maybe be not right now, right now, but sometime in the near future)
 
yes, following this one
I just did something to look at a value in a chain (the "spy" below):
fn analyze(log_lines: Vec<LogLine>) {
    log_lines.iter()
        .into_group_map_by(|ll| ll.remote_addr)
        .spy(|g| println!("{} distinct remote_addresses", g.len()))
        .into_iter()
        .sorted_by_key(|e| Reverse(e.1.len()))
        .take(3)
        .for_each(|e| println!("{} hits by remote addresse {}", e.1.len(), e.0));
}

pub trait Spyable {
    fn spy<F, D>(self, f: F) -> Self where F: Fn(&Self) -> D;
}

impl<T> Spyable for T {
    fn spy<F, D>(self, f: F) -> Self where F: Fn(&Self) -> D {
Now please tell me there's a standard way to do it already, or it's stupid anyway
 
10:34 AM
There should be a basic way to do this without a trait...
 
@PeterVaro The 12 hour long stream by "marcan" (Asahi Linux) is nuts.
@DenysSéguret I'll be right back, I could only glance at this, but is this similar to .inspect()?
 
10:57 AM
It looks a little like inspect, but it works for any type (while inspect is specialized and look at itered items)
 
Looks like I missed some interesting conversations. :)
 
@FélixGagnon-Grenier Make that 11.
 
12.
It's hard to grasp what the OP wants to achieve.
We can answer only halfway.
 
 
4 hours later…
2:58 PM
I'm fairly confident it will be proven stupid but in the meantime I use it: crates.io/crates/have
 
I'm happy not to call win32 API, though
 
3:42 PM
at some point I was thinking of using winapi-rs to generate C# bindings to the Win32 API... won't be necessary now :P
hmm, I see, winrt-rs became windows-rs as it incorporated the Win32 API (in addition to the existing WinRT API)
 
4:13 PM
maybe we'll see new bindings to Java based on this metadata
 
 
6 hours later…
10:09 PM
@DenysSéguret Albeit I love the pun in the name, I think with_self or something like that would work better. I know for sure @FrancisGagné would call it also, and @Shepmaster would never call it map ;) There must be other crates who do similar things, but I bet each of them have silly names and we cannot find them easily.. which I believe is going to be the destiny of have as well. Otherwise it is indeed useful!
(Other silly names come to my mind are: bypass, scan, over, side_effect, with, and through (or for our American friends who don't know how to play Scrabble properly) thru ;))
 
via could also work. In fact, I vote for this.
 
poke_with_a_6_foot_stick
 
That's the one!
That being said, @DenysSéguret, you know dbg evaluates to the value you passed in, right? Not sure what else one would use have for, but since you started with spy, I thought I mention this. Yes, macro invocation does not look nice with method-call-chains, but it does the job.
 
10:30 PM
I’d still advocate for tap as in Ruby
 
10:48 PM
I have a friend working on some audio processing code he says he's going to open source, any thoughts? github.com/j-roark/udp-throughput/blob/main/src/main.rs
 
@AaronHall I personally think he should start using rustfmt
 
why do you say that?
 
@AaronHall Because I believe it would cause him great joy. Honestly.
 
He says he understands why you say that, but I'm asking on my own behalf because I've never heard of it...
But I suppose I can ddg it.
 
@AaronHall It's a formatter akin to prettier, gofmt and others.
 
10:58 PM
oh, that's what I thought, but he said it's a trait and so I thought I was wrong
 
Thank God it's not akin to prettier
@AaronHall What kind of thoughts are you looking for, BTW? Thoughts about the code? What could perhaps be improved?
 
Yeah, all of the above
 
I think that reading user input should not be happening inside of ThroughputSession::start
I also don't see why init_socket is not a part of start
Since, presumably, that's what happens when a session is started... right? You'd expect a socket to get opened when a session is started?
 
@AaronHall Not related to the code itself, but a README and, in my opinion, more comments would be a great addition.
 
What is the benefit of writing slice_payload instead of just &self.payload? It only makes the code more convoluted
Don't use return unless you really have to, Rust returns the last expression in the function if you omit the semicolon, makes writing functions way nicer, especially if they are one-liners like slice_payload
I.e. you could do
fn slice_payload(&self) -> &[u8] {
    &self.payload
}
Same thing for listen, you could write it instead as
pub fn listen(&mut self) -> usize {
	let mut buffer = Vec::with_capacity(self.size);
	match self.socket.recv(&mut buffer) {
	    Ok(received) => {
			print!("r");
			received
 		},
	    Err(_) => {
			print!("e");
                               0 as usize
		}
	}
}
I hate this website
Hopefully you enjoy reading unformatted garbage, welcome to SO chat
 
@EnnMichael use 4 spaces instead of tabs and it will work.
 
@AaronHall It would have worked out of the box if your friend had used rustfmt, I'm not replacing all those tabs with spaces!
 
gotcha. :)
 
Thank you
You are a greater man than I am
How long has your friend been doing programming / Rust?
 
IDK, I think this is his first attempt.
 
11:12 PM
I think he's on the right path
Has he read Rust By Example?
 
IDK, why?
 
Because if he hasn't, he really should. It's a very quick and light read and it teaches you a lot of stuff about Rust in an effective way
There's also the Rust Book
You just got a code review from the biggest noob in this chat room by the way
The biggest noob with the biggest ego
Be careful with that
Always take it with a bowl of salt
This is good advice in general
Trust no one, not even your local health authority
They don't care about your health they care about your money, going into their pockets
Always use your head
 
libc++ being open-source, you can find its string header here, I am checking it out at the moment :) — Matthieu M. Feb 11 '14 at 8:14
Well look who I found; @MatthieuM.
 
11:28 PM
I look at my mobile phone and I find it incredible that we still have careers
We should all be dead from starvation by now
Whoever makes these piece of shit phones deserves castration
 
I just had a ton of fun implementing MD5 for some puzzle due to Rust's ergonomics. I'm somewhat surprised at how short the actual implementation itself is! I thought these algorithms would come in at thousands of lines.
 
Do you understand how much more value a construction worker brings to this world than me?
They're building houses for people to live in
I build shit for people to waste time on
The last time that technology eased human life was when the light bulb was invented
And those construction workers make way less money, too
How does that make sense?
 
11:56 PM
Nothing wrong with building something that people want to "waste" their spare time on.
 

« first day (2292 days earlier)      last day (1208 days later) »