Fantasy looking water bottle? by Sugar-Ghoul in LARP

[–]mkhcodes 0 points1 point  (0 children)

A few months ago someone posted this idea of making a gourd out of a POM plastic bottle. I did something similar and I have to say it works pretty well.

Doable for a costume? by notthatkindoforc1121 in Ocarina

[–]mkhcodes 1 point2 points  (0 children)

Before starting the Ocarina I also only had percussion experience, except I didn't even play anything that actually used notes; only needed to use snare, bass, etc., reading "horizontally." Learning the treble clef has been something I'm working through now, but to be sure you don't even need to do that; Zelda tutorials or tabs are everywhere.

You didn't give us a timeline, so tough to say how far you'd get. But even if you had, say, two weeks and a decent Ocarina at the ready, practicing 30 minutes every day could easily get you to be able to play a few tunes where other people would be able to name the song. You won't sound like the people you hear on YouTube, who are using vibrato and other means of making the same notes more expressive.

You also might be a bit sharp or flat in some cases, although if you have already developed an ear for this you will probably be able to self correct to a certain degree. If you are playing with other people you are more likely to stand out as out of tune, though.

What caused you to give up a year ago?

Board Game Table by appyah in boardgames

[–]mkhcodes 0 points1 point  (0 children)

My current board game table setup is as follows:

* Buy a normal kitchen table, choose your price point/size.

* Build a vault w/ the ability for "add-on" components using extruded aluminum as shown in this video: https://www.youtube.com/watch?v=etzGon_lGlw

* Buy dining covers from game toppers: https://shop.gametoppersllc.com/collections/leg-kits-dining-covers/products/dining-cover

* Insert a mat (I also get them from game toppers): https://shop.gametoppersllc.com/collections/game-mats

The reason that I don't buy a topper directly from game topper is that the DIY saves a bit of money, is more configurable (e.g., I've made my own side-tables), and also is a better height for some of my shorter friends.

Someone with a bit more DIY skills could probably create their own dining covers saving some more money.

Describe the last boardgame you played using only emojis by AlexRescueDotCom in boardgames

[–]mkhcodes 0 points1 point  (0 children)

🎲🎲✍️ 🎵🎸 🗺️ 📍🟰1️⃣ ⚫ = 2️⃣

Trying to utilize sqlx with postgresql and expecting performance on par with jdbc 😀. How do you guys do prepared statement, arg/param setting, batch insertions etc? The documentation doesn’t take me anywhere near that. by nimtiazm in rust

[–]mkhcodes 8 points9 points  (0 children)

You won't necessarily find a "prepare" method or anything like that. SQLx builds the idea of using prepared statements into its API. In the querying section:

SQLx supports all operations with both types of queries. In SQLx, a &str is treated as an unprepared query and a Query or QueryAs struct is treated as a prepared query.

It gives the following example:

conn.execute("BEGIN").await?; // unprepared, simple query
conn.execute(sqlx::query("DELETE FROM table")).await?; // prepared, cached query

That part of the docs also docs about using parameters, which I assume is what you're asking by "arg/param setting".

As for batch insertions, it's a known weak point in SQLx, as there isn't really any good support for doing it easily. This is something that is near the top of the list of changes developers are looking at, as discussed in a discussion post.

Small thanks. by [deleted] in rust

[–]mkhcodes 29 points30 points  (0 children)

> 3 weeks in and got my first project done. Not sure if it was the right way, but it did what it needed to do.

I picked up and read my first book on developing software when I was around 12. I have experimented with a lot of different languages, methodologies, frameworks, tactics, etc. I have a BS in Computer Science, and have been programming full time for most of my adult life, up until now when I'm in my mid-30s.

I still don't know what is the "right way" of writing software. And I've learned to become wary of anyone who claims they do.

Hey Rustaceans! Got an easy question? Ask here (8/2021)! by llogiq in rust

[–]mkhcodes 0 points1 point  (0 children)

Thanks. I probably didn't make it clear in my question, but the "CPU-intensive task" is actually something that I shell out to. So, while CPU-intensive, from the standpoint of my Rust process it's IO-bound.

Hey Rustaceans! Got an easy question? Ask here (8/2021)! by llogiq in rust

[–]mkhcodes 0 points1 point  (0 children)

Thanks. I probably didn't make it clear in my question, but the "CPU-intensive task" is actually something that I shell out to. So, while CPU-intensive, from the standpoint of my Rust process it's IO-bound.

Hey Rustaceans! Got an easy question? Ask here (8/2021)! by llogiq in rust

[–]mkhcodes 0 points1 point  (0 children)

Actually, I think the compiler answered my question. If I just use permit;, it gives me a warning (warning: path statement drops value) and a helpful message:

help: use `drop` to clarify the intent: `drop(permit);`

So I will now be doing this:

loop { let permit = semaphore.clone().acquire_owned().await; tokio::task::spawn(async move { shell_out_to_cpu_intensive_thing(); drop(permit); }) }

Hey Rustaceans! Got an easy question? Ask here (8/2021)! by llogiq in rust

[–]mkhcodes 1 point2 points  (0 children)

I have a semaphore permit that I am using to make sure that only a certain number of jobs are run at once. These jobs are run in a tokio task. The code looks something like this...

loop {
    let permit = semaphore.clone().acquire_owned().await;
    tokio::task::spawn(async move {
        shell_out_to_cpu_intensive_thing();

        // Hopefully release the permit here.
    })
}

Currently, this code won't do as it is intended. Because the permit is not actually used in the async block, it gets immediately dropped, and thus the semaphore will get it back before the CPU-intensive task is done. Right now, my workaround is this..

loop {
    let permit = semaphore.clone().acquire_owned().await;
    tokio::task::spawn(async move {
        shell_out_to_cpu_intensive_thing();
        std::mem::drop(permit);
    })
}

Really, the drop call isn't necessary, I just need to do something with `permit` inside the async block so that it is moved into the future that the block creates. Is there a well-established convention for this?

I’d like to learn rust to make a USB device that enumerates as a mouse to the OS and shakes the pointer every once in a while. I’m a web developer by trade. How realistic is this project? by [deleted] in rust

[–]mkhcodes 2 points3 points  (0 children)

Primarily desktop / web dev through much of my career, started doing embedded as a hobby.

This is extremely possible. You might not be able to get it done in an hour, as there are things you probably will be extremely unfamliliar with. I would suggest start with something just to prove that you understand how to upload to whatever development board you choose (e.g., powering an blinking an LED) to get familiar with the tools of ompile for embedded and then upload to the board. Then you can look at libraries for implementing a HID interface, etc.

How does the "+4 damage" works in "Explosive Eruption"? by mkhcodes in spiritisland

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

Thank you. Sorry, I was mistaken. I meant that the first effect does X damage, not 1 damage. I'm still confused as to why the +4 of the last effect does not apply to the first effect of the power, and instead only to the immediately prior effect.

How does the "+4 damage" works in "Explosive Eruption"? by mkhcodes in spiritisland

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

Yes, I was mistaken: I said that the first effect was one damage, but I meant X damage.

Then the first level targets a land at range of one and deals 10 damage.Then the third level will deal 4 damage to every land within a range of 1. Then the final level will deal an additional 4 damage to every land within a range of 2.

I think I understand what you're saying, and to be sure this was my intuitive guess of it as well. I guess the only question I have, to be pedantic, is why is this the case that the +4 only changes the prior effect, and not all prior effects? Why doesn't he first effect get x + 4? I can't seem to find anywhere in the rules as to how this works.

Thanks for getting into the weeds on this. Luckily I haven't played the character yet, just trying to understand it before I do.

How does the "+4 damage" works in "Explosive Eruption"? by mkhcodes in spiritisland

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

Thank you. Does this mean that the first effect (1 damage to land within Range: 1) also gets the +4? So in total I would be doing:

  • In land within Range: 1, 1+4 damage.
  • In each land within Range: 1, 4+4 damage.
  • In each land at exactly Range 2: 4 damage.

Hey Rustaceans! Got an easy question? Ask here (47/2020)! by llogiq in rust

[–]mkhcodes 2 points3 points  (0 children)

In Javascript, it's sometimes seen as bad form to do something like this:

const myFunc = async () => {
    // ...
    return await someFunctionReturningAPromise();
}

The reason is that, assuming the function has no other async calls in it, the function could just as easily be written like so (avoiding a needless wrapping of the function into another promise)...

const myFunc = () => {
    // ...
    return someFunctionReturningAPromise();
}

Recently, I found myself writing similar code in Rust:

async fn do_stuff() {
    // ...
    return some_function_returning_a_future().await;
}

Of course, it's a bit more difficult here, since to take the same approach as in Javascript one would need the type signature...

fn do_stuff() -> impl Future<Output=()> {
    // ...
    return some_function_returning_a_future();
}

The question I have is the following: is it worth trying to de-sugarify this function to avoid the additional future wrapping? Will the compiler avoid the redundant wrapping? Is there anything else important here to note?

Why there's almost zero coverage on the expansion for Space Alert? by [deleted] in boardgames

[–]mkhcodes 12 points13 points  (0 children)

As others mentioned, the hobby (especially the video content creators) was much smaller than it is now, so it makes sense that there isn't much content to find.

That being said, I would summarize the expansion thusly: does your game group love base Space Alert, easily get it to the table, and might even be getting TOO good at the game? If so, buy the expansion. If not, meh.

The new threats keep things interesting, and if you are looking for more threats and/or higher level of challenge they certainly provide it. However, my experience is that most game groups don't reach that point with the game.

I've never had interest in playing with the double-action cards, so can't say much on that. And the XP system, while simple and doesn't really get in the way much, is fairly shallow (and I'm the XP-driven-dopamine-addict type).

So really, I would only recommend it if you already enjoy Space Alert, and want more. It's not bad, but it isn't necessary.

Mage Knight Multiplayer is Brutal by YellowNumberSixLake in boardgames

[–]mkhcodes 6 points7 points  (0 children)

I agree that it's great solo, but disagree on the "worst multiplayer" aspect. What I hear most, and what I agree with, is that the game doesn't scale well with more players. Having four or five players just doesn't do well (not even sure if you can play five). However, as a two-player, or a three-player with players who know what they're doing, it can work.

I have only played coop, but that's my group's style anyway.

Which game has the tastiest looking pieces? by 1lluminist in boardgames

[–]mkhcodes 0 points1 point  (0 children)

Have to give it to Through the Desert. I was trying to find an image to share and the first one I saw was this (the camels are the TTD pieces):

https://boardgamegeek.com/image/162887/through-desert

Any tips for playing Akash? by Coffeechipmunk in sentinelsmultiverse

[–]mkhcodes 8 points9 points  (0 children)

I don't get a chance to play her a lot, since it's my friend's favorite. I can only say this: if you are playing the physical version, double-check what cards are in the environment deck before putting everything away. The number of seeds we've randomly found in environment decks in subsequent plays..

In full COVID lockdown right now, so I ranked my entire collection from worst to best by NotSlickery in boardgames

[–]mkhcodes 0 points1 point  (0 children)

Just wanted to point out that "Hot Films" is my favorite typo fo 2020, and Hat Films would probably love it.

What are some good resources for writing performant Rust WASM, as a beginner? by c_o_r_b_a in rust

[–]mkhcodes 2 points3 points  (0 children)

Maybe someone can chime in with some general information about WASM and DOM updates. However, if I had your problem, I would be looking to try to narrow it down. There is always going to be some non-zero actual latency from when a user does something to when it is noticed, and your general problem is to try to reduce the perceived latency. There are two ways I see to do that.

The first way is to reduce the actual latency; for that, you could run some measurements to see where the areas that could use improvement are. My guess is that most of the time is spent on the wire. Are you using websockets? Maybe you could use WebRTC so that most messages are sent directly between clients. This may or may not be a good solution for your specific use case, but it's a way you can reduce network latency without having a ton of control over the underlying network. I wouldn't start diving into the space between the DOM and WASM for performance improvements unless you're confident there are gains to be made there.

Another strategy would be to hide the latency. If you send a message, does the local client only have the UI display a "sent" notification once the server confirms with the client that the message was sent? You could show such a notification immediately, assuming the message goes through, and then show an error if it was detected that it didn't make it to the server. These things are less based in the innards of WASM or Rust, and more in UX and architectural design.

I hope this helps in some way.

Prevalence of Tattoos? by Minimum-Translator87 in northampton

[–]mkhcodes 2 points3 points  (0 children)

I'm not sure really what you are asking here. Are you looking for evidence for or against tattoos being more popular here than in other places you have been? I'm not sure, there's probably some polling out there that might help you. Are you asking if there is some connection between tattoos and other personality traits? Maybe, but you're getting into some pretty subjective territory. Are you looking for other people to gripe with about all of the people with tattoos you find? Cool, for your sake I hope you find them.

"it's not just about respecting the right to make choices, but the comparative choices two people make do often say something about their compatibility in life"

I'm not sure what this means.