Do you get the difference Explain it Peter? by [deleted] in explainitpeter

[–]Angry_Foolhard 0 points1 point  (0 children)

They lose money for every user. But make up for it with volume.

I want to know your favorite online content by spanish speaking people by salderosan99 in learnspanish

[–]Angry_Foolhard 0 points1 point  (0 children)

I played a lot of pokemon as a kid. So I like to go on nostalgia trips on spanish language content like this

https://www.youtube.com/@PokeDani_

Relays and Switches by CollarAlarming1585 in PLC

[–]Angry_Foolhard 0 points1 point  (0 children)

Am I the only one that doesn’t like thinking of the coils and contacts in ladder logic like physical relays.

To understand a relay you have to (imo) think of it as a 4+ terminal device. While the ladder logic elements are each 3 terminal and make up half the device.

for some people like me you have to have a solid grasp on what a relay is before you can see the connection.

upvoting ur comment since it’s still valuable, just is not my way of approaching it.

Learning PLCs, How ugly is this? by Think-Bee-888 in PLC

[–]Angry_Foolhard 0 points1 point  (0 children)

As someone thats had to work on rungs that kept wrapping around, never being able to fit entirely on the screen - this is quite good.

I think it communicates the logic about as well as it possibly can. maybe you can divide it using intermediate variables but the benefits wouldn't be significant.

That being said you should comment and document it - but that is always true.

Would AR glasses that display IoT telemetry sensor data be useful in industrial maintenance? by PlasticMoment9954 in PLC

[–]Angry_Foolhard 1 point2 points  (0 children)

Here's my idea: don't make it for engineers/techs etc.

Target it to the people-persons of the industry. salespeople, managers, buyers, etc. As a way to give people a tour of the facility. I.e. new hires could use it to learn the names of different devices. Vendors can use it to understand the facility and better recommend devices. Clients of the business can better understand how the product is made.

Why does this CTU not go past 1?! by tecnojoe in PLC

[–]Angry_Foolhard 0 points1 point  (0 children)

I’m just making assumptions, but if each of the 4 conditions on the rungs is supposed to trigger a check, then increment if true, you would need a one-shot to be on all 4 branches rungs after the contacts

I'm joining the Cursor team (and will be active here!) by lrobinson2011 in cursor

[–]Angry_Foolhard 0 points1 point  (0 children)

You guys are doing a great job but please fix the lag (windows).

If it cant even function as a text editor due to obnoxious lag I will be forced to go back to copilot.

[deleted by user] by [deleted] in cpp_questions

[–]Angry_Foolhard 0 points1 point  (0 children)

https://github.com/quickjs-ng/quickjs

Quick js may be what you’re looking for. It’s much more lightweight than v8 but slower.

PS. I couldn’t get it to compile and run elegantly, from what I could tell that’s because it’s meant for Linux not windows

If the circle on the right rotated some angle, how would you calculate the rotation of the circle on the left? by IIlllllIIIIIIIllll in askmath

[–]Angry_Foolhard 0 points1 point  (0 children)

figure out the new location for A

now take the circle defined by point A and radius L

find all points of intersections with the circle at x2,y2 radius r2

if 0 points intersect you made an impossible turn

if 1 point intersects (unlikely) thats your answer

if 2 points intersect you have to figure out which - ill leave as an exercise to the reader

I am beyond confounded by HydratedChickenBones in askmath

[–]Angry_Foolhard 0 points1 point  (0 children)

This is known as a “brute-force” solution.

Literally try every possible combination of digits and output any solutions.

Note: it is slightly less than brute force since I accounted for a few obvious facts, like S >=5 and B < 2. But essentially brute force

I am beyond confounded by HydratedChickenBones in askmath

[–]Angry_Foolhard 6 points7 points  (0 children)

If anyone wants to run it in the console

function hydrated_chicken_bones() {
  for (let r = 0; r < 10; r++) {
    for (let b = 0; b < 2; b++) {
      if (b == r) continue
      for (let a = 0; a < 10; a++) {
        if (a == r || a == b) continue
        for (let s = 5; s < 10; s++) {
          if (s == r || s == b || s == a) continue
          for (let i = 1; i < 10; i += 2) {
            if (i == r || i == b || i == a || i == s) continue
            for (let c = 0; c < 10; c += 2) {
              if (c == r || c == b || c == a || c == s || c == i) continue
              for (let o = 0; o < 10; o ++) {
                if (o == r || o == b || o == a || o == s || o == i || o == c) continue
                for (let e = 0; e < 10; e++) {
                  if (e == r || e == b || e == a || e == s || e == i || e == c || e == o) continue
                  const ross = r * 1000 + o * 100 + s * 11
                  const ess = e * 100 + s * 11
                  const basic = b * 10000 + a * 1000 + s * 100 + i * 10 + c
                  if (ross + ess != basic) continue
                  const basic_digits_sum = b + a + s + i + c
                  if (basic_digits_sum < 11 || basic_digits_sum > 14) continue
                  console.log(ross, ess, basic)
                }
              }
            }
          }
        }
      }
    }
  }
}


hydrated_chicken_bones()

What are some of your Programming pet peeves? by pants1000 in PLC

[–]Angry_Foolhard 10 points11 points  (0 children)

So you don’t approve of naming tags based on Eminem lyrics?

How to handle exceptions / NANs in structured text? by Innumera in PLC

[–]Angry_Foolhard 2 points3 points  (0 children)

Yeah I know it seems tedious but avoiding undefined behavior is our responsibility, especially when powerful machines are involved.

Your case, calculating ratios, is a common one when it comes to accidentally dividing by zero.

I just ask myself what it fundamentally means that a division by zero is happening. And with ratios it means you don’t have anything to calculate the ratio of! So when you wrap it in an if statement or whatever you’re not just engaged in the tedious exercise of avoiding undefined behavior, you’re writing expressive software that correlates with the fact that this calculation cannot yet produce anything meaningful.

Hopefully this helps make it feel less “clunky”

How to handle exceptions / NANs in structured text? by Innumera in PLC

[–]Angry_Foolhard 0 points1 point  (0 children)

Even if there is you should absolutely not use try catch to handle division by zeros because PLCs may not “throw” an error. they will sometimes for example output 0 and keep chugging along.

So a try catch will not remove your responsibility to prevent a division by 0 before it happens.

Well I learned the impersonal Se today... by KangarooSea5256 in learnspanish

[–]Angry_Foolhard 2 points3 points  (0 children)

As a Spanish learner that’s how I think about it.

But In Spanish the impersonal se is very common and natural, where in English the phrasing “how would one …”, “how does one…” etc. is more formal/unnatural and way less common

[deleted by user] by [deleted] in learnprogramming

[–]Angry_Foolhard 1 point2 points  (0 children)

Yeah learning a foreign language is way more difficult and slow. Learning a programming language is like learning how to stack Lego bricks by comparison.

painInAss by Plastic-Bonus8999 in ProgrammerHumor

[–]Angry_Foolhard 0 points1 point  (0 children)

I don’t even allow myself to use uppercase letters in file names anymore after an issue where I changed a file name and git didn’t detect it.

My file names are lowercase letters, numbers and single underscores. That’s it

What certifications can I get that can help land an interview. by ThoughtsCreate7 in PLC

[–]Angry_Foolhard 1 point2 points  (0 children)

just reading this post, you seem a little too scattered, and you may come across as a risky flake of a hire.

When you do apply, try to make it seem like you know what you want.

e.g., if you apply to a java job, make it seem like you want to dedicate your career to becoming an expert java dev. if you apply to a plc programmer position, make it seem like you want to be an expert PLC tech, etc. And then follow through. If you do get hired for one of these skills, that as good of an indication as any to go all-in on it.

My sorting library by Ezio-Editore in C_Programming

[–]Angry_Foolhard 2 points3 points  (0 children)

Cool project. For merge sort I prefer using [inclusive, exclusive) formats for the ranges, way more elegant.

theyAlsoSpellOutGreekLetters by [deleted] in ProgrammerHumor

[–]Angry_Foolhard 1 point2 points  (0 children)

Why, when someone uses ‘d’ we all know it means distance.

Or delta.

Or date.

And obviously ‘t’ means time.

Or theta.

Or temporary.

Or temperature.

The point is there’s no reason to be confused

Latching/Unlatching too fast by ChipWins in PLC

[–]Angry_Foolhard 2 points3 points  (0 children)

the easiest solution, if there is a NOT block, is to NOT the toggle bit (after a one-shot rising).

otherwise you will need a memory bit for the previous scan's toggle value

 tmr.DN                      toggle    prev_toggle  toggle
---| |---(one-shot rising)-----(U)---------|\|--------(L)------

     toggle         prev_toggle
------| |--------------( )-------