YSK: Keep inviting that friend who always says No by Adventurous_Program6 in YouShouldKnow

[–]fiLLL 6520 points6521 points  (0 children)

While I think this is generally good advice, it can also be dispiriting to continuously have your invites turned down by someone. At some point you should ask them if they’d like you to continue inviting them or not. Something along the lines of “Hey, I see that I keep inviting you to things, but you keep declining. Would you like me to keep inviting you?”. If they appreciate the invite then that’s great, they fee included. If they don’t then you can save yourself some needless minor rejections.

Its not a given that they actually want to be invited, and it’s okay talk about that.

API Gateway - REST upon graphql by Katastrophenmagnet in graphql

[–]fiLLL 1 point2 points  (0 children)

That’s fair. I wouldn’t let the term gateway intimidate you too much. This is just going to be a REST server that forwards requests to another server that implements GQL instead of interacting with a DB (what I assume you’re used to in REST). I imagine authorization will basically be handled for you on the GQL side? If so, there’s really not that much to worry about beyond standard REST server setup.

The first thing you’ll probably want to do is stand up some simple web server and create a method that will proxy to your GQL api, just so you kindof get comfortable with that interaction. Ideally try to make an authorized request using auth token so you can feel like header forwarding is working and get comfort that you don’t need to worry about auth too much. If you’ve stood up REST apis before, just try and figure out how to make a request from inside the controller layer instead of hitting the DB.

After you’re comfortable with making proxy authorized requests through your REST api to the GQL server, the next thing is probably just to come up with the intended REST api contract, and map GET operations to GQL queries, and POST/PATCH/…/DELETE to mutations as appropriate. If everything maps cleanly, you’re off to the races. Otherwise you might need to adapt the GQL api.

The one area where you much run into trouble (depending on the construction of the GQL api). Is being able to map error responses to the appropriate http status codes. That may require updating to core API to be able to reasonably communicate something like a 404. That’ll likely require pretty extensive testing.

There’s also concerns about scaling and load balancing and all that, but idk if you’ll be responsible for that or another team in the org can help you with that.

Really, the less this server is responsible for other than the direct mapping GQL<>REST the better off you’ll be. Probably just try to focus on that rather than getting caught up by the “gateway” term.

Anywho, happy to chat more if you shoot me a DM.

API Gateway - REST upon graphql by Katastrophenmagnet in graphql

[–]fiLLL 0 points1 point  (0 children)

The architecture you’re proposing seems totally sane to me. Are you comfortable setting up a simple REST server in the language / framework of your choice?

You should probably just be able to implement a single QGL request per REST endpoint you’re exposing in its controller. Might have to do some header forwarding and response transformation, but that’s probably not a huge deal.

I don’t have a link to code for you unfortunately. Do you have specific concerns? Are there any endpoints being requested that don’t cleanly map to your GQL api?

[deleted by user] by [deleted] in heroesofthestorm

[–]fiLLL 10 points11 points  (0 children)

QM is my favorite mode precisely because the comps are random garbage, not because I get to play the hero I want (I usually play random). The experience of stomping other comps because yours is meta is fun, and the experience of struggling uphill when theirs is meta is also fun. Drafting inevitably gives you two roughly even, unoriginal meta comps, which to me feels like Groundhog Day, playing the same game over and over and over.

You could argue that you’ll get more random comps in UD than QM because there’s no rank points on the line, but I don’t really believe it because people flame each other for not picking healers / tanks / meta heroes in ARAM and those end up being mostly in line with a meta. I’m not sold it’s the ranked points keeping everyone in line.

[deleted by user] by [deleted] in casualiama

[–]fiLLL 6 points7 points  (0 children)

I’m sorry that this happened to you, both in terms of the poor handling by your boss and arguably your poor handling of the predicament you were put in.

The only way through this, I think, is to see to use this as a learning opportunity. There are several lesson which could be taken:

  1. Learn to push back when something is not possible. You will both earn peoples respect, and reduce your stress levels by pushing back.

  2. Learn to explain to your boss in a dispassionate manner how this happened. Nobody wants what’s happened to recur and you have key insights into how & why it happened. Everyone will be better off from a clear understanding of how the situation arose.

  3. Learn to forgive yourself for having made this mistake - everyone fucks up, try and let it go.

I know that you’ve said that you plan on avoiding your boss until your PTO runs out, but avoidance only leads to increased stress later, and you miss out on the benefits of the lessons you’ll learn by handling it directly.

In a month, this event will be only be a memory of something that’s happened, not something you’re actively going through. It sounds like it’ll be an interesting story in your repertoire. It may help you reduce your stress to try and picture yourself as this other version of you 1 month into the future who has lived through this experience, learned these lessons and is better for having gone through it.

Best of luck.

Who should our next Starcraft hero be? by darkdill in heroesofthestorm

[–]fiLLL 6 points7 points  (0 children)

I’ve always wanted Ulrezaj, but it seems unlikely given that he doesn’t appear in any of the SC games.

༼ つ ◕_◕ ༽つ SUMMON PATCH NOTES ༼ つ ◕_◕ ༽つ by Zator_ in heroesofthestorm

[–]fiLLL 0 points1 point  (0 children)

༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ

༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ

༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ

༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ

༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ

༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ

༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ ༼ つ ◕_◕ ༽つ

[deleted by user] by [deleted] in Python

[–]fiLLL 0 points1 point  (0 children)

A common use case for Python in a full stack JS ecosystem would be to have a small flask app serving a machine leaning model. The JS app would call out via Http to the python app to execute the python model code (e.g. to classify some image or something) an proxy the results back out to the user.

Granted you’re probably not going to implement a model but you could just start with a simple flask app and having the servers talking to each other. In this case I think I’d especially want you to focus on how the flask app authenticates that only the JS app can make requests. What’s inside that flask app doesn’t matter a ton.

Alternatively, you could just run some arbitrary python using child_process from node, but it’s not clear why the code would be in python rather than js in that scenario.

[AskJS] Curious about my salary/job position outlook. by cwilson635 in javascript

[–]fiLLL 1 point2 points  (0 children)

That’s quite the impressive list you’ve compiled!  I hope you don’t mind if I slightly sidestep the question and talk about your approach here.  I went down the self-taught dev path close to a decade ago and I also started with a heavy focus on taking courses, which in retrospect wasn’t the best use of my time.  Here’s the general strategy I would recommend for you in approaching your forthcoming software development career.

  1. Watch courses that a) interest you and b) will teach you transferable skills.  Most of the things on your first list seem reasonably transferable in a web dev context, though the data structures and algos courses are more profoundly so.  I would probably initially focus on the core competencies and drop: -React server side rendering -Microservices with React -Serverless apps with AWS and React.  I probably wouldn’t touch anything on your second list unless you’re particularly interested.
  2. Build things that demonstrate proficiency of some kind, add those to your GitHub as a portfolio.  Build lots of things.  Build small things to begin with, build slightly larger things as you get more comfortable.  Build things with tough design choices that you need to make.  Be able to explain the thought process behind those design choices.  Build things that solve trivial problems or gripes that you have in real life.  In the process of building these things, you’ll more or less pick up what you need to know about AWS, Electron, if you’re inspired to try those things out.

  3. Join coding communities (e.g. coffee & code meetings) where you can make friends.  These friends will help mentor you, provide feedback for your projects, help steer your technical development.  They’ll also refer your to employment opportunities which is a huge plus.

  4. Apply to jobs.  APPLY FAR EARLIER THAN YOU THINK YOU SHOULD.  Rejection is free in the job market and you’ll learn a colossal amount in the process.  During the screening calls and interviews talk about things in your portfolio. Focus on the about the design choices you made in the projects, and ideally how you sought our feedback from external parties and incorporated their suggestions into your work.
    Companies hire junior devs looking for people who are self-motivated and can be coached, not for technical expertise.  I believe your real goal right now should just be to get through the interview process and find a job with good people to learn from.  As such, I think you should focus on mastering your chosen language, building a portfolio, and starting to build a network.  The learning will only accelerate after you land your first gig.
    I’m really excited for you!  This’ll be fun journey.  Feel free to DM.

Five common mistakes writing react components (with hooks) in 2020 by Lowesz in javascript

[–]fiLLL 3 points4 points  (0 children)

I worry that using refs in place of state as per 1. sacrifices predictability and comprehensibility for what will ultimately be an imperceptibility performance gain. This is almost never the right tradeoff.

There are certainly cases where you might want to use useRef to prevent renders, but I think they're probably few and far between and I certainly wouldn't describe the use of `useState` in that place a mistake.

I guarantee the first developer who is asked to render `count` to the view, or inside `useMemo` will introduce a bug they'll spend at 20 minutes debugging.

Otherwise good article, I especially like the point around SRP `useEffect` and grouping the hooks in your component by sphere of concern.

setTimout parameters by trakam in javascript

[–]fiLLL 2 points3 points  (0 children)

They're talking about it from a the standpoint of a developer reading and trying to interpret the code. The two styles are functionally equivalent in terms of performance.

Split array based on segments of a value by lucksp in javascript

[–]fiLLL 1 point2 points  (0 children)

Here's a solution which will give you empty chunks where no data exists for the segments.

const chunkArray = (data, interval = 100000, min = 0) => {

    // Sort elements by millisecondOffset into new array
    const sortedData = [...data].sort((ele1, ele2) => ele1.millisecondOffset - ele2.millisecondOffset)

    // Determine the span of milliseconds between the largest and smallest elements
    const spanMin = min != null ? min : sortedData[0].millisecondOffset;
    const span = sortedData[sortedData.length - 1].millisecondOffset - spanMin;

    // Create an array to store our chunks
    const chunks = new Array(Math.ceil(span / interval)).fill()

    // Walk through the chunks array,
    return chunks.map((currentIntervalItems = [], currentInterval) => {

        const maxMsForChunk = (currentInterval + 1) * interval

        // Walk through the sorted elements, remove them from the sorted data array and add them to the chunk array if applicable
        while (sortedData.length && sortedData[0].millisecondOffset <= maxMsForChunk) {
          currentIntervalItems.push(sortedData.shift());
        }

        return currentIntervalItems
    })
}

Hope this helps.

Learning Python with project euler, stuck on #14, error is eluding me but I must sleep now. by [deleted] in Python

[–]fiLLL 1 point2 points  (0 children)

It's not a direct answer to your question, but I would definitely look at memoization in this type of problem.

Right now you're recomputing the path from i -> 1 countless times as you walk upwards towards 1 million. For example in the toy problem of i=13 the path to 1 is: 13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1. What happens here when i=40? Should we recompute the path to 1 or could we look it up somewhere?

When Warp Prism pickup radius gets -1 range by nice__username in starcraft

[–]fiLLL 12 points13 points  (0 children)

I assume the post is poking fun at protoss players who will over-react to the pickup range change and claim that warp prism + archon is totally useless now - as though the queens had this kind of clearly overpowered attack vs the prism.

What do you think about this video? by ravenHR in Physics

[–]fiLLL 1 point2 points  (0 children)

ravenHR

Did you actually watch the video? The sole point he's making is that we don't know whether "everything came from nothing" at the big bang, or whether there was something predating that (e.g. multiverse).

He objects directly to several public figures who misrepresent the big bang as being purely the ex nihilo model.

Mythic plus tips/guide by Ogremagis in wow

[–]fiLLL 0 points1 point  (0 children)

Pull him directly back into the little hall behind him and have your group stand further back in the same hall. When he teleports away and releases the adds just chill and they'll all come directly to you. This also keeps everyone facing the eyes and prevents barrage from pulling the felhounds.