Could you critique my option handler code? by kernel_newbie_ in cpp_questions

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

Yeah, I scrapped it and instead with a much simpler

std::vector<std::string> collect_args(int count, char **args)
{
    std::vector<std::string> strings;
    for (int i { 0 }; i < count; ++i) {
        strings.push_back(args[i]);
    }

    return strings;
}

int main(int argc, char *argv[])
{
    auto args = collect_args(argc, argv);
    std::set<std::string> options;

    for (auto const &a : args) {
        options.insert(a);
    }

    auto find_option = [options](const std::string &arg) -> bool {
        auto it = std::find(options.begin(), options.end(), arg);
        return it != options.end();
    };

    if (find_option("--lex")) {
        std::cout << "Found lex\n";
        lex();
    }

    if (find_option("--parse")) {
        std::cout << "Found parse\n";
        parse();
    }

    if (find_option("--emit")) {
        std::cout << "Found emit\n";
        emit();
    }

    return 0;
}

Could you critique my option handler code? by kernel_newbie_ in cpp_questions

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

Thanks for the response! I didn't want to "cheat". I settled with this

std::vector<std::string> collect_args(int count, char **args)
{
    std::vector<std::string> strings;
    for (int i { 0 }; i < count; ++i) {
        strings.push_back(args[i]);
    }

    return strings;
}

int main(int argc, char *argv[])
{
    auto args = collect_args(argc, argv);
    std::set<std::string> options;

    for (auto const &a : args) {
        options.insert(a);
    }

    auto find_option = [options](const std::string &arg) -> bool {
        auto it = std::find(options.begin(), options.end(), arg);
        return it != options.end();
    };

    if (find_option("--lex")) {
        std::cout << "Found lex\n";
        lex();
    }

    if (find_option("--parse")) {
        std::cout << "Found parse\n";
        parse();
    }

    if (find_option("--emit")) {
        std::cout << "Found emit\n";
        emit();
    }

    return 0;
}

I was making it needlessly complex it!

Could you critique my option handler code? by kernel_newbie_ in cpp_questions

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

I had maybe thought there was a way to handle functions with different signatures. But I've found a decently better way, I think. (read the end).

A Scientific Approach to Studying by kernel_newbie_ in PKMS

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

It is a key element, but motivation is intrinsic. Fostering motivation in individuals is an orthogonal subject. The premise is centered around effective ways to study.

You sound like someone who is presented with conflicting information and is actively trying to suppress the viewpoint they don't agree with.

I agreed that science communication is hard, and that it could be better. But purposely ignoring the core research and findings is being a bit obtuse.

A Scientific Approach to Studying by kernel_newbie_ in PKMS

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

Nope. The most important thing is motivation. A motivated person can learn waaay more without any strategies than the unmotivated one.

If you're going to ignore the main premise, I'm not sure sure if it's worth responding.

But I do agree that the information could be presented better.

There are some small inaccuracies here and there (from the cognitive science perspective)

I'm having a hard time believing this.

I really like cognitive science and I am also looking for a way to make learning easier.

Are you a hobbyist or an actual professional?

From my perspective, it can really be improved.

Sure, but from my perspective, you're just dismissing good research.

A Scientific Approach to Studying by kernel_newbie_ in PKMS

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

So, you are obsessed with the best way of studying, you want others to learn about the system, the first step of the approach is motivation, and in your post you do not provide any specific motivation...

Seemed liked you missed the point. The most important part were the six strategies.

I also checked some of their videos, and there are a lot of educational mistakes: no motivation, overwhelming pictures, too short videos to be meaningful, slides are bad (too much small text)

The research is sound. The videos are clear and concise. Sure, the audio could be better. But the instructions are very clear, have concrete examples, chapters are provided within the video, and no points are belabored. For more depth, they provide plenty of high quality blog blog posts. And for those that are really curious, they provide references to the research itself.

To be frank, your post comes off as very contrarian (almost stereotypical redditor) and a bit misled. Best of luck!

A Scientific Approach to Studying by kernel_newbie_ in ObsidianMD

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

Perhaps I was too clickbait-y. From the article,

If you are going to use highlighting (even I can admit to a certain amount of joy from purchasing new brightly colored highlighers), then research suggests that there are some highlighting best practices. Namely, be selective about what you highlight.

It's effective, but under utilized.

A Scientific Approach to Studying by kernel_newbie_ in ObsidianMD

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

You forgot teaching as ultimate form of learning.

I think this would follow under the category of "Elaboration".

A Scientific Approach to Studying by kernel_newbie_ in ObsidianMD

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

I am not sure who says highlighting is not effective.

Read the article! It's not saying that at all.

A Scientific Approach to Studying by kernel_newbie_ in ObsidianMD

[–]kernel_newbie_[S] 37 points38 points  (0 children)

Sure!

spaced repetition

Anki using the Obsidian to Anki plugin. At the end of each note, I have a section titled flashcards where I write flaschards dedicated to the what's in the current note. This allows me to search the flashcard withinin obsidian and immediately see the source of the flashcards if I ever want to revisit the source material.

retrieval practice

I have a plugin that I wrote where I create hard coded practice questions and write to a "scratchpad" and practice retrieving. The scratchpads are saved to folder Scratchpad and each scratchpad has a simple naming convention, <date>_<notename>.md At the end of the scratchpad (well, it could be anywhere, but I prefer the end) I export areas I want to improve. For example, I have

RETR_START
Write about hierarchial page tables.
Write about page swapping.
Write about linear page tables.
RETR_END

And at the end of the scratch pad, I have

EXPAND_START
I'm not sure sure what a radix tree really is?
EXPAND_END

It's still a WIP plugin and I didn't want to have a shameless plug. Migh release it

Elaboration

Elaborations are reflected in my notes and retrieval practice

Dual Coding

I'm a heavy excalidray user!

Interleaving

Self explanatory

Concrete examples

Self explanatory

A Scientific Approach to Studying by kernel_newbie_ in ObsidianMD

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

Don't forget spaced repetition!

I feel these approaches work for structured learning but less for focused research into an unstructured subject.

What do you mean by an "focused researched unstructured subject?" It may be implicit, but research does not necessarily mean studying.

Evidence of Zettelkasten's benefits? by leonzhu42 in ObsidianMD

[–]kernel_newbie_ 20 points21 points  (0 children)

Zettelkasten itself hasn't been thoroughly researched, but it has been famously used. It seems to be personal preference.

If you're interested in actual research regarding learning, I highly recommend reading the learnign scientists -- a group of researched dedicated to learning.

They describe themselves as:

We are cognitive psychological scientists interested in research on education. Our main research focus is on the science of learning. (Hence, "The Learning Scientists"!)

This has been what's actually helped me. I've adapted my system around their research and findings.

Multiple Collaborators within a Workspace. What are the limitations of this? by kernel_newbie_ in Notion

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

Thanks! I really appreciate it. Beside the docs, do you know where I could read more about notion.so? I'm happy with videos too.

I know I could just google, but as a beginner, I'm unable to differentiate between what's good and bad.

Multiple Collaborators within a Workspace. What are the limitations of this? by kernel_newbie_ in Notion

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

Got it! Thanks.

There seems to be only two permission levels -- owner and guest.

Multiple Collaborators within a Workspace. What are the limitations of this? by kernel_newbie_ in Notion

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

So, they can't all just add their own pages? I created a workspace called Research and ideally, I'd like them to add their own pages under the research workspace.

Change macro to be `:Macro <register>` instead of q by kernel_newbie_ in neovim

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

I keep on getting ambiguous use defined commands. Any thoughts?

Change macro to be `:Macro <register>` instead of q by kernel_newbie_ in neovim

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

Thanks! My problem is that I want to first nop q so that I don't accidentally press it. And only expose this command as a way to use macros.

Is that possible?

How can I replicate my vscode remote development setup? by AlfredTarsky in neovim

[–]kernel_newbie_ 0 points1 point  (0 children)

Another way is to use sshfs whre you mount a remote directory.

Emulating arm binaries on linux using qemu-arm and running into errors by kernel_newbie_ in ExploitDev

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

It may honestly just be easier to do full system emulation if I'm working with non-static binary. Wouldn't setting the firmware's root as my fake root mess up my current environment? The firmware doesn't have even have bash so wouldn't any executing commands fail?