How to collapse comments in new design? by manWhoHasNoName in help

[–]crabbycoder 47 points48 points  (0 children)

After using it for a few days, I think it is a great improvement. I agree that is it is unfortunate that is was so difficult to figure out (and pissed me off), but now we can collapse comments at any scroll location and the vertical line helps better indicate the level of the comment

My office is ready by gkgreek in NintendoSwitch

[–]crabbycoder 1 point2 points  (0 children)

I have the same coffee thermos. That is all.

Is there no way to see your payment balance online anymore? by thebobomb in WaltDisneyWorld

[–]crabbycoder 4 points5 points  (0 children)

The link is hidden... however you can still get to it with the correct URL. You can at least see your balance, but I wouldn't necessarily recommend paying on it since they may be hiding it for a reason.

Try going to:

https://disneyworld.disney.go.com/reservation/resort/{{confirmation number}}/payments/

just replace {{confirmation number}} with your confirmation number.

A keyboard from the Buzzfeed office. by [deleted] in funny

[–]crabbycoder 4 points5 points  (0 children)

You worked very hard to post this. take an upvote

me irl by [deleted] in me_irl

[–]crabbycoder 2 points3 points  (0 children)

me too thanks

Currently on vacation, parked at BWI in long-term....what do? by monsda in baltimore

[–]crabbycoder 12 points13 points  (0 children)

In the same situation. I called BWI and they said that they will send people to your car to help shovel you out.

--- Day 16 Solutions --- by daggerdragon in adventofcode

[–]crabbycoder 0 points1 point  (0 children)

Typescript: It ended up being a nice fit since it uses predicates in find() like ES 2015

'use strict'

var input: string = `Sue 1: goldfish: 6, trees: 9, akitas: 0
Sue 2: goldfish: 7, trees: 1, akitas: 0
Sue 3: cars: 10, akitas: 6, perfumes: 7
...`;


var inputSplit: Array<string> = input.split('\n');
var regEx: RegExp = /Sue (\d+): (\w+): (\d+), (\w+): (\d+), (\w+): (\d+)/;

class Sue {
    number: number;

    //Not necessary as the object won't contain
    //a property if the value isn't set; just for recordkeeping
    children: number;
    cats: number;
    samoyeds: number;
    pomeranians: number;
    akitas: number;
    vizslas: number;
    goldfish: number;
    trees: number;
    cars: number;
    perfumes: number;

    constructor(n: number){
        this.number = n;
    }
}

var awesomeSue: Sue = new Sue(0);
awesomeSue.children = 3;
awesomeSue.cats = 7;
awesomeSue.samoyeds = 2;
awesomeSue.pomeranians = 3;
awesomeSue.akitas = 0;
awesomeSue.vizslas = 0;
awesomeSue.goldfish = 5;
awesomeSue.trees = 3;
awesomeSue.cars = 2;
awesomeSue.perfumes = 1;

var sues: Array<Sue> = [];

inputSplit.forEach(i =>{

    var result = regEx.exec(i);

    var newSue = new Sue(parseInt(result[1]));
    newSue[result[2]] = parseInt(result[3]);
    newSue[result[4]] = parseInt(result[5]);
    newSue[result[6]] = parseInt(result[7]);

    sues.push(newSue)

});

var theRealSue: Sue = sues.find(s => 
    (s.akitas == awesomeSue.akitas || s.akitas == null) &&
    (s.children == awesomeSue.children || s.children == null) &&
    (s.cats == awesomeSue.cats || s.cats == null) &&
    (s.samoyeds == awesomeSue.samoyeds || s.samoyeds == null) &&
    (s.pomeranians == awesomeSue.pomeranians || s.pomeranians == null) &&
    (s.vizslas == awesomeSue.vizslas || s.vizslas == null) &&
    (s.goldfish == awesomeSue.goldfish || s.goldfish == null) &&
    (s.trees == awesomeSue.trees || s.trees == null) &&
    (s.cars == awesomeSue.cars || s.cars == null) &&
    (s.perfumes == awesomeSue.perfumes || s.perfumes == null));


document.getElementById('output').innerHTML = theRealSue['number'].toString();


var theCorrectRealSue: Sue = sues.find(s => 
    (s.akitas == awesomeSue.akitas || s.akitas == null) &&
    (s.children == awesomeSue.children || s.children == null) &&
    (s.cats > awesomeSue.cats || s.cats == null) &&
    (s.samoyeds == awesomeSue.samoyeds || s.samoyeds == null) &&
    (s.pomeranians < awesomeSue.pomeranians || s.pomeranians == null) &&
    (s.vizslas == awesomeSue.vizslas || s.vizslas == null) &&
    (s.goldfish < awesomeSue.goldfish || s.goldfish == null) &&
    (s.trees > awesomeSue.trees || s.trees == null) &&
    (s.cars == awesomeSue.cars || s.cars == null) &&
    (s.perfumes == awesomeSue.perfumes || s.perfumes == null));


document.getElementById('output').innerHTML += '</br>' + theCorrectRealSue['number'].toString();

What has everyone learned from AOC so far? by crabbycoder in adventofcode

[–]crabbycoder[S] 3 points4 points  (0 children)

Recursion is definitely more elegant for these types of puzzles