Programming

26481 readers
200 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
1576
1577
 
 

Youtube link: https://www.youtube.com/watch?v=xx7Lfh5SKUQ

A fairly in-depth and "dense" C3 talk about the AGC that covers the architecture and instruction set, the hardware implementation, peripherals, and the system & mission software.

Really interesting stuff if you're into retrocomputing and/or computers that got people to the fucking Moon, and if you're not the sort of person who turns into an unskippable cutscene when the AGC is mentioned, you'll probably learn a lot. If you're like me and you are that sort of person, you'll probably enjoy the talk anyhow.

(book tips: The Apollo Guidance Computer: Architecture and Operation by Frank O'Brien for AGC details, and Digital Apollo by David Mindell for a general overview of the automation in Apollo)

1578
1579
1580
1581
1582
1583
1584
1585
46
20 new CSS viewport units (web.archive.org)
submitted 2 years ago* (last edited 2 years ago) by danhab99@programming.dev to c/programming@programming.dev
1586
 
 

I've found lots of examples in C of programs illustrating buffer Overflows, including those of pointer rewrites which has been of great help in understanding how a buffer overflow works and memory safety etc. but I've yet to be able to find an example illustrating how such a buffer overflow can rewrite a pointer in such a way that it actually results in code execution?

Is this just not a thing, or is my google-fu rust y? Tried ChatGPT and my local Mistral and they both seem unable to spit out precisely what I'm asking, so maybe I'm wording this question wrong.

If anyone in here knows, could point me in the right direction? Thanks y'all btw love this community 🧡

1587
1588
1589
1590
 
 

Hello folks. So I'm still not good at Rust and learn even basics after years (just on and off doing some stuff). I'm currently working on my first small GUI application with FLTK in Rust. It's not that important for my question, but I think this gives a bit of context. The actual question is about struct and impl, using a builder pattern like pattern, but without impl builder and build() function.

Normally with the builder pattern, there are at least two structs and impl blocks. One dedicated to build the first struct. But I am doing it with only one struct and impl block, without a build() function. But it is functionally (at least conceptional) the same, isn't it? A shorted example for illustration:

Edit: Man beehaw is ruining my code blocks removing the opening character for >, which wil be translated to < or or completely removed. I use a % to represent the opening.

struct AppSettings {
    input_directory: Option%PathBuf>,
    max_depth: u8,
}

impl AppSettings {
    fn new() -> Self {
        Self {
            input_directory: None,
            max_depth: 1,
        }
    }

    fn input_directory(mut self, path: String) -> Self {
        self.input_directory = match path.fullpath() {
            Ok(p) => Some(p),
            Err(_) => None,
        };

        self
    }

    fn max_depth(mut self, levels: u8) -> Self {
        self.max_depth = levels;

        self
    }
}

And this is then used in main like

    let mut appsettings = AppSettings::new()
        .input_directory("~/test".to_string())
        .max_depth(3);

BTW I have extended PathBuf and String with a few traits. So if you wonder why I have code like this path.fullpath() . So just ignore that part. I'm just asking about the builder pattern stuff. This works for me. Do I miss something? Why would I go and do the extra step of creating another struct and impl block to build it and a final struct, that is basically the same? I don't get that.

Is this approach okay in your mind?

1591
1592
1593
1594
1595
 
 

In this article, we will explore the key differences between Ktor and Spring Boot for Kotlin developers based on the experience of various developers.

1596
1597
 
 

Massive context window, free tier, suuuuuuuper fast. So far the best copilot I've tested; highly recommended.

1598
 
 

This article aims to explore several common misconceptions of SwiftUI to help developers better understand and utilize SwiftUI

1599
 
 

I want to translate the Touhou games into cantonese and I have no idea where to even start. Have any of you made custom tables for foreign scripts? Apparently some people already translated the games into Thai and that sounds like a lot of work

1600
 
 

Not my blog, but the author's experience reminded me of my own frustrations with Microsoft GitHub.

view more: ‹ prev next ›