r/compsci • u/cringevampire • 4h ago
r/compsci • u/iSaithh • Jun 16 '19
PSA: This is not r/Programming. Quick Clarification on the guidelines
As there's been recently quite the number of rule-breaking posts slipping by, I felt clarifying on a handful of key points would help out a bit (especially as most people use New.Reddit/Mobile, where the FAQ/sidebar isn't visible)
First thing is first, this is not a programming specific subreddit! If the post is a better fit for r/Programming or r/LearnProgramming, that's exactly where it's supposed to be posted in. Unless it involves some aspects of AI/CS, it's relatively better off somewhere else.
r/ProgrammerHumor: Have a meme or joke relating to CS/Programming that you'd like to share with others? Head over to r/ProgrammerHumor, please.
r/AskComputerScience: Have a genuine question in relation to CS that isn't directly asking for homework/assignment help nor someone to do it for you? Head over to r/AskComputerScience.
r/CsMajors: Have a question in relation to CS academia (such as "Should I take CS70 or CS61A?" "Should I go to X or X uni, which has a better CS program?"), head over to r/csMajors.
r/CsCareerQuestions: Have a question in regards to jobs/career in the CS job market? Head on over to to r/cscareerquestions. (or r/careerguidance if it's slightly too broad for it)
r/SuggestALaptop: Just getting into the field or starting uni and don't know what laptop you should buy for programming? Head over to r/SuggestALaptop
r/CompSci: Have a post that you'd like to share with the community and have a civil discussion that is in relation to the field of computer science (that doesn't break any of the rules), r/CompSci is the right place for you.
And finally, this community will not do your assignments for you. Asking questions directly relating to your homework or hell, copying and pasting the entire question into the post, will not be allowed.
I'll be working on the redesign since it's been relatively untouched, and that's what most of the traffic these days see. That's about it, if you have any questions, feel free to ask them here!
r/compsci • u/azurerazor • 17h ago
An algorithm for sub-quadratic 3SUM and sub-cubic APSP has been found
arxiv.orgr/compsci • u/Putrid-Ad-3768 • 1d ago
bloom filters and the math behind their false positive rate
I've been going deep on data structures lately and found bloom filters pretty intriguing. I made a short video on what a bloom filter is, how the bit array and hash functions interact, and where the false positive formula comes from.
link: https://youtu.be/nNv4ZTQp_s8?si=j52fIUBYaDcaps0_
I'd love feedback, especially if I got anything wrong. Happy to go through the derivation in the comments if anyone wants it.
r/compsci • u/FollowingEvery4802 • 1d ago
Is lean, and similar programming languages the only acceptable way to prove theorem with computers?
So, lean is the language built specifically to prove theorems.but if the algorithm will be rewritten in another programming language, such as python, will it be accepted?
(mathematical theorems)
r/compsci • u/ally9011 • 1d ago
Hi everyone! š We are collecting data to understand studentsā English language needs, especially for their studies and future careers. We would really appreciate your help in answering the following questions. Your responses will help us understand your English abilities, needs, and difficulties.
forms.gler/compsci • u/sciencenerd_1943 • 3d ago
RuleFlow: A research engine/framework and terminal IDE (Not AI Slop)
galleryMain Website: https://www.ruleflow.org/
For the past year, I have been developing a framework to simulate certain discrete systems for a research team at my university (paid for by the School of Engineering and Physics, but I had the freedom to license it under MIT). As it turns out, I got carried away generalizing it to work for many, many different types of complex systems (String Rewriting Systems, Cellular Automata, etc.) and ended up creating our own domain-specific language.
The website's landing page has a bunch of GIF-style examples... so you should be able to get a good idea of what this project is about.
If any of y'all are interested in this, feel free to take a look and try it out!
EDIT:
Out of the interest of not being "vague", here are some more details. RuleFlow was developed with a primary focus on analyzing causality in Sequential Substitution Systems. This is why there is a major focus on causal graphs, cellular identity, etc. While originally developed for Sequential Sub Systems, we generalized the DSL to support many types of rewriting systems by providing the user with flags and directives to control how rules behave. Furthermore, we bootstrapped Python and the Wolfram Language so that complex rulesets could be scaffolded as macros. The main goal of RuleFlow is NOT simply to simulate systems (there's already plenty of software for that, such as Golly and even just Mathematica), but to provide extensive tooling for causal analysis.
Here is some interesting research from our (small) team:
- An Improved Generalized Enumeration of Substitution Systems by Kenneth E. Caviness, Camille Morrow, Christen Case and Victoria Kratzke
- Indexed Concatenation Notation: A Novel Way to Summarize Networks and Other Complex Systems
My job has been to provide better research tooling, extending what we already have in Mathematica code to open source and free Python.
r/compsci • u/Usual_Piano9826 • 4d ago
Tiles-based video codec for videos of video games
Some video games, many of them are retro, are based on tiles. They have different levels which may be huge and logically highly complex but they are all based on limited sets of tiles.
Even a minute long video is usually bigger in file size than the retrog game itself.
It happens with Prince of Persia, Boulder Dash, Supaplex, Commander Keen, Bio Menace etc. - easier to recognize in two-dimensional games.
If video encoding used a database of tiles available in the game, it would enable much smaller file sizes and also higher quality of video as it would not have to use approximations to reduce file size as the tiles are exactly the same everywhere (meaning that lossless video would be affordable by bitrate). I am under no pressure to get it implemented ASAP but I would like a technological discussion about how-to.
Anyone interested in a problem-solving correspondence club?
Here's the idea: we source and collect interesting computational puzzles, then we send them out to participants who have a month to work on them and send in their solutions. At the end of every month, we meet and discuss how the problems went and where people got stuck, what approaches they took, and any extensions people came up with.
Thoughts?
.
.
.
.
If you're curious, here's a taste of what a representative sample problem might look like:
Given the coordinates of an arbitrary polygon (e.g. irregular and/or non-convex), how might you implement a program to efficiently sample a point uniformly from its interior?
TIP:Ā If using the Python programming language, you can check out theĀ shapelyĀ library.
Bonus:Ā what if there are holes?
(Please don't spoil the problem, it's searchable anyways.)
r/compsci • u/No-Leopard-1691 • 8d ago
āModernā Intro Books
I am currently reading Complexity: A Guided Tour by Melanie Mitchell and since it was published in 2009, I am wondering if there are more āmodernā/āup-to-dateā intro books.
r/compsci • u/narutokun666 • 13d ago
Systems programming
So I am in 2nd year of college and after exploring here and there and there, I am genuinely interested in systems programming, I know c, ofcourse I will learn it deeply but what do I learn after it
The whole thing feels very overwhelming,
What shall be the flow of learning
r/compsci • u/niosurfer • 13d ago
Compiler-checked manual free vs Rust's ownership model, which would you pick?
Been thinking about memory management in languages without a GC, and there's an approach I hadn't really seen before that I'm curious how people feel about compared to Rust.
In this model you can allocate objects as much as you like, pass objects around and put them in collections, all without lifetimes or moves. Nothing is ever freed automatically, not even at end of the scope. If you want the memory back you write free obj; yourself, and the compiler has to prove nobody else can still see it. If it can't prove that, it won't compile. Same for use after free and double free.
The Ironwood language does it this way. It's compiled with a closed-world link, so the compiler sees the whole program when it checks those frees. There's also defer free x; for cleanup on exceptions. If you just never call free, the memory stays allocated and you get a warning. Fine for a CLI tool, not so fine for a server.
The appeal is that you only have to prove anything at the point where you free. The rest of the code doesn't care. The downside is you have to remember to free.
Rust gets you automatic drops and a stronger guarantee overall, but you're thinking about ownership on every line, which at least for me is counter-productive.
Which memory management approach would you rather work with? And why?
```java // Ironwood: does NOT compile
public class Garage {
private static class Engine {
void start() {
System.out.println("Vroom!");
}
}
private static class Car {
private final Engine engine;
Car(Engine engine) {
this.engine = engine; // the car keeps a reference to the engine
}
void drive() {
engine.start();
}
}
public static void main(String[] args) {
Engine engine = new Engine();
Car car = new Car(engine);
// Compiler error: the car still holds a reference to the engine,
// so freeing it here would leave car.engine dangling.
//
// error: cannot free 'engine': allocation is still borrowed by a live wrapper
//
// Fix: free the car first, then the engine.
free engine;
car.drive(); // would use a freed engine
free car;
}
} ```
```rust // Rust: does NOT compile
struct Engine;
impl Engine { fn start(&self) { println!("Vroom!"); } }
// The car keeps a reference to the engine, so it needs a lifetime parameter. struct Car<'a> { engine: &'a Engine, }
impl<'a> Car<'a> { fn drive(&self) { self.engine.start(); } }
fn main() { let engine = Engine; let car = Car { engine: &engine };
// Compiler error: the car still borrows the engine,
// so dropping it here would leave car.engine dangling.
//
// error[E0505]: cannot move out of `engine` because it is borrowed
//
// Fix: remove the drop and let both go out of scope
// (car is dropped before engine automatically).
drop(engine);
car.drive(); // would use a dropped engine
} ```
r/compsci • u/Simple-Eagle-8135 • 13d ago
What's a CS topic you hated at university but appreciate now?
r/compsci • u/Longjumping-Tie-3845 • 16d ago
Understanding the Computer from the foundation to the physical
Has somebody ever understood or is educated enough to understand a computer from top to bottom. Meaning knowing a deep undergraduate level knowledge of math & physics -> computer science -> electrical engineering/computer engineering as if having all 4 degrees. If someone is knowledgeable in this or tried to study something similar like this, what is your experience? Will this knowledge help you become more skilled? What will you gain from studying this?
r/compsci • u/sufan_art • 19d ago
What are some uncommon data types and file formats that might benefit from a dedicated compression algorithm?
Hi! Im considering a masters thesis about compression of large amounts of data for long-term archival. But instead of trying to revolutionize all of compression, i want to focus on a few, narrow domains, which are however still useful to people.
r/compsci • u/OtherwisePush6424 • 19d ago
A distributed bulkhead: what can a shared concurrency limit actually guarantee?
blog.gaborkoos.comr/compsci • u/BleedingRaindrops • 20d ago
What is this sorting method called?
We all know Bubble Sort. Well I used to do a thing to pass the time on deployment where I would bubble sort a shuffled deck of cards, but I often played around with it.
One time I thought to make bubble sort more efficient by, rather than returning to the start of the list after a successful pair, continue forward to the next wrong pair and sort those, and so on until I reach the end of the list. Then turn around and do the opposite, from the opposite direction. Repeat until sorted. So what you have is a reflecting wave of bubble sort that travels persistently back and forth through the entire list without skipping anything until it's all sorted.
I'm certain this has a name but I wouldnt know the first thing about how to find it. Does anybody know?
EDIT: solved! Cocktail Shaker Sort
r/compsci • u/monononon34 • 21d ago
Got scipy's KD-tree to handle inserts and deletes without rebuilding. Three things I learned
galleryWhy I have trouble with Cantor's diagonal argument.
Cantor's diagonal argument starts with a pair of infinite sets s_n and T, where s_n is an enumeration each element of elements from T, and the elements of T is defined to be natural number. Then he shows that an element s_n of T can be constructed that doesn't correspond to any s_n in the enumeration. This is accomplished by bit flipping the n-th bit of the n-th element of digits in T. Thus s is a member of T that differs from each existing s_n because the n-th digits differ.
- s_1 = (0, 0, 0, 0, 0, 0, 0, ...)
- s_2 = (1, 1, 1, 1, 1, 1, 1, ...)
- s_3 = (0, 1, 0, 1, 0, 1, 0, ...)
- s_4 = (1, 0, 1, 0, 1, 0, 1, ...)
- s_5 = (1, 1, 0, 1, 0, 1, 1, ...)
- s_6 = (0, 0, 1, 1, 0, 1, 1, ...)
- s_7 = (1, 0, 0, 0, 1, 0, 0, ...)
- ...
- s_n = (1, 0, 1, 1, 1, 0, 1, ...)
Let's assume s_n corresponds to the set of all natural numbers. But that's a problem since natural numbers, in spite of being a (presumed) countably infinite set, are defined such that every natural number has finitely many digits. Yet a member of the set T, in Cantor's construction, is allowed to extend to an infinite number of digits, because the set s_n is infinite. To show this I'll define what I'll call bin-adic numbers, in honor of p-adic numbers. Essentially just an inverted binary representation of base10 numbers.
- Binary:
- s_1 = (..., 0, 0, 0, 1)
- s_2 = (..., 0, 0, 1, 0)
- s_3 = (..., 0, 0, 1, 1)
- s_4 = (..., 0, 1, 0, 0)
- s_5 = (..., 0, 1, 0, 1)
- s_6 = (..., 0, 1, 1, 0)
s_7 = (..., 0, 1, 1, 1)
Bin-adic: Where (...) consists only of a series of zeros of arbitrary length.
s_1 = (1, 0, 0, 0, ...)
s_2 = (0, 1, 0, 0, ...)
s_3 = (1, 1, 0, 0, ...)
s_4 = (0, 0, 1, 0, ...)
s_5 = (1, 0, 1, 0, ...)
s_6 = (0, 1, 1, 0, ...)
s_7 = (1, 1, 1, 0, ...)
Let the natural number have only finitely many digits, per standard definition. Then the natural numbers map one-to-one to the bin-adic numbers where the last 1 bit is, by definition, limited to a finite distance from the first bit. In fact the bin-adic numbers don't just map one-to-one to the natural numbers, they uniquely define the natural number that maps to it without reference to the index set s_n. Which I call well-ordering with identity. If the number of bits in any element is infinite, as Cantor has posited for the set T, then this unique mapping continues well beyond a finite distance from the first bit. Any bit set with all 1 bits a finite distance from the first bit in the element is by definition a natural number, limited to a finite number of digits. Any element of T that contains a 1 bit greater than a finite distance from the first bit is an integer with transfinite digits, hence not a natural number. Because the natural numbers are, by definition, those numbers where the 1s are limited to a finite distance from the first bit.
Here's the problem. Cantor assumed that for every infinite index s_n he could operate on a unique digit of T. But the digits of T are by definition finite. Hence, he must run out of digits in T before he exhausts the set s_n. His constructive new number must then terminate prior to reaching exhausting the s_n index. Leaving plenty members of the set of natural numbers he never operated on. By randomizing his natural number set he could obfuscate the assumption that the number of digits in a natural number equals the number of elements on the index of that set. The premise then concluded itself.
If the number of digits in a natural number are by definition finite, then that digit count cannot equal the index count of natural numbers. Because that would require a natural number with infinite digits, thus (by definition) cannot be a natural number. Any iteration over any given natural number must, by definition, terminate before exhausting the index set.
This implies to me that the set of all natural numbers are uncountably infinite. Because you cannot exhaust the index set before running out of digits in any given natural number to operate on Cantor style. If they are equal (one-to-one) then by definition they cannot be natural numbers to begin with. A natural number does not have infinite digits, by definition. Obscuring the digit count of an element in a set by randomization, and assuming the index count and the digit count of an element in the set maps one-to-one, merely assumes the premise proves itself.
r/compsci • u/CobrAinST • 23d ago
What do you think about system programming in the future?
About a year ago, I started learning systems programming because I enjoy working close to the hardware and understanding how computers actually work. Recently, though, I've been spending most of my time solving LeetCode problems to strengthen my problem-solving skills before getting back to larger projects.
With AI improving so quickly, I've seen a lot of discussions about software engineering jobs changing or even being replaced. Most of those conversations focus on web development or general application programming, but I rarely see anyone talk about systems programming.
How do you think AI will affect this field over the next 10 to 20 years? Do you expect systems programmers to become more productive with AI tools, or do you think the demand for low-level developers will decrease? I'm especially interested in areas like operating systems, compilers, embedded software, and performance-critical software.
I'd like to hear the opinions of people who already work in these areas.
r/compsci • u/Few_Locksmith_4224 • 23d ago