Developer / Potential Contributor Question: how to add a custom post/comment ranking algorithm to Lemmy?
How would I add a new ranking algorithm to Lemmy as a contributor? I'm a developer by trade, but unfamiliar with Rust and the codebase of Lemmy specifically. It doesn't seem like Lemmy has a concept of 'ranking plugins', so whatever I do would have to involve an MR.
Specifically, I'd like to introduce a ranking system that approximates Proportional Approval Voting, specifically using Thiele's elimination methods, like is used in LiquidFeedback.
I'm pretty sure that with a few tweaks to Thiele's rules, I can compute a complete ranking of all comments in a thread in O(ClogC + E + VlogC), where C is the number of comments, E is the total number of likes, and V is the number of users. This would also support partial approvals, upvotes could decay with age.
I believe this would mitigate the tendency towards echo chambers that Lemmy inherits from Reddit. Lemmy effectively uses Block Approval Voting with decays to rank comments and posts, leading to the same people dominating every conversation.
I was thinking of it as a drop-in replacement for "hot" just so that it doesn't require any changes on the UI to implement. I'm a bit rusty with UI development, lol. The frontends wouldn't have to add a new button, and the Lemmy API wouldn't need to add a new sort type. That said, maybe that sort of thing is easy to do?
As far as it would work, Thiele's elimination rules is computed roughly as follows (I'm assuming that only upvotes are counted; I haven't considered yet if the process works if disapprovals count as a vote of "-1" or how the process could remain scalable if an abstention counts as a vote of "0.5":
begin with the list of posts, list of users, and list of votes
# initial weighting, takes O(E)
for each post:
for each vote on the post:
lookup the user that voted on the post
based on the number of votes the user has given, determine how much the user would be made "unhappy" if the current post was removed
# the basic idea here is that if the user didn't vote for a post, then they won't care if its removed
# if the user did vote for a post, but also voted for 100 others, then they probably won't care if one gets removed as long as 99 remain
# if the user did vote for a post, but only voted for 2 or 1 others, then they'll care more if this one gets removed
# if this is the only post the user voted for, then they'll care a lot if it gets removed
# LiquidFeedback uses a formula of "1/r", where r is the total number of votes the user has given
# as posts get removed, the votes get removed too, so surviving votes get more weight
# for the sake of efficiency, I'll probably use a formula like "if r > 20 then 0 else 1/r" so that users only start to contribute weight to posts once they only have 20 approvals left. Replace 20 with a constant of your choice
add the user's resistance to the post being removed to the post
# initial heap construction, takes O(C)
construct a min-heap of the posts based on the sum of the users' resistances to the post being removed
# iterative removal of posts
while posts remain in the heap: # O(C)
remove the first post in the heap - this has the least resistance to this post being marked 'last' in the current set # O(logC)
yield the removed post
for each vote for the removed post: # in total, O(E) - every vote is iterated once, across the entire lifetime of the heap
lookup the user that voted on the post
compute this user's resistance to this post being removed
remove this vote from the user
based on the number of remaining votes the user has given, compute the user's resistance to the next post being removed
compute how much the user's resistance to their next post being removed increased (let this be "resistance increase")
if "resistance increase" is nonzero (based on my formula, this will happen whenever they have less than 20 votes remaining, but not if they have more than 20 votes remaining):
for each vote for a different post by this user:
increase the post resistance to removal by "resistance increase"
perform an "increase_key" operation on the min-heap for this post # this will be O(logC)
# worst-case, each user will perform 20 + 19 + 18 + ... "increase_key" operations -
# they only begin once there are 20 votes remaining
# when they have 20 votes remaining, they have 20 increase_key's to do
# when they have 19 votes remaining, they have 19 increase_key's to do
# etc.
# because this is a constant, it doesn't contribute to the time complexity analysis.
# so each user performs at worst a constant number of O(logC) operations
# so the overall time complexity of the "increase_key" operations is O(VlogC)For this algorithm, the
yield the removed post statement will return the sorted posts in reverse order. So worst to best. You could also interpret that statement as "Give the post a rank in the final sorting of count(posts) - (i++)".Thiele says that process can be used to elect a committee of size N by stopping your removal when N votes remain. But because it's a "house monotonic" process (electoral speak for "increasing the size of the committee by one and re-running an election is guaranteed not to cost any existing members their seat), I figure it could be repurposed to produce a ranking as well - the top one item is "best one", the top two items are the best two, the top three are the best three, etc.
To make the above process work for approvals that decay over time, we'd just treat a decayed approval as a partial approval. I still have some work to do on how exactly to integrate partial approvals into the "resistance to removing each post" calculations without ruining my time complexity. But basically it's a proportional score voting election instead of proportional approval.
Adding a new sort type is not a big deal, so dont worry about it. And a new admin setting for this would also require UI changes, so the new sort type is easier overall.
The current sort options calculate the rank for each post only from the data on that post (number of votes, creation time). Your suggested algorithm looks much more complicated than that, as it requires two iterations and needs to access data from multiple posts at once. Im not sure if this can really be implemented in a way thats performant enough for production use. Anyway feel free to open a pull request, then hopefully other contributors can help you to get it working.
How to protect my identity while running an online store?
Hello, Sorry if this is the wrong place for this.
I am looking to start an online store for some art projects/crafts/stickers mostly as a creative outlet for some of my current frustrations.
Since some kinds of people take art way too personally, I want to take precautions from doxxing or being harassed.
What are some best practices for an online shop? Are there any recommended storefronts or something like that? I’m sure there’s a lot of things I’m not even considering.
Any help would be much appreciated, Thanks
I'm pretty sure he's far from the only one. Databases with such a vast amount of "forbidden" knowledge will always be misused.
That's why we shouldn't have global surveillance, espionage and "highly classified material" wherever it's possible for agencies to do their jobs without them.
And I'd argue most of the data the contractor had access to was neither relevant for his own work, nor for the work of all of the CIA.
like this
We’ve known since Snowden that these people browse private info for fun, and exchange anything spicy they find with each other. But this guy was straight up selling classified info to anyone who would buy it.
I’m shocked they’re letting this guy off with a plea deal. This was so far beyond misuse of systems. This was full on treason.
I’m shocked they’re letting this guy off with a plea deal. This was so far beyond misuse of systems. This was full on treason.
but he didn't try to run or get caught running in russia; so he's ok. lol
Depends which kind of partisan you’re talking to. One kind believes it’s ok to keep them in boxes in a bathroom. The other kind thinks ok to keep them in the trunk of a car or a private server.
Reasonable people want both kinds held accountable.
Fact : what's really behind the Swiss E-ID
End of September, Switzerland will vote for E-ID.
A big threat for our privacy as it will widely used for tons of new use cases.
Behind the government pitch of an "open source project, completely optional" hides big tech industry... Which will make it mandatory to access their services.
What are your thoughts on that ?
like this
private ids where always the scope of the privacy movement. However, it may as such present other challenges which can include age based discrimination. It as such must be implemented wisely.
Age is already being weaponised against us (child protection, etc), this shouldn't be like that - We can already see what kind of power governments hold. Ageism is what will ultimately destroy us.
Filter Your Files Directly in Zsh, Without Long Pipelines | Bread on Penguins
0:00 zsh opts
1:31 wildcards
2:46 when to glob!
4:08 special patterns
4:50 filtering, sorting
7:10 $f example
8:25 when not to glob!- YouTube
Profitez des vidéos et de la musique que vous aimez, mettez en ligne des contenus originaux, et partagez-les avec vos amis, vos proches et le monde entier.www.youtube.com
i use zsh on my work macs and now i'm thinking of doing so too on my linux machines because of this lady's videos.
i've been using bash for 20+ years and my work macs keep reminding me that the transition is going to have hiccups because bash has become muscle memory for me.
Bloody Day For Israel With Six Soldiers Killed In Gaza And West Bank (Videos, Photos)
Bloody Day For Israel With Six Soldiers Killed In Gaza And West Bank (Videos, Photos)
Six Israeli soldiers were killed on September 18 in two separate attacks that took place in the occupied West Bank...Anonymous1199 (South Front)
Russia challenges ICAO’s findings on MH17 crash in UN Court of Justice — ministry
Russia challenges ICAO’s findings on MH17 crash in UN Court of Justice — ministry
Russian diplomats also noted that although the tragedy occurred over 11 years ago, "there is still a long way to go in the quest for truth"TASS
Texas Man Is Charged With Making Threats Against Mamdani
https://www.nytimes.com/2025/09/18/nyregion/zohran-mamdani-threat-nyc-mayor.html
Beijing Prefers Peaceful Reunification with Taiwan But Warns Conventional Arms Are Sufficient
Beijing Prefers Peaceful Reunification with Taiwan But Warns Conventional Arms Are Sufficient
Retired PLA Lieutenant General He Lei said China has enough conventional weapons to resolve the Taiwan issue if necessary, though peaceful reunification remains Beijing’s preferred pathPavel Morozov (Pravda English)
A Reforma Administrativa avança para destruir o Estado brasileiro
A Reforma Administrativa avança para destruir o Estado brasileiro
Em meio a entrevistas concedidas à grande mídia, o relator do GT da Reforma Administrativa divulga a conta gotas possíveis ataques a direitos e ao próprio Estado.jornalofuturo.com.br
'Kill zone' around crucial Ukrainian city as Russian forces try to squeeze defenders out
'Kill zone' around crucial Ukrainian city as Russian forces try to squeeze defenders out
Pokrovsk has withstood Russian assault for more than a year, but Sky News hears from an expert that the defence could be coming to an end - here's why.Michael Drummond (Sky News)
EU to force Ukrainians to return home
EU to encourage Ukrainians to return home
Member states are facing financial strain providing benefits to millions escaping the conflictRT
Is the Kyiv Independent good enough for you, buddy?
kyivindependent.com/eu-to-phas…
EU to phase out temporary protection program for Ukrainians, prepares transition other residence statuses
In a recommendation adopted by member states, the Council agreed on a framework to ensure a "sustainable return and reintegration into Ukraine, when conditions allow," as well as a coordinated transition to other residence statuses for those eligible…The Kyiv Independent news desk (The Kyiv Independent)
Well aren't you a peach
How about you try a news source instead of... Whatever the hell this site is pretending to be, and then maybe make an attempt to be nuanced and truthful?
Edit: lol, the domain doesn't even resolve anymore
Is the Kyiv Independent good enough for you, buddy?
kyivindependent.com/eu-to-phas…
EU to phase out temporary protection program for Ukrainians, prepares transition other residence statuses
In a recommendation adopted by member states, the Council agreed on a framework to ensure a "sustainable return and reintegration into Ukraine, when conditions allow," as well as a coordinated transition to other residence statuses for those eligible…The Kyiv Independent news desk (The Kyiv Independent)
Works fine for me.
Well now it's gone but the other link is even better lol
Drone from Yemen strikes hotel in Israeli resort city Eilat
Drone from Yemen strikes hotel in Israeli resort city Eilat
Drone from Yemen strikes hotel in Israeli resort city Eilat-english.news.cn
On one hand USA bombed my country, poisoned the waterways with depleted uranium, and helped war criminals rip a chunk of it off and continue ethnically cleansing people to this day.
On the other, for over a decade China has been helping criminals running the country embezell billions in return for putting us in so much debt who knows how many generations will be paying it off.
Both can go fuck themselves.
Workers across France strike over budget cut plans
Workers across France strike over budget cut plans
The widespread walkouts come less than a fortnight after the government collapsed over a proposed budget.Laura Gozzi (BBC News)
Samsung brings ads to US fridges
Samsung brings ads to US fridges
Samsung’s ‘screens everywhere’ initiative is morphing into ads everywhere.Thomas Ricker (The Verge)
How do I turn my Anki deck into multiple choice quiz automatically?
I am trying to study for my Network+, I have an Anki deck I downloaded from the internet that's very helpful, but I have to basically mark down myself which things I'm struggling with. I was wondering if there is a tool available that would automatically turn my deck into a quiz? I do not want to spend a lot of time turning it into a quiz myself, because there is a lot of material. I am okay with using Duck.ai (ChatGPT) for helping me with this, if needed. Just not aware of an easy way to do this.
I'm trying to avoid using non-free sites like Quizlet.
Any help is appreciated!
like this
Why do you have to mark cards manually? Anki's algorithm already reschedules cards based on what you're struggling with. Additionally the card browser has an ease filter that you can sort by.
How is the quiz you want different than what Anki already provides? Is it that instead of providing the answer from memory, you want to be provided a list of choices? I'd argue if you're studying, it is better to do it the "hard" way by just knowing the answer, and then acing the test since its the easier multiple choice format.
When I did Net+ and then Sec+, most of my questions were formatted this way, but I also manually added the multiple choice questions that were in my study book. For that I listed all the choices in the question field, then just the question and answer in the answer field.
Lastly, this isn't really a Linux question though, as Anki is cross-platform. You may get more response on Anki's forums.
As the other comment says, Anki already changes dynamically so that you study the hard stuff more. Just make sure to mark whether you got the answer and how hard it was to get it.
Now, here’s something that could help you, perhaps more than any multiple choice exam could ever help you with: when studying, make sure to not only blurt the answer but also use elaborative recall. In other words, make an effort to think and do so mindfully (rather than mindlessly).
Why? You learn through effort and through mindfully (and not mindlessly) connecting the new knowledge with what you already know.
You could even structure your elaborative recall through Visible Thinking Routines.
How does that look like?
- You start your study session.
- You get an Anki card.
- You remember this card clearly, and so you say it out loud and then check.
- You get it right. No need for elaborative recall. Better to focus your energy elsewhere.
- You get another Anki card.
- This one’s tough. You’re unsure.
- You say out loud why it could be any of the two answers you think could be right.
- You get the answer and sure enough it was one of the two you thought.
- You decide to do elaborative recall so that you learn this well. To guide your elaborative recall, you decide to use the thinking routine “Connect-Extend-Challenge”.
- So you do elaborative recall through a thinking routine. You do it by talking out loud or writing it out.
- This step may sound silly but make sure to celebrate so that you feel pride and satisfaction for doing something that takes effort (especially if you’re struggling with the habit of studying).
- Then you move on to the next Anki card.
A missile, not a drone, hit a residential building in Poland – Rzeczpospolita
A missile, not a drone, hit a residential building in Poland – Rzeczpospolita
The Polish Air Force mistakenly hit a residential building in the village of Wyrzyki-Wola with a missile, according to the Rzeczpospolita newspaper.newsmaker newsmaker (English News front)
‘They will destroy the city, but not the people’: Gaza braces for Israel’s largest assault of the war
‘They will destroy the city, but not the people’: Gaza braces for Israel’s largest assault of the war
As Israeli troops push into the enclave’s heart, civilians face an impossible choice: Flee into uncertainty or stay and risk annihilationRT
Bank of Russia governor dismisses talk of recession
Bank of Russia governor dismisses talk of recession
Cooling growth should not be confused with a contraction, Bank of Russia Governor Elvira Nabiullina has saidRT
U.S. sees 5.7 million more childless women than expected, fueling a "demographic cliff"
U.S. sees 5.7 million more childless women than expected, fueling a “demographic cliff”
New research shows a sharp, accelerating rise in childlessness, with 5.7 million more women aged 20-39 without children than expected in 2024. This trend has contributed to 11.8 million fewer U.S. births since 2007.Karina Petrova (PsyPost Psychology News)
Their vision is based on movement, stay perfectly still.
You're thinking of a different kind of predator. I don't think that would work against sexual predators.
Arab and Islamic airspace blockade would damage Israel, finds UAE think tank
The report estimated that it would cause Israel’s GDP to contract between 4.8 and 5.7 percent, which would trigger a recession.
A wide-scale blockade including OIC members such as Turkey, Pakistan and Indonesia would sever direct flights to Israel’s east and south, creating a significant barrier to high growth markets in Asia and Africa.
It estimated that detours which added four to six hours to flights could cost between $30,000 to $60,000 per flight. Israeli airline El-Al would likely suffer a reduction of revenue of between 60 to 75 percent, according to a “conservative estimate”.
Such a move, according to the paper, would disrupt tourism to Israel, and high-value time-sensitive exports like diamonds and medical equipment.
It would likely cause contract cancellations, as well as a potential exodus of research and development initiatives based in Israel.
Such a coordinated action taking place may well be unlikely, given that it would draw the ire of the US, and would create economic costs for the blockading countries themselves.
The UAE, as well as Bahrain, Morocco and Sudan, established full relations with Israel as part of the Donald Trump-brokered Abraham Accords in 2020.
Israel's genocide in Gaza has brought about condemnation from these countries, but not a suspension or withdrawal of the accords.
Arab and Islamic airspace blockade would damage Israel, finds UAE think tank
An Emirati-owned think tank has published a paper assessing the economic, political and security impact of a potential coordinated airspace blockade against Israel by Arab and Muslim-majority countries.Rayhan Uddin (Middle East Eye)
‘Liberal’ has become a term of derision in US politics – the historical reasons are complicated
‘Liberal’ has become a term of derision in US politics – the historical reasons are complicated
Why are so many Americans unwilling to identify as liberals, white or otherwise, even while supporting traditionally ‘liberal’ government programs?The Conversation
Democratic PR Firm to Run Bot Army for Israel
SKDKnickerbocker LLC, a top Democratic Party-aligned public relations firm, has agreed to run a “bot-based program” to amplify pro-Israel narratives on Instagram, TikTok, LinkedIn, YouTube, and other platforms, according to a filing under the Foreign Agents Registration Act submitted on Aug. 29. The contract, signed on April 28, 2025, describes a strategy to “flood the zone” with content promoting the Israel Ministry of Foreign Affairs’ pro-Israel messages, using automated tools to increase the reach and visibility of specific posts.
The contract, worth $600,000 from April 2025 through March 2026, also tasks SKDK with coaching Israeli civil society spokespeople for on-camera appearances, testing the effectiveness of social media influencers, and arranging tailored outreach to journalists at outlets including BBC, CNN, Fox, and the Associated Press to secure favorable coverage. While it is not confirmed whether the bot program is already active, the contract date suggests it could be underway.
Democratic PR Firm to Run Bot Army for Israel
A new FARA document reveals SKDK's plan to "flood the zone" with social media bots as part of its $600,000 contract with Israel.Donald Shaw (Sludge)
Looking for software that will allow keyboard/mouse to output to tablet via usb
Hey all,
I have a tablet that I’ve been working on and in order to setup OS I need to plugin a usb hub to the usb port, using an adapter to microUSB, ok, and then plugin either a keyboard and mouse or a combo unit (in my case, the wireless receiver device of a mini keyboard/touchpad device), and finally, the flash drive with the OS install on it.
To put it simply, it’s really a pain in the ass anytime I want to do some testing. It works, but it is a clutter and nuisance.
Is there any software that will allow me to plug in a USB cord from my laptop (Linux) and the other end into the USB port of the tablet, and use the laptop to control the tablet?
Thanks.
Hah, no worries. I think it's just an unusual use case and... well, I recognized it because I'm obsessed with PiKVM lately and those things!
I'm not superknowledgeable on USB, but Linux has features to do this; they are called "gadgets" in this list:
docs.kernel.org/usb/index.html
I have used this to turn a RPI Zero into a virtual USB drive with these scripts: github.com/alexpdp7/rpi-zero-u…
Likely by searching the Internet for USB gadgets you might find good explanations about requirements. I know there are unexpected difficulties- I'm using a Pi Zero instead of a nicer Pi because... nicer Pis can draw too much power over USB and bork what they're connected to. So be careful.
GitHub - alexpdp7/rpi-zero-usb-iso: Converts a Raspberry Pi Zero 2W into a virtual USB drive for ISO
Converts a Raspberry Pi Zero 2W into a virtual USB drive for ISO - alexpdp7/rpi-zero-usb-isoGitHub
How L.A.'s Playbook Can Guide Chicago's Fight Against ICE
How L.A.'s Playbook Can Guide Chicago's Fight Against ICE ~ L.A. TACO
With ICE terrorizing Chicago, independent media outlets The Triibe, Unraveled Press and The Chicago Reader joined forces to report on ICE’s activities in the city and suburbs.lataco.com
like this
ChonkyLincoln
in reply to MeatPilot • • •eldavi
in reply to ChonkyLincoln • • •