Programming

20253 readers
624 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
1
 
 

Hi all, I'm relatively new to this instance but reading through the instance docs I found:

Donations are currently made using snowe’s github sponsors page. If you get another place to donate that is not this it is fake and should be reported to us.

Going to the sponsor page we see the following goal:

@snowe2010's goal is to earn $200 per month

pay for our 📫 SendGrid Account: $20 a month 💻 Vultr VPS for prod and beta sites: Prod is $115-130 a month, beta is $6-10 a month 👩🏼 Paying our admins and devops any amount ◀️ Upgrade tailscale membership: $6-? dollars a month (depends on number of users) Add in better server infrastructure including paid account for Pulsetic and Graphana. Add in better server backups, and be able to expand the team so that it's not so small.

Currently only 30% of the goal to break-even is being met. Please consider setting up a sponsorship, even if it just $1. Decentralized platforms are great but they still have real costs behind the scenes.

Note: I'm not affiliated with the admin team, just sharing something I noticed.

2
3
4
 
 

I need to create a website that holds some events data as well as other content, it will also maybe need to grab some data from APIs.

Since I'm skilled with Hugo (static site generator) I thought I could use that but it's turning out it's a total mess actually.

In Hugo I can have contacts (like events organizers) as taxonomy, but that is a different format (yaml) than CSV or vcard, and it's also static, meaning that if I edit a contact it will only change in Hugo. So I found myself having to manage contacts in 4 different places, in 4 different ways: Hugo yaml, Thunderbird, google contacts, CSV (from earlier days)... And I will add mailchimp once I'll also add a newsletter. This ensures my contacts are kinda becoming a mess.

Same goes with events, it's okay if I generate events in Hugo, but if I grab events from APIs and then the API content changes I will have to modify it on Hugo as well.

Everything it's turning out to be a total mess essentially and I think I tried to use something simple to build something quite complex, I realized the complexity later.

Now ideally I would like to be able to have my contacts, my newsletter, my content in one single place ato have everything nicely synced and not having to deal with 30 different lists or formats.

What should I do?

I know about the jamstack and headless CMS like ghosts and I was wondering if they could be a good solution, or if I should opt for a full CMS. Obvious solution would be WordPress but I wouldn't really want to mess with all the plugins.

Also I spent quite a but of time in building my templates for the Hugo website and throwing everything away would feel awful, if there's a way to reuse them (?).

I know some JavaScript basics but I would avoid it if possible.

5
6
 
 

I use vscode for my personal projects (c++ and a fully open source stack, compiling for both Linux and Windows).

I'm using the proprietary version of vscode (via the aur) for the plugin repository, but I've always envied the open source version...

Are there any tools that have made you excited?

Bonus points if they have some support for compiling with MSVC (or if you can convince me to ditch it for something else).

7
8
 
 

I am experiencing a bit of a whiplash here at work. To be fair, I am getting paid very well (and got a significant raise last year, that was good), but we have had positions be open for years now with no hiring. And we are having more and more projects being proposed without finishing the projects themselves. Its the classic they want to do more with less scenario. The top brass just announced a hiring freeze so new devs for a while.

The execs are floating the idea that AI can be used to replace or supplement the people leaving. On all of our propitiatory code-base/solutions....yeah that will go well.

So yeah anyone else dealing with this?

9
 
 

I have been familiar with Monero for many years now, so I have to address this problem urgently:

I have noticed a fatal issue with Bitmain's “I am not an ASIC” ASIC, the Antminer X5: Even though the device is all about CPUs and RAM sticks, it is still the most efficient device. It beats all miners that rely on conventional CPUs (EPYC or RYZEN) in terms of price and efficiency. As a result, Monero mining has become completely dependent on a single company within just a few years. Entrepreneurs who want to mine Monero are faced with one of the toughest competitions there is. They will therefore use the most efficient equipment. The X5. Am I the only one who seems to have noticed this so far?

Monero's ASIC resistance was meant to not be dependent on one company. Now we are. How can we wriggle out of this noose?

I would also like to ask you not to fall for assumptions that someone at home is simply mining for the good Monero with their own computer. The percentage is probably the smallest. In truth, it is an advanced industry.

I see the recent hashrate growth as particularly critical when looking at the hashrate chart as a whole. Often these increases came before a prominent ASIC came out of the shadows and was presented to the world, while it had already been mining for years. (Like in 2018 and 2019)

If the hashrate drops dramatically again, this could lead to a significant vulnerability of Monero.

Moneros Hashrate Chart: https://bitinfocharts.com/comparison/monero-hashrate.html#alltime

I work a lot with Monero, so I wanted to share these thoughts with you.

I usually address problems for which I also have solutions. But frankly, I don't have any ideas here. Because adjusting the mining algorithm would not throw Bitmain out of the race. After all, they have only built a very efficient CPU miner.

As if they were spitting at the developers' feet, even based on an open source chipset (RISC-V).

What do you think?

10
 
 

I'm trying to wrap my head around how media player websites work.

This might not be fully programming, but idk where else to post this question

Some video sharing sites uses blob objects to send the video in chunks, instead of letting the browser download in full. Usually there's mpd or m3u8 files that we can use to download the whole video

But some sites don't use those files. They send mp4 chunks, but those mp4s can't be played and seem encrypted.

How is the webpage's video player able to play the video? Is there a decrypter or something in the webpage/video player? Am i able to download all mp4 chunks and run them through some decrypter in the webpage served to me and create the whole video from it?

11
 
 

I'm writing to follow up on the QP tool here- because I posted before, and it was incredibly helpful. Thanks to those who helped out with all the directions.

RECAP:

Been building a tiny tool to share structured thoughts fast- no tabs, just type and share.

It’s called Quickpoint → https://quickpoint.me/

Curious what people think it's for. Some use it like a notepad, some for demos or quick specs.

If you gave it 30 seconds:

**- What’s your gut sense of what this is?

  • Would you actually use it for anything?
  • What would stop you from using it twice?**

Thanks — Trying to see who might use this and for what and adapt accordingly.

Really appreciate any feedback that you can give.

12
13
14
15
16
 
 

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.

17
 
 

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!

18
 
 

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

19
20
21
22
 
 

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.

23
24
 
 

Lessons from event driven architecture

25
 
 

I’m a retired coder, These days, I mostly scroll around Lemmy to kill time, but something caught my eye recently, a post about this protocol called Plebbit.

Honestly? At first, the name put me off. Sounded like a joke, plebbit word was a sluar used against redditors…But I was curious enough to check it out and I’m glad I did. Plebbit is basically a protocol that combines the structure of Reddit and all other social media with the tech behind torrents. Every sub is its own instance, and everything is peer-to-peer. No central servers, no single point of failure. It’s simple, but it hits at something big : real decentralized social media.

After digging into it (and chatting with the dev a bit : an anonymous dev named Esteban Abaroa)I started thinking… what if Lemmy could run on top of this? No more relying on any one instance just pure P2P. So yeah, I have decided to build a Lemmy client on top of Plebbit.

Still not a fan of the name but the idea is solid. And honestly, I think we might need this more than we realize.

If anyone has name suggestions for the client, I’d love to hear them. I’ll leave the GitHub link here so you can check out the code yourself.

https://github.com/plebbit

Need your honest opinions, guys.

view more: next ›