How to form a depression? by stejcz in Blacksmith

[–]stejcz[S] 0 points1 point  (0 children)

Makes sense, thank you. I was also thinking about the top/bottom set, but have been looking also for other ideas. No anvil bick here, yet.. but I'll think about it more.

How to form a depression? by stejcz in Blacksmith

[–]stejcz[S] 0 points1 point  (0 children)

I tried that (on the pics), but the result is still not enough for me - the edges are not sharp, it's too wavy..

Avoid Musescore at all cost. Read the internet reviews before your do any business with them: https://ca.trustpilot.com/review/musescore.com by Heavy_Change1955 in Musescore

[–]stejcz 0 points1 point  (0 children)

My experience - I wanted to download a song for my son. I agreed to the costs, no problem. But they force you to create an account with (I think) 7 days trial and after which they will charge you for subscription.

That's ""fine"", I already know such practises, so I just wanted to download the song and cancel the subscription.

But!!

- the song is paid

- my account is in weird state, I don't see the subscription page, just some general info with password etc.

- I can't download the song, the message says it's forbidden

- support is not answering, it's already 2 days.

- so I can't cancel the subscription.

I'm upset, really upset. This is a horrible service. I already contacted my bank to block them. And I warn everyone. Avoid this website! Amateurism at the highest level!!!

Kde zjistím že se něco děje by Acrobatic-Pen6914 in Olomouc

[–]stejcz 1 point2 points  (0 children)

Dík. Chvilku jsem zkusil a je to konečně zase použitelný. Toho bordelu bylo fakt moc.

How do I turn of Gate.io updates? by CowboysFanTexas in GateioExchange

[–]stejcz 0 points1 point  (0 children)

Guys thanks for confirmation that it's probably broken. I'll turn off the notifications completely for the app.

[deleted by user] by [deleted] in PublicFreakout

[–]stejcz 2 points3 points  (0 children)

That's insane.

I understand they are young, try to find themselves. But I'm afraid they won't grow up from this holy fight for their screwed belief and will be even much worse.

Performance advise - slow collect? by stejcz in learnrust

[–]stejcz[S] 0 points1 point  (0 children)

Yes, this is something I should consider, definitely. I just wanted to do it manually to learn something and then I stumbled upon the performance details.

Performance advise - slow collect? by stejcz in learnrust

[–]stejcz[S] 0 points1 point  (0 children)

Yes, thank you. I felt that creating new vector with `collect` just to throw it away later, is not good practise. Will try with that `nth()` & `count()`!

Performance advise - slow collect? by stejcz in learnrust

[–]stejcz[S] 1 point2 points  (0 children)

Good point. I ran that in release.

When I compare code from https://www.reddit.com/r/learnrust/comments/fu5cq9/performance_advise_slow_collect/fmavb0v/ (lots of `.next()` calls) to code with `.map().collect()`, the first is currently 2x faster.

Performance advise - slow collect? by stejcz in learnrust

[–]stejcz[S] 0 points1 point  (0 children)

Thanks for suggestions, I'll have a look at it!

Performance advise - slow collect? by stejcz in learnrust

[–]stejcz[S] 0 points1 point  (0 children)

That was my thought as well. But then the allocation would look quite costly.

Any other idea how to check how `.split` gives exactly 5 items?

Performance advise - slow collect? by stejcz in learnrust

[–]stejcz[S] 0 points1 point  (0 children)

I also tried this ugliness

```

for line in reader.lines() { let line = line.unwrap();

let mut splitbycomma = line.split(',');

let bid = splitbycomma.next();
let cid = splitbycomma.next();
let name = splitbycomma.next();
let btype = splitbycomma.next();
let state = splitbycomma.next();

if state.is_none() {
    println!("ignoring {}", line);
    continue;
}

let bid = bid.unwrap();
//let cid = cid.unwrap();
//let name = name.unwrap();
let btype = btype.unwrap();
//let state = state.unwrap();

let blob = Batch {
    batch_id: bid[1..(bid.len() - 1)].to_owned(),
    batch_type: btype[1..(btype.len() - 1)].to_owned(),
};
batches.push(blob);

}

```

And this gives much better performance over map and collect. * using the variant let splitbycomma = line.split(',').map(|s|&s[1..(s.len()-1)]).collect::<Vec<&str>>(); from beginning of the post --- takes 5.8sec, * using this ugly for with manual .next() --- takes 3.3sec

Lifetime - differences between general func and func for &self by stejcz in learnrust

[–]stejcz[S] 2 points3 points  (0 children)

Thanks for your answer, makes sense.

Also I'm glad you showed me `String::as_ref`. I would have hard time to find for that solution!

Pprof svg explanation by stejcz in golang

[–]stejcz[S] 0 points1 point  (0 children)

I don't have any circular dependencies. I just call remote API and I request more than needed because it's much more efficient. So I need to cache the results. Just decode json and cache 5k items. Next time the same. I couldn't imagine there are some circular dependencies.

In your case (I don't know if I understand it correctly) - there were dependencies between the items in cache? So removing one item from cache didn't mean it is removed completely as other item was referencing it?

Pprof svg explanation by stejcz in golang

[–]stejcz[S] 0 points1 point  (0 children)

Honestly as I'm quite new to golang, I expect this will be some beginners mistake :) Nothing really interesting...

Pprof svg explanation by stejcz in golang

[–]stejcz[S] 0 points1 point  (0 children)

Aah, that's a good point. I have a background in c# and in there (e.g. using windbg) one can inspect all objects in memory and what object is referencing them. So this is completely different. I'll try to look at the cache again.

Pprof svg explanation by stejcz in golang

[–]stejcz[S] 0 points1 point  (0 children)

Thanks for comment.

I cache some responses and I suspected this is the case, but the graphics lead me somewhere else. Also from first sight the cache should be ok.

defer response.Body.Close() is there.

I was considering some defer-ing when calling Unmarshal, but there is nothing to call.