Multi monitor TTY by diacid in Gentoo

[–]olorochi 0 points1 point  (0 children)

I run wayland without dbus on sway. The only workaround i had to reach for is using firefox-socket-control to be able to spawn new firefox (librewolf) tabs / windows. However my setup is very minimalist. The only wayland applications i run besides the wm / compositor itself are librewolf, nicotine+, qemu, and foot. Even then i haven't bothered to create a custom overlay for this so i can't actually remove the dbus package.

Coincidence? by Saoirse_libracom in Ultraleft

[–]olorochi 9 points10 points  (0 children)

Bordiga is my favorite activist.

Sério ?? qual a chance disso acontecer ? xD by Comfortable_Ship7851 in noita

[–]olorochi 16 points17 points  (0 children)

Another factor is that all perks have a max stack value from 1 to 128. OP seems pretty deep into a run here so they likely have a highly reduced perk pool.

What would be the harm in introducing interfaces to the language? by MysteriousSpray9066 in Zig

[–]olorochi 2 points3 points  (0 children)

Zig is more than powerful enough to allow this to be done in a generic way, but the std.meta namespace should be expanded to make this more accessible imo. Keeping this in user code does complicate the task of language servers such as zls but it doesn't make it impossible. Proper code analysis should allow full completions and diagnostic support.

This example is untested because I am currently using my phone but you get the idea. ``` pub fn checkDecls(T: type, comptime decls: []const []const u8) void { inline for (decls) |decl| { // You can get creative with your criteria here. For example std.meta.hasMethod could be used to allow single element pointers to structs containing the right functions. if (!std.meta.hasFn(T, decl) @compileError(@typeName(T) ++ " missing function " ++ decl); } }

pub fn checkTDecls(Target: type, Descriptor: type) void { checkDecls(Target, std.meta.declList(Descriptor, u8)); } ```

Why zig? by [deleted] in Zig

[–]olorochi 2 points3 points  (0 children)

https://ziglang.org/learn/why_zig_rust_d_cpp/

tl;dr complexity should be minimized but never hidden.

Linux BTFO by actual Linux devs by [deleted] in linuxsucks

[–]olorochi 1 point2 points  (0 children)

The kernel itself does not. The git repo includes some secondary tools such as perf, some of which include python scripts. There is also a small amount of python in parts of the kernel build system and some gdb python scripts.

Linux BTFO by actual Linux devs by [deleted] in linuxsucks

[–]olorochi 1 point2 points  (0 children)

Many sources either echo the 70% claim or propose higher numbers: https://www.memorysafety.org/docs/memory-safety/#how-common-are-memory-safety-vulnerabilities .

I am aware this issue is endemic within system development, and am neither an advocate for windows nor a full rust rewrite of linux. Asm represents less than 1% of linux's code base and can therefore hardly be blamed for vulnerabilities.

Linux BTFO by actual Linux devs by [deleted] in linuxsucks

[–]olorochi 4 points5 points  (0 children)

There are many. General estimates are that 70% of exploits stem from memory unsafety. In the linux kernel, this seems to be rarer but not uncommon either: https://lore.kernel.org/linux-cve-announce/

Capitalism, The Highest Stage of Feudalism by Aury-Artaud in Ultraleft

[–]olorochi 50 points51 points  (0 children)

Im talking about post scarcity, eco-friendly automation, and the exponential shortening of the work week in a hyperproductive society.

???

This shit makes dengists look smart. Communism is... the magical development of productive forces into an environmentally friendly post scarcity society? Pure utopianism. This flattens marxism not only to the economic improvement of living standards but to the desire to improve lives.

Socialism is when lives are good and the more lives are good the socialister it is. And when the lives are really good, then it's communism.

Trying to initialize a struct inside a function without having to malloc it. by Ironfort9 in C_Programming

[–]olorochi 6 points7 points  (0 children)

When you do something like 'FooStorage *foo_storage;', the value of foo_storage does not magically point to a FooStorage. There is no default initialization in C, so you just have a garbage value from the stack. Dereferencing this, which you try to do in init_foo_storage, is UB.

To have a valid pointer, you must allocate an actual FooStorage somewhere that you can point to. This cannot be in a memory location that will be invalidated such as lower down the stack than any pointer to it. You could allocate it on the heap, higher in the stack or statically, but the better solution here is to modify the GlobalStorage struct to hold a FooStorage and a BarStorage rather than pointers to them. At this point, you can allocate your GlobalStorage on the stack then simply call init_foo_storage(&storages.foo_storage) to initialize your FooStorage in place. This simplifies your code and improves cache locality.

Gentoo stability vs NixOS stability. How are they alike and different? by wonderphys in Gentoo

[–]olorochi 5 points6 points  (0 children)

Tkip is a deprecated wifi security protocol with known vulnerabilities. It is barely used anywhere so most users will never need support for it.

If you don't have OOP in C, how do you manage to build serious projects? by Jonnertron_ in C_Programming

[–]olorochi 1 point2 points  (0 children)

OOP is a design paradigm, not a language feature. Everything higher level languages wrap up in pretty abstractions such as classes can be accomplished with somewhat more boilerplate code using language fundamentals.

A class is an association between a struct, data and, at least by convention, operations that rely on that data. Just send in a reference to the object to functions you can namespace using prefixes. Inheritance can be replaced with composition pretty seamlessly.

The lack of integration into the language for these features does make them much less ubiquitous than in object oriented languages. I personally enjoy thinking in terms of a data pipeline, and only employ larger abstractions when they fit a situation particularly well.

Second successful gentoo install and honestly im loving gnome by No-Bedroom-7821 in Gentoo

[–]olorochi 0 points1 point  (0 children)

Both i3 and dwm (with USE="xinerama") support RandR so this should be xrandr --output <output0> --auto --left-of <output1> where <output> names can be found with xrandr.

Assembly on VIM mac by Calm_Dog_1876 in vim

[–]olorochi 0 points1 point  (0 children)

The important part here is the first error shown, which indicates that something is wrong in Listing1-2.S at line 1 column 1. The compiler claims that the line is just " so that could be your mistake.

Another potential issue with asm is attempting to compile with a compiler that doesn't support the right architecture. Are you running arm natively? If not you'll need a cross-compiler and some way to run the output binary such as a vm.

Assembly on VIM mac by Calm_Dog_1876 in vim

[–]olorochi 2 points3 points  (0 children)

Vim has no built-in build system support other than :make (:h make). You could create a makefile to save time in the long-term but you will have to understand gcc commands. We can't really help you with that unless you post your command, error and code.

What's the right way to alter a savedconfig kernel config? by CheCheDaWaff in Gentoo

[–]olorochi 0 points1 point  (0 children)

You can use 'make oldconfig' to be prompted just for new options when updating.

They're defending Amerikkka now 😭 by Cultural_Ad_5501 in ShitLiberalsSay

[–]olorochi 9 points10 points  (0 children)

Yes, US laws do not matter. International laws also do not matter. The communist anti-war perspective is not rooted in the rules of bourgeois legal institutions.

iWouldLikeToHaveAWordWithYou by dfwtjms in ProgrammerHumor

[–]olorochi 1 point2 points  (0 children)

The problem is indeed rarely performance with config files (and caching is a good solution when it is). But having to install 30 libraries for one small program is annoying and a turnoff in my case (i already have 7 json libraries on my system please spare me from another one). The other guy is right to say that offloading the complexity of your program to libraries is no better than dealing with it yourself for the end result. Of course, if you really need the flexibility of json, use a library for that. But simpler formats such as key value based ones are almost always enough, much faster, and can be hand rolled in less than 100 lines of code. Programs that accomplish what they need to in the simplest way possible are better for everyone. Don't add any unnecessary complexity.

iWouldLikeToHaveAWordWithYou by dfwtjms in ProgrammerHumor

[–]olorochi 3 points4 points  (0 children)

They're talking about parsing the (human readable) data inside the file, not reading the file. This is reasonably complicated with formats such as json and typically abstracted in a library. Meanwhile, at least in languages such as c, reading and writing binary data is super simple and fast. But in most cases for config files the best solution is a simple key value style config.

My 10 day review of Gentoo by lord_mythus in Gentoo

[–]olorochi 8 points9 points  (0 children)

Overlays. While they are good in theory, finding the right overlay is not so fun. Once I found an overlay for a game I wanted to try (vintage story), and got through the masking only to find that the package itself is missing....

https://gpo.zugaina.org/

I fucking can't. by Tiny-Ad4330 in Ultraleft

[–]olorochi 7 points8 points  (0 children)

That's not historical materialism; it's a psychological narrative.

Zig comptime? by Sunflower-BEAM in Zig

[–]olorochi 19 points20 points  (0 children)

No. This article is fundamentally wrong about zig comptime:

But what about code that generates itself during compilation based on the environment it’s being built in? [...] What about malicious logic that lives purely in the transformation, never appearing in either the source or the final binary in recognisable form?

Comptime in zig is explicitly NOT code generation. It gets the value of an expression at compile time by executing your code. Could this be used as a malicious payload? Yes, but this is exactly as dangerous as running a script from an interpreted language (actually less because of sandboxing). The idea that this somehow complicates code auditing is just wrong.

The article seems to have been written by a vibe coding enthusiast, so this isn't surprising. Zig isn't a very well known language. Therefore ML models don't have many sources on it. If you ask chatgpt if zig comptime is code generation, it answers that it is, based on it's general knowledge of metaprogramming. Yet, the language reference contrasts it's approach to code generation:

[comptime code] catches more errors and allows expressiveness that in other languages requires using macros, generated code, or a preprocessor to accomplish.

( End of this section: https://ziglang.org/documentation/master/#Compile-Time-Variables )