Programming

24235 readers
245 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
 
 

Double TAP is lightweight testing framework where users write black box tests as rules checking output from tested "boxes". Boxes could be anything from http client, web server to messages in syslog. This universal approach allows to test anything with just dropping text rules describing system behavior in black box manner.

Rules are written in formal DSL and could be extended on many programming languages

Tool aims to help with infrastructure audit and testing as well as with validating development environments

4
5
8
Meeting Seed7 (genodians.org)
submitted 19 hours ago* (last edited 18 hours ago) by strlcpy to c/programming@programming.dev
 
 

A strongly typed programming language. Interpreted and compiled. Performance in the ballpark of C. Memory-safe since decades. I feel embarrased to admit that I had been totally unaware of Seed7 until mere two months ago.

6
7
 
 

The title doesn't help explain my problem so I'll explain and give my code here.(This is my first project that I'm doing on my own)

I made a clock + Session timer by using an RTC module (DS3231) and I've done the basic time and session programs(and they work fine). Then I wanted to make it more "lively" by adding some simple animations. What I wanted was to put a little animation between time change ( Basically I just add two time modes where in one there's seconds and without seconds (sometimes seeing seconds feel like a stress so ye)), and this animation runs across the whole screen whether the session is running or not(I'm not having any worries abt the way it's going)

void animation() {
  if (doAnimation == true) {
    switch (Animation) {
      case Animation::Start:
        lcdClearAnimation();
        if (currentMillis - animationStartMillis >= animationState[0]) {
          Animation = Mid1;
        }
        break;
      case Animation::Mid1:
        lcd.setCursor(0, 1);
        lcd.print("Mid1 Doing");
        if (currentMillis - animationStartMillis >= animationState[1]) {
          Animation = Mid2;
        }
        break;
      case Animation::Mid2:
        lcd.setCursor(0, 1);
        lcd.print("Mid2 Doing");
        if (currentMillis - animationStartMillis >= animationState[2]) {
          Animation = End;
        }
        break;
      case Animation::End:
        lcd.setCursor(0, 1);
        lcd.print("END. Doing");
        if (currentMillis - animationStartMillis >= animationState[3]) {
          doAnimation = false;
        }
        break;
    }
  }
}

So this is the one that handles the animation. This runs when I change the toggle switch. I've already done the "lcdAnimationClear();" one. Now I'll explain what animation I want. What I have in mind is this,

In the "Mid1" part(I'll probs remove Mid2 but let's keep it here for now), The program picks an order from 1-16(I have a 16x2 lcd) and let's say it picks the number each 50ms (For every time the animation runs the number order should be different), and when the first number is taken, it will go on a sequence of changing symbols on that picked column (kind of like a weird glitch and symbol changing transition but this continues until the time I want it to stop) and while that column is going through the different symbols, the program picks the next column and again puts that column in the symbol changing loop thing. Like this the program will pick all columns in both rows and filling (or doing the animation) .

@@ Then I want to end the columns that stays clear in the LCD in a blank(I think I'll be able to manage this by getting which states I'm in(switch modes and session running or not)), and the columns that have displaying time and session(if on) will just go to that.

For now I want to ignore the part after "@@" bc I'm still stuck on the main animation thing (Mid1 part). I don't want any code but I do need some suggestions on how to do this and or I can even get to this type of animation from arduino. I'm thinking like this bc I've always saw arduino as a way to tell something to do something like this and stop (not like -> start this, keep doing that and also start this after a few milliseconds, and keep doing all of that until the last part is done)

I also have a few things I've been avoiding. I'm not using blocking code in this program, I never used delay on this program(it's kind of like a learning challenge) I saw from an AI about fisher yates algorithm which need a "for loop" (it kinda goes against my challenge so I'm thinking about looking into some libraries or something that somehow get my randomize problem(I saw on google(AI again) that there is some libraries there))

Thank you for reading all of this and hope someone can give me an idea

8
9
10
 
 

To put C++’s growth in context:

Compared to all languages: There are now more C++ developers than the #1 language had just four years ago. Compared to Rust: Each of C++, Python, and Java just added about as many developers in one year as there are Rust total developers in the world.

Whoa. That are some carefully selected numbers. It is like saying that I am earning much better money than my 16-year-old nephew (who just finished school), and that, because my job is installing and servicing coal stoves and coal stoves are still used in large part of the country, the coal stove industry is in a totally healthy state.

Hmm. Sounds like C++ is losing ground to Rust - which is much younger - fast.

Especially considering that according to the Stack Overflow surveys, young programmers tend to get into C++, but experienced developers clearly prefer Rust.

Of course, C++ isn't going to dissppear. It will continue to be used for a long time, especially in old, mature code bases. But the same is true for COBOL. And very few new projects use COBOL. In the same way as some scholars and archeologists need to know Latin, but very few publish research or write new books in Latin - even if it was the language of science just a couple hundred years ago.

11
12
 
 

I thought of this after a recent bug I found. I use Vivaldi browser and recently it updated. After the update my mouse cursor was not visible when within the browser window. Other programs worked fine. I tried visual studio and steam and epic game store all had my mouse, Vivaldi didn't.

I closed all instances of Vivaldi via task nanager(was unable to click the x) and restarted it. That fixed the bug and I haven't been able to replicate so I don't have anything to submit for a bug report. Just a really strange thing.

What have been your weirdest bugs?

13
 
 

If you just want the library https://codeberg.org/janantos/brow6el

Reminds me of Browsh

14
15
16
 
 

cross-posted from: https://programming.dev/post/43351044

https://media.ccc.de/ is the publication website for the Chaos Computer Club, the largest hacking collective in the world based in Germany.

GrayJay is an application to consume media from anywhere a plugin has been written for (Youtube, Peertube, SoundCloud, TED Talks, BitChute, BillBilli, ...). Think yt-dlp with a frontend and subscription features.

Installation

Add a new source and use the URL of the JSON manifest on radicle

https://seed.radicle.garden/raw/rad%3AzWzu5sgdan7wuErGDRz1u4JTFEF7/head/MediaCCCConfig.json

17
 
 

Matches my own experience when working on software where quality matters, like large and long-running scientific projects: Even if there are tight time constraints, you won't sacrifice quality, because that would make you slower.

18
19
20
21
 
 

This is a first for me. I've got some personal projects I want to work on, and I really enjoy programming. Normally first thing in the morning I'll spend an hour waking up, drinking coffee, and writing some code.

I'm a professional software developer, and software development is a passion and hobby. But I felt like I needed a bit of a reset so I've made an effort to not write any code at all during the Christmas/New Years holidays (about 3 weeks).

Honestly I don't feel like I've missed out, but I'm definitely looking forward to getting back into it and I think I'll benefit from it. Ill be back at it again next week.

I know 3 weeks isn't a huge amount of time in the grand scheme of things. Have you found yourself taking a complete break from coding? How did you find things when you had to start up again? Felt like it benefitted you or ended up losing the trail a bit?

22
23
24
25
view more: next ›