Canageek is a user on cybre.space. You can follow them or interact with them if you have an account anywhere in the fediverse.

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.

Canageek @Canageek

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?

· Web · 1 · 1

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.


I'm sure someone could explain why a) saving commands to a file is more dangerous then running them by typing them in line by line and b) what the point is if you don't disable cmd.exe the same way?

Here is where I really don't get: If I save "2+2" into a file called test.ps1, then powershell won't run it. If I save "powershell 2+2" into test.bat then run that from cmd.exe IT RUNS FINE.

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.

@Canageek That is insane.
And probably why my own personal relationship with msw at home only lasted 2 months. Painfully. In the 90's...
You literally have to pay me to use it. It's such a piece of...

@gemlog Modern Windows is actually pretty good. It just tends to have stupid defaults.

I mean, I've got a compete Ubuntu install at home, within Windows, so I can call Windows executables from Bash and Vis versa. Less hacky then cygwin, but no X yet (offically anyway)

@Canageek I've added that to my win10box at work too.
Now, make a cronjob 'just work'.

@gemlog Ah, depending on the version the scheduler in Windows is pretty good as I recall. Been a while since I used it though.

@Canageek I'm just saying in ubuntu, under windows, an actual cronjob won't work thru a reboot.

I use the windows scheduler to do dyndns at one place reliably.

@Canageek Much better than cygwin. There is a hacky way to get x11 using e.g. vnc.

@Canageek I don't have it at home, because I don't use windows and I never will. You must pay me! :-)
And even then I'll complain about it!

@Canageek I have linux boxes avail + I'm the IT guy, so I can grant myself magic wishes on any machine, but I didn't know that.
I hate MS. I just do.

@Canageek No. It's live java vs python: "How can we make this line use up three times the chars?"