Programming

19402 readers
144 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 2 years ago
MODERATORS
26
27
 
 

Short version of the situation is that I have an old site I frequent for user written stories. The site is ancient (think early 2000's), and has terrible tools for sorting and searching the stories. Half of the time, stories disappear from author profiles. Thousands of stories and you can only sort by top, new, and 30-day top.

I'm in the process of programming a scraper tool so I can archive the stories and give myself a library to better find forgotten stories on the site. I'll be storing tags, dates, authors, etc, as well as the full body of the text.

Concerning the data, there are a few thousand stories- ascii only, and various data points for each story with the body of many stores reaching several pages long.

Currently, I'm using Python to compile the data and would like to know what storage solution is ideal for my situation. I have a little familiarity with SQL, json, and yaml, but not enough to know what might be best. I am also open to any other solutions that work well with Python.

28
29
27
submitted 2 weeks ago* (last edited 2 weeks ago) by [email protected] to c/programming
 
 

Examples of what I mean by modding:

  • minecraft mods: add some jar file into your mod folder
  • skyrim mods: add some .esp file into your mod folder
  • luanti: put some folder with .lua files and config into your .minetest/mods folder

Mods are basically "turing-complete" and can add different types of computation to your application, while integrating with the (GUI) system.

How to design a program that allow for modding?

With interpreted programming languages like python or lua, you can load code as strings at runtime … but is it done that way for these languages (that would be really bad for security)?

eval("print('mod loading ...')")

So roughly how I imagine modding in python to work, a demo in the python repl …

>>> items = {}
>>> newmod = """
... {"name": "holy-mod-sword", "value": 10, "do-damage": lambda x: x.firedamage(1000)}
... """
# loading the mod
>>> items["holy-mod-sword"] = eval(newmod)
>>> items
{'holy-mod-sword': {'name': 'holy-mod-sword', 'value': 10, 'do-damage': <function <lambda> at 0x7f8c710a9d00>}}

is it done that way or similar?

30
31
12
submitted 2 weeks ago* (last edited 2 weeks ago) by [email protected] to c/programming
 
 

Where can you view package details like dependencies and package size on PyPI like on npm?

For example, when I look at React's page on npm, I can see that it has 0 dependencies and an unpacked size of 237kB.

On the other hand, when I visit Flask's page on PyPI, I can't seem to find it's dependencies even after clicking on project details.

32
 
 

In a project, I've successfully compiled multiple shaders, but at the last fragment shader it just decides to revert back to 110 for no real reason (it's vertex pair just compiled fine), then fails to compile due to me using some 330-related features.

Yes, I requested 3.30 core profile before you ask.

33
67
submitted 2 weeks ago by ruffsl to c/programming
34
 
 

Ive used this pattern in quite a few MV(C/P) frameworks. Works well as long as the models dont get huge.

35
 
 

Got bored of having GPT's explain everything when I'm trying to learn or debug so I made this prompt to give me enough info and point out where I have gone wrong without robbing me of the chance to lean.

36
37
38
 
 

I'm a junior in highschool and will be graduating next year, and the degree that makes the most sense to me is computer science. I've always loved using and tinkering with technology, and learning about it when I can.

I've taken the CS50p course as an introduction to coding, and have really enjoyed the problem solving nature of programming. I just don't know what the industry is like, and people keep saying the job market for CS majors is terrible. so I'm not 100% sure that a computer science degree would be right for me. any advice?

update: I've gotten a lot of good advice from comments and have decided to start a personal project of some sort, to test the waters and see if this is something I can do and enjoy as a hobby outside the CS50p course. thanks to everyone who responded!

39
 
 

Creating Fluid Animations with Framer Motion https://chat-to.dev/post?id=VTFYcDg4aHdmRHlDVUx0eTBrbGdaQT09 #react #reactnative #javascript #webdesign #frontend

40
41
 
 

Hi all, 

I'm working on my personal website, my first forway into javascript and web development.

I wanted to create a flip dot style display which has since morphed into more of a CRT look. 

You can take a look here if you like:  https://343f-66-113-2-158.ngrok-free.app/main.html

However, I've recently, when sending it to a friend, we found it only seems to work with any performance on Safari, sometimes in fact failing entirely on Chrome and Firefox.

I'm wondering if anyone has any ideas on how I might change my design to migigate this or whether there is some way to give myself more resources on firefox and chrome.

A cursary look into fixing this seems to suggest I should use RequestAnimationFrame, however, this drawing of all elements smoothly at once, while efficent, destroyes the organic effect that the timeouts gave both on the individual dot level and when refreshing line by line.

My general design is outlined here: 

I'm using HTML5 canvas; each dot is a class which redraws its section of the canvas with a 50-300 ms delay to emulate the per dot lag of a given hinge on a flip dot display. The display class again using setTimeOut(), schedules each line of the display, consisting of dots, to update at a slight offset so that you can see the display refresh from left to right. Then the rest of the program modifies the "next frame" array with text or images which I wish to be displayed. 

 

Thank you!

42
 
 

the heck you mean "lists aren't indexable"

43
44
3
wow (lemmy.world)
submitted 2 weeks ago by [email protected] to c/programming
 
 
45
 
 

https://nlnet.nl/news/2025/20250321-call-announcement-core.html

Notes

  1. Projects meaningfully sharing two programming languages get 0.5 a point each, even if the split is not exactly half-half.
  2. Two projects are listed under "Multi/Misc/Other" which is opinionated, and some may disagree with.
  3. Three points (5 projects) are assigned to "Unaccounted/Not Available". Two of the projects have no code at all (related to the grant, or otherwise). One project with no published code is (charitably) listed under "Python", however, since the author mentions Python+QT as the choice for implementation.

9.5 (10 projects) Rust

https://git.joyofhardware.com/Products/FastWave2.0
https://github.com/slint-ui/slint
https://github.com/stalwartlabs/mail-server
https://github.com/dimforge
https://github.com/DioxusLabs/blitz
https://github.com/fdtshim
https://github.com/trynova/nova
https://github.com/yaws-rs
https://github.com/lycheeverse/lychee
https://git.syndicate-lang.org/synit/synit
(0.5 rust, 0.5 shell)

9 Python (8 + 1 project without code)

https://github.com/owasp-dep-scan/blint
https://github.com/web-platform-tests/wpt
https://github.com/niccokunzmann/open-web-calendar
https://git.xmpp-it.net/sch/Rivista
https://github.com/DataLab-Platform/DataLab
https://codeberg.org/IzzyOnDroid/rbtlog
https://gitlab.com/py3dtiles/py3dtiles
https://codeberg.org/flohmarkt/flohmarkt
https://rackweaver.app
(says python+qt, but no code yet)

6 (7 projects) C

https://mntre.com/sources.html
https://github.com/open-sdr/openwifi
https://wiki.musl-libc.org
https://github.com/LekKit/RVVM
https://github.com/skarnet/s6-rc
https://git.savannah.gnu.org/git/mes
(scheme interpreter, compiler + minimal libc in C = 0.5)
https://www.gnunet.org
(gnunet itself is C = 0.5, Anroid work would presumably use Java/Kotlin/Dart/... = 0.5 unaccounted)

3.5 (4 projects) TypeScript

https://github.com/cartesapp/cartes
https://github.com/edumeet
https://github.com/adorsys/open-banking-gateway
(0.5 Java, 0.5 TypeScript)
https://github.com/janeirodigital/sai-js
(grant is about specification work. But implementation is in TypeScript)

3.5 (4 projects) Java

https://github.com/slovensko-digital/autogram
https://github.com/igniterealtime/Openfire
https://github.com/MarginaliaSearch/MarginaliaSearch
https://github.com/adorsys/open-banking-gateway
(0.5 Java, 0.5 TypeScript)

3 Kotlin

https://github.com/florisboard/florisboard
https://github.com/EventFahrplan/EventFahrplan
https://github.com/tuskyapp/Tusky

2.5 (3 projects) Hardware/Verilog/...

https://github.com/opera-platform/opera-dsp
https://github.com/simple-crypto/SMAesH
https://github.com/IObundle/iob-versat
(hardware part = 0.5, software is C++)

2.5 (3 projects) Scheme

https://codeberg.org/spritely/goblins
https://nlnet.nl/project/SchemeTestingFramework
(no external link in grant page)
https://git.savannah.gnu.org/git/mes
(scheme interpreter, compiler + minimal libc in C = 0.5)

2.5 (3 projects) JavaScript

https://github.com/CycloneDX/cdxgen
https://github.com/overte-org/overte
(0.5 C++, 0.5 JS)
https://nlnet.nl/project/TALER-integration-Nuxt
(no external link)

2 Nix

https://nlnet.nl/project/Nix-ControlPlane
https://github.com/ibizaman/selfhostblocks
(no external link)

2 Go

https://github.com/namecoin/encaya
(namecoint-core is written in C++, but the grant is about encaya)
https://github.com/hockeypuck/hockeypuck

1.5 (3 projects) C++

https://github.com/IObundle/iob-versat
(software part = 0.5, hardware is Verilog)
https://github.com/overte-org/overte
(0.5 C++, 0.5 JS)
https://kde.org/plasma-desktop
(grant is about mobile power management improvements, no idea about the code, but KDE/Plasma is C++, so charitable 0.5 for C++, 0.5 unaccounted)

1 Clojure

https://github.com/NyanCAD/Mosaic

1 Assembly

https://lib25519.cr.yp.to
(grant covers NEON vector implementation)

1 Haskell

https://github.com/ghc-proposals/ghc-proposals

1 Julia

https://github.com/PeaceFounder/AppBundler.jl

0.5 Shell

https://git.syndicate-lang.org/synit/synit
(0.5 rust, 0.5 shell)

2* Multi/Misc/Other

https://github.com/IObundle/iob-linux
(build project, a mix of python, Make, and C from OpenSBI)
https://unifiedpush.org
(specification for Android and D-Bus. Implementations in Go, C, Kotlin, and Flutter)

3* (5 projects) Unaccounted/Not Available

https://www.gnunet.org
(possible non-native Android yet to be written)
https://kde.org/plasma-desktop
(grant is about mobile power management improvements, no idea about the code but, KDE/Plasma is C++, so 0.5 for C++, 0.5 unaccounted)
https://nlnet.nl/project/LicenseCompatibilityAutomation
(no external link or specific info about the implementation)
https://librediagnostic.com
(fully unaccounted, site pages "under construction")
https://github.com/mapterhorn
(fully unaccounted, from org readme "Coming soon...")

46
 
 

Key Tips for Job Interview Success https://chat-to.dev/post?id=THhKcFF0OHRxNjB1YWdackt0QzBSQT09 #interview #programming #job

47
48
 
 

Hi, [email protected]. I'm curious about zero-knowledge encryption, and I would like to use it in my CS50x final project. My goal is to authenticate users and store their encrypted data on the server so that only the users can decrypt it.

I understand the general concepts of public and private keys, as well as symmetric keys, and how to use them to protect data. However, I don't understand how to authenticate users. I have searched online for information on implementing the zero proof knowledge authentication flow, but I found either vague high-level descriptions or research papers that require a strong background in mathematics and cryptography to understand and implement.

Could you maybe suggest some resources on this topic? When your search for "how to implement jwt authentication", you can find many articles that describe the flow with code examples. I'm looking for something similar.

Or should I choose a simpler project?

49
50
view more: ‹ prev next ›