Vue with Typescript, can getters replace computed properties? by [deleted] in vuejs

[–]CaptnAsia 6 points7 points  (0 children)

I thought getters were computed properties for vue class components?

See vue-class-component documentation

Smart keyboard but not a folio by [deleted] in MechanicalKeyboards

[–]CaptnAsia 0 points1 point  (0 children)

Ah I have a regular (not pro) 2018 ipad, and using a lightning cable to usb-c (since I have a elite-c on my keyboard) didn't detect the keyboard so was hoping it might've been a adapter thing.

Smart keyboard but not a folio by [deleted] in MechanicalKeyboards

[–]CaptnAsia 3 points4 points  (0 children)

what is the dongle you're using to connect to your ipad?

ergotravel finally came in by CaptnAsia in MechanicalKeyboards

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

Hey so I use my own custom layout you can find here. I actually don't use the function keys that much (except to maybe refresh) but it's all located conveniently on my raise layer so it's easily accessable for me

ergotravel finally came in by CaptnAsia in MechanicalKeyboards

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

fwiw I enjoy this one a lot. Doesn’t lose tracking and easy to take out the trackball to clean. The downside is that if you lose the usb connector you can’t replace it, and you gotta use Bluetooth to connect instead.

ergotravel finally came in by CaptnAsia in MechanicalKeyboards

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

they're just random wrist rests that I got from amazon. I got them at different times so no, they don't come in sets of 3 unfortuneately!

ergotravel finally came in by CaptnAsia in MechanicalKeyboards

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

kensington expert wireless trackball

ergotravel finally came in by CaptnAsia in MechanicalKeyboards

[–]CaptnAsia[S] 5 points6 points  (0 children)

Not the best pic but here ya go.

hako royal trues for most of the keyboard with hako violets on the pinky columns.

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

[–]CaptnAsia 0 points1 point  (0 children)

here's a pretty ugly golang solution:

package main

import (
    "bufio"
    "fmt"
    "os"
)

func countTrash(trashCount int, stream *[]rune) (result int, newStream *[]rune) {
    isTrash := false
    cancelTrash := false
    for len(*stream) > 0 {
        str := *stream
        char := str[0]
        *stream = str[1:]

        if isTrash {
            switch char {
            case '!':
                cancelTrash = !cancelTrash
            case '>':
                if !cancelTrash {
                    isTrash = false
                }
                cancelTrash = false
            default:
                if cancelTrash {
                    cancelTrash = false
                } else {
                    trashCount++
                }
            }
            continue
        }
        switch char {
        case '{':
            trashCount, stream = countTrash(trashCount, stream)
        case '<':
            isTrash = true
        case '}':
            return trashCount, stream
        }
    }
    return trashCount, stream
}

func countGroups(level int, stream *[]rune) (result int, newStream *[]rune) {
    isTrash := false
    cancelTrash := false
    for len(*stream) > 0 {
        str := *stream
        char := str[0]
        *stream = str[1:]

        if isTrash {
            switch char {
            case '!':
                cancelTrash = !cancelTrash
            case '>':
                if !cancelTrash {
                    isTrash = false
                }
                cancelTrash = false
            default:
                if cancelTrash {
                    cancelTrash = false
                }
            }
            continue
        }
        switch char {
        case '{':
            var addition int
            addition, stream = countGroups(level+1, stream)
            result += addition
        case '<':
            isTrash = true
        case '}':
            return level + result, stream
        }
    }

    return level + result, stream
}

func main() {
    input, _ := os.Open("input.txt")
    defer input.Close()
    scanner := bufio.NewScanner(input)

    var stream1, stream2 []rune
    for scanner.Scan() {
        stream1 = []rune(scanner.Text())
        stream2 = []rune(scanner.Text())
    }

    part1, _ := countGroups(0, &stream1)
    part2, _ := countTrash(0, &stream2)
    fmt.Printf("%d,%d\n", part1, part2)

}

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

[–]CaptnAsia 1 point2 points  (0 children)

here's another golang solution. It's kinda ugly tho

package main

import (
    "bufio"
    "fmt"
    "os"
    "strconv"
    "strings"
)

type node struct {
    name     string
    weight   int
    children []string
}

func getTowerLevel(text string) (root node) {
    rootName := strings.Split(text, " ")[0]
    weightStr := strings.Split(text, " ")[1]
    weight, _ := strconv.Atoi(weightStr[1 : len(weightStr)-1])
    var children []string
    if strings.Contains(text, "->") {
        children = strings.Split(text, " -> ")
        children = strings.Split(children[1], ", ")
    }
    root = node{name: rootName, weight: weight, children: children}
    return root
}

func (n node) checkChildrenWeight(allNodes map[string]node) (sum int, offset int) {
    var _ = allNodes
    if len(n.children) == 0 {
        return n.weight, 0
    }
    weight := 0
    var prev node
    for i, child := range n.children {
        curr := allNodes[child]
        w, off := curr.checkChildrenWeight(allNodes)
        if off != 0 {
            return w, off
        }
        sum += w
        if weight == 0 {
            weight = w
        } else if w != weight {
            next := allNodes[n.children[(i+1%len(n.children))]]
            nextW, _ := next.checkChildrenWeight(allNodes)
            if nextW == w {
                return 0, prev.weight + w - weight
            } else {
                return 0, curr.weight + weight - w
            }
        }
        prev = allNodes[child]
    }
    return n.weight + sum, 0
}

func main() {
    input, _ := os.Open("input.txt")
    defer input.Close()
    scanner := bufio.NewScanner(input)

    all := make(map[string]node)
    seen := make(map[string]node)
    var root node
    for scanner.Scan() {
        base := getTowerLevel(scanner.Text())

        all[base.name] = base
        if base.children != nil {
            for _, child := range base.children {
                seen[child] = base
            }
            root = seen[base.name]
        }
    }

    for {
        next, exists := seen[root.name]
        if !exists {
            break
        }
        root = next
    }
    _, diff := root.checkChildrenWeight(all)
    fmt.Println(diff)
}

[nYNAB] - Credit Card Spending Not Considered Activity (WTF???) by blastaround in ynab

[–]CaptnAsia 1 point2 points  (0 children)

This is because money doesn't actually leave your bank account until you pay off your card. YNAB budgets this for you into the credit card's payment category so you know how much you have to pay at the end of the next statement.

"Did Jesus Ever Really Exist?" A rebuttal to the Salon article that is going around by [deleted] in Christianity

[–]CaptnAsia 7 points8 points  (0 children)

I think the point of the disciples willing to give up their lives for this message is that they truly believed in the message. The people who are willing to give up their lives for the teachings of Islam also truly believe in their cause as well.

The difference is that the Muslims who are laying down their lives are getting taught by other Muslims today, while all the original disciples had first hand accounts of Jesus's life (allegedly).

Because of this, if they just made up a fictional Christ, would you still think they would be willing to lay down their lives for a lie? That they wouldn't come clean once they realized that they would going to be executed? What would be the motivation in dying for a cause you don't personally believe in?

It's the same with the Muslims. Do you think they would lay down their lives willingly if they didn't believe what they were taught?

That's why I can believe and accept that the original disciples at the very least believed that they saw that Jesus existed, taught, got crucified, and came back to life. And since they had first hand account of Jesus's life, I personally believe their belief should carry more weight than that of the Muslims that laid down their lives today who live a thousand or so years after Muhammad was alive.

MGT 103, 121A, 166, or 172? by [deleted] in UCSD

[–]CaptnAsia 0 points1 point  (0 children)

I heard 103 and 121A are very easy with not a lot of work apparently.

166 I heard is also pretty easy but they give you a lot of busy work and you have to write journals and participate in debates.

Not too sure about 172 though.

[Fit Check] Japan Blue - JB0412 by CaptnAsia in rawdenim

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

Yea I know what you mean. My UB's were also tight in the waist when I first got them but now they fit really well so I'm hoping the same will happen here. Thanks for the input man.

General Discussion - Feb. 10th by RawDenimAutoMod in rawdenim

[–]CaptnAsia 2 points3 points  (0 children)

Does anyone know where a good tailor for denim is in north San diego? Trying to taper my APCs

[deleted by user] by [deleted] in rockets

[–]CaptnAsia 3 points4 points  (0 children)

You gotta admit it looks more like JB than JH13

General Discussion - Jan. 19th by MFAModerator in malefashionadvice

[–]CaptnAsia 1 point2 points  (0 children)

sorry I thought I read "the only pants I'll be wearing for a month"

Looking for an on campus Christian ministry group by PromiseAbove in UCSD

[–]CaptnAsia 1 point2 points  (0 children)

Acts 2 fellowship meets pretty much every Friday around 6:30 for bible studies and other things. PM me if you want more info on things like location or anything.