|
I forgot to wait an hour ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Yes, and had you waited that hour ...
... I still wouldn't have beaten you to the answer (because I didn't look at it until 3:30 London time). But! I did solve it! In the last 2 or 3 weeks I have solved 2 and been very close on 2 others. As my Aussie friends would say I'm feeling a bit chuffed with myself right about now.
|
|
|
|
|
How many of you (that program in JavaScript or similar) know what this line is:
const {Pass, Fail, NA, NO} = changes;
and could be used like this:
if (Pass || Fail || NA || NO) {...do something...}
If not, can you guess, knowing that changes is an object:
const changes = { Pass: 1, Fail: 0, NA: 0, NO:0 };
?
If you're still clueless, like I was, it's called "destructuring[^]".
So I'm just curious, because like I said, I knew about this, forget about it because it's rather arcane IMO, and just got reminded about it again.
|
|
|
|
|
I use it every day. I don’t know what would be of my life without it.
Also, we already know part of changes.
const { Pass, Fail, NA, NO } = changes;
the above hint us that changes may have the following fields Pass, Fail, NA, NO
|
|
|
|
|
smells like a dictionary met an enum on a dark night
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
|
|
|
|
|
...and unholy and unspeakable acts followed.
cheers
Chris Maunder
|
|
|
|
|
Looks a bit like they got the idea from Python.
|
|
|
|
|
Richard MacCutchan wrote: Looks a bit like they got the idea from Python.
As in, Monty. As a joke.
|
|
|
|
|
It's actually quite handy, but it also leads one down the "I can use it so I shall" path, rather than the "This is the most readable, maintainable way to write"
If everyone working on the code is good to go, it's great. But there's many devs who don't know, or forget, or get it mixed up.
...like a lot of "convenient" syntax these days.
There's a point where a syntax becomes so specialised / esoteric that the savings from less keystrokes, less code to maintain, more lines per screen are outweighed by the costs to hire more senior developers and the time taken for non-experts to get up to speed on that syntax.
Everything's become so engineer focused lately. What about those who have to pay salaries, or maintain some uber-dev's code, or what about focusing on stability and the user experience rather than the elite factor.
cheers
Chris Maunder
|
|
|
|
|
And I am sure that intellisense will stop a JavaScript nube from messing up.
|
|
|
|
|
If you buy a new power supply, it may come with an "eco switch". This switch regrettably ships in the on position.
I spent about $200 and a day and a half of labor trying to find an overheating issue before I turned that switch off and solved all of my problems.
Here's what it does - it turns the PSU fan off. That's it. Ostensibly it's supposed to kick in when it needs it.
Clearly they don't. My machine was hard turning off after a time under moderate to heavy GPU load.
I had to flip the power switch on the PSU in the back off and back on again before the power switch on the front of the chassis would work. That should have been my clue that it was either the mobo or the PSU. And previously (without the GPU) the mobo worked fine. The PSU was new with the GPU out of necessity.
Anyway, I wanted to let you all know about this in case you build a system these days. That eco mode switch may actually damage your equipment. Turn it off.
To err is human. Fortune favors the monsters.
|
|
|
|
|
We have a bunch of 2 year old desktops at work. Occasionally they get “stuck” and you have to unplug them for at least 30 seconds to reset them. I may pop a case and look for a setting like that on the power switch.
|
|
|
|
|
On mine it was a smaller switch right next to the regular power switch.
To err is human. Fortune favors the monsters.
|
|
|
|
|
Thank you, grazie, danke schon, mercì, gracias, domo arigato.
GCS d--(d-) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
Now I have this crazy idea to pilot the switch based on some parameters (i.e. CPU load, GPU load, some named process running). Do you know if that button is also ACPI / BIOS / something driven? Could even be useful.
In my el-cheapo ITEK case I have a manual dial to set the power of a bundle of fans. I don't know if the dial or both fans went legs up though since it's a while they're not working.
GCS d--(d-) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
It's already supposed to be controlled by heat, which makes the most sense to me, but the trouble is it doesn't seem to work, at least on my unit.
Edit: No you can't control it with software. It's just a standard PSU.
To err is human. Fortune favors the monsters.
|
|
|
|
|
Aw f* em. It's probably due to some EnergyStar requirement anyway, those are stupid squared.
GCS d--(d-) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
Corsair and some other manufacturers have (very expensive) software controlled PSUs.
I have a Corsair HX1200 in my computer, it has no switch for eco mode but has, what they call, "zero rpm fan" which, I suppose, is basically the same thing.
The software controlled version of my PSU is the Corsair HX1200i (notice the "i" in the end). It is controlled by a software named "iCUE", which seems to be just a driver and a "cute" (read flashy) interface. It only works in Windows and Mac. And they do not seem to update the software (I mean, they update it but seems the new versions do not support previous PSUs).
I bought the version not controlled by software because I only use Linux and I do not like the idea of a, possibly buggy and easily hackable, driver to be able to control such a potentially catastrophic piece of equipment.
So far I had no problem with my PSU but, according to a power meter I have on the outlet, I never went above 500W (of the 1200W the PSU supports).
|
|
|
|
|
Either the Environmental Protection Agency or the Department of Defense has dragged me away for the computer I now posses. Send cake.
To err is human. Fortune favors the monsters.
|
|
|
|
|
...I would win more 1st place article of the month competitions. You are a good competitor!
|
|
|
|
|
I actually try to hold off posting every month because I feel bad for how much I win. Seriously.
I don't want to be *that* person. I think other people's articles deserve a shake. I happen to (I think) have a skill for technical writing and that gives me something of an advantage I think. I'm not sure entirely, but there are plenty of great projects I find mine winning over, and honestly? Sometimes I don't think I deserve it more than the runners up.
So I stay my hand some months.
To err is human. Fortune favors the monsters.
|
|
|
|
|
honey the codewitch wrote: I actually try to hold off posting every month because I feel bad for how much I win. Seriously.
I don't want to be that person. I think other people's articles deserve a shake. I happen to (I think) have a skill for technical writing and that gives me something of an advantage I think. I'm not sure entirely, but there are plenty of great projects I find mine winning over, and honestly? Sometimes I don't think I deserve it more than the runners up.
So I stay my hand some months.
@chris-maunder How hard would adding a feature to let someone opt out of the monthly competition be?
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
|
|
|
|
|
Just email sean@codeproject.com and he'll make sure you're banished, in the nicest possible way, that month.
cheers
Chris Maunder
|
|
|
|
|
Oh cool. Then I can submit every month if I want without worrying about taking up too much room here.
To err is human. Fortune favors the monsters.
|
|
|
|
|
I don't know where you get the time. I'm very jealous.
cheers
Chris Maunder
|
|
|
|