modulus

joined 2 years ago
[–] [email protected] 4 points 3 months ago (1 children)

From the link:

We are very excited to announce that we have made our self-research agent demo open source, you can now try our agent demo online at demo for instant English chat and English and Chinese chat locally by following the docs.
You should mention that the content is released under a CC BY-NC-SA 4.0 licence.

So which is it, open source or CC-BY-NC-SA? NC restrictions are not compatible with either the free software or the open source definitions.

[–] [email protected] 6 points 7 months ago (1 children)

I do not think it is a very good analogy. I do not see how this would turn into a broadcast medium. Though I do agree it can feel less accessible and there is a risk of building echo chambers.

Not so concerned on that--people being able to establish their tolerances for whom they want to talk to is fine with me. But if the system goes towards allowlists, it becomes more cliquish and finding a way in is more difficult. It would tend towards centralisation just because of the popularity of certain posters/instances and how scale-free networks behave when they're not handled another way.

It’s most likely a death sentence for one-persone instances. Which is not ideal. On the other hand, I’ve seen people managing their own instance give up on the idea when they realized how little control they have over what gets replicated on their instance and how much work is required to moderate replies and such. In short, the tooling is not quite there.

I run my instance and that's definitely not my experience. Which is of course not to say it can't be someone else's. But something, in my opinion not unimportant, is lost when it becomes harder to find a way in.

[–] [email protected] 9 points 7 months ago (3 children)

I'm concerned that people are already eager to bury the fediverse and unwilling to consider what would be lost. The solutions I keep hearing in this space all seem to hinge on making the place less equal, more of a broadcast medium, and less accessible to unconnected individuals and small groups.

How does an instance get into one of these archipelagos if they use allowlists?

Same thing with reply policies. I can see the reason why people want them, but a major advantage on the fedi is the sense that there is little difference between posters. I think a lot of this would just recreate structures of power and influence, just without doing so formally--after all the nature of scale-free networks is large inequality.

[–] [email protected] 6 points 8 months ago

It's possible FF wouldn't get away with something like integrating ad blocking by default, but in no reasonable universe were they required to do the PPA stuff and turn it on by default. Nor is it clear that it will lead to websites caring about FF compatibility--unfortunately many already don't.

[–] [email protected] 15 points 8 months ago (2 children)

The usual pro-advertising take. "It's ok that we're going to experiment without your consent on how to manipulate you, because we only use aggregated data so it's not personal, it's business."

[–] [email protected] 22 points 10 months ago (4 children)

For me the weirdest part of the interview is where he says he doesn't want to follow anyone, that he wants the algorithm to just pick up on his interests. It's so diametrically opposed to how I want to intentionally use social networks and how the fedi tends to work that it's sometimes hard to remember there are people who take that view.

[–] [email protected] 2 points 1 year ago

Ah, that does seem like it will solve the problem. Thanks!

[–] [email protected] 1 points 1 year ago (1 children)

Not sure I understand. What I'm trying to do is something like this:

  • Poll a stream which takes fedi events. Read player commands.
  • If an event comes from a known player, check which match they are into.
  • With that info, get their opponents/coplayers etc and perform the change of state in the game (send replies, next turn, etc).

So what I have as a key is a player name (AP username) and from that I need to find which match they're in.

There's nothing semantically useful about a match ID.

[–] [email protected] 1 points 1 year ago

Thanks, the RC is a possible approach. It seems to violate DRY a bit but maybe there's no way around it.

The reason I had the players outside the match is that I need them there anyway, because when I get a player action I need to check in which match they are, who are their opponent(s) and so on. So even if they're in, they'll have to be out too as there are concurrent matches and the player actions come all through the same network stream.

 

I have a struct that looks like this:

pub struct Game {
    /// A HashSet with the players waiting to play as account strings.
    lobby: HashSet<String>,
    /// capacity determines  how many people a match contains.
    capacity: u8,
    /// A vector of ongoing matches.
    matches: Vec<Match>,
    /// HashSet indicating for each player which match they are in.
    players: HashMap<String, usize>,
}

I realised that this won't work because if there are 3 matches (0, 1, 2) and I remove 1 because it ends, the players that used to point at 2 will be pointing outside the vector or to an incorrect match.

So I thought the obvious solution was to use a reference to the match: players: HashMap<String, &Match>. But this makes lifetimes very complicated.

What's a good way to deal with a case like these where data are interrelated in the same struct?

[–] [email protected] 1 points 2 years ago

Possibly yes. I'll check if the results are equivalent.

[–] [email protected] 5 points 2 years ago (2 children)

Apparently the problem is due to an incompatibility between the use of certain libraries (winapi and windows-sys) which use different versions of COM. At least so I deduce from the documentation I've read.

There's a workaaround:

On Cargo.toml, use.

[build-dependencies]
embed-manifest = "1.3.1"

And on the root of the project (not the src dir) create a build.rs file with the following content:

use embed_manifest::{embed_manifest, new_manifest};

fn main() {
    if std::env::var_os("CARGO_CFG_WINDOWS").is_some() {
        embed_manifest(new_manifest("Contoso.Sample")).expect("unable to embed manifest file");
    }
    println!("cargo:rerun-if-changed=build.rs");
}

This embeds a manifest together with the executable, solving the issue.

[–] [email protected] 1 points 2 years ago

Same erro by using this approach.

Tokio works fine, by itself. windows-native-gui works fine, by itself. It is the combination that causes this issue.

 

Hi there,

I'm trying to do some native windows rust programming. I'm using native-windows-gui and native-windows-derive to do it, but if I try to mix that with tokio, I get the following:

No entry point found error for GetWindowSubclass. On console, I get:

error: process didn't exit successfully: `C:\source\myprojectanem\target\debug\myprojectname.exe` (exit code: 0xc0000139, STATUS_ENTRYPOINT_NOT_FOUND)

If I change

#[tokio::main]
async fn main() {

to:

fn main() {

The problem goes away, but obviously I can't use tokio then.

Any clue what the problem is and how to fix it?

 

Hi there,

I'm working on a bot to do social games on the fedi, and using the mastodon-async crate for communicating with the ActivityPub server in question. At the moment I'm using tokio mt as a runtime, though I'm new at async so if you think I shouldn't let me know.

The pattern I want to implement is the following:

  • At any given time, a user sends a "play" message to the bot.
  • If the player list is empty, the player is added to it awaiting someone else.
  • Otherwise, the bot checks if there are enough players on its list (who have previously sent a play message). For some games, enough is 1, since it's a 2-player game, for some it's 3 or more.
  • If there are enough players, play commences. list is cloned for that match, then emptied so other players can get in.

What I'm not very clear is how to keep this list to assure that sequence will be respected. I.a., if two play messages come reasonably quick together, I want one to be processed, then entered on the list, or get the match to start; then the other to get processed.

My current thoughts:

  • I could use a channel that receives the player accounts. When a new player is added, it performs the logic.
  • I could use a mutex with a list (or an option player value for the degenerate case of 2-player games).

Any thoughts on what the reasonable thing to do is here? I'm very new to async and while I realise there's probably lots of ways to do this, they're not all equally ergonomic and I want to avoid myself future pain.

view more: next ›