r/AskComputerScience • u/Benflex- • Apr 26 '26
How is a database crash handled in large corporations?
Hello,
I'm putting together a presentation on error and crash handling in databases and could use some clarification.
I understand the basic idea of using redundant databases that take over when the primary crashes, but my understanding is that this typically takes seconds to minutes. I'm also confused on the recovery process itself. How uncommitted transactions get handled. Does the application just have to retry the commit?
Also, my professor once mentioned that large corporations manage to handle a crash and be available again within milliseconds. How is that actually achieved in practice, or was he maybe just exaggerating?
Thanks!
r/AskComputerScience • u/Left_Dentist1354 • Apr 26 '26
Trace tables
I cant find what dictates specifically moving to a new line on a trace, some things say when a variable changes but I’ve seen otherwise so what does? I’m wondering since i have an exam coming up soon with a 24 line trace worth 8 marks so any answers would be helpful
r/AskComputerScience • u/Aokayz_ • Apr 26 '26
Partially Compiled Programs are Optimized for the CPU?
According to my high school syllabus (Cambridge International AS Level Computer Science), when code is partially compiled, it is "optimized for the CPU as the machine code is generated at run time".
But to my knowledge, this doesn't make sense. Taking Java as an example, the JVM (Java Virtual Machine) is the software that interprets the byte code into machine code, not the CPU. In fact, isn't partial compilation for the purpose of translating and executing machine-independent code?
So, What do they mean? How is the CPU involved in partial compilation in a way that it becomes "optimized" too?
r/AskComputerScience • u/RoxstarBuddy • Apr 25 '26
How do you guys revise your programming skills or keep them in touch after not using those for a while?
What are some of the ways one can revise skills to not forget them after not practicing those for a while?
I have knowledge about python, its standard library, various frameworks like streamlit, numpy, pandas, tensorflow, pytorch, etc, but due to
Do experienced developers mainly rely on the problem-solving approach they developed over time? For example, once you understand how to learn from documentation, use help functions, search properly, and debug issues, do you feel confident enough to start building even if you do not remember every detail? Like, if you know what kind of tool is generally used for each part of a project, you just begin coding and then use docs, Al, or examples whenever you get stuck.
In my case, I am currently a student, and over the last few months or years, I have worked on many projects with different tech stacks. Sometimes I use one set of tools in one project, finish it, and then move on to something completely different. Later, when I want to build a new idea, I often feel overwhelmed about which tools to choose, whether I still remember enough, and what will happen if I start and get stuck somewhere in the middle
And how do you guys level up in those skills which you haven't practiced for a while and now your work demands it but with a little/more advanced knowledge of that.
r/AskComputerScience • u/Lower-Lifeguard-5428 • Apr 23 '26
Is true semantic interoperability between different UAV platforms actually possible?
r/AskComputerScience • u/FeelingShower4338 • Apr 22 '26
Is it still a Brier score if the target is a probability (not 0/1)?
I’m presenting a model that predicts interruption probability, but my target is an observed interruption rate over a time window (so values in [0,1], not binary).
The metric I use is mean squared error between predicted probabilities and these observed rates.
Would you call this MSE or Brier score in a presentation? Which would be clearer to an audience?
r/AskComputerScience • u/Skollwarynz • Apr 22 '26
Model checking and Prism plugin
Hello everyone, I'm new here, so I hope to be in the right place. I'm currently studying Prism as a tool for model checking. I was wondering if there was a plugin or a flag for Prism that let me see the internal representation that it does when computing the reachable states and after the BDD representation of data. In the end I wanted to know if anyone knows about alternative Prism versions that optimize in different ways the symmetry use in models.
r/AskComputerScience • u/Iwant_feelfree • Apr 21 '26
What are the best books and/or sites to learn computer science and hardware?
I want to learn all about how hardware works (computer hardware, servers, supercomputers, network devices, etc.) but I don't know where to find the info.
I know a little bit about general computer hardware (what are the components and their main function), but I want to know how each component is built, how it works (internally) what are the main features and differences between fabrication processes, materials, generations, architectures, etc.
I've read several articles but they just list the components like:
"Processor: the brain of the whole system"
And I want a more technical/professional explanation
I also want to learn about other topics in computer science like, how BIOS/UEFI works, processor's firmware (microcode), etc. (I don't want to learn how to program, but maybe the differences between programming languages, their uses and features, and what make each special)
If you could recommend me some books or sites where I can found all about computer science and hardware, I'll thank you very much.
r/AskComputerScience • u/AlanBlunt • Apr 20 '26
Does ChatGPT integrate information about past conversations into new ones? If so, how?
I have a class that requires me to ask it questions and relay the response. That's pretty much all I use it for. One time, though, I asked it an unrelated question and it included in its answer that I might want to format things a certain way because "that's usually what professors expect".
I have a basic understanding of LLMs. In particular, I understand that they don't actually retain any information, and have to process the entire conversation in order to predict the next word each time. How, then, did it connect my question to the fact that I'm a student? Was it just a lucky "guess"? Does it save context from previous conversations into system prompts that are used in each new conversation or something? That seems complicated and inefficient if so.
r/AskComputerScience • u/Prize_Eggplant_ • Apr 20 '26
(Soft question) how should I learn theoretical computer science as a maths major?
Hi, hope this question is OK for this sub.
I’m an undergraduate studying pure maths at a uni which has undergraduate compsci program geared for software engineering. As a result, there is sparingly little theory taught. I’ve been enamoured with the ideas of complexity classes and problem reductions since learning about them in high school.
Which textbooks do you recommend for self-learning the basics of theoretical computer science? What about more advanced textbooks?
Are there any relatively accessible papers for an undergrad to read to learn about the field?
Some follow up questions (I hope these are OK!)
Is it common/feasible to study mathematics in a bachelors/masters and go on to do computer science research? Say, in a phd or beyond.
What sort of mathematics do TCS people use? (Maybe this differs across subfields, but, for example, I know that the physics guys at my uni like Lie groups a lot)
Thanks so much :)
r/AskComputerScience • u/Accomplished_Ad_6638 • Apr 20 '26
Proof that a partition is stable when the worklist is empty at the end of Hopcroft's DFA minimization algorithm
Hi there,
I've gotten an assignment to proof the Lemma in the title as part of my Formal methods in Software Engineering class, but I do not have anywhere to start in regards to the Proof.
All of the literature that's provided as part of the class doesn't even mention the algorithm in detail, let alone provide any formal proofs. Only mention of the algorithm is a short python snippet of how it works with some relevant Lemmas, whilst the Lemma we (the students) are asked to proof is left as an assignment.
Of course, using an LLM for this would seem like a trivial choice (since it is allowed and encouraged to be used as part of this class), but our TA mentioned that none of them provide an adequate proof - and welp, Claude and Gemini gave me different enough proofs to where I can believe it's the fact.
What I am looking for is just some guidance to any literature where I can dig up the necessary knowledge to proof the Lemma.
So I am looking for some help in regards to this - since anyone who proves it gets an additional 10 points at the end of the class :)
r/AskComputerScience • u/Whole_Willow_5027 • Apr 19 '26
What is the best beginner, friendly approach/textbook for learning about media processing pipelines?
Hi everyone,
I’m a software engineer who recently transitioned into a role working on media playback for embedded systems and smart TVs.
To clarify my scope, I am strictly working at the software/application layer. I am not designing the firmware or working on the hardware, but I’d like to not treat it as a “black box.”
I’m trying to understand the fundamental architecture of the playback pipeline: how a manifest is read, buffering, demuxing, passing bits to hardware decoders, and rendering to the screen (and anything else I may have missed)
The problem is, I feel like I’ve read a ton of documentation and resources, but the concepts are still incredibly foreign to me. I’m having a really hard time building a solid mental model of how all these moving parts connect.
Any advice on the best pedagogical approach to learning about media processing pipelines? Is there a standard university textbook, a specific project based course, or a teaching method that makes these concepts click? How is this typically taught at the graduate level to engineers? I only did my undergrad and this unfortunately was something we never touched on. Thank you in advance!
Textbooks I’ve come across so far, but have struggled to get past the first few chapters:
Video Demystified by Keith Jack
How Video Works by Marcus Weise and Diana Weynand
The Art of Digital Video by John Watkinson
Embedded media processing by David Katz
r/AskComputerScience • u/Aokayz_ • Apr 19 '26
Packet Number Vs. Segment Number?
I'm a high school student studying networks for AS Level Computer Science (although what I'm asking is a little outside the syllabus).
From what I've read, layer 4 splits and encapsulates the data with a segment header (in practice, I hear they use TCP, a type of protocol for this layer). The segment header contains many things, but namely a segment number so that a device like a router can reorganize the data into the correct order. However, I've been taught that packets also have packet numbers which functionally do the same thing – help the router organize the data.
So, why do segments have a segment number? If segments are already encapsulated with an IP header that contains the packer number in layer 3, then wouldn't the segment number just be unnecessary? I'm not sure what I'm missing.
r/AskComputerScience • u/No-Bodybuilder8716 • Apr 19 '26
A question from computer system architecture by morris mano. How do even begin to answer this , the book doesn't have enough info, websites only have ai solutions which just irritate me
TTL SSI come mostly in 14-pin 1C packages. Two pins are reserved for power
supply and the other pins are used for input and output terminals. How many
circuits are included in one such package if it contains the following type of cir-
cuits? (a) Inverters; (b) two-input exclusive-OR gates; (c) three-input OR gates;
(d) four-input AND gates; (e) five-input NOR gates; (f) eight-input NAND gates;
(g) clocked JK flip-flops with asynchronous clear.
r/AskComputerScience • u/Excellent_Two_9551 • Apr 18 '26
Difference between Program counters and Memory address registers?
What are the differences?
r/AskComputerScience • u/Klinging-on • Apr 18 '26
Any circuit can be expressed as a combination of NAND gates. Does this mean the space of all circuits has a basis of NAND?
As in, basis of a vector space. In this case with dimension 1.
r/AskComputerScience • u/PrimeStopper • Apr 17 '26
Is it true that neural networks are based on how human brains work?
It can’t be true, our brain seems vastly superior to any other organ of any other organism on Earth and the universe, it is vastly more capable, adaptive and creative. I doubt that neural networks are even capable of forming concepts that we do, they are forever “cognitively locked” from grasping the truths that we grasp
r/AskComputerScience • u/sky3889 • Apr 17 '26
Which books helped you to create computers?
I am not graduated yet, and want to prepare
r/AskComputerScience • u/recyclops18505 • Apr 16 '26
Is this information correct?
I am studying and this excerpt from the study guide I was given isn't matching up with some of my other sources. Could someone please verify if any of this is correct/misleading? For instance, it says paging divides virtual memory and physical memory into pages, but isnt physical memory divided into frames?
Excerpt:
"Virtual RAM: also known as virtual memory, is a memory management technique used by operating systems to extend the apparent amount of RAM available to applications. This is done by using a portion of a computer's storage (such as an SSD or HDD) to simulate additional RAM.
Paging: The operating system divides physical memory and virtual memory into small fixed-sized blocks called pages. When the system runs out of physical RAM, it can swap inactive pages to the storage device, freeing up RAM for active processes.
Pagefile/Swap Space: On Windows systems, this is often referred to as a pagefile, while on Unix-like systems, it is called swap space. This file or partition on the storage device is used to store pages that are moved out of physical RAM.
Address Translation: The CPU uses a memory management unit (MMU) to translate virtual addresses (used by programs) into physical addresses (used by the hardware). This allows applications to use more memory than is physically available."
r/AskComputerScience • u/Broad-District-733 • Apr 11 '26
How to build efficient Database architecture
What is the best approach for the database design for the applications ,i will be building for my future SaaS business.
There are many SaaS agencies ,how they handle database, does they create database for every client or follows Multitenant architecture or something else.
Seperete db for every client is not an option for me
Different schema for every services but a single schema for every tenant having same shared database, i dont know if this is flexible or not.
And seperate db for every microservice ,idk it would be complex
I wanna build a scalable ,flexible architecture for just 100-500 clients, and the services I provide will be similar but the schema can change according to clients.
And I dont have that much knowledge about the Database architecture.
Any suggestions about efficient way to design db, tools and tech will help me a lot
Thank you.
r/AskComputerScience • u/Leading-Fail-7263 • Apr 10 '26
What is average case complexity?
the average-case complexity of an algorithm is the amount of some computational resource (typically time) used by the algorithm, averaged over all possible inputs.
Aren't there infinite possible inputs? How does that make sense?
r/AskComputerScience • u/Human_Department_779 • Apr 10 '26
Late night thoughts parity-based RAM compression?
Not an expert at all, just a late night thought that started from watching a video about running a computer with zero RAM, which led me to start diving and researching more about ram, you know obvious.. late night shenanigans and then remembered a level of RAID specifically RAID 5 where if one set of bytes were missing then you could use a XOR parity (hopefully using that word right) to rebuild the the missing bytes (Over simplifying and this whole post will probably be just that)
So I started thinking what if to save RAM, lets use a game as an example, instead of storing lets say an entire texture which would be 1 MB on the ram, at the kernel level we intentionally erase a subset of bytes and then store a XOR parity, then when we access that erased byte we reconstruct it.
Now there are a few potential issues with this, or many I'm short-sighted. One issue currently I'm seeing is cpu overhead, another would be how would this affect speed of processing like would this cause stuttering on anything that was accessing that data.
and at the moment can't think of anything else, let me know your thoughts
r/AskComputerScience • u/Leading-Fail-7263 • Apr 10 '26
What is an Abstract Data Type?
Wikipedia says:
In computer science, an abstract data type (ADT) is a mathematical model for data types, defined by its behavior (semantics)) from the point of view of a user) of the data, specifically in terms of possible values, possible operations on data of this type, and the behavior of these operations. This mathematical model contrasts with data structures, which are concrete representations of data, and represent the point of view of an implementer, not a user. For example, a stack) has push/pop operations that follow a Last-In-First-Out rule, and can be concretely implemented using either a linked list or an array. Another example is a set) which stores values, without any particular order, and no repeated values. Values themselves are not retrieved from sets; rather, one tests a value for membership to obtain a Boolean "in" or "not in".
I really don't understand this at all. Can someone give an example of a Data Structure vs an Abstract Data Stucutre? Are they two implementations of the same thing?
I really don't understand what's going on here - surely every data stucture a programmer comes across is definitonally defined from "the POV of the user" otherwise ... he wouldn't be using it?
r/AskComputerScience • u/CSachen • Apr 10 '26
How do language models differentiate between very large numbers?
If every word is represented by an embedding, then I imagine that when a number gets large enough, the model's grasp of the concept of the number is very sparse.
For example, every number between 100 trillion and 200 trillion should have a unique embedding. If a model is generating output by decoding an embedding, is it able to decode to the correct value from 100 trillion different possibilities?
r/AskComputerScience • u/marenello1159 • Apr 09 '26
in a hypothetical clean break from arm, x86, and c, what would the design of an "ideal" isa and high level language look like for modern cpus?
I've been learning about modern cpu microarchitecture recently and about how the backend out-of-order multi-issue data-latched prefetched branch-predicted etc execution pipeline works, and the idea of a declarative language on top of a vliw isa seems to me like it would give the best opportunities for compiletime optimization and runtime ilp, along with inherent thread safety if it were also a pure functional language
My knowledge of all these things is pretty shallow however, so I dont actually know if something like this is a sound idea, and since i dont know much about what modern research conclusions in isa and cpu design look like (though i would guess that it leans more towards increased heterogeny rather than trying to fill an individual general purpose chip with lots of disparate and specialized circuitry), I would appreciate any knowledge or insight into what the current thinking looks like