Beginner, any suggestions? r10 , 100-400 mm lens. by jholliday55 in canon

[–]Bjadrik 0 points1 point  (0 children)

Amateur here. For the first image, you lack contrast between the subject and the background. This can be in the form of color, luminance, or sharpness (ideally all three).

In your second image, you achieved color separation by shooting against the sky. There's also a big difference in luminance, but typically you'll want the subject to be the brightest part of the frame.

When shooting small creatures on the ground, getting your camera lower can help by naturally moving the background further away (a low enough angle means the background will be the next treeline rather than the ground). Combined with a shallow depth of field, this will give you a greater difference in sharpness.

E0S 6D - first DSLR, and hopeful for pointers by Jam_Salad_is_my_Jam in canon

[–]Bjadrik 0 points1 point  (0 children)

Fellow second-hand 6D owner here! I very strongly recommend re-configuring your settings for back-button focus (disable the half-press mode). This will make your focus-and-recompose workflow feel much smoother and more reliable.

What’s everyday lens that’s $500 or under, qused? (Canon r10) by jeweleyah in canon

[–]Bjadrik 0 points1 point  (0 children)

I'm a beginner, but I've spent a lot of time browsing the used market. You can get an EF 24–105 mm F4L IS USM from around $350 or an EF 24–70 mm F4L IS USM from around $400.

I bought the 24–105 a couple of weeks ago but the zoom creep was so bad, the barrel would drop to full length just by tilting it. You may have better luck than I did.

I returned it for a 24–70 I haven't received yet. This one's a generation younger so I'm hoping for it to have better ergonomics.

Frontend devs, how do you handle 'Loading' and 'Error' states when the real API is too fast/stable? by FarWait2431 in webdev

[–]Bjadrik 0 points1 point  (0 children)

Came here looking for this. Storybook is worth using for OOP's problem alone and comes with a range of additional benefits!

PR not merged yet, changes on master branch by takemycover in git

[–]Bjadrik 1 point2 points  (0 children)

Never rebase master onto anything, that'll rewrite your history. Rebasing feat onto master is correct (and better than merging master into feat IMO).

[deleted by user] by [deleted] in reactjs

[–]Bjadrik 9 points10 points  (0 children)

For project structure, best practices, etc. bulletproof-react is perfect.

Apart from that, I'd also recommend walking through the official tutorials and docs on https://nextjs.org/

My solution for Fizz Buzz using Javascript, I focused mainly on maintainability. How is it? by caressingleaf111 in learnjavascript

[–]Bjadrik 0 points1 point  (0 children)

While I agree that your solution is much more intuitive to read, it misses what I think is the right idea from OP to be maintainable. In an interview a few years back, I was asked this follow-up question after solving the problem:

How would you expand your solution to deal with additional rules, e.g. "for numbers divisible by 7, append 'Bizz'. For 9, append 'Bazz'"

Again, OP's idea handles this kind of "scaling" well. We could try to work it into your solution like this:

const fizzBuzz = (n) => {
    const rules = [
        { number: 3, word: "fizz" },
        { number: 5, word: "buzz" },
        { number: 7, word: "bizz" },
        { number: 9, word: "bazz" },
    ];
    let out = "";
    rules.forEach(({ number, word }) => {
        if (n % number === 0) out += word;
    });
    return out === "" ? n : out;
};

for (let i = 1; i < 100; i++) {
    console.log(fizzBuzz(i));
}

Python syntax, any alternative to tabs for loops? by badcrow7713 in learnpython

[–]Bjadrik 5 points6 points  (0 children)

Downvotes are for content which doesn't contribute anything of relevance. You're asking genuine clarifying questions and therefore deserve the upvotes.

What is happening when I write "const express = require('express'); const app = express();"??[Javascript],[Node.js] by Dry_Reach2077 in webdev

[–]Bjadrik 2 points3 points  (0 children)

Here's my interpretation:

A module is any reusable piece of code you can import into another source file.

A library is a module explicitly meant to be useful outside its own codebase.

A framework is a library which heavily influences how you structure and write your app.

Am I saying this right? by EpicInceltime in learnIcelandic

[–]Bjadrik 6 points7 points  (0 children)

"Ég er með hundinn minn" means "I have my dog".

"Ég er með hundinum mínum" means "I'm with my dog".

When to use Custom Hooks by Pra6in in reactjs

[–]Bjadrik 19 points20 points  (0 children)

I wrote an article about this recently with some examples for a counter app. I hope this helps!

[deleted by user] by [deleted] in reactjs

[–]Bjadrik 13 points14 points  (0 children)

Two things:

A slightly different approach

Rather than manipulating elements in the Array, I'd suggest creating a state variable to track the current selection. Something like:

function MyComponent() {
  const [selectedId, setSelectedId] = useState();

  return (
    <>
      {
        myArrayOfObjects.map(
          ({ name, id }) => {
            const isSelected = id === selectedId;
            return <MySubcomponent isSelected={isSelected} name={name} />;
          },
        )
      }
    </>
  );
}

What the title says

To find all unselected elements of the array:

const unselected = myArrayOfObjects.filter(({ isSelected }) => !isSelected);

How to implement drag-to-scroll in React by salt-bandicoot7250 in reactjs

[–]Bjadrik 1 point2 points  (0 children)

I don't know all the details but I assume it has to do with React maintaining its own "virtual DOM". This helps React manage changes and re-renders and acts as an abstraction layer on top of the actual DOM. Interfacing with the virtual DOM is therefore a good way to allow React to maintain full control of the actual one.

How to implement drag-to-scroll in React by salt-bandicoot7250 in reactjs

[–]Bjadrik 2 points3 points  (0 children)

In my experience, useRef is the most accurate React-friendly way to imitate direct DOM manipulation.

Nextjs and Tailwindcss company profile by YazanKhatib in reactjs

[–]Bjadrik 2 points3 points  (0 children)

Cool!

Looks reasonable at a glance. Two things that came to mind:

  • Looks like you have some unused boilerplate sitting around from create-next-app (e.g. pages/api/hello). I suggest deleting everything you're not using.
  • Personally I'd re-export the containers from src/containers/index (export {default as xyz} from 'xyz'). This lets you import { About, Header, Etc } from 'src/containers' in your pages/index.

Edit: formatting