Programming

26353 readers
138 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
901
902
903
904
905
 
 

Hi everyone,

yesterday, we released iceoryx2 v0.6, an ultra-low latency inter-process communication framework for Rust, C and C++. Python support is also on the horizon. The main new feature is Request-Response-Stream, but there's much more.

If you are into robotics, embedded real-time systems (especially safety-critical), autonomous vehicles or just want to hack around, iceoryx2 is built with you in mind.

Check out our release announcement for more details: https://ekxide.io/blog/iceoryx2-0-6-release

And the link to the project: https://github.com/eclipse-iceoryx/iceoryx2

906
1
submitted 10 months ago* (last edited 10 months ago) by Ryick@lemm.ee to c/programming@programming.dev
 
 

Pointers in C can often be difficult to understand—I certainly had a learning curve and am continuing to learn. However, I had a thought that may help some by comparing a common experience and wanted to share.

A pointer in C behaves just like a word in any spoken language which refers to a physical object or multiple objects and the uniqueness of each object (e.g Skippy the dog, Mittens and Tiger the cats, fork number 5). The word itself does not contain the physical object and its uniqueness but only communicates the existence of the physical object and its uniqueness. The pointer itself does not contain the physical address and its value but only communicates the existence of the physical address and its value.

907
 
 

Hello,

I am making an open source privacy-first fitness band for myself and I am writing the firmware now as someone relatively inexperienced at firmware development (I am an electronics engineer by trade). I get it done but sometimes I run into concept issues, especially when I start overthinking, like now that I need help with.

I have a macronix SPI NOR flash on-board that I want to use as offline activity saving, backup at low battery, etc... I am dreaming up the data structure for it. Here is the values I need to save to not lose information and what will be required for my supported features in the Bluetooth Physical Activity Monitor Service:

struct memory_map_nor {
    time_t timestamp;
    uint16_t sub_sess_id;
    uint32_t steps: 24;
    uint8_t bpm;
    float16_t spo2;
    uint16_t pulse_inter_beat_interval;
    uint16_t cadence;
    uint16_t speed;
    uint16_t activity_level;
    uint16_t activity_type;
    uint16_t temp;
};

So from this datastructure, it has a total of 28 bytes of data. This has to fit on a 256 byte page, which means 9 "rows" of data can be written per page, 144 per sector, 2304 per 64 bit block, and 147456 in total for a 32Mbit NOR.

But, I am getting confused while reading about memory structures in "normal" processors that need to read everything in 4/8-byte words via the parallel interfaces. This means that conventionally, everything has to be padded to neat structures that are divisible by 4 (32-bit) for QSPI reading. In that case, I would either have to add another 32 bits of data or pad 32 bits to every "row", making a neat 8 data "rows" per page.

OR, because I am only using single lane SPI, would this not matter and I could shove an extra datapoint in each page. The difference is 147456 data rows vs 131072 data rows. At 3s polling rate, that is 5.12 days vs 4.55 days. For my application, the difference might be useless anyway, but the band goal battery life is 2 weeks or so.

Again, maybe I am overthinking this and can just pad the data to make everything neat and fit well. Anyone have any opinions? Thanks!

908
 
 

I couldn't sleep last night and ended up working on a terminal-based recreation of the old Starry Skyline screensaver we had on our computers when I was a kid (part of the After Dark suite of screensavers). It's been a lot of fun to work on and I'm enjoying thinking of what else I can add to it beyond the simple office windows and stars. I just got finished adding fireworks and I'm real pleased with how they turned out.

https://github.com/Whelk/asciiskyline

This is my first time working with curses so it's serving as a useful learning experience. Hoping to throw together some TUI utilities once I'm comfortable enough with it.

909
 
 

Lessons from event driven architecture

910
911
 
 

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

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

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

To admit frankly, l am a non technical person who would be tinkering with the task of creating a full fledged website for a travel company. For me, it's going to be a fun activity. There are a lot of nerds out here who can help me with their expertise. Many thanks to you all😊😊😊

912
 
 

IP tells you where the request comes from, that’s it. It doesn’t tell you what language the user speaks. It looks like Google thinks otherwise, and many programmers are blindly repeating it for Google with no idea how do it properly.

913
914
 
 

I appreciate Simon's balanced take on how LLMs can enhance a project when used responsibly.

I'm curious, though—what are this community's opinions on the use of LLMs in programming?

915
916
 
 

An update from GitHub: https://github.com/orgs/community/discussions/159123#discussioncomment-13148279

The rates are here: https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28

  • 60 req/hour for unauthenticated users
  • 5000 req/hour for authenticated - personal
  • 15000 req/hour for authenticated - enterprise org
917
918
 
 

For the Crustaceans

919
920
30
submitted 10 months ago* (last edited 10 months ago) by greywolf0x1@lemmy.ml to c/programming@programming.dev
 
 

;; An up to date version of SICP

;; Also available in PDF and epub format

921
922
 
 

Plebbit is a fully peer-to-peer, decentralized alternative to Reddit Built on IPFS that doesn’t rely on centralized servers or federated instances like Lemmy or Mastodon. Instead of traditional infrastructure, .No single point of failure, no global mods with ultimate control, no admin backdoors.

In theory, this should mean true censorship resistance and user ownership of content. Communities (subplebbs) are moderated locally with cryptographic keys, and moderation actions are transparent and accountable. It’s a different model than just “federated social media” this is more like BitTorrent for discussion forums.

Do you think a system like this can scale in practice?

Can it maintain quality discussions without centralized moderation?

Will regular users adopt something this technical?

Is it really more decentralized than alternatives, or just differently centralized?

https://github.com/plebbit/seedit

923
 
 

Biome is an integrated linter/formatter for JavaScript/TypeScript, CSS, HTML and GraphQL.

We are now in the process of implementing TypeScript-like inference (not full type checking!) that allows us to enable type-informed lint rules. This is similar to typescript-eslint except instead of using tsc we attempt to implement the inference ourselves.

This post describes our progress thus far, with a detailed overview of our type architecture.

924
67
submitted 10 months ago* (last edited 10 months ago) by jay0072007@programming.dev to c/programming@programming.dev
 
 

Created a simple query language for JSON data.

Features:

  • Basic query selection
  • Fallback Mechanism
  • Wildcard support
  • Array Slices
  • Multiple Key Selection
  • Key Omission
  • Single Key Omission
  • Functions
  • Comparison Operators
  • Conditions
  • Configurable

Here's an example to get the list of adult friends:

$.friends[?(@.age >= 18)]

Runs in browsers, and Node.js

Documentation site: https://jqlite.vercel.app/

GitHub: https://github.com/Jay-Karia/jqlite

NPM Package: https://www.npmjs.com/package/jqlite-ts

⭐ Leaving a star on GitHub is much appreciated!

925
view more: ‹ prev next ›