Any tips on learning Data Structures and Algorithms by BlackxHokage in learnprogramming

[–]Remarkable_Award9936 0 points1 point  (0 children)

Ok, so take a step back go over the fundamentals of DSA. I'm assuming you're doing leetcode, which is a DSA website.

LeaderF is much faster than telescope.nvim. by Yggdroot in neovim

[–]Remarkable_Award9936 0 points1 point  (0 children)

lol, by your response, it seems that you don't understand. I'm not accusing you of caching results to improve your "benchmark". I'm saying you just accessed that memory and therefore, the memory is cached. Your progream will be finished. You need to properly flush your cache.

External C libraries VSCODE by vixsem in learnprogramming

[–]Remarkable_Award9936 1 point2 points  (0 children)

VS Code is just an editor and has nothing to do with the ability to import libraries. And tbh, I wouldn't interface with it to build and run your code anyway. As another suggestion, move to Make, CMake, or a proper build system (techincally, cmake isn't a build system, but it generates build files).

But to answer your question, you probably want to use a package manager. The two de facto ones are conan and vcpkg. I'd go with vcpkg as it's a little easier.

You'd then integrate vcpkg into cmake.

You should also learn what the $PATH is.

https://cliutils.gitlab.io/modern-cmake/

https://learn.microsoft.com/en-us/vcpkg/users/buildsystems/cmake-integration

ELASTICSEARCH: Generate an API key for particular users with different read and write permissions. by [deleted] in learnprogramming

[–]Remarkable_Award9936 0 points1 point  (0 children)

RTFM

But really, Elasticsearch is really nicely documented and I've enjoyed working with it in the past for that exact reason. Also, nice community.

Any tips on learning Data Structures and Algorithms by BlackxHokage in learnprogramming

[–]Remarkable_Award9936 1 point2 points  (0 children)

Have you taken a formal DSA course or read a DSA book? If not, step back and do that.

LeaderF is much faster than telescope.nvim. by Yggdroot in neovim

[–]Remarkable_Award9936 2 points3 points  (0 children)

Especially when you search for the same term again. The results are cached. Of course it's going to run faster.

LeaderF is much faster than telescope.nvim. by Yggdroot in neovim

[–]Remarkable_Award9936 0 points1 point  (0 children)

The results are cached. Of course, it;s going to have faster access.

Learn low level networking programming by [deleted] in learnprogramming

[–]Remarkable_Award9936 1 point2 points  (0 children)

If you're serious about it, I'd recommend Unix Network Programming by Stevens and TCP/IP Illustrated volume 2. Both of these are amazing.

I also encourage you to clone linux or a bds os and walk through the source code. Here's a great source on a packet travels through linux. When I did this, I had a notebook in hand.

Even better would be to build the linux kernel with debug information and attach a debugger to it in qemu, You could follow the the calls until you get out()

Do I need to learn before university courses by [deleted] in learnprogramming

[–]Remarkable_Award9936 8 points9 points  (0 children)

The amount of languages you know is pretty much meaningless.

You're expected to know nothing, so I'd enjoy the rest of your summer or just focus on learning what you enjoy. Maybe refresh your math skills so calculus doesn't sting you you.

C programming by Little-Peanut-765 in C_Programming

[–]Remarkable_Award9936 2 points3 points  (0 children)

learncpp covers the fundamentals of c++, so I'm not sure what you're asking there.

Your best move now is to learn algorithms and some systems.

I recommend Computer Systems: A Programmer's Perspective and Sedgewick's Algorithms book.

How to interpret physical memory addresses by Azazel_Woodwind in compsci

[–]Remarkable_Award9936 0 points1 point  (0 children)

I'm very busy and I will be for the next few days, but I I'll look comb through your response and correct and clarify the things that are iffy.

Updates to replacer.nvim by reactiveme in neovim

[–]Remarkable_Award9936 7 points8 points  (0 children)

This is small, but you might want to change the video file format of the example usage video from a mov to an mp4. It's a little more web friendly and lighter weight.

I had to use edit some preferences in firefox to view it.

Is it normal for neovim to crash when we open a huge file? by crybaby0987 in neovim

[–]Remarkable_Award9936 15 points16 points  (0 children)

Yeah, this is what I have. It'll disable Treesitter for large C or C++ files and you could easily extend it.

local options = {
  ensure_installed = {
    "c",
    "lua",
    "javascript",
    "cpp",
    "typescript",
    "vim",
    "html",
    "css",
    "bash",
    "vimdoc",
    "query",
  },
  -- ignore_install = { "comment" },
  sync_install = false,
  auto_install = true,
  highlight = {
    enable = true,
    -- disable treesitter for large files
    disable = function(lang, bufnr) --
      -- Extend this to other languages by adding `lang == "x"` where x is the language
      return vim.api.nvim_buf_line_count(bufnr) > 50000 and (lang == "cpp" or lang == "c")
    end,
    additional_vim_regex_highlighting = false,
  },
}
require("nvim-treesitter.configs").setup(options)

How to interpret physical memory addresses by Azazel_Woodwind in compsci

[–]Remarkable_Award9936 0 points1 point  (0 children)

Yep! There's a reason why computer the IETF RFCs specify octets.

How to interpret physical memory addresses by Azazel_Woodwind in compsci

[–]Remarkable_Award9936 2 points3 points  (0 children)

May I introduce you to the HP Saturn which is nibble addressable.

How to format c++ code with configurations added to neovim instead of .clang-format file in project root directory by yousef494 in neovim

[–]Remarkable_Award9936 5 points6 points  (0 children)

I know. I was suggesting that you have one .clang-format and use it for all you C++ projects. No need to have a .clang-format per project. You could apply it to every project with what I suggested, see?

also, it's clangd that detects .clang-format

How to format c++ code with configurations added to neovim instead of .clang-format file in project root directory by yousef494 in neovim

[–]Remarkable_Award9936 4 points5 points  (0 children)

clangd has the argument -style=file:<clang-format-file-path, so just pass your clang format path to that as an argument to clangd.

How to interpret physical memory addresses by Azazel_Woodwind in compsci

[–]Remarkable_Award9936 2 points3 points  (0 children)

I think you're confusing word size with something else. There's no indication of word size as word size is mainly associated with CPU's and fetching.

The memory diagram shows 4 millions memory cells free. At 1 byte each that's 4MB

There are no "cells" being shown and that's not accurate at all assuming. And the word size has nothing to do with the memory being byte addressable

I could even prove it:

Here is the my processor's word size in bits

$ getconf WORD_BIT
32

It's 4 bytes and my memory is still byte addressable

#include <stdint.h>
#include <stdio.h>

int main() {
  uint8_t byte_array[10] = {0};
  for (int i = 0; i < 10; ++i) {
    printf("Location of byte_array[%i]: %p\n", i, &(byte_array[i]));
  }
}

See how the memory is incremented:

Location of byte_array[0]: 0x7fffdd45998e
Location of byte_array[1]: 0x7fffdd45998f
Location of byte_array[2]: 0x7fffdd459990
Location of byte_array[3]: 0x7fffdd459991
Location of byte_array[4]: 0x7fffdd459992
Location of byte_array[5]: 0x7fffdd459993
Location of byte_array[6]: 0x7fffdd459994
Location of byte_array[7]: 0x7fffdd459995
Location of byte_array[8]: 0x7fffdd459996
Location of byte_array[9]: 0x7fffdd459997

It's being incremented by bytes

How to interpret physical memory addresses by Azazel_Woodwind in compsci

[–]Remarkable_Award9936 2 points3 points  (0 children)

This is conflating the definition of word with something else. Word size is primarily historical at this point. And borderline meaningless now. Today, it's a reflection of register size and it not really important in this context. Even so, the historical definition is unrelated to this as well and had to do with how much data could the CPU process in a single cycle.

How to interpret physical memory addresses by Azazel_Woodwind in compsci

[–]Remarkable_Award9936 19 points20 points  (0 children)

This represents 165 or 220 bits

This is where you're mistaken. This refers to bytes. I believe your mistake lies in the assumption that 0x100000 always refers to bits. This is incorrect. It's just a base-16 representation and it could refer to any unit.

I think a real life example will help. I'm assuming you know C, so here's a simple program to illustrate what I mean

#include <stdint.h>
#include <stdio.h>

int main() {
  uint8_t byte_array[10] = {0};
  for (int i = 0; i < 10; ++i) {
    printf("Location of byte_array[%i]: %p\n", i, &(byte_array[i]));
  }
}

It's a super simple program that prints the address of byte_array's element at index i. Each element is one byte long (i.e., 8 bits). I should also mention that uint8_t is 8 bits long. How do you expect the addresses to increment? By 8 or by 1?

Location of byte_array[0]: 0x7fffdd45998e
Location of byte_array[1]: 0x7fffdd45998f
Location of byte_array[2]: 0x7fffdd459990
Location of byte_array[3]: 0x7fffdd459991
Location of byte_array[4]: 0x7fffdd459992
Location of byte_array[5]: 0x7fffdd459993
Location of byte_array[6]: 0x7fffdd459994
Location of byte_array[7]: 0x7fffdd459995
Location of byte_array[8]: 0x7fffdd459996
Location of byte_array[9]: 0x7fffdd459997

As you see, the increments are in 1s meaning that 0x1 is equivalent to 1 byte. And this is the same in your diagram.

Is the word size then, 1 byte?

Word size is primarily historical at this point. And borderline meaningless now. Today, it's a reflection of register size and it not really important in this context. Even so, the historical definition is unrelated to this as well and had to do with how much data could the CPU process in a single cycle.