Ategon

joined 1 year ago
MODERATOR OF
[–] [email protected] 11 points 10 months ago

had some trolls who made an account there and started spamming nsfl content in a bunch of comment sections

[–] [email protected] 21 points 10 months ago

Update: Ada is back and banned them, im refederating

[–] [email protected] 2 points 10 months ago

Ive temporarily defederated programming.dev from blahaj until the spam wave is sorted and deleted all the comments so we shouldnt get any more of them

When the accounts are dealt with im refederating

[–] [email protected] 26 points 10 months ago* (last edited 10 months ago) (1 children)

Im going to temporarily defederate for now until they get the spam bot problem under control but once the admin comes online and gets everything sorted im refererating

[–] [email protected] 2 points 10 months ago

Lemmy doesn't handle certain characters well currently such as left angle brackets and ampersands due to some sanitization in the back end to stop scripting attacks

[–] [email protected] 2 points 10 months ago* (last edited 10 months ago)

[Rust] Harder one today, for part 1 I ended up getting stuck for a bit since I wasnt taking numbers at the end of lines into account and in part 2 I defined my gears vector in the wrong spot and spent a bit debugging that

Code(lemmy removes some chars, all chars are in code link)

use std::fs;

fn part1(input: String) -> u32 {
    let lines = input.lines().collect::>();
    let mut sum = 0;

    for i in 0..lines.len() {
        let mut num = 0;
        let mut valid = false;
        let chars = lines[i].chars().collect::>();

        for j in 0..chars.len() {
            let character = chars[j];
            let parts = ['*', '#', '+', '$', '/', '%', '=', '-', '&', '@'];

            if character.is_digit(10) {
                num = num * 10 + character.to_digit(10).unwrap();

                if i > 0 {
                    if parts.contains(&lines[i - 1].chars().collect::>()[j]) {
                        valid = true;
                    }

                    if j > 0 {
                        if parts.contains(&lines[i - 1].chars().collect::>()[j - 1]) {
                            valid = true;
                        }
                    }

                    if j < chars.len() - 1 {
                        if parts.contains(&lines[i - 1].chars().collect::>()[j + 1]) {
                            valid = true;
                        }
                    }
                }

                if i < lines.len() - 1 {
                    if parts.contains(&lines[i + 1].chars().collect::>()[j]) {
                        valid = true;
                    }

                    if j > 0 {
                        if parts.contains(&lines[i + 1].chars().collect::>()[j - 1]) {
                            valid = true;
                        }
                    }

                    if j < chars.len() - 1 {
                        if parts.contains(&lines[i + 1].chars().collect::>()[j + 1]) {
                            valid = true;
                        }
                    }
                }

                if j > 0 {
                    if parts.contains(&lines[i].chars().collect::>()[j - 1]) {
                        valid = true;
                    }
                }

                if j < chars.len() - 1 {
                    if parts.contains(&lines[i].chars().collect::>()[j + 1]) {
                        valid = true;
                    }
                }
            }
            else {
                if valid == true {
                    sum += num;
                }

                num = 0;
                valid = false;
            }

            if j == chars.len() - 1 {
                if valid == true {
                    sum += num;
                }

                num = 0;
                valid = false;
            }
        }
    }

    return sum;
}

fn part2(input: String) -> u32 {
    let lines = input.lines().collect::>();
    let mut gears: Vec<(usize, usize, u32)> = Vec::new();
    let mut sum = 0;

    for i in 0..lines.len() {
        let mut num = 0;
        let chars = lines[i].chars().collect::>();
        let mut pos: (usize, usize) = (0, 0);
        let mut valid = false;

        for j in 0..chars.len() {
            let character = chars[j];
            let parts = ['*'];

            if character.is_digit(10) {
                num = num * 10 + character.to_digit(10).unwrap();

                if i > 0 {
                    if parts.contains(&lines[i - 1].chars().collect::>()[j]) {
                        valid = true;
                        pos = (i - 1, j);
                    }

                    if j > 0 {
                        if parts.contains(&lines[i - 1].chars().collect::>()[j - 1]) {
                            valid = true;
                            pos = (i - 1, j - 1);
                        }
                    }

                    if j < chars.len() - 1 {
                        if parts.contains(&lines[i - 1].chars().collect::>()[j + 1]) {
                            valid = true;
                            pos = (i - 1, j + 1);
                        }
                    }
                }

                if i < lines.len() - 1 {
                    if parts.contains(&lines[i + 1].chars().collect::>()[j]) {
                        valid = true;
                        pos = (i + 1, j);
                    }

                    if j > 0 {
                        if parts.contains(&lines[i + 1].chars().collect::>()[j - 1]) {
                            valid = true;
                            pos = (i + 1, j - 1);
                        }
                    }

                    if j < chars.len() - 1 {
                        if parts.contains(&lines[i + 1].chars().collect::>()[j + 1]) {
                            valid = true;
                            pos = (i + 1, j + 1);
                        }
                    }
                }

                if j > 0 {
                    if parts.contains(&lines[i].chars().collect::>()[j - 1]) {
                        valid = true;
                        pos = (i, j - 1);
                    }
                }

                if j < chars.len() - 1 {
                    if parts.contains(&lines[i].chars().collect::>()[j + 1]) {
                        valid = true;
                        pos = (i, j + 1);
                    }
                }
            }
            else {
                if valid == true {
                    let mut current_gear = false;
                    
                    for gear in &gears {
                        if gear.0 == pos.0 && gear.1 == pos.1 {
                            sum += num * gear.2;
                            current_gear = true;
                            break;
                        }
                    }
                    
                    if !current_gear {
                        let tuple_to_push = (pos.0.clone(), pos.1.clone(), num.clone());
                        gears.push((pos.0.clone(), pos.1.clone(), num.clone()));
                    }
                }

                num = 0;
                valid = false;
            }

            if j == chars.len() - 1 {
                if valid == true {
                    let mut current_gear = false;
                    
                    for gear in &gears {
                        if gear.0 == pos.0 && gear.1 == pos.1 {
                            sum += num * gear.2;
                            current_gear = true;
                            break;
                        }
                    }
                    
                    if !current_gear {
                        let tuple_to_push = (pos.0.clone(), pos.1.clone(), num.clone());
                        gears.push((pos.0.clone(), pos.1.clone(), num.clone()));
                    }
                }

                num = 0;
                valid = false;
            }
        }
    }

    return sum;
}

fn main() {
    let input = fs::read_to_string("data/input.txt").unwrap();

    println!("{}", part1(input.clone()));
    println!("{}", part2(input.clone()));
}

Code Link

[–] [email protected] 56 points 10 months ago* (last edited 10 months ago) (3 children)

Zoomed out graph including some months before the join wave

Users/month are relatively stable now at 33x users/month compared to pre join wave (users/month is people who have posted or commented)

[–] [email protected] 3 points 10 months ago* (last edited 10 months ago)

Rust (Rank 7421/6311) (Time after start 00:32:27/00:35:35)

Extremely easy part 2 today, I would say easier than part 1 but they share the same sort of framework

Code Block(Note lemmy removed some characters, code link shows them all)

use std::fs;

fn part1(input: String) -> i32 {
    const RED: i32 = 12;
    const GREEN: i32 = 13;
    const BLUE: i32 = 14;

    let mut sum = 0;

    for line in input.lines() {
        let [id, content] = line.split(": ").collect::>()[0..2] else { continue };
        let id = id.split(" ").collect::>()[1].parse::().unwrap();

        let marbles = content.split("; ").map(|x| { x.split(", ").collect::>() }).collect::>>();
        let mut valid = true;

        for selection in marbles {
            for marble in selection {
                let marble_split = marble.split(" ").collect::>();
                let marble_amount = marble_split[0].parse::().unwrap();
                let marble_color = marble_split[1];

                if marble_color == "red" && marble_amount > RED {
                    valid = false;
                    break;
                }

                if marble_color == "green" && marble_amount > GREEN {
                    valid = false;
                    break;
                }

                if marble_color == "blue" && marble_amount > BLUE {
                    valid = false;
                    break;
                }
            }
        }

        if !valid {
            continue;
        }

        sum += id;
    }

    return sum;
}

fn part2(input: String) -> i32 {
    let mut sum = 0;

    for line in input.lines() {
        let [id, content] = line.split(": ").collect::>()[0..2] else { continue };
        let id = id.split(" ").collect::>()[1].parse::().unwrap();

        let marbles = content.split("; ").map(|x| { x.split(", ").collect::>() }).collect::>>();
        
        let mut red = 0;
        let mut green = 0;
        let mut blue = 0;

        for selection in marbles {
            for marble in selection {
                let marble_split = marble.split(" ").collect::>();
                let marble_amount = marble_split[0].parse::().unwrap();
                let marble_color = marble_split[1];

                if marble_color == "red" && marble_amount > red {
                    red = marble_amount;
                }

                if marble_color == "green" && marble_amount > green {
                    green = marble_amount;
                }

                if marble_color == "blue" && marble_amount > blue {
                    blue = marble_amount;
                }
            }
        }

        sum += red * green * blue;
    }

    return sum;
}

fn main() {
    let input = fs::read_to_string("data/input.txt").unwrap();

    println!("{}", part1(input.clone()));
    println!("{}", part2(input.clone()));
}

Code Link

[–] [email protected] 2 points 10 months ago

Im not sure how lemm.ee handles it but a lot of instances that aren't lemm.ee dont have uploads disabled

For example this post has an image uploaded to .world

[–] [email protected] 4 points 10 months ago* (last edited 10 months ago)

I dug through the code and turns out the post read table does store when its read (with number of comments when it was read stored in a person post aggregates table), it just only stores it for people from your instance so I cant get accurate numbers from all of lemmy (and why it seemed like there was a low amount)

[–] [email protected] 12 points 10 months ago (1 children)

The 118k is half year aka 6 months

The one around 35k is month

[–] [email protected] 3 points 10 months ago (2 children)

Dont have access to those stats in the database so adding on voting is the best I can do

Theres a post read table but its only people who have explicitly marked something as read and is way less than the post likes

 

11 hour long tutorial where he goes over pretty much all basic aspects of the engine

 

Welcome to the Weekly Discussion! This is a place where you can do general chat in the community for things that might not deserve their own post

2
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 

This is a spot to chat about anything relating to the haskell programming language!

Currently this community doesn't have any mods so if you want to moderate it feel free to dm me or reply here

 

Welcome to Showcase Sunday!

Are you making anything in Godot? Feel free to discuss it below or show off your progress!

1
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 

Edit: if you already voted see edit at bottom of post

Hey everyone, this is another post regarding choosing the icon style for communities in the instance

There was a bunch of issues raised about the last poll so Ive remade it. The last poll results will not count and instead these ones will be used

  • Voting is done by single transferable vote
  • You can no longer accidentally click vote

There are two Parts of the poll: The icon style and the icon shape

Icon Style

Note this is just to determine the recommended style for communities, individual communities can choose not to follow it if they want

Option 1: All Unified Same Color

This option is for every icon to have the same style and same color gradient

Option 2: All Unified Diff Colors

This option is for every icon to have the same style with the black background and gradient. However each community has their own colors for the gradient rather than having the same one for all of them. For example the godot community might have a blue purple gradient for their logo and functional programming might have orange red.

Option 3: General Unified Same Col

This option is for general communities (such as experienced devs, meta, programming, game development (things that arent specific to one language, engine, etc.)) have the unified style but other communities instead have the logo for the language, engine, etc.. For example game development would have the gradient icon but godot would have the godot logo

Option 4: General Unified Diff Col

This is a combination of options 2 and 3 where general communities have the gradient style but they also have different colors from each other

Option 5: No Unified Style

No gradient logos for any communities, instead having different style ones for every community

Icon Shape

This is the default shape that you want community logos to have when they show up. If a community logo has a specific shape (ex the godot logo) the voted on shape is overridable. Users will also be able to override whatever gets chosen locally, its just the default. Currently lemmy uses circles for both users and communities.

Poll Link

Edit: the website that was being used makes it very easy to cheat by just downloading a new browser and voting again as many times as you want. Due to this voting will be happening through dms to me. Sorry for all of the iterations of the vote but this will be a big change in the instance and I want to get accurate info

If you want to vote send me a dm with the options ordered based on your preference. Here are the available options (for the two different votes):

Icon Style

  • All Unified Same Color
  • All Unified Diff Colors
  • General Unified Same Col
  • General Unified Diff Col
  • No unified style

Icon Shape

  • Circle
  • Squircle
  • Square
  • Diamond
  • Hexagon
  • Pentagon

Rank each category from your first choice to your last choice. If your first choice ends up having the least amount of votes then your second choice vote counts instead, etc. until one option has 50% or more of votes.

To dm me go to my profile Here and click on one of the send message buttons (secure message sends it through matrix while the other just sends it through lemmy)

Ill respond to you when I note down your vote to be counted (shouldnt take longer than 8 hours and I try to respond quickly, if I dont then something went wrong with the dm)

Voting will end in a week

 

Hey everyone! Ive made a third bot for the instance called Linker. This bot will automatically detect when you try to reference a certain community and then give both relative and direct links to it in a comment for people to check out.

The usual syntax when you want to reference a community is [email protected] with communityname replaced by the community name and programming.dev replaced with the instance the community is in

It will also detect when you link a community like this https://programming.dev/c/programming

Works for both posts and comments but will only handle communities that have been entered in the bot. To start with I've put in the top 50 most active communities in the instance but will put the rest in soon

If you have any suggestions for communities to link in on other instances let me know

Source Code

1
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 

Now that people have settled in a bit into the instance and we have over 100 communities created I've created a new community that new community requests are going to be moved into rather than the pinned thread

Feel free to post community ideas in there and they will be considered to be added once they hit 7 points from upvotes

You can also request to take over communities that have inactive mods there

You can find the it using these links:

1
Community Icon Poll (programming.dev)
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 

Edit: This link is outdated, see new poll here https://programming.dev/post/190520

Hey everyone

Wanted to run a poll about the community icons to choose between a couple options

Option 1 - Use UBP icons - Use unified icons for all of the communities similar to beehaw

Option 2 - Use UBP for general communities and specific language, etc. icons for specific communities

Option 3 - Dont use UBP icons

Vote using the strawpoll here (doing strawpoll so it can be ranked voting) [removed in favor of new post]

EDIT: I have remade the poll with two more options. If you voted in the previous one please vote again in this. The new options are just for adding different colored gradients to the unified icons for different communities

Quick example of this:

 

cross-posted from: https://programming.dev/post/149828

Hey everyone! Wanted to highlight some other game development related communities in the instance

I Need a Team (Getting teammates)

A community for finding teammates to work with for both free and paid work. This includes getting teammates for making commercial games, finding other people to work with for a game jam, etc.

Play My Game (Posting about game)

A community for showing off your completed game to others

Destroy My Game (Getting Feedback)

A community for getting honest feedback on things such as aspects of your game, your store page, mechanics, etc.

Godot (Game Engine)

A community for posting anything relating to the godot game engine

Unity (Game Engine)

A community for posting anything relating to the unity game engine

Unreal (Game Engine)

A community for posting anything relating to the unreal game engine

Pico-8 (Game Engine)

A community for posting anything relating to the pico-8 game engine

2
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 

Hey everyone! Wanted to highlight some other game development related communities in the instance

I Need a Team (Getting teammates)

A community for finding teammates to work with for both free and paid work. This includes getting teammates for making commercial games, finding other people to work with for a game jam, etc.

Play My Game (Posting about game)

A community for showing off your completed game to others

Destroy My Game (Getting Feedback)

A community for getting honest feedback on things such as aspects of your game, your store page, mechanics, etc.

Godot (Game Engine)

A community for posting anything relating to the godot game engine

Unity (Game Engine)

A community for posting anything relating to the unity game engine

Unreal (Game Engine)

A community for posting anything relating to the unreal game engine

Pico-8 (Game Engine)

A community for posting anything relating to the pico-8 game engine

 
 

Short video where he goes over a couple important things

  • Add an icon to your game
  • Add a splash screen
  • Set the main scene of your project properly
  • Add your game name in the project settings + localizations
  • Make fullscreen the default (most of the time)
  • Add a custom mouse cursor
  • Enable AA if applicable to get rid of jaggies
view more: ‹ prev next ›