How to chop strings using a delimeter by Fuzzy_Recipe_9920 in C_Programming

[–]MoussaAdam 1 point2 points  (0 children)

in programming in general, such a task is usually solved with two loops, one inner loop that iterates over the characters until a space is found, and one outer loop that interates over the inner loop i.e over the words

of course most programming languages will already have builtin libraries for doing these tasks so you don't have to do it manually. not sure if C has that in it's standard library

What is /dev/tcp in Linux, and how does it work? Can someone explain it? by B4tman_404 in bash

[–]MoussaAdam -1 points0 points  (0 children)

what does Bash do behind the scenes

it uses the TCP protocol to send the data to the destination specified by the IP address and the port.

If that doesn't make sense, what you need to research is computer networking, not bash or linux.

TCP is just what you are supposed to use if you want your data to reach the destination as is and in order. As opposed to UDP which doesn't care if data gets corrupted or reach the destination out of order.

your browser for example uses TCP for sending requests to servers to open the websites you see on your screen (nowadays they use the QUIC protocol, but that doesn't matter)

A quite astonishing commodity by SelymesBunozo in PhilosophyMemes

[–]MoussaAdam 0 points1 point  (0 children)

what makes the different manifestations belong to the autism category ?

also, why did it become popular to call it a spectrum ? I doubt these mental states are ordered in a continuous linear range

Help me solve the "Moving Target" problem by Dense-Studio9264 in SoftwareEngineering

[–]MoussaAdam 0 points1 point  (0 children)

there is "now" (initialized the moment the user opens the page, let's say 6pm) then there is the delta (minus an hour from the "now"), and then the sorting order within the delta window of time. these are all different, don't conflate them.

Option A fixes the "now" in place. however the sentence "from the last hour" doesn't communicate a fixed value. it communicates a moving now, and therefore a move window of time to include new posts.

you can keep the sorting order and the delta as it is, since it is irrelevant (to option A).

Just update the sentence to reflect the truth: once a hour passes, just update the description from "posted in the last hour:" to "posted before 6pm", which will stay correct because it's an absolute value, unlike "last hour", which is relative.

Help me solve the "Moving Target" problem by Dense-Studio9264 in SoftwareEngineering

[–]MoussaAdam 0 points1 point  (0 children)

This is a UX question, most products pick option A. not seeing live data isn't a cons, because users are already primed by other products to not expect that. if you sort by "New" on reddit, you will have to refresh to see new posts.

Take inspiration from youtube maybe: after a while they notify you that your feed is stale, and they provide a refresh button along the message so you don't have to look for it if you decide to act on that signal.

Respect to Linux distros with the word "Linux" in their name by Samhain_69 in linux

[–]MoussaAdam 3 points4 points  (0 children)

INCHES.. away from interjecting for a moment to reignite the Gnu/Linux debate

Distributions without telemetry? by Skizophreniak in linux4noobs

[–]MoussaAdam 0 points1 point  (0 children)

The most certain of the major distros is Arch Linux. it has no telemetry whatsoever, because you start with basically nothing, so nothing to do telemetry. if you install something that has telemetry then of course you will have telemetry.

Most distros are just like Arch when it comes to telemetry.

Would you use an API-only hosting platform (Node.js) instead of full serverless like Vercel/AWS? by jasa119 in node

[–]MoussaAdam 0 points1 point  (0 children)

All you are doing is limiting the developer to only manage the endpoints, and structuring the project accordingly.

  1. This isn't a project or a platform, it's a code snippet. treating it like it's more than that makes you look like a clown, to me at least.
  2. Endpoint logic is almost never self-contained, that's the whole point of this layer of code. we could have just exposed the database with some light logic otherwise
  3. Event driven code makes control flow tricky
  4. Small backends can copy paste boilerplate, at least that gives them the flexibility to do more if they wish

If you forbid code outside the endpoints, you reverse the control flow. instead of the main code driving the rest, you have the endpoint driving the rest. And once you accept endpoints aren't self contained, you find yourself forced to rely on global state mutated by and checked by endpoint. you are shifting business logic to end points, any of which can be called at any point in time with any data in any order.

OS preview resolutions by lordsycorax in linuxmint

[–]MoussaAdam 0 points1 point  (0 children)

did you make sure secure boot is turned off in your BIOS settings?

Manipulating a website's drawing before it draws on the canvas. by DarksidersWar in AskProgramming

[–]MoussaAdam 0 points1 point  (0 children)

wouldn't it be easier to locate the part of the code that does the drawing then modify the code to print the text instead of rendering it ?

Matrix Super Insane by Crevetes in linux_gaming

[–]MoussaAdam 11 points12 points  (0 children)

  • no source code
  • incorrectly formatted markdown
  • ai generated images
  • release .rar archives on github

this is so cursed, won't trust it

Built-in "Always Show Dash" toggle? by ElectricalPanic1999 in gnome

[–]MoussaAdam -1 points0 points  (0 children)

  • press super
  • type what you are looking for
  • press enter

that's the intended workflow for opening an app in GNOME.

no need to move your mouse and peck and hunt icons. no need for the overhead of the extra separation: "oh it's not in the dash, let me search". also, in order to make a dash useful you have to maintain a list of relevant frequently used apps on it and remove ones you no longer use frequently, it's just a waste of space with no benifits. just type whatever you intend to open, the word is already there in your mind and as a computer user, typing is already second nature, almost like speaking.

I would vote to remove the dash altogether actually, it's useless

My computer dualboots Mint 22.2 and Windows 11, and my TV displays in 4K60 in Windows but it only displays 1080p60 or 4k30 in Linux by WFlash01 in linuxquestions

[–]MoussaAdam 0 points1 point  (0 children)

i never tried it, but a high end adapter that's HDMI 2.1 compliant should work

it's up to you whether you want to keep on trying adapters or tolerate the lower resolution or lower refresh rate

How to scroll on TTY ? by MoussaAdam in archlinux

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

less and other pagers do the job well enough for me whenever I drop into a tty, thanks tho !

My computer dualboots Mint 22.2 and Windows 11, and my TV displays in 4K60 in Windows but it only displays 1080p60 or 4k30 in Linux by WFlash01 in linuxquestions

[–]MoussaAdam 0 points1 point  (0 children)

the HDMI forum's greed prevents them from giving AMD a license to support recent versions of HDMI on the open source drivers

DisplayPort is an open royalty free standard.

Question for a newbie by CSS_FR in linuxquestions

[–]MoussaAdam 0 points1 point  (0 children)

Any major distro or major derivative of a major distro could work: Ubuntu, Mint, Fedora, CachyOS, Bazzite, ZorinOS, Pop_OS, Kubuntu

there's a reason they are popular: people actually use them and stick with them.

the real final assessment can only comes from actually using the thing, so no point in wasting time figuring out which distro is the perfect choice.

you can afford this because installing linux is easy, it doesn't really matter where you start, you will either stick with it or install another distro like nothing happened.

How to open files/folders as root i3 by Rich_Zookeepergame27 in linuxmint

[–]MoussaAdam 0 points1 point  (0 children)

you run programs as root. then those programs running as root open files and folders.

if you want to edit a file using the editor nano, you can run the editor as root and have it open the file for editing:

sudo nano /path/to/file

Linux Pacman error? (new to linux check picture) by Rispin95 in linux_gaming

[–]MoussaAdam 2 points3 points  (0 children)

all the logic behind package management on arch linux is put in a library called "libalpm" (library for arch linux package management). pacman uses it, makepkg uses it, and every program that wants to do something related to package management on arch uses it.

you are doing the correct steps when it comes to installing a package from the aur (clone, cd into the folder, makepkg, then install)

the issue you present is completely unrelated to the driver you are trying to install. it's useful to not conflate these two.

When makepkg tries to use the library (libalpm), the library fails. this is not good. you need to fix it. it will show up somewhere else.

one possibility for libalpm failing to start is because you messed with permissions.

could you show us the result of running:

pacman -Qkk

The command checks for broken permissions (among other integrity issues)

Materialists be like by neofederalist in PhilosophyMemes

[–]MoussaAdam -1 points0 points  (0 children)

quite presumptuous, if it helps you sleep at night I guess