Interests: programming, video games, anime, music composition

I used to be on kbin as e0qdk@kbin.social before it broke down.

  • 1 Post
  • 87 Comments
Joined 1 year ago
cake
Cake day: November 27th, 2023

help-circle
  • I’ve had to review resumes when we were trying to find someone else to bring on the team. My boss dumped hundreds of resumes on me and asked if any of them looked promising – that’s after going through whatever HR bullshit filters were in place – on top of all the other work I was already behind on since we didn’t have enough staff. That is the state of mind you should expect someone to be in while looking at your project.

    If anyone looks at your repo, they’re going to check briefly to see if you have any clue at all what you’re doing and whether your code likes like it’s written by the kind of person they can stand working with. Don’t make any major blunders that someone would notice with a quick glance at the repository. Be prepared to talk about your project in detail and be able to explain why you made the choices you did – you might not get asked, but if you are you should be able to justify your choices. If it gets to the point of an interview and your project looks like something that could’ve been done easily in 100 lines of Python you’d better believe I’m going to ask why the hell you wrote it in C in 2025… and I say that as someone who has written a significant amount of C professionally.

    If you say you have multiple years of professional programming experience and send me a link to a repo that has .DS_Store in it… your resume is going straight into the trash.




  • e0qdk@reddthat.comto196@lemmy.blahaj.zoneceleste rule
    link
    fedilink
    arrow-up
    9
    arrow-down
    1
    ·
    2 months ago

    I suggest using H264 instead of H265 for better compatibility. The video doesn’t play in my browser, and I think it’s likely because of that. The audio works but the video is just black in my browser. (I can play it with another player like VLC though, of course.)



  • It’s not a particular protocol right now, but it would be a URI that refers to a specific resource. A protocol could also be defined – e.g. a restricted subset of HTTPS that returns JSON objects following a defined schema or something like that – but the point really is that I want to be able to refer to a thread not a webpage. I don’t think that’s a silly thing to want to be able to do.

    Right now, I can only effectively link to a post or thread as rendered by a specific interface – e.g. for me, this thread is https://old.reddthat.com/post/30710789 using reddthat’s mlmym interface. That’s probably not how most users would like to view the thread if I want to link it to them. Any software that recognizes the new URI scheme could understand that I mean a particular thread rather than how it’s rendered by a particular web app, and go fetch it and render it appropriately in their client if I link it. (If current clients try to be clever about HTTP links, it becomes ambiguous if I mean the thread as rendered into a webpage in specific way or if I actually meant the thread itself but had to refer to it indirectly; that causes problems too.)

    I don’t think lemmy:// is necessarily the best prefix – especially if mbin, piefed, etc. get on board – just that I would like functionality like that very much, and that something like a lemmy URI scheme (or whatever we can get people to agree on) might be a good way to accomplish it.


  • Not that I’m opposed, but I’m not sure if it’s practical to make a fediverse-wide link that’s resolvable between platforms since there are so many differences and little incompatibilities and developers who don’t directly interact with each other – or even know each other exist!

    Even if it isn’t though, it would be nice to be able to do something like lemmy://(rest of regular url) to indicate data from a lemmy(-compatible) server that should be viewable by all other lemmy clients without leaving your particular client and having to open some other website.






  • Try adding some prints to stderr through my earlier test program then and see if you can find where it stops giving you output. Does output work before curl_easy_init? After it? Somewhere later on?

    Note that I did update the program to add the line with CURLOPT_ERRORBUFFER – that’s not strictly needed, but might provide more debug info if something goes wrong later in the program. (Forgot to add the setup line initially despite writing the rest of it… 🤦‍♂️️)

    You could also try adding curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); to get it to explain more details about what it’s doing internally if you can get it to print output at all.



  • As a sanity check, does this work?

    #include <curl/curl.h>
    #include <stdio.h>
    #include <stdlib.h>
    
    size_t save_to_disk(char* ptr, size_t size, size_t nmemb, void* user_data)
    {
        /* according to curl's docs size is always 1 */
        
        FILE* fp = (FILE*)user_data;
        fprintf(stderr, "got %lu bytes\n", nmemb);
        return fwrite(ptr, size, nmemb, fp);
    }
    
    int main(int argc, char* argv[])
    {
        char errbuf[CURL_ERROR_SIZE];
        FILE* fp = NULL;
        CURLcode res;
        
        CURL* curl = curl_easy_init();
        
        if(!curl)
        {
            fprintf(stderr, "Failed to initialize curl\n");
            return EXIT_FAILURE;
        }
        
        fp = fopen("output.data", "wb");
        if(!fp)
        {
            fprintf(stderr, "Failed to open file for writing!");
            return EXIT_FAILURE;
        }
        
        curl_easy_setopt(curl, CURLOPT_URL, "https://www.wikipedia.org");
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, save_to_disk);
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
        curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf);
        
        errbuf[0] = 0;  /* set error buffer to empty string */
        res = curl_easy_perform(curl);
        
        if(fp)
        {
            fclose(fp);
            fp = NULL;
        }
        
        if(res != CURLE_OK)
        {
            fprintf(stderr, "error code   : %d\n", res);
            fprintf(stderr, "error buffer : %s\n", errbuf);
            fprintf(stderr, "easy_strerror: %s\n", curl_easy_strerror(res));
            
            return EXIT_FAILURE;
        }
        else
        {
            fprintf(stderr, "\nDone\n");
            return EXIT_SUCCESS;
        }
    }
    

    That should write a file called output.data with the HTML from https://www.wikipedia.org and print out the number of bytes each time the write callback receives data for processing.

    On my machine, it prints the following when it works successfully (byte counts may vary for you):

    got 13716 bytes
    got 16320 bytes
    got 2732 bytes
    got 16320 bytes
    got 16320 bytes
    got 128 bytes
    got 16320 bytes
    got 16320 bytes
    got 1822 bytes
    
    Done
    

    If I change the URL to nonsense instead to make it fail, it prints text like this on my system:

    error code   : 6
    error buffer : Could not resolve host: nonsense
    easy_strerror: Couldn't resolve host name
    

    Edit: corrected missing line in source (i.e. added line with CURLOPT_ERRORBUFFER which is needed to get extra info in the error buffer on failure, of course)

    Edit 2: tweaks to wording to try to be more clear



  • Magnitude 6.7 earthquake. Woke up to it shaking my bed violently in my dorm room. (Boarding school) Thankfully, I didn’t have anything above me that could fall, but some of the other students kept books in the shelves above their beds. Suffice it to say they got an even ruder awakening than I did…

    There was a big aftershock a few minutes later – just after I’d gotten the hell out of the building, basically – and smaller aftershocks for days afterwards.

    It put a big crack in the floor of my dorm and everyone who lived there had to stay outside all day until the administration declared it safe for us to re-enter.

    That was coincidentally the same day as a school festival and I’d spent the evening before working with my classmates converting the art room into a haunted house. I never got to see the mess, but whatever happened in there was so bad the room was unusable for months. Most of the rest of the festival (e.g. outdoor stalls and such) was still able to be run though, so they carried on with the parts they could. It was surreal.