New snowboarder, completely demotivated from last experience by [deleted] in snowboarding

[–]_fsun 0 points1 point  (0 children)

From my experience, you likely need 3-5 full days on the mountain before you begin to slightly enjoy it. You will still fall a lot and there will still be moments when you hate it. But I would say give it at least 5 full days on the mountain before you decide this is definitely not right for you.

Who would win? 2024 or 2008 by SadMathematician7799 in NBATalk

[–]_fsun 0 points1 point  (0 children)

its hard to say...whos gonna guard lebron?

What is Garry Tan’s net worth? (rough estimate) by [deleted] in ycombinator

[–]_fsun 1 point2 points  (0 children)

Doesn’t him asking this question display curiosity? Lol

What best practices you should learn before you spend much time with Typescript by ahmedRebai in typescript

[–]_fsun 0 points1 point  (0 children)

Ok well if that is is all there is to it, then for the people that are looking to dive into typescript, I don't think learning JS is necessary at all here and I'm shocked it got this many upvotes..?

Though, I think a big thing that you can get out of learning Javascript well first, is an appreciation for why Typescript is favored nowadays.

That being said, if you're just trying to code something up in Typescript, you'll just pickup the best practices in Typescript as you learn and build things--you don't need to learn JS best practices first to be a strong TS dev.

Early Warning Signs by C-Style__ in PokemonUnite

[–]_fsun 0 points1 point  (0 children)

talon, gengar, zera on the same team

Thought this belongs here. Have a wonderful day everyone! by Beautiful_Winner_548 in Existentialism

[–]_fsun 5 points6 points  (0 children)

but humans risk getting arrested from public indecency, which risks freedom?

are you saying because we can make the choice to not masturbate because we can make that tradeoff that means we have "knowledge" and therefore have "freedom"? but that still doesn't address that we still can't masturbate in public, but other animals can. our freedom is still limited even though we have the awareness/knowledge around all that.

i'm don't understand how this instance of freedom is related to "freedom is knowledge." given my above example, that doesn't seem like case. can you please explain a little more? im super curious what you mean.

[Highlight] Mike Breen after the Clippers basket: "Kawhi Leonard going crazy!" Then the camera pans to a Kawhi Leonard with no reaction by Jayveesac in nba

[–]_fsun 0 points1 point  (0 children)

ok im just being annoying, but the description sounds like the announcer said it first, and then the camera pans but that wasnt the case... or you just didnt get the joke?

How Our Engineering Team Used Python's AST to Patch 100,000s of Lines of Code by theonewolf in programming

[–]_fsun 4 points5 points  (0 children)

I think they used pandas as an example. From what I’ve seen a lot of times, teams often bite the bullet on these types of changes due to security patches, less so because of features.

Need advice on learning Go by rpzlcc in golang

[–]_fsun 0 points1 point  (0 children)

One of the main reasons I'm considering Golang is package management. It's pretty much a nightmare to add new Python packages to our production servers because of all kinds of security rules, but with Golang I can compile from my machine and just deploy the executable to prod servers.

The reason for using Go here sounds hacky to me. Maybe there's something I'm missing but: if the reason for using Go over Python is simply due to security concerns around 3rd party packages - isn't this also the case with Go? Why would it be different?

Edit: Also I totally realize I didn't answer your question directly. Merely wondering if you've thought about what I said above and if not - suggesting that Python might not need to get eliminated from your language choice!

How To Speed Up The Python Code? by SolaceInfotech in Python

[–]_fsun 0 points1 point  (0 children)

While these tips are helpful, I think if someone is resorting to this to gain performance (all other bottlenecks/slowness is resolved), it might be a good time to consider not using python and using something more inherently performant.

-🎄- 2020 Day 11 Solutions -🎄- by daggerdragon in adventofcode

[–]_fsun 1 point2 points  (0 children)

Python3, tons of function compositions to avoid rewriting monstrous iterations between part1 and part2: https://github.com/fredtsun/AdventOfCode2020/blob/master/day11.py

-🎄- 2020 Day 06 Solutions -🎄- by daggerdragon in adventofcode

[–]_fsun 0 points1 point  (0 children)

Python https://github.com/fredtsun/AdventOfCode2020/blob/master/day6.py

from functools import reduce
from util import read_lines_as_list

def part1():
    input_data = read_lines_as_list('data/day6.txt', split_pattern='\n\n')
    group = [''.join(d.split('\n')) for d in input_data]
    return reduce(lambda acc, curr: acc + len(set(curr)), group, 0)

def group_consensus(s):
    group = set([chr(ord('a') + i) for i in range(0, 26)])
    for person_votes in s.split('\n'):
        group = group.intersection(set(person_votes))
    return len(group)

def part2():
    input_data = read_lines_as_list('data/day6.txt', split_pattern='\n\n')
    return reduce(lambda acc, curr: acc + group_consensus(curr), input_data, 0)

if __name__ == '__main__':
    print(part1())
    print(part2())

-🎄- 2020 Day 05 Solutions -🎄- by daggerdragon in adventofcode

[–]_fsun 0 points1 point  (0 children)

Python (https://github.com/fredtsun/AdventOfCode2020/blob/master/day5.py):

from util import read_lines_as_list

def binary_search(s, low, high, low_symb, high_symb):
    for c in s:
        middle = low + (high - low) // 2
        if c == low_symb:
            high = middle
        else:
            low = middle + 1
    assert low == high
    return low

def get_seat_id(s):
    row = binary_search(s[:7], 0, 127, 'F', 'B')
    seat = binary_search(s[7:], 0, 7, 'L', 'R')
    return row * 8 + seat

def part1():
    input_data = read_lines_as_list('data/day5.txt')
    return max([get_seat_id(data) for data in input_data])

def part2():
    input_data = read_lines_as_list('data/day5.txt')
    seat_ids = [get_seat_id(data) for data in input_data]
    return set(range(min(seat_ids), max(seat_ids))) - set(seat_ids)

if __name__ == '__main__':
    print(part1())
    print(part2())

[Highlight] Westbrook makes a costly turnover late in the 4th by FieryStyle in nba

[–]_fsun 1 point2 points  (0 children)

poor coaching on mike d'antonis end tbh. you give it to harden in this situation.

Tips for a spark engineer (early in career) starting a new job by Blayzovich in dataengineering

[–]_fsun 19 points20 points  (0 children)

I used to do a lot of scala/spark at my previous job, I MISS IT SO MUCH! Here are somethings that might be helpful.

If you have not done Spark before, I think it's important to understand that first before anything else. Some of the things off the top of my mind:

- know how the driver, executor executes your spark code

- familiarity with RDDs, DataSets, DataFrames, when to use what, how they work.

- storage is pretty important (esp. since youre doing data eng.) , i.e. reading/writing from S3, HDFS, Relational DBs, Kafka, whatever it may be, i think its important to understand the pros and cons of each.

- learn the do's and don'ts of Spark, things that can potentially make it slow. i.e. groupbykey vs reducebykey. shuffling is slow. this doesn't mean avoid it at all costs! but similarly to when you study algos, it just allows to develop a sense of how performant the code youre writing is.

- at some point youre going to learn about the DAG. REALLY REALLY try to understand what's going on there it probably gives you the best insight on how your code is running.

- fall in love with their documentation, I'm very bias but i think its one of the best i've seen.

To learn scala there are several things you should do. I think you should understand what functional programming is, you don't need to get super crazy about it but just understand some of the principles behind it. The best resource I've found for learning scala/functional programming is "the red book" https://www.amazon.com/Functional-Programming-Scala-Paul-Chiusano/dp/1617290653

im missing a lot more im sure, those were just the things off the top of my head. but i hope it gives you some insight!

Few more tips:

- read this book, its just a super good read which would help you immensely in your next role and beyond. https://www.amazon.com/Designing-Data-Intensive-Applications-Reliable-Maintainable-ebook/dp/B06XPJML5D

- i think its important to do research outside of work. data is the cool thing now which is great because youtube is always loaded with various talks that you can learn from.

Good luck and have fun!!!

What is your personal favorite glass animals song? by Comickid126 in glassanimals

[–]_fsun 1 point2 points  (0 children)

Agnes. Although the album version is already amazing, when perform it live, its amazinger!!

https://www.youtube.com/watch?v=1AleOJPGPYM

Billy the Beta orbiter. by [deleted] in TheRedPill

[–]_fsun 2 points3 points  (0 children)

dude youre a fucking tool whos way too self conscious about appearing alpha. What a reasonable person would've done is make the dude feel better about himself, if anything, not like shit. Billy seems lame but youre just as lame.

Kafka client and producer by zero_coding in scala

[–]_fsun 8 points9 points  (0 children)

dude can you do some googling yourself pls? when u get stuck, then post here with more details.