×

How do you guys inplement redundancy? by nordicJanissary in PLC

[–]desrtfx 0 points1 point  (0 children)

ABB AC800M

The absolutely easiest way to have proper redundancy. Zero configuration apart from making the controller redundant in Control Builder.

Struggling to grasp the basic fundamentals of Python. by kewday96 in learnprogramming

[–]desrtfx 4 points5 points  (0 children)

  1. Your code, as it is unformatted, is completely meaning and useless. Python code relies on indentation and once this is lost, the code becomes ambiguous. Reddit has code block formatting - use it.
  2. How would you have written it? Show it.
  3. The prompt tells exactly why the code was written in that particular way.
  4. What happens here is that the prompt calls for a helper function run_time to calculate the individual run time of a section. This helper function takes the distance, the minutes and the seconds and returns the run time
  5. Further, the prompt calls for another function that uses the helper function to calculate the total run time for multiple sections and returns that.

How would you write it differently?

And how do you know where to begin with writing a proper function that achieves the result?

This starts way before writing the function - at planning. You solve the task as you, the human would do it. You need to understand the inputs, calculation, and output. Once you have your solution, you can translate it in code.

Don't make the typical beginner mistake of trying to directly program your task. You will fail. Sit down with pencil and paper and work out a manual solution first. It also helps to learn to draw flow charts.

Yet, your questions at the bottom have actually nothing directly to do with Python, but with general programming. You have to do the same things for every programming language. Only the actual code, the implementation is different. The algorithm, the sequence of steps that needs to be executed, stays the same, regardless of language.

You don't fail at Python, you fail at programming.

Some books that might help:

  • "Think Like A Programmer" by V. Anton Spraul
  • "The Pragmatic Programmer" by Andrew Hunt and David Thomas
  • "Structure and Interpretation of Computer Programs" (SICP) by Ableton, Sussman, Sussman
  • "Code: The Hidden Language of Computer Hardware and Software" by Charles Petzold

New To Coding and Somethings Dont Make sense to me... by Amazing_Big4129 in learnprogramming

[–]desrtfx 0 points1 point  (0 children)

Next time, instead of using AI, refer to the official documentation - in your case from Microsoft. Learning to use the documentation is a vital skill for every aspiring programmer.

The documentation is always the ultimate reference point, not the output from some potentially hallucinating AI.

How to change Windows SID after clone? by Consistent_Damage824 in techsupport

[–]desrtfx 0 points1 point  (0 children)

Oh, that's new. Didn't know about that.

Thanks for the correction! Appreciate it.

How to change Windows SID after clone? by Consistent_Damage824 in techsupport

[–]desrtfx 0 points1 point  (0 children)

you are just going to run into issues with doing things like shared folder access.

Not even then. scratch that. See below

How to change Windows SID after clone? by Consistent_Damage824 in techsupport

[–]desrtfx 0 points1 point  (0 children)

The only time a duplicate machine SID would be a problem would be if you have two machines simultaneously on the same network using the same SID.

That hasn't been a problem for a very long time already.

The only problem is if the machines are connected to a WSUS server.

You seem to be confusing SID with MAC - duplicate MACs would definitely be a problem.

Duplicate Windows SIDs aren't.

How to change Windows SID after clone? by Consistent_Damage824 in techsupport

[–]desrtfx 1 point2 points  (0 children)

There is a nice little program out called SidChange - google it. It does exactly what it says.

Duplicate SIDs are not really a problem anymore apart from if you have a WSUS server from where the client updates.

Zero programming knowledge, but I want to learn Python. Where do I start in 2026? by Effective-Sorbet-133 in learnpython

[–]desrtfx 1 point2 points  (0 children)

MOOC Python Programming 2026 from the University of Helsinki - free, top quality, extremely practice heavy - sign up, log in, go to part 1 and start learning

What are some good interactive websites to learn Python 3? by Great-Pace-7122 in learnprogramming

[–]desrtfx 0 points1 point  (0 children)

MOOC Python Programming 2026 from the University of Helsinki - free, top quality, extremely practice heavy - sign up, log in, go to part 1 and start learning

George by [deleted] in learnjava

[–]desrtfx 1 point2 points  (0 children)

Employability?

There are far more Java jobs than Go ones.

Android apps?

Java is still the second native Android language (Kotlin is the main one)

Completely disregarding Python just because you think it is only for AI/ML is also a big mistake. Python is general purpose and a great addition to one's toolbox. It's much easier to write simple one-off scripts in Python than in anything else.

PNG output not existing by Task_force_delta in javahelp

[–]desrtfx 1 point2 points  (0 children)

Glad your issue is solved.

Don't take the next personal as I just want to point out some improvements and criticism on your code.

Why are you using such an extremely clumsy and convoluted approach to your colors when there is Color(int rgb)?

Your i already is a RGB value that holds exactly the color you are later assigning after all your hexstring follies. That is completely unnecessary.

You can reduce everything in your first for loop to a single statement: colorArr[i] = new Color(i);

The naming of your variables is horrible. Nobody will understand what you mean by firstNum, secondNum, thirdNum which you don't even use anywhere. This part alone should not be there.

When you work with coordinates as in your nested loop, use x and y or col and row for the loop variables.

Your xCount, yCount, and scaler should be constants - public static final variables in Java and should be declared at class level. They represent "magic numbers" and as such should always be constants.

Similar with the 256*256*256 that you repeatedly have in your code. That's simply the NUMBER_OF_RGB_COLORS and should also be a constant declared at class level. Then, this should be reused everywhere you need it.

What does this: char a = 's'; even do?

Your if hexString.length() chain, if you insist on it, should actually be a switch...case or, at least the hexString.length() should be stored in its own variable since you repeatedly use it. Every time you call the .length() method, it gets recalculated.

I've been programming for almost a year and I need help! by LetCommercial8689 in learnprogramming

[–]desrtfx 0 points1 point  (0 children)

You've got the entire internet at your fingertips. For your HTML, CSS you can replicate the looks of any website of your choice. With JavaScript, you can add dynamics. There are near infinite possibilities and you can't think of anything?

You don't have any ideas, any hobbies that could benefit from your skills?

Learning Java by wickedagileone in learnjava

[–]desrtfx[M] 0 points1 point  (0 children)

Unfortunately, the mobile app lacks in that matter. It is accessible, but not prominently visible and therefore people tend to ignore it.

Yet, same on desktop. Way too many people fail to find or read the sidebar, not only here, but also on /r/learnprogramming as the posts there indicate. They have some of the best wiki around, yet, people neither find, nor read it.

Stickied posts are also fairly useless. Barely anybody reads them. Worse, if the sub is sorted by "new", the stickied posts don't work (at least on "old reddit").

People come here to get direct answers, to get served and quite often spoon-fed. Most of these people are not used to do their own, individual research, due to their upbringing and schooling where they have to parrot repeat everything they are told. I don't even blame these people. It's in their culture, in their heritage, in their upbringing. They are not responsible.

Programming is, for quite a high number of them, an entirely different experience where their usual memorization technique doesn't work at all or with quite low effect. People are not even used to playing around, to trying, to experimenting. They do the exercises, if they can't solve them within a fairly short time, they resort to looking up the solutions, and a couple days/weeks later complain about not having learnt anything.

Struggling to learn the language by Stealurmurcry in learnpython

[–]desrtfx 0 points1 point  (0 children)

MOOC Python Programming 2026 from the University of Helsinki - free, top quality, extremely practice heavy - sign up, log in, go to part 1 and start learning

How do you practice problem solving without getting overwhelmed? by btwife_4k in learnprogramming

[–]desrtfx 1 point2 points  (0 children)

e.g. Exercism, Advent of Code - all the previous years challenges are available. Some are more algorithm/math heavy, some less.

Learning Java by wickedagileone in learnjava

[–]desrtfx[M] 1 point2 points  (0 children)

We had an Automoderator rule, but that triggered too many false positives and therefore, I've added the (!)sidebar (remove the parentheses) command to the Automod rules. Everybody can use that with the shebang. It's not limited to moderator accounts.

We've tried it with stickied posts, with the Automoderator rule, with just about everything. Nothing really helps.

C++ beginner here, my friend coded a function that I don't understand (involves recursion), I would like an explanation because that certain someone can't explain for their life. by [deleted] in learnprogramming

[–]desrtfx 0 points1 point  (0 children)

i just thought that returning forcefully ends everything. ty!!!

That would be a special case of recursion, called "tail call recursion optimization" - here, the recursion truly ends when the base case is reached, but there need to be certain circumstances where this works and the language itself must support tail call optimization.

"Normal" recursion works like the staircase I previously mentioned.

C++ beginner here, my friend coded a function that I don't understand (involves recursion), I would like an explanation because that certain someone can't explain for their life. by [deleted] in learnprogramming

[–]desrtfx 5 points6 points  (0 children)

You only have covered one part of the functions - the magic happens when you come back from the recursion.

You only went into the recursion down to the end condition, completely neglecting the code that happens after the recursive calls, the part starting with int i.

Once the recursion ends, the function continues at that line. Now, you have to evaluate what happens. Then, for the next level out, and so on.

You have to think about recursion as of a staircase. Every recursive call takes you one floor deeper. Every end of the recursion takes you only one floor back up, not the entire staircase.

_               _
 _             _
  _           _
   _         _
    _       _
     _     _
      _   _
       _ _
        _     Base case

how to fix fn locked keyboard via coding? by AppropriateLocal129 in learnprogramming

[–]desrtfx 0 points1 point  (0 children)

That sounds more like the keyboard has a NumLock key somewhere that is locked upon startup. The fn key is just a temporary thing to disable NumLock.

Check the driver of your keyboard or the system bios of your computer for a "NumLock" state.

A rant about the programming community (coming from a noob) by SargentDoom7404 in learnprogramming

[–]desrtfx 0 points1 point  (0 children)

I know nothing about playing music, and making a Minecraft mod is basically the equivalent of me going hey I want to play a riff or this song, but I don't know how to read sheet music, know what or where the notes are or how to play a guitar.

Well, it's not actually that much of a problem.

There are tabs that tell you what fret you have to put your finger on and what string to strike - that's basically what you need to know in order to at least play a riff - you only need to practice the positioning, timing, striking, and transitions. You do not even need to know where the notes are.

OP's comparison lacks in all aspects.

I know many guitar players who actually aren't that bad, but can absolutely not read sheet music, nor even know where the notes are, and some can't even recite the note names. They just mechanically know where to put their fingers.

Is it true that learning how to code is not a linear journey? by whiskyB0y in learnprogramming

[–]desrtfx 7 points8 points  (0 children)

Yes, this is true, but it's by far not limited to programming. Basically anything works that way.

Once you have a solid foundation, throw away the training wheels and start cycling.

Learn as you go is everywhere.

Learning Python quick and well by AdGeneral231 in learnprogramming

[–]desrtfx 5 points6 points  (0 children)

MOOC Python Programming 2026 from the University of Helsinki - free, top quality, extremely practice heavy - sign up, log in, go to part 1 and start learning

Rule no. 3 PLEASE HELP by EurogirlinOR in ModSupport

[–]desrtfx 2 points3 points  (0 children)

Don't worry. You don't have a red flag on your account.

As others have said: a user reported it for one reason or the other - some are just trolls, some do it to harm someone, etc.

As a moderator you have to stand above such. Report as report abuse and move on. That's it.

Rule no. 3 PLEASE HELP by EurogirlinOR in ModSupport

[–]desrtfx 2 points3 points  (0 children)

Go into the moderation log, find the post, bring it up, and then you can still report the report abuse and reinstate the post if you want.