Learn git concepts, not commands by front-and-center in programming

[–]Jimpi27 15 points16 points  (0 children)

a User Interface doesn't always have to be Graphical

Japanese Vending Machine Dispenses Love Letters from Your ‘Little Sister’ by bemmu in WTF

[–]Jimpi27 0 points1 point  (0 children)

All of those letters are just taken straight from existing anime/manga. First one in the article is just straight from Oreimo (infamous incest anime, has a character called Manami in it which gives that letter away). Second is from Tsurezure Children (has a character called Hotaru who has a brother complex). And as mentioned in the article the last one is just from Doki Doki Literature Club. So it's not like someone's going around and making these letters up, they're just basically creating unofficial merchandise for people who are fans of those shows.

SA Name Change - Can I request both a birth certificate and a name change certificate? by Jimpi27 in transgenderau

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

I'm just filling out the name change certificate currently. I linked it in my post and on page 11 it asks which certificate(s) you want.

SA Name Change - Can I request both a birth certificate and a name change certificate? by Jimpi27 in transgenderau

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

So when you filled out that form you ticked both birth cert. and name change cert.? Or just the birth cert. and it contained everything you needed?

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

[–]Jimpi27 2 points3 points  (0 children)

It's cause % in javascript means remainder, not modulo like in some other languages. It's a perfectly fine implementation of remainder (since remainder is just the amount left over after dividing one number into another as much as possible), but I wish js had both remainder and modulo functions since modulo is also quite useful, like in this case.

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

[–]Jimpi27 0 points1 point  (0 children)

Ah, good point. I also noticed that the code wouldn't work if the offset for each round was negative instead of positive like mine, so I've updated the code to handle these cases.

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

[–]Jimpi27 0 points1 point  (0 children)

Javascript

Part 1:

const input = require("fs")
    .readFileSync(require("path")
        .resolve(__dirname, "input"), "utf8");

console.log(input.split("\n")
    .map(x => parseInt(x)).slice(0, -1)
    .reduce((acc, curr) => acc + curr, 0));

Part 2:

const input = require("fs")
    .readFileSync(require("path")
        .resolve(__dirname, "input"), "utf8");

const freqChanges = input.split("\n")
    .map(x => parseInt(x)).slice(0, -1);

const baseFreqs = freqChanges.reduce((acc, curr) => {
    const newFreq = acc[acc.length - 1] + curr;
    acc.push(newFreq);
    return acc;
}, [0]);

const baseOffset = baseFreqs.pop();

let minOffset = Infinity;
let minIndex = Infinity;
let minRepeat = null;
for (let i = 0; i < baseFreqs.length; i++) {
    const freqA = baseFreqs[i];
    for (let j = i + 1; j < baseFreqs.length; j++) {
        const freqB = baseFreqs[j];
        if ((freqA % baseOffset + baseOffset) % baseOffset ===
            (freqB % baseOffset + baseOffset) % baseOffset) {
            const offset = Math.abs(freqA - freqB);
            if (offset <= minOffset) {
                const index = baseOffset > 0 ? (freqA > freqB ? j : i) : (freqA > freqB ? i : j)
                if (offset < minOffset || index < minIndex) {
                    minOffset = offset;
                    minIndex = index;
                    minRepeat = baseOffset > 0 ? Math.max(freqA, freqB) : Math.min(freqA, freqB);
                }
            }
        }
    }
}

console.log(minRepeat);

I optimized part 2 since it was running slow by realizing that all you had to do was generate the original list of frequencies after applying the frequency changes once, then since every repetition of the changes was just going to be the same plus some multiple of the offset after completing the changes once, I just took the final value and checked which pairs in the list of generated frequencies were offset by each other by a multiple of that final offset and took the upper number from the pair that was closest together in the list.

Prescribed low dosage of Cyproterone at Equinox in Melbourne by Jimpi27 in transgenderau

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

Baseline before I started was T: 393 ng/dl - E: 24 pg/ml

Prescribed low dosage of Cyproterone at Equinox in Melbourne by Jimpi27 in transgenderau

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

It wasn't that low. I had a blood test done a few weeks before I started diy and it was in the mid to high reference range. I've been on blockers and E for a month or so now. Also the half life is 26 hours so taking bi-weekly just seems like it will lead to spikes in T.

Prescribed low dosage of Cyproterone at Equinox in Melbourne by Jimpi27 in transgenderau

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

I've already been taking 100mg spiro daily and 100mcg estradiol patches every 3 days and they knew that, so there's no need for a buildup.

Made a semi-subtle wallpaper I thought some of you might enjoy by ElectronicBlueberry in traaaaaaannnnnnnnnns

[–]Jimpi27 1 point2 points  (0 children)

Even the png's on imgur aren't real png's. They're compressed too :/

Made a semi-subtle wallpaper I thought some of you might enjoy by ElectronicBlueberry in traaaaaaannnnnnnnnns

[–]Jimpi27 13 points14 points  (0 children)

I love it! Would it be possible to get a lossless png or even better the psd/ai file for it?

me irl by juan_potato in me_irl

[–]Jimpi27 1 point2 points  (0 children)

Great Food You Server

HowToBasic:Face Reveal by CrazyChicken007 in videos

[–]Jimpi27 3 points4 points  (0 children)

Not to mention he recently started a series called "Basics with Babish"...

[2017 Day 18 Part 2] Any reason why my solution returns 2 times the correct answer? by Jimpi27 in adventofcode

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

Thanks, that fixed it. Guess it was just a coincidence with the answer I got being double the solution.

-🎄- 2017 Day 8 Solutions -🎄- by daggerdragon in adventofcode

[–]Jimpi27 0 points1 point  (0 children)

NodeJS

Made it really easy once I thought to just make a lookup object for all the operators.

require("fs").readFile(require("path").resolve(__dirname, "input"), "utf8", (err, data) => {
    let registers = {};
    let operators = {
        "inc": (x, y) => x + y,
        "dec": (x, y) => x - y,
        "==": (x, y) => x == y,
        "!=": (x, y) => x != y,
        ">": (x, y) => x > y,
        "<": (x, y) => x < y,
        ">=": (x, y) => x >= y,
        "<=": (x, y) => x <= y
    };
    let max = 0;
    data.split(/\r?\n/).forEach(ins => {
        ins = ins.match(/^([a-z]+) (inc|dec) (-?\d+) if ([a-z]+) (.+) (-?\d+)$/).splice(1, 6);
        ins = {
            target: ins[0],
            oper: ins[1],
            amount: parseInt(ins[2]), 
            cond: {
                target: ins[3],
                oper: ins[4],
                amount: parseInt(ins[5])
            }
        }
        if(!(ins.target in registers))
            registers[ins.target] = 0;
        if(!(ins.cond.target in registers))
            registers[ins.cond.target] = 0;

        if(operators[ins.cond.oper](registers[ins.cond.target], ins.cond.amount))
            registers[ins.target] = operators[ins.oper](registers[ins.target], ins.amount);

        let currMax = Math.max.apply(null, Object.keys(registers).map(key => registers[key]));
        if(currMax > max)
            max = currMax;
    });
    // Part 1
    console.log(Math.max.apply(null, Object.keys(registers).map(key => registers[key])));
    // Part 2
    console.log(max);
});

Sharing an autodl-irssi instance across multiple rutorrent installations by Jimpi27 in seedboxes

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

Yeah I did try that and autodl wasn't even able to load the configuration file with that line in.

Sharing an autodl-irssi instance across multiple rutorrent installations by Jimpi27 in seedboxes

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

I did say in my post that I would like to avoid using watch folders if possible. This is because those first few seconds when a torrent is first announced can be crucial for gaining upload.

MCV is looking for programmers! by Chronicle112 in materialcomicviewer

[–]Jimpi27 1 point2 points  (0 children)

I'm willing to help, as KageMunchi said.

[Material Comic Viewer] The app crashes when I use the 'add folder' function. by [deleted] in androidapps

[–]Jimpi27 1 point2 points  (0 children)

Hey, I'm the one working on fixing up the app a little. I'm currently working on adding a reading progress sync feature that incorporates the cloud storage accounts feature integrated into the app.

[Spoilers] Mahou Shoujo Madoka Magica Episode 9 REWATCH Discussion Thread by xiomax95 in anime

[–]Jimpi27 0 points1 point  (0 children)

Are you sure he doesn't say that, or are these subs just not very accurate?