For all your programming needs

772 readers
2 users here now

A community to discuss programming and or related topics

founded 5 years ago
MODERATORS
1
 
 

cross-posted from: https://lemmy.pierre-couy.fr/post/678825

Hi ! I've been working on this article for the past few days. It would mean a lot to me if you could provide some feedback.

It is about implementing a physico-chemical simulation as my first attempt to write a shader. The code is surprisingly simple and short (less than 100 lines). The "Prerequisite" and "Update rules" sections, however, may need some adjustments to make them clearer.

Thanks for reading

2
23
title (lemmygrad.ml)
submitted 2 months ago* (last edited 2 months ago) by [email protected] to c/[email protected]
 
 
3
4
5
6
7
 
 

Hi!

Let's say I have a questions system and the writers of questions always add at least one but maybe more clues for the question.

Would it be better design to have each question have its own table for clues, even though the vast majority of the time the questions only have 1 clue? (ie is it inefficient to create like a zillion tables for a database?) Or would it be better to have a "clues" table, where each clue stores which question ID the clue applies to? (ie are later queries linear in time based on the amount of clues in the table which would be bad?)

Thanks for your help! And I'd appreciate motivations for the answers too so I will understand better.

8
 
 

I’ve tried using ChatGPT for some basic coding syntax/logic, and I’ve had mixed results. Usually not so great.

Wondering if it had access to the whole code base and could better understand the context of the code if it would be better.

What’s your experience been like?

9
 
 

I just can't find the words to describe how happy I was to receive so much feedback and understanding on your part, this community is truly wonderful <3

I'll work on some of your (legal) ideas in my spare time, which is not much but I work fast! So far I've designed a generalized edit distance function with some pretty cool properties that would make it useful for running an organization under non-friendly conditions:

$ cat message1.txt
Liberal anti-fascism is a reactionary idea. Anti-fascism is not practical without being anti-capitalist.

$ cat message2.txt
The anti-fascism of liberals is not a progressive idea. It is impractical with no anti-capitalism.

$ cat leak.txt
Liberals' anti-fascism is not useful without anti-capitalism, not a progressive idea.

$ ./trace.py leak.txt message*.txt
Delta | File name
----------------------
   19 | message1.txt
    8 | message2.txt

Predicted origin of 'leak.txt' is 'message2.txt'.

So far it works with any sufficiently long text I've thrown at it. Make two versions of any text, rewrite any of the two into a third file, and the algorithm will trace its origin. Also the math is pretty elegant!

For obvious reasons I won't be publishing any of it any time soon :) Maybe the RTC will advise me on what to do. Or maybe I'll just hoard a bunch of software like this. Anyway, thanks, I'll keep at it.

10
 
 

Imagine a forum where each post is piece of theory. Users can create and rate connections between posts. There are three types of connection: introductory, elaborative and contra.

How could one easily implement such a forum (as someone who knows nothing about web-dev)? Would lemmy work? All you'd need is three bot-generated pinned top-level comments under each post, one for each type of connection, then users submit connections in the form of links as replies to those top-level comments. Though it would be nice to be able to sort those replies by rating. Does Lemmy fulfill any/all of those requirements? Any other software that could fit the bill?

11
 
 

I have absolutely zero background or knowledge on coding/programming/IT/software/computing etc, but I've recently taken an interest in it. How much time, effort and resources would I need to sink into it in order to become at least borderline competent?

12
 
 

I'm a membership organiser with a community union and spend an inordinate amount of my time prepping excel spreadsheets with membership data. Is there anything out there I could use to split the entire data set into sheets with tables of, say, 20 members each, their contact details, plus boxes for whether or not they can attend this or that event?

13
 
 

I've been thinking about acquiring one of these for a while, because RISC-V sounds quite interesting, but I think I should ask about it here before I spend money on this stuff and the shipping...

First of all, how well does it run Linux? It appears that MangoPi uses their own distro, so I could imagine that a standard one wouldn't run... I don't know about the Sipeed chips. Did anyone here try?

Secondly, which specific model do you have? It's a little hard to get an overview of what's currently available (MangoPi and Sipeed are the only two that I know), I would appreciate a list or just the name of the one you have.

And, in general, what's it like? Does the shipping take long? What are you using it for?

14
 
 

Aside from the proverbial legal use of "linux ISOs", file sharing software is best known for the facilitation of digital piracy. I'm not gonna lie, as a third world person who grew up in the days of dial-up internet, before YouTube and legal music streaming were even concepts, my cultural horizons would have been much more narrow without P2P software growing up. Radio stations only played (and still play) whatever was popular at that moment, in that place; CDs were expensive, and stores didn't allow you to preview music before purchase other than a few high-charting albums; my family was poor and we were unable to afford video games, and so on.

Piracy via P2P software allowed me to get my hands on a vast amount of music, games, software and movies that I wouldn't have even known about without it. It shaped my life beyond belief, and that's just my personal experience with it. Legal streaming services wouldn't have appeared if the traditional business models of the entertainment industries hadn't collapsed due to P2P piracy. My cultural enrichment experience was certainly not the only one in the world, and there are quite a few popular musicians out there who credit music piracy for introducing them to tons of music they wouldn't have found otherwise.

That said, from a workers-centric Marxist perspective, the collapse of the music industry in particular only worsened material conditions for every musician and band that wasn't a superstar already, as they were no longer able to make a living off selling albums, since sales plummeted directly as a result of P2P file sharing becoming so popular. While the immediate adaptation of the music industry in the early 2000s (iTunes) did try to get on with the times and offer the purchase of individual songs for 99 cents and albums for $9.99 from the comfort of your computer, it did not end piracy, and only the arrival of the streaming model managed to do that.

The streaming model, however, has devalued music more than ever before in history:

On the other hand, listeners love the fact that for only $10 a month they can instantly enjoy all the music they can listen to, legally. But aside from the streaming services themselves, only huge artists benefit from this deal. All in all, this represents an absolute worsening of material conditions for the vast majority of artists.

There's this essay here that explains the reasons way better than I can (tl;dr it's the capitalists' fault, both the streaming services and big record labels): https://medium.com/@michaelcbrook/this-is-why-spotify-pays-so-little-how-to-fix-it-1e0c0e1ef860

Now, my questions are: did this devaluing of music really begin with P2P file sharing, and did it directly lead to today's terrible conditions for artists, or is it only capitalism's fault for "locking in" that devaluation by offering unlimited music to customers for the price of a single album a month with a model that benefits the biggest labels over the actual artists? (my personal opinion is that this could be overcome with a different royalty model, as the one proposed with services such as resonate.coop)

But most importantly:

  • Has the revolutionary potential for P2P file sharing been exhausted as of 2022?

  • Is piracy still revolutionary? Was it ever?

  • What is revolutionary software now?

I know I'm focusing on music in this post, since as a musician, that's the field I have the most first-hand experience on, but I'd like to know if the P2P file sharing phenomenon had a similar effect on other industries. Let me know guys if you have any experience on that.

15
 
 

For anyone that doesn't know, rustlings is a "project [which] contains small exercises to get you used to reading and writing Rust code. This includes reading and responding to compiler messages!"

I'm going to help someone with learning Python. After we go through Automate The Boring Stuff With Python, I was hoping we could work through something similar to rustlings, as it's really an incredible set of exercises that helped me immensely.

If there isn't, I might look into creating something similar that follows along with Python 3 tutorial, as that covers a good chunk of the language and would also expect a basic grasp of Python and programming concepts.

16
17
 
 

So the other day I was burning time doing a little bit of Spanish practice on the free version of duolingo when I thought to myself "wouldn't it be fantastic if something freely available like this existed that comprehensively taught mathematics up to a university level".

Does something like this exist and if so is it any good? Ideally the software I imagine is totally comprehensive; offering not only tutorials on everything from the absolute fundamentals to advanced topics but also problem generators that allow people to apply the lessons, practice and test their understanding under a wide variety of possible circumstances. Does such freeware exist?

A readily available, approachable and most importantly freely available resource of this kind could be a huge boon for spreading mathematical education all over the world.

18
 
 

When previous internet privacy scandals hit—from the Apple dispute with the FBI to Edward Snowden’s NSA leaks and even to obscure data gathering provisions in anti-piracy laws—groups like the Electronic Frontier Foundation had been out on the cyber-barricades, piling up the e-tires and setting them ablaze with memes and gifs. They organized online protests, website blackouts, digital strikes, cyber pickets, and even physical rallies: you name it, they did it all. And that made sense. Because EFF’s leaders, together with their digital-rights comrades shoring up the bulwarks of civil society as we know it, were supposed to be go-to defenders of the people on the internet. They were professional activists, attorneys, and technologists who did the hard, thankless work of keeping the internet free and democratic.

And yet something broke down with the Facebook-Cambridge Analytica scandal. On paper, this controversy looked to be a dream organizing opportunity for EFF and its allies. Here was a Silicon Valley giant using its platform to spy on Americans and subvert the workings of our democracy. EFF should have been leading the charge. And yet in what was arguably the greatest public dispute concerning the planet’s largest social networking platform, EFF was AWOL—nowhere to be found. As I continued scanning the privacy group’s website in the weeks after Mark Zuckerberg’s appearance on Capitol Hill, all the advice it offered to irate and concerned Netizens seeking to preserve their privacy on Facebook were pro forma notifications telling them to opt out of platform API sharing and download EFF’s Privacy Badger ad blocker extension for Chrome—a browser made by Google, a Silicon Valley surveillance giant.

The silence of digital advocacy groups was deafening, and even insiders began to question their motives. April Glaser, a Slate tech reporter who had previously worked at EFF, penned a heartfelt appeal for EFF and other tech watchdogs to do something—anything—to protect the American people from Silicon Valley surveillance. “Privacy advocates know how to build coalitions and campaigns. They know how to make demands, and they know how to hatch an action agenda fast,” she wrote. “But it didn’t happen over the March weekend that the Cambridge Analytica news broke.” She wondered why the normally spunky and combative advocacy groups—groups that she admired and worked for—were sitting on the sidelines. “If the people whose job it is to care about digital privacy can’t be bothered to push for laws to regulate how Facebook treats the data we give it,” she wrote, “why should Congress?”

19
 
 

Briar is a messaging app designed for activists, journalists, and anyone else who needs a safe, easy and robust way to communicate. Unlike traditional messaging apps, Briar doesn’t rely on a central server - messages are synchronized directly between the users’ devices. If the internet’s down, Briar can sync via Bluetooth or Wi-Fi, keeping the information flowing in a crisis. If the internet’s up, Briar can sync via the Tor network, protecting users and their relationships from surveillance.

20
21
 
 

but seriously what text editor do y'all use?

22
 
 

EDIT: URL has been changed to new git location on sourcehut. Not all projects mentioned below have continued to exist.

So I just kinda code as a hobby and as a result I probably have a lot of shitty code.

I just recently started looking into IPFS and really just wrote up ipm yesterday as a way to handle pins better, as the having to remember hashes or blindly look around your repo got annoying very quickly.

capital is so aptly named as it's meant for those with a lack of it 😏 basically I'm very on top of making sure my finances are okay since capitalism makes have to worry about money. It started off as my second project ever so there's probably a lot that I should work on and it's not yet complete (e.g. paying off credit cards is still done manually through SQL as I haven't put in the functionality) but it works well for my flow.

Just ignore savoybot lmao, it's been through a lot. That was my first ever project and I had to do a lot to go around Discord's awful API. Apparently now all the stuff I hacked around is made a lot easier, but I probably won't go back to it since fuck Discord. It'll either get rewritten for Matrix or just scrapped and a Matrix bot start anew. What I managed to get out of it is pretty nifty though.

23
24
 
 

Kinda weird how you find Nazis in the most unlikely places. Thankfully I was only using their terminal emulator so I switched to alacritty.

Also relevant: https://news.ycombinator.com/item?id=20845633

25
 
 

Post on dev.lemmy.ml

Let's start with the biggest news first: Lemmy is receiving funding from the NLnet foundation! The funding is for a total amount of 45.000 €, which will allow /u/dessalines and me (/u/nutomic ) to work on Lemmy full-time for at least half a year.

We have created various milestones for the work we are planning to do. Most of them are about getting ActivityPub federation ready for production. In addition, we will work on:

  • better accessibility
  • private communities and instances
  • reworking search
  • creating a joinlemmy.ml type site
  • the option to block other users or communities

The details of the milestones will be posted on our github issue tracker soon.

We're very excited about this opportunity, and can't wait to finish federation.

In other news, we have just released Lemmy v0.7.0. Most importantly, this update switches to Pict-rs for image hosting, due to various performance-related issues with Pictshare. Pict-rs was coded from scratch in Rust by the amazing @asonix, who also created the ActivityPub library for Rust. We can't thank him enough for all the work he is doing for Lemmy!

We'd also like to thank the following people for their contributions:

  • @iav for their work in building arm compatible rust docker images and builds.
  • @ernestwisniewski and @bytesnake for code contributions.
  • Many others for contributing translations via the Lemmy weblate.
  • Our Patreon and Liberapay supporters who help us devote more time to Lemmy (We're still very far from these being able to sustain two developers)
  • Everyone else who contributes to Lemmy, be it by coding, hosting instances or just using it and spreading the word!

Other than that, since v0.6.0 in January we've closed over 100 issues, fixed tons of bugs and added many new features.

You can find the full changelog and upgrade instructions here.

view more: next ›