Programming

26189 readers
146 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
401
 
 

Biggest WTF news I've read today. I'm not a web dev so this doesn't affect me, but this is bizarre.

We get a closer first look at what's around the corner for AI coding tools, and make Bun better for it

This incredibly popular tool is now going to merge with an AI company and shift gears to be turned into some forced AI hype machine. Yipee! Exactly what all the devs were hoping for! /s

402
 
 

A somewhat old video regarding a fascinating OS called Uxn.
https://100r.co/site/uxn.html

image

https://metasyn.srht.site/learn-uxn/

403
404
189
submitted 3 months ago* (last edited 3 months ago) by bluemoon@piefed.social to c/programming@programming.dev
 
 

Qualifications

  • Prior experience working on one or more of Android/AOSP-based operating systems, the Linux kernel and its hardening, memory allocators, or Android app development
  • Strong programming skills in relevant languages (in order from most to least common: Java, Kotlin, C++, C, Rust, JavaScript, TypeScript, arm64 assembly, Bash, Python)
  • Need to have enough experience to be comfortable to self direct workloads and submit finished features and fixes ready for review
  • Commitment to privacy and security principles
  • Ideally prior experience contributing to free and open source projects

Salary and remuneration will be commensurate with experience and aligned with industry standards. You will be employed as an independent contractor

405
406
407
408
409
410
411
412
413
414
415
416
 
 

https://github.com/ZILtoid1991/iota/blob/main/source/iota/controls/polling.d#L865

I have done multiple changes, but the moment I get an event on a game controller, it'll lock up until a new event is made on the game controller. I cannot find any documentation on what to do exactly, only some vague gesturing about EV_SYN events, and that they should be handled in a certain way. And of course the usual recommendations of "but there are already libraries made to abstract OS-level stuff", except many of them often janky in more than one way (a lot of them still uses DirectInput).

417
 
 

Wrote this to reduce boilerplate when calling a function with a nullable parameter. Language is Dart. I like how concise it is but it feels weird to override []. Would you be okay with this?

extension CallMaybe<R, T> on R Function(T t) {  
  R? callMaybe(T? t) => switch (t) {  
    null => null,  
    T t => this(t),  
  };  

  R? operator [](T? t) => callMaybe(t);  
}  

void example() {  
  int? n;  
  math.sqrt[n];  
}  
418
 
 

Please excuse - and do not hesitate to point out - any violation against etiquette that I might be committing here... I am new here.

I started to learn C a few months ago as a hobby as part of a bigger project, namely to learn about computers in general. I have had so much fun reading Code - The Hidden Language of Computer Hardware and Software by Charles Petzold. But that's another story...

I was about to buy a few new SSDs and needed to do some budgeting. Instead of using my phone's calculator, I decided to try to write a calculating program in C, because I hadn't touched programming for some weeks or months because life and I wanted to see if my knowledge had matured some.

The goal was to have it do the four standard arithmetics and also save the last result in a variable, which I just called "memory" for lack of bette phrasing on my part. Maybe next week I'll figure out how to make it possible to use the value saved in memory instead of having to type a number.

I welcome any constructive criticism on how and why this code is up to code or not(sorry...), if it can be improved and how or even if it's just garbage and why that is. I am just proud that it worked without gcc throwing any errors.

#include <stdio.h>

int main(void) {

        int num1 = 0;
        int num2 = 0;
        int choice = 0;
        int memory = 0;

        printf("Welcome to the Calculator of the century!\n\n");

        while (1) {
                printf("What would you like to do?\n\n");
                printf("(1) Add two numbers\n(2) Subtract two numbers\n(3) Multiply two numbers\n(4) Divide two numbers\n(5) Show memory\n(6) Exit\n\n");
                printf("Enter 1, 2, 3, 4, 5 or 6: ");
                scanf("%d", &choice);

                if (choice >= 6 || choice < 1) break;

                if (choice == 5) {
                        printf("\n%d in memory.\n\n", memory);
                } else if (choice < 5 || choice > 0) {
                        printf("\nEnter the first number: ");
                        scanf("%d", &num1);
                        printf("Enter the second number: ");
                        scanf("%d", &num2);
                }

                if (choice == 1) {
                        printf("\nThe sum of %d and %d is %d\n\n", num1, num2, num1 + num2);
                        memory = num1 + num2;
                } else if (choice == 2) {
                        printf("\nThe difference of %d and %d is %d\n\n", num1, num2, num1 - num2);
                        memory = num1 - num2;
                } else if (choice == 3) {
                        printf("\nThe product of %d and %d is %d\n\n", num1, num2, num1 * num2);
                        memory = num1 * num2;
                } else if (choice == 4) {
                        printf("\nThe quotient of %d and %d is %d\n\n", num1, num2, num1 / num2);
                        memory = num1 / num2;
                }
        }

        printf("\nWe hope to see you soon again!\n");
        return 0;
}
419
 
 

During OpenAI’s GPT-5 launch event, they demoed the model’s ability to fix real bugs in production code. Live on stage. In their own repository. The kind of demo that makes CTOs reach for their credit cards and engineers nervously update their resumes. There’s just one small problem: the fix they promised to merge “right after the show” is still sitting there, unmerged, three and a half months later.

420
 
 

I’m trying to convert a blog into an EPUB and keep running into issues with existing tools.

I first tried blog2epub, but it fails during parsing with:

lxml.etree.XMLSyntaxError: Opening and ending tag mismatch: meta line 10 and head, line 17, column 8

I then tried WebToEpub on Firefox, providing:

  • Content selector: .article-content
  • Chapter title selector: .title

It generated an EPUB, but the file wouldn’t open in any reader.

What I’m looking for is a tool where I can point to a blog’s base URL, define CSS selectors for the article title and body, and have it automatically fetch all entries and create one chapter per post. Or something similar.

Does anyone know of a reliable tool, script, or workflow that does this well on Linux?

421
422
42
submitted 4 months ago* (last edited 4 months ago) by maxint@programming.dev to c/programming@programming.dev
423
 
 

cross-posted from: https://lemmy.ca/post/55496692

Devs gripe about having AI shoved down their throats

424
31
Tips on getting certs? (lemmy.dbzer0.com)
submitted 4 months ago* (last edited 4 months ago) by SpiceDealer@lemmy.dbzer0.com to c/programming@programming.dev
 
 

A couple of weeks ago, I made this post over at !asklemmy@lemmy.world asking if I should go back to university. After some thoughtful consideration, I've decided to pursue certs; specifically Comptia A+ and then the Network+. I'm almost done with an A+ study guide I bought and feel almost ready to take the exam. But I've also wanted to hear about your experience on getting tech certs and the career that followed. Any advice is welcomed. Thanks in advance.

425
view more: ‹ prev next ›