Programming

16945 readers
653 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
26
21
submitted 1 week ago* (last edited 1 week ago) by [email protected] to c/programming
 
 

Apologies if this is the wrong community, happy to remove and post elsewhere.

I'm essentially a beginner to programming. I know some python (made a game of hangman with ASCII art for example) but nothing more complicated than that.

I've been wanting to learn some programming, whether it's python or something else, and I think I've decided on a project I want to make (if possible?).

I aiming to make an emulation front end/GUI selector. I know there are things like RetroArch that are great, but it doesn't have access to all emulation tools (e.g. doesn't have Xbox/PS2/switch).

I'd picture just opening one program GUI that can select the "system" you want to use, then it provides a list of games.

The complexity that I can see is that even if I can run the actual emulator in a container or use a custom GUI to open the emulator it won't 1) be able to show a games list within the same GUI and 2) it won't be an easy back and forth to change emulators.

Not looking for anyone to solve the problem for me, just hoping for some advice on where to start like languages and what I should be trying to learn etc. or if it's even possible. I'm aware there's a high chance it's not!

I've got years to learn and build before my kid might use it, not in a rush.

Thanks!

27
 
 

Videos (part 1 and part 2) just released for public viewing this week.

Grace Hopper (December 9, 1906 – January 1, 1992) was an American computer scientist, mathematician, and United States Navy rear admiral. She was a pioneer of computer programming. Hopper was the first to devise the theory of machine-independent programming languages, and used this theory to develop the FLOW-MATIC programming language and COBOL, an early high-level programming language still in use today. She was also one of the first programmers on the Harvard Mark I computer. She is credited with writing the first computer manual, "A Manual of Operation for the Automatic Sequence Controlled Calculator."

28
 
 

Originally, I was going to use D, but its current WASM guideline is buried under a lot of Discord threads, all while people are lazy to touch the wiki. I need to test stuff with WASM (use for scripting in applications, not browsers).

Please NO RUST!!! While I see why functional programming is useful (I even use wasmtime as my WASM engine, which is developed in Rust), but is horribly counterproductive for game development, especially if it's opt out like in Rust.

EDIT: In the meanwhile, I've found AssemblyScript, which seems to be good for my usecase.

29
30
 
 

A judge has dismissed the majority of claims in a copyright lawsuit filed by developers against GitHub, Microsoft, and OpenAI.

The lawsuit was initiated by a group of developers in 2022 and originally made 22 claims against the companies, alleging copyright violations related to the AI-powered GitHub Copilot coding assistant.

Judge Jon Tigar’s ruling, unsealed last week, leaves only two claims standing: one accusing the companies of an open-source license violation and another alleging breach of contract. This decision marks a substantial setback for the developers who argued that GitHub Copilot, which uses OpenAI’s technology and is owned by Microsoft, unlawfully trained on their work.

...

Despite this significant ruling, the legal battle is not over. The remaining claims regarding breach of contract and open-source license violations are likely to continue through litigation.

31
32
33
34
35
 
 

This is more of a system config question than a programming one, but I think this community is the best one to ask about anything Git-related.

Anyway, I am setting up a new project with hardware that has 2 physical drives. The "main" drive will usually be mounted and have 10-20 config files on it, maybe 50-100 LOC each. The "secondary" drive will be mounted only occasionally, and will have 1 small config file on it, literally 2 or 3 LOC. When mounted, this file will be located in a specific directory close to the other config files.

I would like to manage all of these files using git, ideally with a single repo, as they are all part of the same project. However, as the second drive (and thus the config file on it) will sporadically appear and disappear, Git will be confused and constantly log me adding and deleting the file.

Right now I think the most realistic solution is to make a repo for each drive and make the secondary drive a submodule of the main. But I feel like it is awkward to make a whole repo for such a simple file.

What would you do in this situation, and what is best practice? Is there a way to make this one repo?

36
139
How to learn Rust? (lemmy.world)
submitted 1 week ago* (last edited 1 week ago) by [email protected] to c/programming
 
 

I want to learn Rust. There are so many resources available and I am unsure which one to go for, and if there are any tips on getting started?

I am a software developer by trade

Edit: Thanks for all the great replies!

37
 
 

It just occured to me, that I haven't asked anything on SO for a while now. It might even be years, the last I asked for help.

Most of the problems I come across were already faced by someone else.

Do you guys feel the same?

38
3
iCloud: Who holds the key? (2012) (blog.cryptographyengineering.com)
submitted 1 week ago by lysdexic to c/programming
39
 
 

I recently stumbled across Cludflares trustpilot page and the reviews were completely mismatched from the way I have experienced people talk about them on forums. The reviews on trustpilot make them sound awful, but I have only seen recommendations for them on forums, often people say they are the best DNS provider.

Whats up with that? Does anyone know why there is such a disparity.

40
41
 
 

Really intriguing article about a SQL syntax extension that has apparently already been trialed at Google.

As someone who works with SQL for hours every week, this makes me hopeful for potential improvements, although the likelihood of any changes to SQL arriving in my sector before I retire seems slim.

42
16
submitted 2 weeks ago* (last edited 2 weeks ago) by [email protected] to c/programming
 
 

I've read an article which describes how to simulate the close ports as open in Linux by eBPF. That is, an outside port scanner, malicious actor, will get tricked to observe that some ports, or all of them, are open, whereas in reality they'll be closed.

How could this be useful for the owner of a server? Wouldn't it be better to pretend otherwise: open port -> closed?

43
42
submitted 2 weeks ago* (last edited 2 weeks ago) by [email protected] to c/programming
 
 

Direct link to the table, for those who block off-site scripts:

https://flo.uri.sh/visualisation/19114866/embed?auto=1

Some of the labels don't seem to show up unless you zoom out.

44
 
 

For Box2D version 3.0 I decided to finally try using SIMD as it is meant to be used for solving contacts. Making contacts solve faster could yield large performance gains so I decided it would be worth the effort.

But how can I gather 4 or 8 contact pairs to be solved simultaneously? The key is graph coloring. The idea is to have a handful of colors to be assigned to all the contact constraints. For example, suppose I have 6 colors and I want to assign all the contacts to one of those 6 colors. Contact constraints act upon two bodies at a time. With graph coloring the restriction is that within a single color a body can only appear once or not at all.

...

I did all this work to enable SIMD processing. Did it help? Box2D has a benchmarking console application to help answer this question. I implemented SSE2, Neon, and AVX SIMD instruction sets in the Box2D contact solver. I also implemented a scalar reference implementation. I have 5 benchmarks scenarios that push Box2D in various ways. See the benchmark results here.

The large pyramid benchmark with 4 workers has the following numbers:

  • AVX2 : 1117 fps = 0.90 ms
  • Neon : 1058 fps = 0.95 ms
  • SSE2 : 982 fps = 1.02 ms
  • scalar (AMD): 524 fps = 1.91 ms
  • scalar (M2): 679 fps = 1.47 ms

...

The bottom line is that making good use of SIMD can be a lot of work but it is worth the effort because it can make games run significantly faster and handle more rigid bodies.

45
46
 
 
47
 
 

Is the new #zed editor mostly hype rn?

I can believe it’s good and cool ( built in graphics and collab seem to me like good ideas).

But as someone who happily stayed with sublime (with LSPs a likely game changer) …

takes like “it’s fast!”, “LSP!”, “it now has snippets!” … along with people telling me it has a plug-in system, but doesn’t (cf python/lua runtimes of sublime/nvim) give me massive hype vibes and honestly just feels very “2020s-tech”.

#programming

@programming

48
14
submitted 2 weeks ago* (last edited 2 weeks ago) by AsudoxDev to c/programming
 
 

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

Hello Lemmings!

I am thinking of making a community moderation bot for Lemmy. This new bot will have faster response times with the help of Lemmy webhooks, an amazing plugin for Lemmy instances by @[email protected] to add webhook support. With this, there is no need to frequently call the API at a fixed interval to fetch new data. Any new data will be sent via the webhook directly to the bot backend. This allows for actions within seconds, thus making it an effective auto moderation tool.

I have a few features I thought of doing:

  • Welcome messages
  • Auto commenting on new posts
  • Scheduled posts
  • Punish content authors or take action on content via word blacklist/regex
  • Ban members of communities by their usernames/bios via word blacklist or regex
  • Auto community lockdown during spam

What other features do you think are possible? Please let me know. Any questions are also welcome.

Community requested features:

  • Strike system

Strikes are added to a certain member of the community and the member will be temporarily banned within a time period if their strike count reaches a certain threshold

  • Post creation restriction by account age

If an account's age is lower than X, remove the post.

49
31
Firewalling Your Code (lackofimagination.org)
submitted 2 weeks ago by Aijan to c/programming
50
 
 

A project I saw linked in the css post, and wanted to share, because I love the insanity.

view more: ‹ prev next ›