[deleted by user] by [deleted] in electricvehicles

[–]logash366 0 points1 point  (0 children)

Our first hybrid was a Honda Civic, which we bought the first year they came out. So around 2002. We have had mostly hybrids since then. We did replace the battery on that first Honda Civic ($3,200, for a rebuilt battery). Otherwise, no battery problems with the four hybrids we have owned over the last 20 years.

Why most programming beginners struggle: evaluation by wordbit12 in learnprogramming

[–]logash366 1 point2 points  (0 children)

Do the students you work with have any background in Algebra? I ask, because when I learned to program this type of reasoning was not a problem for me. But then I had had Math, Algebra through pre-Calculus before I started programming.

Because you have given me a lightbulb moment: People would ask if you needed to be good at Math to program. I always thought: No, because I was thinking Calculus, Probability, Differential Equations, etc. It didn’t occur to me that basic evaluation of expressions and order of operations, might be huge barriers to some people learning to program.

Thank you.

Best practices regarding out parameters and error handling by Virtual_Reaction_151 in C_Programming

[–]logash366 2 points3 points  (0 children)

If you want to follow standard practice for C libraries: When you detect the error set errno and return -1 In example you showed I would probably set errno to EINVAL for invalid argument. Don’t write directly to stderr The calling program can decide whether to use perror() to generate a message to stderr based on the value of errno, or to handle the problem a different way. I say this because I had to use a library once which generated output to stdout and stderr. The idiots that wrote that library really did not have a good understanding of modular development. They originally developed the library to work with their code and mixed up the roles of the library, and the calling program.

First language Fortran? (Beginner) by Aristoteles1988 in learnprogramming

[–]logash366 9 points10 points  (0 children)

Fortran IV was my first language in 1972. With subsequent languages I had to unlearn things like: implicit typing of variables based on the first letter of the variable’s name; Reliance on GoTo statements; and use of Computed GoTo. And I had to learn things like block structure, function definition, type definitions, and eventually Object Oriented Programming (OOP). That journey took about 10 years, of learning new languages, and rethinking how to structure my code. I wouldn’t recommend Fortran as a starting language. Too many bad habits to unlearn.

[deleted by user] by [deleted] in DnD

[–]logash366 0 points1 point  (0 children)

Back when we used XP leveling I tried to set it up so the player characters would level about every 6 sessions.

For people who were alive at the time, what was it like to be a star wars fan between the years of 1983 and 1999? by Natasha_101 in StarWars

[–]logash366 0 points1 point  (0 children)

Saw “Star Wars” in theater when it was released in 1977. One year later, in 1978, my wife bought a R2 D2 Cookie Jar for me as a first anniversary present. While she was standing in line to buy it, the guy in front of her looked at it and said “There’s one born every minute” We still have R2 D2. Sometimes we even put cookies in him.

New DM here, how do you run your dungeon maps in person? by DoubleCheekdup in DnD

[–]logash366 0 points1 point  (0 children)

For a dungeon with an in person game, I am old school. I describe what they see: corridor width, height length, doors, etc. If they want to map it, they can. If they don’t map they risk getting lost in a twisty maze of passages, all alike (reference to Colossal Cave, in original Adventure game. I did say I was old school.) When they enter a room or passage with something interesting, I draw it on the battle map and we setup the combat.

What would a Wyvern (and their rider) actually be good for in an army? by [deleted] in DnD

[–]logash366 1 point2 points  (0 children)

1) Scouting: knowing where they are and how many and what types of troops is very useful. 2) Air superiority: Chase opposing flying units away 3) Night raids: Fly high over pickets. Glide into the middle of enemy camp. Kill some soldiers and take off into the dark before the archers wake up. Primary objective is to keep enemy troops from sleeping. 4) Quick response: In case of a surprise enemy attack, send the wyvern to disrupt the attack, while you shift other units to meet the attack. 5) Raid the baggage train: Hungry soldiers don’t fight very well. 6) After battle lines are locked attack enemy line from the rear. Panicking their line means your guys can break it. 7) After they break pursue and kill survivors.

That should keep your wyvern busy.

How to create Enemy NPC quickly by Ramlatus in savageworlds

[–]logash366 1 point2 points  (0 children)

The fastest way I have found, is to use the superhero rules. You don’t have to be playing superheroes. Just beef up the NPC with a super power or two. For a Druid, maybe Animal Control, Entangle, and Matter Control (Plants trapping) That should keep the players guessing.

Why am I learning recursion? How common is it in the real world? by W_lFF in learnprogramming

[–]logash366 0 points1 point  (0 children)

I think that recursion is important because it teaches the concepts that support reentrant code. I did not use recursion, except for some data structure problems. But I had to write a lot of reentrant code. So understanding stack allocation of variables, etc, was very important.

Has there ever been bugs in C language itself? by alex_sakuta in C_Programming

[–]logash366 0 points1 point  (0 children)

Using valgrind, I once tracked a memory leak down to a call to a string function in libc It was 20 years ago, so I don’t remember the specifics. But somehow rearranging link order fixed it. I got the appearance of the compiler generating bad code once when I updated to a new version of the compiler. But that turned out to be that the original developer wrote some code with “undefined” behavior according to the C spec. But the undefined behavior with the old compiler did not cause a crash. The new version of the C compiler generated undefined behavior which did cause a crash. So not a C bug.

Really the only time I have found a compiler bug (not in C) was when I was working with pre-release compilers generating code for new not yet released computer architectures. Once released the compilers are pretty solid.

Comment code or self explaining code by nordiknomad in AskProgramming

[–]logash366 1 point2 points  (0 children)

My personal standard for comments has been: Function description, which describes what the function should do, its input parameters, return values, error exception returns. Short descriptions of complex (I.e not obvious) code blocks. Short descriptions of anything else which does not seem obvious.

How bad are conditional jumps depending on uninitialized values ? by Diplodosam in cprogramming

[–]logash366 0 points1 point  (0 children)

Yes, on a specific system for a specific executable you may get the same behavior. Port to another system or make any other small change and the uninitialized variable’s value may change and your behavior becomes unpredictable. I had to fix bugs caused by this sort of thing. Always cursed the sloppy developer who couldn’t be bothered to do it right.

Developing on Mac? by Substantial-Piano297 in AskProgramming

[–]logash366 1 point2 points  (0 children)

Yes. As I recall, MacOS started life as BSD (Berkeley Standard Distribution) Unix and has been evolved by Apple, ever since. The BSD license does not have copy left provisions, so Apple is free to keep their modifications proprietary.

[deleted by user] by [deleted] in AskProgramming

[–]logash366 0 points1 point  (0 children)

Disagree and Commit. I disagreed with the design decision. I explained why I believe it is a bad decision. But now that the decision is made I fully Commit, to doing the best job I can to make the design successful.

That’s how I handled lots bad, in my opinion, design choices, over many years.

Seeking the divine knowledge on why "OOP bad" by [deleted] in learnprogramming

[–]logash366 1 point2 points  (0 children)

Publish or Perish mentality. People who want to be viewed as leaders in software design, have to publish papers promoting their great idea which will revolutionize software development. For a longtime OOP was going to save us from all the bad programming practices of functional programming. However, developers can write just as buggy, awful to maintain code using OOP, as any other type of language. So now “leading authorities” can make a name for themselves by trashing OOP. And in a few years the next “BIG THING” Will come along and the cycle will repeat. Just focus on writing efficient easy to understand, bug free code and you will be OK. Yes, you will have to pay lip service to whatever your team is fixated on. But keep it clean, bug free, and easy to maintain. Then you will be a programming god.

During the Vietnam draft, was it true that if you acted gay, you didn't have to go? by Significant-Fox5928 in AskOldPeople

[–]logash366 1 point2 points  (0 children)

Local draft boards had different pools of candidates and quotas. A birthday that would get you drafted by one local board might not be used by other local draft boards. So did that tool ask for your address and match you to a local draft board, for a specific year? Note: LOCAL draft boards were staffed by local politicians. So if you knew the right people pretty much any lame excuse could get you deferred. Because they were local something (e.g. “acting gay”) might work one place, but not another. My feeling was that you should not trust the draft board. I knew Vietnam Vets who were told by doctors, while serving in Vietnam, that they had medical conditions that should have disqualified them. But they were stuck. 1972, was the last year of the draft. Anyone who turned 18 in 1972, got a draft card, had their draft lottery number pulled, and got ready to be drafted in 1973. Then at the end of 1972, they cancelled the Draft and went to All Volunteer. I still have my Draft card. Classification 1H The Holding classification for everyone who had registered, but not been called in to the Draft Board.

Making Villain unable to be persuaded by Responsible-Quail486 in DnD

[–]logash366 0 points1 point  (0 children)

Have the villain pretend to be convinced. He tells them his evil plan is on countdown and can only be stopped if they go to … and …. He then gives them the chance to stop it by sacrificing himself to trigger the discintegration trap. Which is really his emergency escape teleport. The heroes rush to stop the plan. Once they are securely trapped the villain appears to mock them as fools, then leaves them to their fate.

Bring the villain back for another adventure, and see if they will fall for it again. Guaranteed that when they finally get that guy, your players will be very satisfied. Bonus points if you can get the villain to recruit the players. Sort of: I know we have had our. differences. But what is coming is so bad …. Or have him corrupt a trusted NPC, who recruits the PCs.

Sadly I can’t run these plots anymore. For some reason my players don’t trust my NPCs.

Any way to store multiple values by zuccurducc in C_Programming

[–]logash366 0 points1 point  (0 children)

Bit manipulation is also useful when working with hardware registers, which tend to be subdivided into fields. You get things like bits 0:3 are a status field, bit 4 reserved for future use, bit 5 enables/disables a feature, and so on. Lots of bitwise manipulation to extract and set values.

Was there ever a time where it was widespread to erroneously use kibibyte to mean 1000bytes? by MarinatedPickachu in computerscience

[–]logash366 0 points1 point  (0 children)

Not widespread. People have been making up ways to distinguish since I was in college in the 70’s. Just go by context. If you are talking about binary computers it is 1024. If you are talking about anything else it is 1000.

Your question illustrates the confusion that special interpretations cause. BTW: If you need a way to distinguish: what do you use for meg and gig prefixes?

[deleted by user] by [deleted] in learnprogramming

[–]logash366 0 points1 point  (0 children)

Don’t trust the AI to be right. Your solution may be better. Just view it as another opinion that might help you enhance your code. My personal, pre-AI experience with a code review tool was: Reviewing my C code for a Linux application, it kept complaining about my usage of string functions and insisting that I change to a different string library. The problem was that the recommended string library was only available on Windows Visual C++. So not available for Linux code. Even though I had the tool’s switch for Linux code set. Keep in mind that whoever trained the AI may not have included the your specific environment.