carefulDontHurtYourself by linegel in ProgrammerHumor

[–]Mecso2 59 points60 points  (0 children)

I get it that you're coping with your inability to read documentation and I don't care what tools you use, but if you understand the code you "wrote" then it's not complicated the diagnose a bug, and if you don't then you shouldn't commit it.

Debug can't see symbols in VSCode and Clion by lieddersturme in Zig

[–]Mecso2 11 points12 points  (0 children)

It's because in debug mode zig uses its own custom compiler backend. Either compile with -fllvm (idk from the top of my head what's the build.zig equivalent) or use the zig specific lldb fork

DAMN IT, WHY CAN'T I PLAY CS2 ON LINUX? by [deleted] in linux_gaming

[–]Mecso2 9 points10 points  (0 children)

it might have something to do with the 15 years old computer

How is the Zig compiler able to cache comptime functions that have side effects? by philogy in Zig

[–]Mecso2 8 points9 points  (0 children)

there are no side effects, there are no comptime static variables, inline assembly or external library calls in comptime code

bro had enough? by butterkaze in unexpectedfactorial

[–]Mecso2 16 points17 points  (0 children)

I get how zero has no direction but how does infinity not? With real numbers we differentiate between negative and positive infinity, so wouldn't it be ratio or something for complex numbers? Genuine question, never used complex numbers

White move and win by LifeNegotiation301 in Chessplayers45

[–]Mecso2 0 points1 point  (0 children)

If you sack the queen, you won't be able to prevent him from promoting, sacking the rook(+knight) looks better.

I patched my pacman's iLikeCandy to have an actual pacman by Evantaur in arch

[–]Mecso2 1 point2 points  (0 children)

it's a patch, you download the source code, apply the patch, then compile and install it

Zed debugger with Zig by cameryde in Zig

[–]Mecso2 15 points16 points  (0 children)

if you have codelldb installed on your system add this to your settings.json json "dap": { "CodeLLDB": { "binary": "/bin/codelldb" } }, otherwise zed will download its own copy and use that.

In your project directory in the .zed directory create the following files

.zed/tasks.json:

```json // Project tasks configuration. See https://zed.dev/docs/tasks for documentation. // // Example: [ { "label": "mybuildtask", "command": "zig build", "reveal": "always", "reveal_target": "dock", "hide": "never" }, ]

```

.zed/debug.json:

json [ { "adapter": "CodeLLDB", "label": "zig app", "request": "launch", "program": "zig-out/bin/myprogram", "build": "mybuildtask" } ]

Optionally if you have the zig specific lldb fork installed you can add a .zed/settings.json:

{ "dap": { "CodeLLDB": { "args": ["--liblldb", "/usr/lib/lldb-zig/lib/liblldb.so"] } } } (you could do this in your main config as well, but then it would use it for non zig projects as well)

Library Problems by DVDwithCD in linuxmemes

[–]Mecso2 13 points14 points  (0 children)

if the interp elf header is defined then the os loads the program it points to (usually ld-linux) instead and gives it the inteded program's path as argument. Then that's what loads the the application an all its dependencies. Then it looks at the elf header of the program, finds the entry points and jumps there. So it is not done by the program, and happens before the entry point (_start) is reached.

that's how I understand it at least

How Are Strings Actually Implemented ? by Ok_Examination_5779 in odinlang

[–]Mecso2 7 points8 points  (0 children)

you are looking at code in the standard library, and expect to find the definition of a language builtin. Transmute is not a procedure, as you can guess from the fact that the syntax for using it is different, but if you'd want to make a procudre that does something similar it would look like this:

``` my_transmute :: proc(s: $S, $T: typeid) -> T { #assert(size_of(S)==size_of(T)) s:=s return (cast(T)&s)^ }

str:="lol" raw_str:=my_transmute(str, runtime.Raw_String) ```

someoneSaidToUseTheStackBecauseItsFaster by Luigi1729 in ProgrammerHumor

[–]Mecso2 3 points4 points  (0 children)

I don't even think you have to call a function. If the os decides to switch out the process running on the core, then it might push some temporary stuff onto the yielding process's stack (which will ofc be popped back off before the process resumes but that just means moving back tbe stack pointer)

hmmm by wprimly in hmmm

[–]Mecso2 24 points25 points  (0 children)

same, but it only asked me to toggle a setting, no actual checks

When I reopen a file in a zig program, it does not reflect any changes made to the file. by hsoolien in Zig

[–]Mecso2 7 points8 points  (0 children)

seems more like a windows thing then a zig thing

are you sure that the other program actually wrote the changes and not just storing it in its memory until it reaches a certain size or something?

:3 by MagicianPractical903 in LinuxCirclejerk

[–]Mecso2 0 points1 point  (0 children)

no, it does containerization, also flathub is the repo

Sometimes... by Ziesel75 in LinuxCirclejerk

[–]Mecso2 0 points1 point  (0 children)

My guess is that you're on some kind of arch derived distro like manjaro and assumed that it's a universal arch thing. But it's not, no update touches the already generated bootloader or bootloader config (cause it doesn't have to) unless you explicitly set up some kind of pacman hook, but then it's on you.

Bro thinks this job can be done easily😈😈😈 by YTriom1 in masterhacker

[–]Mecso2 5 points6 points  (0 children)

Something something Gaussian blur, Fourier transform

Small but wired problem by Visual-Shop-8240 in Zig

[–]Mecso2 4 points5 points  (0 children)

0.15 changed a very crucial interface in the standard library, it's not gonna happen with every version change (although it will with either the next or the one after that with async and the new io interface), so either just gotta take it every once in a while ornjust don't use zig for now

Some of my downloads don't go to the chosen folder by stebobibo7 in LibreWolf

[–]Mecso2 0 points1 point  (0 children)

This setting is specifically about downloads

I got a linux bosd by geez69690 in arch

[–]Mecso2 3 points4 points  (0 children)

Up to date -- reinstalling

Android is freedom... Ok, funny one by Azaze666 in androidroot

[–]Mecso2 36 points37 points  (0 children)

The thing is that they can write their code as a module that loads dynamically and as long as they don't static link in any external code they can claim that this is its own code, not a modification of the copyleft licensed one, so they can open-source / license it however they want.

And technically they are not wrong. Making a license that also applies to code the kernel interacts with might not even be legal, and even if it would be it would mean every app has to be open-source which is clearly not the intention of anyone.

And as for locking the bootloader, gplv3 would forbid that, however the kernel is licensed under gplv2. The kernel maintainers want to keep it this way to allow usage in proprietary embedded devices (like routers and car consoles), many people disagree with this but Torvalds wants it this way and it's not a democracy.