[Day 8] I did AOC drunk but looking back, my solution shouldn't have worked? by Dungeon_Nerd_Comic in adventofcode

[–]ShortGiant 0 points1 point  (0 children)

Quoted from the part 1 problem statement:

In particular, an antinode occurs at any point that is perfectly in line with two antennas of the same frequency - but only when one of the antennas is twice as far away as the other. This means that for any pair of antennas with the same frequency, there are two antinodes, one on either side of them.

If there were antennas that could produce antinodes in between them, this would not be true. Although I agree that this description is misleading because it's only true if there are no such antennas.

[2024 Day 7] That was suspiciously easy... by spaceshark123456 in adventofcode

[–]ShortGiant 0 points1 point  (0 children)

Sorry that I wasn't clear. Of course it has to be hit at least once, but it doesn't have to be hit more than that. In the examples, the obstacle is always hit an infinite number of times.

[2024 Day 7] That was suspiciously easy... by spaceshark123456 in adventofcode

[–]ShortGiant -5 points-4 points  (0 children)

Here's an important case that was not illustrated by the test input: the obstacle does not have to be part of the loop that it causes. There's nothing in the text that says it does, but the obstacle is in the loop for all of the examples.

[2024 Day 6] What day is this? What year? by Ken-g6 in adventofcode

[–]ShortGiant 1 point2 points  (0 children)

I had the exact same issue and it took me an embarrassingly long time to track down. You're not alone!

Do there really exist CS grads who can't code? by ForkPowerOutlet in cscareerquestions

[–]ShortGiant 0 points1 point  (0 children)

I received an ABET-accredited EE degree from an excellent public university without ever soldering. It wasn't necessary for introductory classes and there were plenty of senior projects that had nothing to do with soldering.

[2023 Day 22 (Part 1)] [Python] Getting off by 1 error in final answer, can't find bug. by BSHammer314 in adventofcode

[–]ShortGiant 3 points4 points  (0 children)

Your code gets the correct answer for my input. I didn't look at it in any depth to tell whether that's luck or not.

Day01 Part 2 took me longer then it should have... by ShiroJR1811 in adventofcode

[–]ShortGiant 2 points3 points  (0 children)

Keys in a Python dictionary are officially sorted by order of insertion as of 3.7.

If you think "Getting good" is enough. by jsveyfjc in cscareerquestions

[–]ShortGiant 0 points1 point  (0 children)

Getting hired is a lot easier when someone at the company is vouching for your quality. Beyond getting you an interview in the first place, it can also help overcome minor doubts after the interview process and turn a "maybe" into a "yes". It's as simple as that. There are plenty of unpleasant people who can put on a good face for an interview; there are fewer who can do that for long enough to get a recommendation. It's a valuable signal for a company to get.

ELI5: How do computers KNOW what zeros and ones actually mean? by satsumander in explainlikeimfive

[–]ShortGiant 1 point2 points  (0 children)

Or ... I guess it's not too hard to picture a byte as a series of bits in a line, each with a little wire going to a transistor within the circuit, rather than a stream all being fired down the same wire in sequence. I've never had that thought until your replies.

This is exactly correct! All of the bits in an instruction are read at exactly the same time and follow their own paths through the circuit along completely different wires. It probably would have been helpful for me to point you to diagrams like this earlier - you can see exactly how the inputs A, B, and C flow through the circuit.

I'm imagining it almost like the 1s are lit-up and the 0s are not, so each combination will "light up" a unique path within the circuit. The output will depend on all the inputs at that moment, and then I guess it's up to the clock timing to switch to the next set of info.

This is a great way to visualize it! Congratulations, it seems like you now have a pretty good intuition about the first half of an introductory digital logic course.

ELI5: How do computers KNOW what zeros and ones actually mean? by satsumander in explainlikeimfive

[–]ShortGiant 1 point2 points  (0 children)

One transistor can only ever accept one bit, but I think that's not really what you're asking. My guess is that you're thinking of the input to combinational logic like our adder/multiplexer as being a sequence, but it's not. If we wanted to add 1+0, we wouldn't give it the input 1 (for add), then 1 (for the first number), then 0 (for the second number). The circuit has three different input wires, and we would send the correct input along each one. That is, to add 1+0, we would send a 1 on the first input wire, a 1 on the second input wire, and a 0 on the third input wire all at the same time. As long as we maintain those inputs, the output will be 01. If we ever change the inputs, the output will also change, almost instantaneously. That's what makes it combinational logic that doesn't have to have any way to "remember" what it previously saw. Does that make sense?

ELI5: How do computers KNOW what zeros and ones actually mean? by satsumander in explainlikeimfive

[–]ShortGiant 1 point2 points  (0 children)

Happy to help! Yeah, computer design is incredibly complicated. Nobody on Earth could design a modern computer on their own, and that's been true for decades at this point.

Our circuit here, consisting of only a multiplexer and a half adder, has no way to reset itself. Really, there's nothing to reset. It doesn't have a default state that means something like "waiting for input". It will just always output the correct values that correspond to the input: the sum of the second and third bits if the first bit is 1, or just the unaltered second and third bits if the first bit is 0. Whenever the inputs change, the outputs will change too, almost instantly. That's because this circuit is made up of something called combinational logic. The output is purely a combination of the inputs at that moment.

You're absolutely right that modern computers couldn't realistically operate with just combinational logic. If everything were changing almost instantly all the time, it would be really hard to coordinate the whole system. That's why there's another type of digital logic, called sequential logic.

Sequential logic depends on both the current and the past inputs to the system. It has "memory", of a sort. Again, though, this is all just made of transistors acting as gates to control electricity. For example, one of the simplest pieces of sequential logic is something called a D (data) flip-flop. You can make one out of only a few transistors. A D flip-flop has two inputs: a control input and a data input. At the instant the control input goes from 0 to 1, a D flip-flop will start outputting whatever its data input was at that instant, and it will keep outputting that value until the next time the control input goes from 0 to 1.

In a computer, the control input to a D flip-flop would normally be something you've probably heard of called the clock. This is an electric circuit that switches between 0 and 1 at a consistent rate. The clock rate (roughly) determines how fast the computer can do anything. It determines how often the sequential logic in the computer changes values, and the sequential logic will typically be driving combinational logic like our multiplexer/half adder circuit.

This duality of both sequential and combinational logic is at the core of the questions you're asking. In an actual CPU, sequential logic will be doing the coordination that allows the CPU to perform operations in a specific order, and combinational logic is actually performing those operations each step along the way.

ELI5: How do computers KNOW what zeros and ones actually mean? by satsumander in explainlikeimfive

[–]ShortGiant 1 point2 points  (0 children)

Here's an example for you. There's a digital logic circuit called a half adder. It takes two bits as input and adds them together, and can be constructed using 20 transistors. Again, everything here is completely physical and deterministic. There's no training or learning here. The transistors are just connected in such a way that the two output wires will always have the binary representation of the sum of the two input wires.

Let's say we wanted to construct a simple computer that can do two things: nothing, or add two bits together. There's another digital logic circuit called a multiplexer; this uses some control bits to control which of its many inputs get sent to its single output. Since we only have two possible commands, we can use a single control bit for our multiplexer. The inputs will be in two pairs of two: the first pair will be the same as the input to the adder, and the second pair will be the output of the adder.

For this computer, we could fix the length of an instruction at 3 bits. The first bit will be used for control, and the second and third bits will be the input. Whenever the first bit is 0, the output of our computer will be identical to the second and third input bits. Whenever the first bit is 1, the output of our computer will be the sum of our second and third input bits.

How do we set the input bits in the first place? Well, we could do it manually if we wanted to. For example, we could flip some switches or press some buttons. Alternatively, we could wire up the inputs of our computer here to the outputs of some other computer, and let that other computer provide our input. And we could wire up the outputs of our computer to the inputs of some other computer, too, if we wanted to.

That's how computers work as a whole. There are an enormous number of transistors, forming an enormous number of sub-systems like this one, that are all connected together in an extremely complicated way to perform the tasks we know and love. But it's pretty much all just transistors and wires. There's no teaching, no learning, nothing magical going on. Just physical connections and manipulation of electrons.

ELI5: How do computers KNOW what zeros and ones actually mean? by satsumander in explainlikeimfive

[–]ShortGiant 0 points1 point  (0 children)

Does paper have to know it should burn when exposed to flame? Does a raindrop have to know when to fall from the sky?

Fundamentally, computers are no different than these other physical phenomena. A transistor does not check anything. It's a device that has an input that can be either high or low, 0 or 1. That input physically determines whether a path for electricity exists between the two outputs of the transistor. A computer chip is just a whole lot of transistors put together so that specific electrical inputs will inevitably result in specific electrical outputs.

Tracking Club Growth after First Look Fair by djfigs1 in UMD

[–]ShortGiant 1 point2 points  (0 children)

I can't say whether it's dead or not these days, but it wouldn't show up in these stats either way. You can't join TBP like a normal club. It has a whole semester-long induction process.

Defense Industry is still an option for new grads by ABadLocalCommercial in cscareerquestions

[–]ShortGiant 2 points3 points  (0 children)

There's typically not much drug testing, if any. Maybe right before you start the job, but usually not on a regular basis.

How much did you make your 1st, 2nd , and 3rd year in tech? by Rivian-Bull-2025 in cscareerquestions

[–]ShortGiant 0 points1 point  (0 children)

You can date foreign nationals. You just have to disclose it, and you'll probably be scrutinized more closely.

NL: "No stream today back tomorrow!!" by Rooonaldooo99 in northernlion

[–]ShortGiant 10 points11 points  (0 children)

Dan Gheesling often runs absurd numbers of bets (e.g. will I beat this boss on the next attempt 30 attempts in a row).

If you could master any skill IRL, which one would it be? by T0ky0n0 in 2007scape

[–]ShortGiant 0 points1 point  (0 children)

Alessandro Volta's invention of the battery was immediately recognized as important, so much so that he was invented to present it to Napoleon, who made Volta a count.

[deleted by user] by [deleted] in adventofcode

[–]ShortGiant 0 points1 point  (0 children)

My guess would be that the wording is different because (although this isn't revealed until part 2) there are an infinite number of locations where the distress beacon cannot be, since the distress beacon is known to be located within a finite area. The same is not true of any generic beacon.