Skip Navigation
velox_vulnus LalSalaamComrade @lemmy.ml

Yup, that's me, President of the agAdbefdsds...what, where am I?

Posts 602
Comments 1.4K
Thinkpad XXXX? with 20 threaded/core "Genuine Intel 0000" CPU?
  • How about the model or unit number? You can use it to verify online on PSREF part by part. Without the number, it shows generic details.

  • Phoronix: Rust-Written Rustls Now Reportedly Outperforming OpenSSL & BoringSSL
  • LibreSSL 4.0.0 released Oct 14th, 2024

    It seems to be maintained, although the development looks slow to me.

  • Phoronix: Rust-Written Rustls Now Reportedly Outperforming OpenSSL & BoringSSL
  • Why no comparison with LibreSSL? It is supposed to be a modernization of the old OpenSSL codebase.

    Edit: the comments as always, racist towards Indians as well as transphobic. What a dog-shit site, with trashy moderation.

  • evian or Acqua Panna
  • Bro over here buying "premium" water, lmao. Just go to a restaurant, ask for a glass, and leave in a hurry.

  • Israeli settler leader Daniella Weiss says Palestinians will 'disappear' from Gaza
  • Weiss? You mean Weiß, the German surname? Go back to Germany, imperialist.

    Weiss or Weiß, also written Weis or Weisz, pronounced like "vice", is a German and Ashkenazi Jewish surname, meaning 'white' in both German and Yiddish. It comes from Middle High German wîz (white, blonde) and Old High German (h)wīz (white, bright, shining).

  • Kagi search engine working with Russia
  • You can disable any backend on SearXNG, Stract, 4get or some other self-hosted FOSS alternative. However, for Kagi, there's this feature called lenses, which probably works in the same way as Stract's Optics - not sure if it allows blocking of a particular search-engine service.

  • Kagi search engine working with Russia
  • SearXNG also supports Yandex as one of the many search-engine backend.

    [feat] engine: implementation of yandex (web, images) #3733

  • Non-English speaking programmers, do you write your comments in your native language?
  • I write them in English, because I can't write in my endangered native language. And even if I knew how to, Unicode just allotted a few block for my language recently, and it is yet to get a font - there is none available.

  • Why is contributing to GNU so hard?
  • The biggest problem for me is the unenthusiastic replies - sometimes, none, which is just a big turn-off.

  • Hey Lemmings, whats some gibberish that we can say to throw off Machine Learning?
  • Unicode 16.0 was recently announced. What you could do is generate characters in those new range, mix them with a little bit of know or well-supported languages and fuck up the LLM.

  • draw.io no longer open source since August 27, 2024
  • Not really - it can't be used with Atlassian's products, violating point 6 of the OSI definition - No Discrimination Against Fields of Endeavor.

  • How to deal with broken collision detection on a deterministic physics engine?
  • Here's what I'm trying to implement - a plinkoo game. Disclaimer: I'm not into, or promote gambling, just wanted to use my knowledge of Monte-Carlo simulation on a toy project to figure out the pre-computed starting points, because client-side physics engine can be spoofed.

    Now, this engine has to be "deterministic" at all cost, even at the cost of frame rates. Now, in my current scenario, gravity is fixed, however, the issue with larger gravity is that the object just phases through the obstacles.

    This is why I was looking for a better solution, at least something that isn't CPU-bound, because as I create more and more object, it hogs the memory, although not a lot, but it would hurt mobile devices (I think I should probably destroy objects after it reaches the bucket).

    So far, I've considered using VanJS to avoid the ReactJS virtual DOM overhead.

  • How to deal with broken collision detection on a deterministic physics engine?
  • Accuracy does not really matter here - it should be fast. But there has to be no compromise on collision. Gravity is constant, but it may change - not a strong requirement for now.

  • General Programming Discussion @lemmy.ml LalSalaamComrade @lemmy.ml

    How to deal with broken collision detection on a deterministic physics engine?

    I've made a very simple and primitive JavaScript canvas engine that is simply not dependent on time, as in it assumes that t = 1 in the formula v = u + at - v is the current velocity, u the initial velocity and a is acceleration due to gravity.

    Now, the issue with this method is that if the value of gravity, or velocity is large enough that the object it should collide, it just goes right through it. Now, I have been told that if time was a parameter, we could just increase the frame rate and dilate the time to resolve this, but this would mean that the engine would no longer be deterministic - as in, the simulation would not work out the exact as it we assumed it to be, owing to hardware and software requirement like decimal point handling and precision.

    How can we deal with this issue on this simple deterministic engine, and improve collision detection?

    7
    The C23 edition of Modern C
  • Thank you for this. I'll be reading this after completing K.N.King's C Programming.

  • What is your favourite medical word
  • Codons. It reminds me of how I was, and still am a biology student by heart. Life happened, and I was forced to pick CS. Other words that I like is bacteriophage, prions and Adenosine Tri-Phosphate.

  • What are the most capitalist things you've heard about?
  • SHGs (which is what you're talking about, also called SBLP in some places) are not a majority, their lenders/borrowers are often people within the same marginalized group, and it is very slow, so people tend to avoid them. MFIs dominate the microloan industry, and they're very exploitative.

  • What are the most capitalist things you've heard about?
  • Microloans, also called microfinances. Very popular in developing countries in South Asia, and also the same thing that is responsible for the suicide epidemic of farmers in India. With high interest rates and fixed time-period constraints, they're the most cruel and fucked up things to ever exist, they're worse than indentured serfdom.

  • Israeli Soldiers SICKENING War Crimes EXPOSED

    0

    Mayor Explains Why He Changed City Named After Slave-Owning Founder To Salami Town

    1
    General Programming Discussion @lemmy.ml LalSalaamComrade @lemmy.ml

    I've been re-learning some basic concepts of C. What next?

    So far, I've followed a simple Tor interceptor tutorial on YouTube, while strictly adhering to C2x with every warning flags enabled - not that it is the optimal way to go about learning the language.

    I may have, or may not have inadvertently used improper C2x, but I've used typedef aggressively to slightly mimic Golang.

    Almost a year ago, I had blindly translated a C++ Vulkan tutorial to C, and I didn't understand a single thing about anything graphics-related - framebuffer, swapchain, etc.

    Now that I am learning it again from scratch, I also wanted to know what to learn next, as well as some of the job opportunities that I can explore.

    4
    General Programming Discussion @lemmy.ml LalSalaamComrade @lemmy.ml

    Why hasn't IP been replaced with RINA or Ouroboros?

    RINA offers a lot of

    3

    Is there any web app that ranks other websites based on how their existence affects the digital divide?

    For starters, since I am on LibreWolf, I have WebGL disabled, meaning that my browser does not support slow, performance-tanking 3D renders, at the cost of breaking them. Now, this is just a positive side-effect as an effort to disable WebGL fingerprinting - if the website is broken, I don't even bother using them.

    I want to stop supporting websites that are performance-heavy and unnecessarily bloated, so that I can show solidarity with folks who are unbeknownst victims to the digital divide, and discourage enshittification of the internet. Any websites that helps with this?

    0

    Rejecting Samsung's 'pity pity' proposals, Indian workers continue striking for $430 a month

    0
    The C Programming Language @lemmy.ml LalSalaamComrade @lemmy.ml

    How do I dynamically allocate a string such that it can contain the response header?

    I am reading data through a socket connected to a proxy, which in turn connects to a website of a choice, based on the IP and port I've assigned. After the successful connection, I am supposed to start sending headers to the server I've successfully connected to:

    ```c ... char *request_header = "HEAD / HTTP/1.0\r\n";

    int response_size = 512; char *response_header = malloc(response_size * sizeof(char));

    write(proxy_fd, request_header, strlen(request_header)); read(proxy_fd, response_header, response_size);

    printf("Response header:\n%s\n", response_header); free(response_header); ... ```

    Now, creating a statically-allocated string array is problematic, because the response header can have any size. Is there a way to dynamically allocate the string response_header?

    1

    How The British Government Covered Up Evidence Of Atrocities

    0
    The C Programming Language @lemmy.ml LalSalaamComrade @lemmy.ml

    Difference between htons() and htonl()?

    Inside <arpa/inet.h>, there are two functions to convert host byte order to network byte order. Why are there two options? I understand that htons() is used for port address related to IPv4 and IPv6, but what use does htonl() serve?

    3
    The C Programming Language @lemmy.ml LalSalaamComrade @lemmy.ml

    GNU indent does not work for preprocessor styling?

    When I try running GNU indent on this particular code snippet:

    c #include <stdio.h> #include <stdlib.h>

    Nothing happens? Why isn't indent dealing with the irregular space between #include and <stdio.h>?

    0
    General Programming Discussion @lemmy.ml LalSalaamComrade @lemmy.ml

    Segmentation fault from a supposedly valid program?

    cross-posted from: https://lemmy.ml/post/21033409

    > In the book authored by K.N.King, there's this example: > > ::: spoiler viewmemory.c > > c > /* Allows the user to view regions of computer memory */ > > #include <stdio.h> > #include <ctype.h> > > typedef unsigned char BYTE; > > int main(void) > { > unsigned int addr; > int i, n; > BYTE *ptr; > > printf("Address of main function: %x\n", (unsigned int) main); > printf("Address of addr variable: %x\n", (unsigned int) &addr); > printf("\nEnter a (hex) address: "); > scanf("%x", &addr); > printf("Enter number of bytes to view: "); > scanf("%d", &n); > > printf("\n"); > printf(" Address Bytes Characters\n"); > printf(" ------- ------------------------------- ----------\n"); > > ptr = (BYTE *) addr; > for (; n > 0; n -= 10) { > printf("%8X ", (unsigned int) ptr); > for (i = 0; i < 10 && i < n; i++) > printf("%.2X ", *(ptr + i)); > for (; i < 10; i++) > printf(" "); > printf(" "); > for (i = 0; i < 10 && i < n; i++) { > BYTE ch = *(ptr + i); > if (!isprint(ch)) > ch = '.'; > printf("%c", ch); > } > printf("\n"); > ptr += 10; > } > > return 0; > } > > ::: > > For some reason, when I try to enter addr variable address as the parameter, it has a segmentation fault error. However, in the book's example and the screenshot from this site in Hangul, there's no such error? > > When I try using gdb to check the issue, here's what I get: > > :::spoiler gdb > console > $ gdb ./a.out --silent > Reading symbols from ./a.out... > (gdb) run > Starting program: /home/<username>/Desktop/c-programming-a-modern-approach/low-level-programming/a.out > [Thread debugging using libthread_db enabled] > Using host libthread_db library "/gnu/store/zvlp3n8iwa1svxmwv4q22pv1pb1c9pjq-glibc-2.39/lib/libthread_db.so.1". > Address of main function: 401166 > Address of addr variable: ffffd678 > > Enter a (hex) address: ffffd678 > Enter number of bytes to view: 64 > > Address Bytes Characters > ------- ------------------------------- ---------- > > Program received signal SIGSEGV, Segmentation fault. > 0x000000000040123a in main () at viewmemory.c:31 > warning: Source file is more recent than executable. > 31 printf ("%.2X ", *(ptr + i)); > (gdb) > > ::: > > What is going on? By the way, I am using Guix, if that matters in any way. Here's the output for ldd: > > :::spoiler ldd > console > $ ldd ./a.out > linux-vdso.so.1 (0x00007ffecdda9000) > libgcc_s.so.1 => /gnu/store/w0i4fd8ivrpwz91a0wjwz5l0b2ralj16-gcc-11.4.0-lib/lib/libgcc_s.so.1 (0x00007fcd2627a000) > libc.so.6 => /gnu/store/zvlp3n8iwa1svxmwv4q22pv1pb1c9pjq-glibc-2.39/lib/libc.so.6 (0x00007fcd2609c000) > > :::

    3
    The C Programming Language @lemmy.ml LalSalaamComrade @lemmy.ml

    Segmentation fault from a supposedly valid program?

    In the book authored by K.N.King, there's this example:

    **viewmemory.c**

    ```c /* Allows the user to view regions of computer memory */

    #include <stdio.h> #include <ctype.h>

    typedef unsigned char BYTE;

    int main(void) { unsigned int addr; int i, n; BYTE *ptr;

    printf("Address of main function: %x\n", (unsigned int) main); printf("Address of addr variable: %x\n", (unsigned int) &addr); printf("\nEnter a (hex) address: "); scanf("%x", &addr); printf("Enter number of bytes to view: "); scanf("%d", &n);

    printf("\n"); printf(" Address Bytes Characters\n"); printf(" ------- ------------------------------- ----------\n");

    ptr = (BYTE *) addr; for (; n > 0; n -= 10) { printf("%8X ", (unsigned int) ptr); for (i = 0; i < 10 && i < n; i++) printf("%.2X ", *(ptr + i)); for (; i < 10; i++) printf(" "); printf(" "); for (i = 0; i < 10 && i < n; i++) { BYTE ch = *(ptr + i); if (!isprint(ch)) ch = '.'; printf("%c", ch); } printf("\n"); ptr += 10; }

    return 0; } ```

    For some reason, when I try to enter addr variable address as the parameter, it has a segmentation fault error. However, in the book's example and the screenshot from this site in Hangul, there's no such error?

    When I try using gdb to check the issue, here's what I get:

    gdb

    ```console $ gdb ./a.out --silent Reading symbols from ./a.out... (gdb) run Starting program: /home/<username>/Desktop/c-programming-a-modern-approach/low-level-programming/a.out [Thread debugging using libthread_db enabled] Using host libthread_db library "/gnu/store/zvlp3n8iwa1svxmwv4q22pv1pb1c9pjq-glibc-2.39/lib/libthread_db.so.1". Address of main function: 401166 Address of addr variable: ffffd678

    Enter a (hex) address: ffffd678 Enter number of bytes to view: 64

    Address Bytes Characters ------- ------------------------------- ----------

    Program received signal SIGSEGV, Segmentation fault. 0x000000000040123a in main () at viewmemory.c:31 warning: Source file is more recent than executable. 31 printf ("%.2X ", *(ptr + i)); (gdb) ```

    What is going on? By the way, I am using Guix, if that matters in any way. Here's the output for ldd:

    ldd

    console $ ldd ./a.out linux-vdso.so.1 (0x00007ffecdda9000) libgcc_s.so.1 => /gnu/store/w0i4fd8ivrpwz91a0wjwz5l0b2ralj16-gcc-11.4.0-lib/lib/libgcc_s.so.1 (0x00007fcd2627a000) libc.so.6 => /gnu/store/zvlp3n8iwa1svxmwv4q22pv1pb1c9pjq-glibc-2.39/lib/libc.so.6 (0x00007fcd2609c000)

    6
    The C Programming Language @lemmy.ml LalSalaamComrade @lemmy.ml

    How is MS-DOS able to store seconds in just 5 bit-field?

    Second representation requires at least 6 bits to represent numbers between 0 to 59. But 5 bits are not just enough - 25 = 32, which can only represent from 0 up to 31 seconds.

    According to K.N. King:

    >You may be wondering how it 's possible to store the seconds - a number between 0 and 59 in a field with only 5 bits. Well. DOS cheats: it divides the number of seconds by 2, so the seconds member is actually between 0 and 29.

    That really makes no sense?

    15
    The C Programming Language @lemmy.ml LalSalaamComrade @lemmy.ml

    What exactly is linkage in C?

    It looks very similar to scope, so I really don't understand the difference. What makes storage classes different from each other? How is auto not the same as static, extern or register?

    0
    General Programming Discussion @lemmy.ml LalSalaamComrade @lemmy.ml

    How do modern languages deal with prototyping and modules internally?

    In my journey to learning C, I've come across header files, which are used to (I'm assuming) define a prototype for the source file, as well as structure modules. This feature, in my opinion, is pointlessly not just redundant, but possibly a source for pitfall. The same information can probably be extracted from the source code, if not for the restrictions of the language specification in C.

    Say, if I have a GTK project, I will have to use the preprocessor directive, that will require the use of GTK headers that look something like #include <gtk/gtk.h>, and they're usually in the system path. How do modern languages, like Rust, Zig or Go deal with this situation, where shared libraries are used?

    5
    The C Programming Language @lemmy.ml LalSalaamComrade @lemmy.ml

    #if vs #if defined vs #ifdef directives - how are they different from each other?

    3
    36
    The German language @lemmy.ml LalSalaamComrade @lemmy.ml

    Is my answer appropriate? (Section "Hallo!" of Nicolas Weg)

    From the Deutsche Welle's "Learn German" web-app, there's a second part to completing A1 level, called the "Nicolas Weg". Here's the question from the last form page:

    1. Hi, wie geht's?

      (Say "hello" and thank them for asking, say that you are doing well. Afterward ask how the person is doing.)

      Their answer: Hallo! Danke, gut. Und dir?

      My answer: Hallo! Danke, es geht gut. Und dir?

    2. Guten Morgen, wie geht es Ihnen?

      (Greet them and say that you are not doing too well.)

      Their answer: Guten Morgen, es geht mir nicht so gut.

      My answer: Guten Morgen, es geht nicht so gut.

    3. Guten Abend.

      (Reciprocate the greeting and formally ask how the other person is doing.)

      Their answer: Guten Abend, wie geht es Ihnen?

      My answer: Guten Abend, wie geht's Ihnen?

    Apart from that, I also have a few doubts:

    • I understand that Ihnen and dir are used in formal and casual occasions. But what about the case when both are avoided? If "Wie geht's?" is grammatically correct, then would that also be the same for the non-contracted form, "Wie geht es?"

    • I was wondering as to when the word "mir" should be used? Why not "mich" or "ich"?

    • And what about "Morgen", instead of "Guten Morgen"?

    1

    Regional victory brings Germany's Scholz brief respite

    1