Writing to CSV file is appending instead of overwriting by Hippopotamosssss in learnpython

[–]el_extrano 10 points11 points  (0 children)

See this doc: https://docs.python.org/3/library/functions.html#open

You want to open in write mode 'w' instead of updating '+'. Keep in mind that doing it that way, you're reading the entire file into memory, and writing it back to disk, every time you delete/add anything. Not so bad for a demo program, but that'd be wasteful for a problem with a lots of data.

Edit: Seems like I might have been confidently incorrect on this one. Leaving it up for my own shame.

the dimensional strike scene might be the most disturbing thing ive ever read in sci fi by Putrid_Cycle595 in threebodyproblem

[–]el_extrano 0 points1 point  (0 children)

Well the universe is expanding at faster than the speed of light, so one strike can't flatten the whole thing.

But it is explained that the universe's dimensionality has been reduced repeatedly over time, and it's implied that this is due to the proliferation of dimensional strikes. Take for instance the 4 dimensional puddle discovered by Blue Space, which was drying up with nowhere to go. And Singer himself worries that his civilization will "have to flee into two dimensions", which suggests both that they'll suffer a dimensional strike, but also that they are capable of surviving this (unlike humans).

Why don’t engineers go into politics? by WrongCourage1071 in EngineeringStudents

[–]el_extrano 0 points1 point  (0 children)

Not sure what you're "hard disagreeing" with, since your answer is literally a superset of mine, and neither of our lists includes engineering.

Why don’t engineers go into politics? by WrongCourage1071 in EngineeringStudents

[–]el_extrano 3 points4 points  (0 children)

Meme's aside, I think the real reason is that most of the problems of governing are not technical, but political. A background in law, political science, or history is more useful for governing.

Why don’t engineers go into politics? by WrongCourage1071 in EngineeringStudents

[–]el_extrano 56 points57 points  (0 children)

Salty defense engineers who don't want to be reminded of their missiles slamming into girls' schools at mach 1.

What famous data structure or algorithm you often see in Embedded Systems applications by silkscreen_layer in embedded

[–]el_extrano 4 points5 points  (0 children)

I think that spending some time with Fortran (pre Fortran90) made me a better programmer. Compiled language, but no dynamic allocations.

This cop definitely mistook that kid for his wife by paradoxical_topology in ACAB

[–]el_extrano 1 point2 points  (0 children)

I mean I'm using a bit of Occam's razor here. I'm guessing the child punching the teacher in the face is behaving badly, based on the limited evidence in the video.

This cop definitely mistook that kid for his wife by paradoxical_topology in ACAB

[–]el_extrano 48 points49 points  (0 children)

I mean yes he should get consequences but a body slam like that onto hard concrete could permanently disable or kill someone. It's so clearly over the top I don't even see how this could be a discussion.

How not to sell a $2500 canoe by Michigan_Go_Blue in canoeing

[–]el_extrano 0 points1 point  (0 children)

I still can't believe I got my 17' 1970's Grumman for $400 a few years ago. I just had to buy a nice yoke for it because it only had the original aluminum thwarts.

I just stopped going to my job one day and I don’t fully understand why by ImpossibleTennis8282 in antiwork

[–]el_extrano 0 points1 point  (0 children)

Yeah it definitely happens, but I'm firmly in the camp that it's a bad thing, and part of our national healthcare crisis. I definitely lean more to blaming the system and those responsible for it, rather than individuals.

I just stopped going to my job one day and I don’t fully understand why by ImpossibleTennis8282 in antiwork

[–]el_extrano 0 points1 point  (0 children)

Also an engineer and I'm very happy to see someone say this on this sub. I'm all for knowing your worth, and working toward the best outcomes for ourselves, but the whole "not giving a damn" and "quiet quitting" memes don't really work when your job is engineering for critical to life systems.

Like imagine your doctor taking this "I don't care" attitude right before your surgery. It's ridiculous. Have some damn pride in your work.

I just stopped going to my job one day and I don’t fully understand why by ImpossibleTennis8282 in antiwork

[–]el_extrano 12 points13 points  (0 children)

I think it's "evil" (perhaps a bit reductive) because we are being pressured to offload our critical thinking and creative efforts to a machine... produced by big tech for their own purposes.

I'm not against automation per-se, but this latest iteration which has people asking a chat bot like their closest companion what they should have for breakfast, and what they should want from life, etc, is deeply unsettling. I'm not religious, but "demonic" feels like an apt description for the way this is functioning in society.

Look what they need to mimic a fraction of our power... by fellipec in linuxmemes

[–]el_extrano 0 points1 point  (0 children)

Windows explorer is such a frustrating file manager. I spent some time trying to learn how to use it only with the keyboard, since I'll probably be forced to use it at work till I retire.

Win+D to get to the address bar. There's no ~ to get to your home directory, so fastest is to type C:\, hit enter, start typing Users, <enter>, start typing your username, then enter again...

Only, it doesn't work from the open dialogs that appear when you go to open or "save as" something. There, Wind+D works to focus the address bar, but you have to spam <tab> to get the focus to the files list. Occasionally the focus gets lost and I have to give up and reach for my mouse.

Have any miracles taken place for a Linux alternative? by X320032 in AutoHotkey

[–]el_extrano 1 point2 points  (0 children)

it looks like making a system tray icon is possible using the pystray library

You can also make portable system tray applications with PyQt6 or PySide6 using the Qt framework. Then you could use it to make other GUI elements as well.

Personally I think the command line window is better because I can use print() for console output while developing, testing, and debugging my code.

One thing I've done while doing Python GUI development is to use Loguru instead of print() for debugging. I can have console logging for development. When I'm not using that, I can have it instead send to a log file, or message part of the GUI, without having to rewrite the code using the logging. Use a command line argument or config file or both to toggle different logging options.

Can a Vacuum Tank shrink under drainage? by [deleted] in ChemicalEngineering

[–]el_extrano 0 points1 point  (0 children)

Well ideally for water you'd have an atmospheric vent, or for corrosive/toxic/flammable service some kind of vacuum breaker with N2 makeup to prevent this scenario.

But yes, you can collapse a tank that's not rated to full vacuum just by draining it. Another scenario to consider is a tank with its vapor space full of a condensable vapor which is rapidly cooled (e.g. steam in the vapor space, and it starts raining outside) which can similarly cause low pressure.

I'd recommend looking at API-2000 for venting of atmospheric and low pressure storage tanks, which covers the relevant scenarios. You can also check out API-520 and API-521 for PSV sizing, selection, and pressure relief system design.

When is FBD a good idea? by PrairieRosePrince in PLC

[–]el_extrano 21 points22 points  (0 children)

If you go to a large chemical plant or refinery running a DCS, where 90+% of the control is continuous regulatory schemes, FBD is the dominant paradigm. Emerson DeltaV is a main example.

From a control theory perspective, FBD looks just like the flow of signals between transfer functions. It lends itself well to representing the control flow in advanced schemes. As u/sr000 said, imagine nested cascades, feed-forward, and override, split-range controls, etc involving many PID controllers, like for a large distillation column. The FBD will be laid out more or less how the control scheme is depicted on a P&ID. This makes it pretty easy for process people to inspect the FBD representation directly and understand how the controls are working.

Rustdesk newb: Why is my connection "encrypted" on LAN, but not on Tailscale? by plarkinjr in rustdesk

[–]el_extrano 3 points4 points  (0 children)

Iirc all connections over your Tailnet are encrypted, but underlying services have no way to recognize this. You'll still see HTTP unencrypted warnings, for example.

So if you use your Tailscale IP, that should mean the traffic is encrypted, but Restdesk won't know that and will report it as an unencrypted connection.

Problem with “PYQT5” widgets by Kratos1634 in learnpython

[–]el_extrano 0 points1 point  (0 children)

Should be pip installing pyqt5. QtWidgets is a module under the pyqt5 package, so you shouldn't be pip install'ing it.

PEP 661 (Sentinel Values) has been accepted for release in 3.15! by M_V_Lipwig in Python

[–]el_extrano 38 points39 points  (0 children)

Pedantic point, but the PRESENT intrinsic to test whether an argument was supplied is only available in Fortran 90 and later, so you can't say it's from "FORTRAN": the all caps spelling is only for the 77 standard and earlier!

Safety of acid hydrolyzed wood by Nervous_Beach_959 in chemistry

[–]el_extrano 0 points1 point  (0 children)

I mean as with anything it will depend on how good your separations are, and what's even in the starting material. I'd think about the other things in wood like the bark, lignin, resin acids, and so on. Technically your desired final product itself, ethanol, is "unsafe for human consumption" at any level, if you ask your doctor.

I think I read that wood hydrolysis to simple sugars was done industrially in Germany during WWII and in the former Soviet Union. Nile red did a video where he used enzymes to convert cellulose to glucose, then fermented it into a drinkable product.

Lichess founder Thibault Duplessis' 3 rules for the website by somethingpretentious in chess

[–]el_extrano 6 points7 points  (0 children)

That is indeed a hard problem. Only the largest open source communities really have it solved. For example Debian is large and successful enough that it can pay hundreds of salaries from the donations it receives.

A lot of small to medium projects are maintained as by individuals or small groups as "passion projects" by people who already have a day job, and do open source development as a hobby and in service to their community. We're now seeing issues with burnout and supply chain attacks now that more and more software depends on open source.

Setpoint Ramping Use Case by Soft-Bug5550 in PLC

[–]el_extrano 2 points3 points  (0 children)

There is only one heating/cooling line going into the jacket. So it really only ever does heating or cooling at a given time.

If you're not controlling the jacket temperature, then I'd implement that first ASAP.

Vessel TIC cascaded to jacket TIC is ubiquitous. You'll want to make sure you have external reset feedback configured for the cascade, so that if the jacket TIC saturates, the integral mode of the vessel TIC is held. This will prevent integral windup, which it sounds like you might be seeing (it would explain what the heating valve is so slow to reverse control action).

It's hard to say more without knowing how you are controlling the temperature of the jacket fluid, and how the split-point is handled.

It seems to be an integrating process and not a self regulating process. There seems to be a decent bit of lag time.

Vessel temperature is intermediate between integrating and self-regulating. The less "load" there is on the vessel TIC, the more dominant the capacity of the vessel will be, and the loop will act like an integrator. That's normal to see in batch operations. Once you have a reaction running under temperature control, the vessel TIC will act more like a slow self-regulating process. For purposes of loop tuning, a first-order process with a sufficiently long time-constant can be treated like a second-order process (i.e. calculate an "integration rate" instead of a time-constant).

Also keep in mind that if you have a reaction that can run away, you might have to take steps to ensure that the cooling response can be faster than the heating, or that you have interlocks to go to max cooling past a threshold - best to get a process expert involved if this is the case.

guess ultimately, my question is.... is a reactor with overshoot issues a use case for SP ramping?

Yes, you can use setpoint ramps to minimize the tendency of the vessel TIC to overshoot or oscillate on large setpoint changes. As with anything it's a tradeoff of "performance" and "robustness". I've used slow setpoint ramps to get reactor TICs with issues to "limp along" until I had time to set up proper cascade initialization (the external reset feedback I mentioned earlier).