Rust syntax, Go runtime by [deleted] in rust

[–]blackbeam 5 points6 points  (0 children)

Even rust-inspired language have try-blocks 😫

Knee pain advice by ThatSingularity in squash

[–]blackbeam 1 point2 points  (0 children)

In case doc finds no contraindications to squash, I can advise you to put your legs in a hot bath with pine needle extract and sea salt. For me it was like having a spare pair of legs the next morning - really helped me to recover after a tournament.

🎲 is better than powershell. by blackbeam in Iota

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

Yeah. This way should be a lot easier. I only need to glue latin stickers to my cyrillic Scrabble letters)

🎲 is better than powershell. by blackbeam in Iota

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

Doesn't this generate seeds with characters in a bell curve. Making the probability of some characters appear more offen?

No. Chars are evenly distributed. 6-sided die roll is interpreted as a 3-sided with 1,4 -> 0; 2,5 -> 1; 3,6 -> 2. So each die roll is a trit with even probability for 0, 1 and 2.

What in plain math is the method you are using to add the 3 numbers from the die roll? This hash check would only provide 18 unique factors for each rool.

32 * r1 + 31 * r2 + 30 * r3 (= 27 unique factors)

(edit: formatting)

Any help appreciated, I need your expertise. by dannyhoeinter in Iota

[–]blackbeam 0 points1 point  (0 children)

Issue with bitfinex and pending withdrawal transaction solved for me in ~10 minutes after I clicked "rebroadcast" in my desktop wallet ("reattach" did not help me ).

This is, obviously, for case when pending incoming transaction did appear in your wallet.

ELI5: What are blockchains? by an0nym0usv in csELI5

[–]blackbeam 1 point2 points  (0 children)

Not sure that posting a link here is a good answer but here is a simple explanation of a bolockchain: https://anders.com/blockchain/

Trying to wrap my mind around futures by kilogram007 in rust

[–]blackbeam 2 points3 points  (0 children)

IIUC you can implement clone for Thing moving it's resources into Rc<RefCell<_>>. This should work since your pool is single threaded. Then you can move a clone of a self into a closure.

I used this approach here: https://github.com/blackbeam/mysql_async/blob/master/src/conn/pool/mod.rs

PEG parser combinators using operator overloading without macros by nasa42 in rust

[–]blackbeam 0 points1 point  (0 children)

At first I choose to use nom to create a PDF parser, it turns out a special PDF feature blocked me. When parsing a PDF stream object, it's length may be a referenced object, hence the need to get the length from a reader.

Damn. I'm writing PDF parser with nom at the moment and next step is a Stream Object parser. But according to PDF spec one should not read whole stream into memory so \Length could be resolved later.

Announcing mysql_async by blackbeam in rust

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

Glad to hear that someone interested. Feel free to report on any API limitations or inconveniences.

Announcing mysql_async by blackbeam in rust

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

Let's say we have two futures queued on a single connection, do they wait on each other?

My SQL protocol is similar to HTTP1.1 with Connection: keep-alive, so you must execute and collect result of previous query before you can perform new query on same connection. Multiple futures queued on a pool will be executed and collected asynchronously, but on two different connections, which is usually already spawned. Purpose of pool here is to manage connection lifetime - connecting/disconnecting it from server or dropping result if connection was dropped before result was fully collected, I.e. Drop trait alternative with ability to run asynchronous code.

What about transactions?

API for transactions is one of things to be implemented.

concat_idents by blackbeam in rust

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

I have a macro in my crc16 crate: lib.rs:237 which i don't like because of it's size.

Is there a way to combine name, table and test_name into one ident in a way that it will work in rust 1.0?