So, decided to write a quick calculator to work out experiment length for our flourimeter while waiting for quantum yield measurements.
Need to do this math: (((EndWavelength - StartWavelength) * DwellTime)\StepSize)\60 so pretty simple. Excel would work, but this PC doesn't have it. Can't use Google Docs, no internet.
I know, dos command line. Pull out phone, google. SET /a and SET /p will work. Spend some time working on that, discover that it won't work as SET is integer math only. Ok, that is pretty useless. I guess fine for counting number of files or something.
Right, this is a modern windows computer. I look up how to do math in powershell. Much easier, but damn, powershell loves to waste characters. They did know they were written a SHELL and not a programming language, right?
Get a quick prototype done, try and run it. NOPE.
It turns out that by default you can't run powershell scripts. What? I was just running batch files from the dos command prompt. Why block powershell if you aren't got to block cmd.exe? PLUS I could type the commands directly, just not run them saved to a file.
So if I wanted to do something harmful, I could just write it in a batch file, and call on powershell for anything I needed anyway. It just makes it super hard for people that actually want to do useful stuff.
PLUS, basic scripting is one of the POINTS of computers. Everyone should be taught the principles of this stuff in school, for basic file manipulation. So many times I've been able to automate repetitive tasks in bash/cmd/awk/etc
@Canageek couldn't agree more. I taught my kids some python.
They don't actually use it... but I do get the odd hey dad, could you...?? At least they are aware.