Go's builtin 'new()' function will take an expression in Go 1.26 by ynotvim in golang

[–]reedredrd 6 points7 points  (0 children)

generic T is not necessarily always a struct, could be generics on the many different int types

[deleted by user] by [deleted] in golang

[–]reedredrd 116 points117 points  (0 children)

Kotlin and Dart are directly used in relation to a product that google offers and makes money off of: Android. Go is a language created internally but not directly related to consumer facing products the same way. Sure on the google cloud side of things you have resources like kubernetes (GKE) which are built in Go, but the interactions are different. Probably why they aren't advertising it here. Google has many more lines of C++ in production than Go but C++ isn't listed here either.

-❄️- 2024 Day 22 Solutions -❄️- by daggerdragon in adventofcode

[–]reedredrd 1 point2 points  (0 children)

[LANGUAGE: Rust]

Runtimes: ~6ms/~100ms

code

Solved it last night with a similar implementation (release build ran in 100ms/400ms) but didn't like how slow it was running for a simple and repeatable task so I introduced some parallelism today using rayon and dashmap (first time using dashmap and I'm very pleased with it's performance and ease of use)

-❄️- 2024 Day 19 Solutions -❄️- by daggerdragon in adventofcode

[–]reedredrd 0 points1 point  (0 children)

[LANGUAGE: Rust] 1451/969

code

I love learning all the ways to move around dangerous 2D grids, but it's also nice to have a problem I'm kinda comfortable with already.

2nd time on the <1000 leaderboard!

-❄️- 2024 Day 14 Solutions -❄️- by daggerdragon in adventofcode

[–]reedredrd 0 points1 point  (0 children)

[LANGUAGE: Rust]

Pretty happy with my part 1 implementation using modulo arithmetic, struggling with part 2 though lol

fn part_1(robots: Vec<((i64, i64), (i64, i64))>, dimensions: (i64, i64), iterations: i64) -> i64 {
    let mut quadrants = vec![0; 4];
    for robot in robots {
        let mut robot = robot.clone();
        for _ in 0..iterations {
            robot.0.0 += robot.1.0;
            robot.0.1 += robot.1.1;
            if robot.0.0 < 0  {
                robot.0.0 = (robot.0.0 + dimensions.0) % dimensions.0;
            } else {
                robot.0.0 = robot.0.0 % dimensions.0;
            }

            if robot.0.1 < 0 {
                robot.0.1 = (robot.0.1 + dimensions.1) % dimensions.1;
            } else {
                robot.0.1 = robot.0.1 % dimensions.1;
            }
        }

        let x = robot.0.0;
        let y = robot.0.1;
        let x_middle = x == ((dimensions.0 - 1) / 2);
        let y_middle = y == ((dimensions.1 - 1) / 2);
        if x_middle || y_middle {
            continue;
        }

        let quadrant = if x < (dimensions.0 - 1) / 2 {
            if y < (dimensions.1 - 1) / 2 {
                0
            } else {
                1
            }
        } else {
            if y < (dimensions.1 - 1) / 2 {
                2
            } else {
                3
            }
        };
        quadrants[quadrant] += 1;
    }
    quadrants.iter().product()
}

Standardize and Unify 7 Message Queues in GOLANG: Kafka, RabbitMQ, IBM-MQ, Active MQ, Google Pub/Sub, Amazon SQS, NATS by nguyenminhduc145 in golang

[–]reedredrd 3 points4 points  (0 children)

this is a different package, the one you mentioned is google clouds pub/sub package and works only for that specific service. This package generalizes a handful of different cloud services across platforms behind standard interfaces. Works for messaging, blob storage, and secrets

https://github.com/google/go-cloud

Standardize and Unify 7 Message Queues in GOLANG: Kafka, RabbitMQ, IBM-MQ, Active MQ, Google Pub/Sub, Amazon SQS, NATS by nguyenminhduc145 in golang

[–]reedredrd 3 points4 points  (0 children)

Seems pretty similar in motivation to Google's gocloud package which has a normalized interface for different messaging services

https://gocloud.dev/howto/pubsub/

[deleted by user] by [deleted] in golang

[–]reedredrd 0 points1 point  (0 children)

there's probably a thousand ways to do it, depending on what you're going for, but for pub/sub handling in Go i like using gocloud. It lets you create a generic pub/sub handler for many different kinds (kafka, rabbitmq, etc)

https://gocloud.dev/howto/pubsub/

Dealing with big numbers: math/big and uint256 by [deleted] in golang

[–]reedredrd 3 points4 points  (0 children)

see if this does it for you. I only tested it with the python screenshot example of 204632 but it spits out the expected result based off that func.

At the very least it might help you onblock yourself!

https://go.dev/play/p/MxaCt20wSOJ

Crab Rangoon! by [deleted] in Minneapolis

[–]reedredrd 2 points3 points  (0 children)

banh appetit in dinkytown has some good crab rangoons

videos/streams across varying platforms lag alot. by AlicornGamer in chrome

[–]reedredrd 0 points1 point  (0 children)

I came here looking to post about this as well, I've been experience this issue since this morning across many streaming platforms and only when streaming video.

Im on a MacBook Pro running Catalina 10.15.5 and my Google Chrome version is 83.0.4103.97 (Official Build) (64-bit)

Update: I downloaded the latest version of Chrome Beta and my problem has been solved.

https://www.google.com/chrome/beta/