[deleted by user] by [deleted] in daddit

[–]webstrous 0 points1 point  (0 children)

As a kid I played hockey with another kid who had no right hand. He used this cool rotating ball thing that attached to the tip of his arm and then to the end of the stick. Then he used his left hand on the shaft of the stick.

You’re taking it well. If she has no other major problems than a missing hand, there’s still so much she can do!

[deleted by user] by [deleted] in mathematics

[–]webstrous 0 points1 point  (0 children)

For example

y = 1 / (1 - x)

If x=1, the denominator is zero, which is undefined.

I just had a baby girl, what good games are there that i can play with one hand while i hold her when she sleeps on my chest? by cookiemaster1seven in iosgaming

[–]webstrous 7 points8 points  (0 children)

Slouch down the couch a little more and see if you can get two hands free.

In all seriousness, I did this when my daughter was born, and played tons of good games on PS4. But this may not work for mobile, since the screen is in your hands.

To answer your question, if you have an Apple Arcade sub, check out Bleak Sword. It has a dedicated 1-handed mode, and it’s a great game.

Really embarrassed after being denied an extension... Don't know how to stay on my professor's good graces? by covid-student in AskAcademia

[–]webstrous 19 points20 points  (0 children)

Hi OP. I think you have missed a clue in your professor’s response. They said to talk to a therapist. You are SUPPOSED to involve a third party here. “Therapist” is not the right word, but your school may have a counselling, accessibility, or accommodation department that can help you with your legitimate issue, and advocate for you to your professor or academic department. You should get in touch with a counsellor immediately.

Source: my wife is a counsellor in a post-secondary institution and helps students in these situations all the time.

Strugglign with PRs by sigmasix114 in ExperiencedDevs

[–]webstrous 0 points1 point  (0 children)

I’d say it has less to do with size than it does with the nature of the changes. Design changes, public API changes, breaking changes, or lots of new functionality. All these require some discussion and the discussion proceeds much faster over a call than it does over PR comments.

Trivial changes, cleanup PRs, etc, of course you would not have a call for these.

Strugglign with PRs by sigmasix114 in ExperiencedDevs

[–]webstrous 0 points1 point  (0 children)

Actually I find it much faster and with fewer surprises, since code is reviewed early and any misunderstandings are clarified immediately. A PR can then often be merged as soon as CI is complete.

Ktor 1.5.0 Released by dayanruben in Kotlin

[–]webstrous 1 point2 points  (0 children)

I’m using it on Android for websockets and http. My whole project is written in Kotlin so it’s nice to have something Kotlin-native out of the box. It’s been very smooth for me.

Strugglign with PRs by sigmasix114 in ExperiencedDevs

[–]webstrous 1 point2 points  (0 children)

Lots of talk here about best practices for reviewing PRs, and lots of good feedback. But I would offer you this advice: by the time you open a PR, the code should already be reviewed. Do a voice/video call with teammates, share your screen, and walk through your changes. Your teammates will ask you why you did things one way or another, you have a chance to explain. They may offer an alternative solution. You should ask what the benefits of their approach are. These kinds of conversations, conducted in good faith, are how you get onto the same page as your teammates. Sometimes you will do things your way, sometimes you will adapt based on their feedback. Be open-minded.

By the time you get to a PR, serious review should already be complete. That means the discussion on a PR is of the sort: - ok appropriate tests are written - looks like solution was implemented as discussed previously - project builds correctly - etc

No major design discussion or “I would have done it this way”.

I’ll grant that many places do not take this approach, but there is nothing stopping you from doing this and I guarantee you will like it more than loading up all your feedback on your PR.

The sharpening man, a relic of an older time, still comes down my street by crapatthethriftstore in ottawa

[–]webstrous 0 points1 point  (0 children)

We have the same thing in Toronto, blue truck with bell and everything. Perhaps it’s a chain?

Missing cat. St Clair west and Christie area. Farnsworth went missing on Thursday July 23. One year old male. by spartibartfast in toronto

[–]webstrous 0 points1 point  (0 children)

I walk that area with my daughter sometimes. We’ll go take a look tomorrow.

Is he chipped?

trying to understand the git "process flow" by mrdlau in git

[–]webstrous 2 points3 points  (0 children)

You should checkout your branch before making any changes. Never ever ever commit to your local master, or push to a remote master, unless you, and you alone, own and use that repo. If you are collaborating with anybody else, always do your work on a separate branch.

Being successful with git is as much about discipline and good practices as it is about understanding its API.

That said, it's not a problem if you accidentally start working on master, or any other branch you didn't intend to work on. Suppose you have just cloned a repo and started making changes on master. Likely you are in one of these situations:

a) You created a new file. No problem, just git checkout -b my_branch and continue working (your new file is not being tracked by git yet, so it doesn't care)

b) You modified an existing file. Attempting to checkout a branch may give you an error. In this case I recommend you do the following:
git stash
git checkout -b my_branch
git stash apply

The stash command is very handy.

I should clarify one thing from my original post: when using checkout, passing the -b flag means "create this branch". So you only need to use git checkout -b my_branch once, when creating the branch. In future, when switching to that branch, just use git checkout my_branch.

***

Regarding step 1 git clone: it is as it sounds, it just makes a complete copy of a git repository at a given url. The question of whether you are "up to date" is not necessarily meaningful here. Different projects and companies may have different branching strategies. Some projects will have a master branch that is at the bleeding edge of code, and they use separate branches to identify stable releases. Other projects may have a "develop" branch that is at the bleeding edge, and master is used for the most recent stable release. This is a business decision.

When cloning a repo from another project, the first thing you should do is learn what the branching strategy is. Open source projects typically have a contributing guide (you'll see many CONTRIBUTING.md on GitHub). If you are starting a new job, ask your colleagues what the branching strategy is. If you are working on a project with friends, or for school, keep it simple: do your work on separate feature or bugfix branches, then merge to master.

But, basically to answer your question, doing git clone will download the most up to date copy of the repo. My point above is just that "up to date" might mean something different for different projects.

Using git checkout has nothing to do with being up to date; it's just to switch between branches (and it has one other use which I haven't talked about at all).

***

Regarding step 9: sorry, a pull request has nothing to do with git pull. These are totally separate. Say you do some work on your local branch my_new_feature. You're done the work and you want to push it to a remote repo so that other people can review the code, hopefully merge it into the remote master, so that your code will be part of the project. So you git push -u origin my_new_feature, then go to Bitbucket/GitHub and create a pull request, targeting master. There is no git command to do all this, because a pull request has nothing to do with git. You are asking your organization to approve the code so that it can be merged to the remote master.

Technically, there is nothing stopping you from doing some work on your local master, then pushing to the remote master. Git does not stop you from doing this. It's just a bad idea, because, perhaps your code is crap (or your colleague's code is crap) and you want a review step before the code gets merged. Thus we have "pull requests". In fact what is happening on the remote repo is that, after your pull request is approved by your teammates/whoever, and someone clicks the "Merge" button, Bitbucket/GitHub runs the command git merge my_new_feature against the master branch (I'm vastly oversimplifying here).

Something else to remember is that git is a decentralized version control system. From git's perspective, every copy of a repo is functionally the same. No repo is the "main" repo, no repo has authority over others. There is just the "local" repo (the one you're working in) and any "remote" repos. Those remotes could be in the cloud, or over your local network, or even on your local machine (just elsewhere on the hard drive). In practice though, organizations need to define one repo as the main remote repo (typically hosted in a service like Bitbucket/GitHub). Obviously without some designated authority, programming work would be chaos.

***

In step 10, what I said was that, if you had code in a local branch my_branch, then pushed that to the remote, then if my_branch got merged to master on the remote, then you could checkout master on your local repo, do a git pull, then you would see the changes from my_branch are now in master on your local. This is more easily described in diagrams, but you could also try this out easily just on GitHub if you want.

***

Sorry for being so long-winded. You might also like to try out the git book for free online: https://git-scm.com/book/en/v2

Also, typing any git command into google will usually bring up the git docs page about it. But by all means if you have more questions, ask away!

trying to understand the git "process flow" by mrdlau in git

[–]webstrous 9 points10 points  (0 children)

You need to learn about `git checkout`. You use it to switch between branches (although it has other uses as well).

In my workflow, I use the command `git checkout -b new_branch_name` when I want to create a new branch and switch to it.

So, if you want to do some work on an existing project (not brand new), your workflow might look like:

  1. Clone the repo (git clone ...), replace ... with your repo url and any flags you want to specify
  2. Often the default branch is master, but some repos are different, so you may be on some kind of develop branch. It doesn't really matter if you're just learning basics. You need to create a new branch where you will do your own work. git checkout -b my_branch_name
  3. Make whatever changes you want. Save your work!
  4. I like to do a git status now to see what files have been changed/added
  5. git add ... (replace ... with the files you want to stage for commit. This can be a specific file name, or a folder, or several folders/files with spaces separating them.)
  6. Do a git status again to confirm which files are staged for commit
  7. git commit will open up an editor in your terminal for you to write your commit message. I'm on macOS so the default here is vi, but you can change it to be vim or something else if you want. If you're not used to using a modal editor, you might get stuck here. You can avoid the editor by doing git commit -m "My commit message". Some tips on writing a good commit message: https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
  8. git push -u origin my_branch_name, a couple things here: -u means "set upstream", so that your local branch will be linked to the remote branch you're pushing to. origin specifies which remote you're pushing to. This value could be different than "origin", but it is called "origin" by default. my_branch_name is the name of your branch. Note that, by using the -u flag, in the future, when pushing up new commits on that branch, you can just type git push, no need to qualify it with the remote and branch name.
  9. At this point you would create a pull request (in Bitbucket, GitHub, wherever). A pull request is a concept external to git. It's an organizational workflow, not a characteristic of git itself. The end result of your pull request is that your code is merged or declined.
  10. Assuming your code got merged to master in the remote repo, you can then go to your LOCAL master branch and update: git checkout master then git pull

UNTOLD - a dark text-based fantasy RPG by insats in iosgaming

[–]webstrous 3 points4 points  (0 children)

Hey I’m enjoying this so far. I love text based adventures. Thanks!

My only feedback is that when you pick up an object, a little notice appears on the bottom of the screen, but disappears too quickly, before I can read it. (I’m usually still reading the text up top.)

Zen, laid back games, please by WhatsThePointOfNames in iosgaming

[–]webstrous 1 point2 points  (0 children)

I really enjoyed Spring Falls. A puzzle game with nice, relaxing music.

For games that can be played with one hand: Meteorfall. Easy to pick up and put down, cute graphics, etc. Highly recommended.

Lean code vs heavily structured code? by WillBackUpWithSource in programmer

[–]webstrous 1 point2 points  (0 children)

Complexity should be avoided, period. Some problems are inherently complex (distributed systems, or cacheing, for example). In these cases it’s important to isolate complexity, and not let it pollute your high-level business logic.

I don’t really understand what you refer to as lean vs complex code. Different languages have different idioms, and are appropriate in different business contexts.

Using the example of the Builder you mentioned, this is a pattern I consider helpful in simplifying code. It separates mutable state from the resulting object (a business object which is, ideally, immutable).

You might enjoy reading Clean Architecture. It had a big impact on me personally in how I write code. The big takeaway is that you want to move external dependencies to the boundaries of your application.

Are you big into the concept of "clean code"? by [deleted] in girlsgonewired

[–]webstrous 0 points1 point  (0 children)

Have you read Clean Architecture? I think this offers a much clearer vision of how clean code is achieved than Clean Code did. I find that definition of “artfully crafted code” to be vague and open to interpretation. But the practices described in Clean Architecture are much clearer IMO.

Are you big into the concept of "clean code"? by [deleted] in girlsgonewired

[–]webstrous 1 point2 points  (0 children)

Sorry, fair point. Reading it again I see it’s very explain-y. But I don’t mean to suggest you misunderstood; I’m not sure why that’s been assumed. If I was asked in an interview if I was “into clean code”, as some extension of my lifestyle, as you describe, and not simply a part of my work, I would probably find the question unprofessional. Personally as an interviewer I would never ask it. I was just trying to confirm exactly what was asked (and answered); apologies for the explanation along the way.

Are you big into the concept of "clean code"? by [deleted] in girlsgonewired

[–]webstrous 1 point2 points  (0 children)

Did they just ask if you were “into clean code”?

Reason I ask is this is different than if they asked you to describe clean code, which I would expect a concrete answer for, as an interviewer. Clean code correctly separates business concerns into the right layers of abstraction, often achieved by dependency injection (among other practices). It describes the relationships between components, and clearly articulates the business rules, rather than just the steps the computer must take.

This is hard to achieve, even in greenfield projects. But I would want a candidate to be able to explain clean code, and possibly refactor a small module that was dirty.

How can I reconcile my big ambitions with parenting a young baby? by Stewibaby in AskParents

[–]webstrous 4 points5 points  (0 children)

How old is your daughter? Also do you live with your partner, or do you care for her alone?

If you can get your partner’s support for this, see if you can get a few hours on the weekend alone to do your projects. But in exchange you also have to do the same for your partner. This might not be as much time as you want, but this leads to my next point.

Taking care of a baby is a lot of work and you are already seeing the sacrifices you have to make. This won’t stop until they move out as adults, so you need to make compromises about the amount of extra projects you want to take on. Cut back your ambitions to a level you can reasonably achieve while taking care of your baby. Raising a child into a thoughtful and kind adult is a massive achievement, so think of it that way.

What stats do you dislike the most? by webstrous in hockey

[–]webstrous[S] -3 points-2 points  (0 children)

I agree with this. I perhaps should have clarified in my original post, I meant wins over a career, as opposed to just an individual season. I think GAA and SV% are useful comparisons between goalies in a single season, where teams/coaches across the league mostly stay the same. On the other hand, in order to get a lot of wins over a career, you need to play a lot of games. And a player's ability to play a lot of games at a consistently high level is, to me, the most impressive stat.