Programming

17123 readers
98 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 [email protected]



founded 1 year 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
 
 

Hi friends, it's been a minute since I shared an update here on this project.

Last time I posted about building a debug GUI in Rust with egui, and I enjoyed the experience so much that I decided to write a status bar for my tiling window manager using egui too!

There is a whole live coding video series which documents the creation of the bar, and I think in general the codebase has some useful tips on doing things with egui like loading custom fonts at runtime and enabling application-wide theming from colorschemes palettes like base16 and catppuccin.

Happy to answer any questions about the technology choices, the experience in general, rough edges etc.

4
5
6
6
Making malware (programming.dev)
submitted 23 hours ago by [email protected] to c/[email protected]
 
 

This is going to sound fishy.

Recently getting into cybersecurity things and have been pretty interested in looking at malware and maybe making some myself to get the hang of it. Do you guys know any good repositories with malware to learn from? For example, if I wanted to make a credential stealing program, there's a lot of different programs that may have credentials that are valuable. Or, maybe writing a keylogger? I took a look at a rust crate that can record keystrokes but has kind of a weird (or at least not as easy) type system because of different OS implementations, but how do different types of malware consolidate those differences?

I guess the broader question I'm getting at specifically is looking at how already made programs get around different technical obstacles like detailed above.

Thanks

7
8
 
 

Zig vs Rust. Which one is going to be future?

I think about pros and cons and what to choose for the second (modern) language in addition to C.

@[email protected]

9
10
11
12
13
 
 

~ Code Crafters Cafe ~

Hello everyone. You know me from two scandalous topics: It's time to return to the roots, to the C programming language and Why is C hidden gold.

I have got enough answers and a predictable assessment. You might have thought that I was some old man from the past or an inadequate newbie who did not understand what he was saying. Some supported me. These topics were clearly fanatical. It's true. In fact, I am not for fanaticism. I am for restoring the true goals of programming as an art.

I created my "cafe" even before this, first in irc, then in the matrix. This is a place for people who perceive programming as creativity, art, handmade, crafting. Here we are not tied to C or other languages. If you are a Rust programmer and do not want to rewrite the whole world in Rust, you are welcome. If you are a JavaScript programmer and do not think that you need to learn TypeScript instead of JavaScript (because it is unsafe) and that everything should be written in Angular and React, you are welcome. You are tired of writing SaaS garbage, you are welcome. Whether you are a CSS artist, or just a creator, you are welcome. No idols, fanaticism, or heroes.

A cozy place where you can share a common vision and feeling with like-minded people. The only rule is to be human and respectful.

Official description: ~ A cozy place in the jungle of the techno world for all programmers who like to create high-quality and effective code from scratch with their own hands. Hobbyists, professionals, beginners, and just curious about how things really work. Handmade, free and open-source software written with a love for engineering and deep knowledge is code crafting. ~

Welcome to our campfire:

irc: irc://irc.libera.chat/#codecrafters
matrix: https://matrix.to/#/#codecrafters:bsd.cafe

@[email protected]
@[email protected]

14
15
 
 

I just spent 6 hours of debugging some code, just to find out I had to delete a line in a .gitkeep file:

I'm developing a Grav skeleton, which is a kind of template for Grav CMS to easily create sites with it. Such skeletons can include themes and plugins, which can be used to enhance its features and make individual sites.

Now I had this error that the sitemap.xml (used to tell search engines which pages should be indexed and where to find them) threw an error because the XML declaration wasn't on the first line as it should, but on the 2nd line. It came out that every page had this empty line, no matter if html, json or xml.
To find the bug causing this, I first disabled all plugins and enabled them step by step to find out which one produces said bug. It was the shortcode-core plugin, which can be used to style text with more than just markdown. Since this plugin isn't related in any way to the sitemap plugin, I searched for other possible error sources.
After some playing around, I found out that when I remove a theme, the bug simply disappears. With that info, it had to be a problem with said theme. Since themes can include custom shortcodes and the shortcode plugin did make some "noises", I started investigating a bit more with that. While trying to find the bug, I accidentally deleted the shortcode folder, which had only a .gitkeep file in it. This file was necessary that the folder persist with git versioning because if there was no such directory, the plugin would output an error message. I then recreated the folder manually and the error was still gone. Even after recreating the .gitkeep file, there was no empty line in the output.
After trying to find the bug, I checked git to see which edit made the bug resolve. And there was it: the .gitkeep file I recreated had some changes? But I didn't make any changes to the file except for recreating it. Wrong. The file originally had 2 empty lines, probably accidentally. And by recreating the file, it only had one line which resolved the bug.

It came out that somehow the shortcode plugin tried to get shortcodes from this file and likely added the 2 empty lines to the output. And an empty line before the start of the XML declaration causes the XML parser to output an error. Deleting the 2nd empty line from the .gitkeep file removes the empty line from the output and the error is gone. Bug fixed.


And I spent 6 hours today with the help of a kind stranger in a discord channel who was a bit like a 2nd brain to me. It really helped having someone who hasn't worked on this skeleton and could see some bugs you don't see because you're too familiar with it ("Betriebsblind" in German).

Edit: The plugins don't get maintained by me, they're getting maintained by the Grav team. I plan to create an issue on GitHub if I know more and probably identified the code causing the problem.

16
 
 

Hy (a lisp built on top of Python similar to how Clojure is built on top of Java) released v1 recently. I couldn't resist playing with it and found it worked sooo nicely. Thanks all the maintainers for creating a great language!

17
18
 
 

They could've named it QtPy

19
 
 

I begun learning programming a few years ago, and it feels like I barely progressed. I know the basics and a bit of advanced python(I have learnt to use a few libraries), html and css plus a tiny bit of c++, but not much outside of those. I enjoy programming and solving problems using code, and it’s an enjoyable hobby of mine. But I feel like all I do is extremely basic and I want to advance but it feels overwhelming seeing the countless of things I could learn.

I wanna know what are ways I can actually apply the things I have learnt/will learn on somewhat worthwhile things, because the main problem right now is that I don’t really have anything to do with the things I’ve learnt other than silly projects that don’t really last more than a day and aren’t that complex. I also want to advance my knowledge as previously stated since I feel like I know too little for the amount of time I’ve been learning to program.

For context I’m still in school but not too far off from higher ed, and I have a decent amount of free time on most days(~2-4 hrs).

Thanks if you reply

20
0
Functional Web Components (mastodon.social)
submitted 6 days ago* (last edited 6 days ago) by [email protected] to c/[email protected]
21
 
 

@[email protected] Nelua programming language, any one Nim or better?

”What is Nelua?
Nelua is a systems programming language for performance sensitive applications, like real-time applications and game engines. Its syntax and semantics are similar to Lua, but its garbage collection is optional, it provides optional type notations, and it is free from an interpreter. Nelua uses ahead-of-time compilation to generate optimized native binaries. It is metaprogrammable at compile-time using Lua and it is simple and easy to use.

Nelua takes advantage of ahead-of-time compilation using powerful, optimized C compilers such as GCC or Clang, and thus generates very efficient native code. No interpreter is needed at runtime.

Nelua compiles to C first then to native code, thus you can read and debug the generated C code, mix in other C code without costs, create or use C libraries, use C tools, and reuse the generated C code. You can think of Nelua like a "better C" heavily inspired by Lua.”

Any thoughts, experiences?

22
 
 

https://ideatrash.net/2024/09/lies-damn-lies-and-surveys-about-ai.html

The author here breaks down GitHub’s self-congratulatory survey on Copilot and argues that GitHub’s claims are not supported by their data.

23
36
Shredding code at Zed (registerspill.thorstenball.com)
submitted 1 week ago by [email protected] to c/[email protected]
24
 
 

I am currently taking a cybersecurity course and as the topic of my project I chose pentesting. I am aware there are CTFs and intentionally vulnerable applications, but I thought it would be interesting and fun to audit projects of other people who are also just students and/or learning programming.

If you have a webapp, mobile application or any other internet connected project that has enough of an attack surface then I would love to get in touch and possibly pentest it. Of course I'd report any issues I'd find so hopefully it would benefit both parties.

I also do pentesting as my job, so I am not a total newbie. If you have any questions feel free to reply here or DM me. If you are scared of letting someone you don't know pentest your application (which is understandable) I can also help with setting up a testing environment, creating mock data, etc.

Thanks in advance!

25
 
 

@[email protected] It's time to return to the roots, to the C programming language.

Why am I writing this post? Not because I hope for something or believe in change. These are just words. I could write this at the end, but then you would be looking for answers for me while reading, and I don’t need them. They won’t change anything.
So here it is. I don’t claim to be a software development guru or a C language expert. I’m just a simple developer.

- Why are we looking for new technologies? Why do we want to be part of a community that is buzzing with new projects? Why do we think that this new programming language will definitely help us create something amazing and truly great and, of course, will make us rich and provide us with a comfortable old age?

- Why are we offered so many courses in so many programming languages and frameworks? Why do we teach what is required for companies that make money from us?

- Why are there a lot of conferences on banal simple things, such as *** framework or ### technology (so as not to offend anyone), and there, with a smart look, newly minted gurus tell us how important it is to be able to transfer the value to the client and how to use certain templates?

- Why do computers become more and more powerful, but programs continue to lag?

- Why, when applying for a job, do we look for a vacancy based on knowledge of a programming language, but find it only based on knowledge of certain frameworks? Is it really difficult for a professional programmer to learn a framework in a week?

- Why do we go into software development with the enthusiasm to create something great, but end up in a situation where we are developing some other catalog or some other digital yo-yo to make money?

Reason: because we want our passion for programming, our interest, to also bring us income.
Result: we do not earn this money for ourselves, but for companies whose main goal is to quickly receive income from the software they sell.

I look at how programming has changed over the course of 25 years, what they teach at universities, and where they start. And I came to the conclusion that on a large scale, it was all for the benefit of giant companies or the government.

We must protect the “intimate” knowledge of the foundations and water the roots ourselves. Because they don’t realize, they don’t see that if the roots are not watered, the branches on which they sit will dry out. Therefore, who, if not us?!

view more: next ›