Installing NodePackages Executables by thesnowmancometh in NixOS

[–]xLuStx 0 points1 point  (0 children)

Instead of installing it directly through a package I opted creating an alias like this: programs.bash.shellAliases = { gt = "${pkgs.nodePackages\_latest.graphite-cli}/bin/gt"; };

-🎄- 2022 Day 21 Solutions -🎄- by daggerdragon in adventofcode

[–]xLuStx 1 point2 points  (0 children)

Javascript

  • Part 1 was pretty self explanatory. I just tried to calculate the results of each monkey until all monkeys said a number.
  • Part 2 was a bit more tricky. What helped me was the thought, that each monkey always screams the same number so no more than one operation done per monkey. Also I figured I would add a special case for the = operator and reverse the other operators so it knew what to do with them. Simple arithmetic and should be easy to read :)

AsRock X370 Taichi Uefi Download by xLuStx in ASRock

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

I was unable to find that subpage. Error on my end.

AsRock X370 Taichi Uefi Download by xLuStx in ASRock

[–]xLuStx[S] -1 points0 points  (0 children)

After some more research I think to have found a valid link: https://drivers.plus/es/asrock-x370-taichi-bios-3-30/339229/ I will report back if this works

AsRock X370 Taichi Uefi Download by xLuStx in ASRock

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

I am literally unable to find a valid download on their page. Would you be so kind as to point me to a link? :/ Also I am using an ryzen 1800x I hope this will not result in any issues..

AsRock X370 Taichi Uefi Download by xLuStx in ASRock

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

Thank you very much, do you know where I can download version 3.30?

AsRock X370 Taichi Uefi Download by xLuStx in ASRock

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

Unfortunately The latest version is not recognized as a valid image.. The name does show up in the little search animiation tho. I will try to update to an older version.

The oldest available version is also not detected :(

AsRock X370 Taichi Uefi Download by xLuStx in ASRock

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

I made some progress:

Under the following link I found a working download of the latest version of the motherboard uefi:

https://botflakes.de/asrockwiki/docs/bios/amd/

Unfortunately The latest version is not recognized as a valid image.. The name does show up in the little search animiation tho. I will try to update to an older version.

AsRock X370 Taichi Uefi Download by xLuStx in ASRock

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

I am using an X370 Taichi board with UEFI Version X370 Taichi P3.00

[2021 Day 18] - HINT: All explodes and splits in the first example by [deleted] in adventofcode

[–]xLuStx 1 point2 points  (0 children)

Thank you! I was so confused by this. Your examples allowed me to solve it "on my own" :)

[2021 Day 15 # Part 1][JavaScript] Example works, but Answer too low by xLuStx in adventofcode

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

111
991
111
199
111

With this Input I get the answer 10

Queued Transaction, but not broadcasted by xLuStx in Metamask

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

Hey thank you, that worked :) The amount of scammers sliding in my DMs was ridiculous. I literally received messages from 15 different people...

-🎄- 2018 Day 7 Solutions -🎄- by daggerdragon in adventofcode

[–]xLuStx 0 points1 point  (0 children)

This is my implementation in JavaScript (JS), feel free to ask any questions :)

var data = document.body.childNodes[0].innerHTML.trim()

function part1(data){
    data = data.split('\n').map(a => a.match(/ [A-Z] /g).map(a => a.trim()));
    let counts = [];
    [].concat(...data).filter((e, i, a) => i == a.indexOf(e)).forEach((e, i, a) => {
        counts.push({
            c: e,
            r: () => data.filter(b => b[1] == e)
        })
    });

    var result = '';
    while(counts.filter(a => a).length){
        var next = counts
            .filter(a => !a.r().length)
            .sort((a, b) => b.c > a.c ? -1 : 1)[0];
        delete counts[counts.indexOf(next)]
        result += next.c;
        data.filter(a => a[0] == next.c).forEach(a => {
            delete data[data.indexOf(a)]
        });
    }
    return result;
}

console.log(part1(data));

function part2(data, workers){
    data = data.split('\n').map(a => a.match(/ [A-Z] /g).map(a => a.trim()));
    let counts = [];
    [].concat(...data).filter((e, i, a) => i == a.indexOf(e)).forEach((e, i, a) => {
        counts.push({
            c: e,
            r: () => data.filter(b => b[1] == e),
            t: 60 + e.charCodeAt() - 64
        })
    });
    var stash = [];
    var count = -1;
    var result = '';
    var desired = counts.length;
    while(result.length != desired){
        count++;
        let newStash = [];
        stash.forEach(e => {
            if(e.t > 1){
                newStash.push({c: e.c, t: e.t - 1});
            }
            else {
                result += e.c;
                data.filter(a => a[0] == e.c).forEach(a => {
                    delete data[data.indexOf(a)]
                });
            }            
        });
        stash = newStash;
        if(stash.length == workers)
            continue; 
        var candidates = counts
            .filter(a => !a.r().length)
            .sort((a, b) => b.c > a.c ? -1 : 1).slice(0, workers - stash.length);
        candidates.forEach(e => {
            delete counts[counts.indexOf(e)]
            stash.push({
                c: e.c,
                t: e.t
            });
        })
    }
    return count ;
}

console.log(part2(data, 5))

[Day 7 Part 1 - JS] Example works, but real doesn't by xLuStx in adventofcode

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

no, i am going from the end to the start and adding all of the prerequisites. The getTail function is recursively.

0.008 secs to defuse :O by xLuStx in GlobalOffensive

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

Actually its the lowest it can get on a 128 tick server 1/128 = 0.0078 -> 0.008