40 aint no joke - General fitness thread

You probably can't do it, so don't even try.
Post Reply
GORDON
Site Admin
Posts: 54397
Joined: Sun Jun 06, 2004 10:43 pm
Location: DTManistan
Contact:

Post by GORDON »

SOMETHING was happening... when I went back to look at the script, the Excel process was all befucked... eventually it showed me that row A of the spreadsheet had an eternal line of 4-digit random numbers being generated. File names did not change.
"Be bold, and mighty forces will come to your aid."
Malcolm
Posts: 32040
Joined: Fri May 21, 2004 1:04 pm
Location: Minneapolis

Post by Malcolm »

Holy christ. Just bust out the powershell and google.
Diogenes of Sinope: "It is not that I am mad, it is only that my head is different from yours."
Arnold Judas Rimmer, BSC, SSC: "Better dead than smeg."
GORDON
Site Admin
Posts: 54397
Joined: Sun Jun 06, 2004 10:43 pm
Location: DTManistan
Contact:

Post by GORDON »

I had to ctrl-alt-delete to close the runaway excel loop so I lost all the changes I was making to that script.
"Be bold, and mighty forces will come to your aid."
TPRJones
Posts: 13418
Joined: Fri May 21, 2004 2:05 pm
Location: Houston
Contact:

Post by TPRJones »

Sounds like it didn't find the folder and ran on an empty set (so 65,536 lines worth in 2000, I believe). I didn't put error checking into it to watch for that.

Oh, well.




Edited By TPRJones on 1449547368
"ATTENTION: Customers browsing porn must hold magazines with both hands at all times!"
Malcolm
Posts: 32040
Joined: Fri May 21, 2004 1:04 pm
Location: Minneapolis

Post by Malcolm »

Done, bitches. Powershell script that ought to work.

Replace "C:\testPs" with your root search directory. Tune the 1-100 RN range to your liking. The number generation isn't guaranteed to be unique, but a big enough range should handle that. The largest random value that can be generated is 2,147,483,647.

foreach ($file in Get-ChildItem "C:\testPs")
{
$r = Get-Random -minimum 1 -maximum 101
$name = $file.Name
$rname = "$r" + "$name"
$fullName = $file.FullName
Rename-Item "$fullName" "$rname"
}

There's probably a way to cram it all in one line, but fuck it.




Edited By Malcolm on 1449553192
Diogenes of Sinope: "It is not that I am mad, it is only that my head is different from yours."
Arnold Judas Rimmer, BSC, SSC: "Better dead than smeg."
TPRJones
Posts: 13418
Joined: Fri May 21, 2004 2:05 pm
Location: Houston
Contact:

Post by TPRJones »

Do the filenames keep getting longer if you run it again to rerandomize?
"ATTENTION: Customers browsing porn must hold magazines with both hands at all times!"
TheCatt
Site Admin
Posts: 53725
Joined: Thu May 20, 2004 11:15 pm
Location: Cary, NC

Post by TheCatt »

Why are you running Excell 2000, are you homeless?
It's not me, it's someone else.
Malcolm
Posts: 32040
Joined: Fri May 21, 2004 1:04 pm
Location: Minneapolis

Post by Malcolm »

TPRJones wrote:Do the filenames keep getting longer if you run it again to rerandomize?

Argh. Fucking stupid MS string variable interpolation. The latest one I posted in should work without issue and won't make the names grow out to the right.

Uh, yeah, rerandomization would prepend new numbers. Without some file name convention, I can't parse the randomized names intelligently enough to reverse the op. If there's an ASCII character you can guarantee isn't used in your file names, I can key off that. Just blitz the files from the music player, recopy from the source, and randomize anew.




Edited By Malcolm on 1449553270
Diogenes of Sinope: "It is not that I am mad, it is only that my head is different from yours."
Arnold Judas Rimmer, BSC, SSC: "Better dead than smeg."
GORDON
Site Admin
Posts: 54397
Joined: Sun Jun 06, 2004 10:43 pm
Location: DTManistan
Contact:

Post by GORDON »

TheCatt wrote:Why are you running Excell 2000, are you homeless?
IIRC Office 2000 was a massively pirated version of the software, before unique keys were a thing. And I pretty much LOL at anyone who thinks they need anything better than Word 2000 to write their grocery list on.

So yeah I was given a pirated copy of 2000 back in Memphis and I've never needed anything else.
"Be bold, and mighty forces will come to your aid."
GORDON
Site Admin
Posts: 54397
Joined: Sun Jun 06, 2004 10:43 pm
Location: DTManistan
Contact:

Post by GORDON »

You fucking fuckers are fucking up my fucking fitness thread.
"Be bold, and mighty forces will come to your aid."
TheCatt
Site Admin
Posts: 53725
Joined: Thu May 20, 2004 11:15 pm
Location: Cary, NC

Post by TheCatt »

GORDON wrote:You fucking fuckers are fucking up my fucking fitness thread.
You started it.

And are lame for using Office 2000.
It's not me, it's someone else.
Malcolm
Posts: 32040
Joined: Fri May 21, 2004 1:04 pm
Location: Minneapolis

Post by Malcolm »

GORDON wrote:You fucking fuckers are fucking up my fucking fitness thread.
We already have one of those. Take your brain medicine.
Diogenes of Sinope: "It is not that I am mad, it is only that my head is different from yours."
Arnold Judas Rimmer, BSC, SSC: "Better dead than smeg."
GORDON
Site Admin
Posts: 54397
Joined: Sun Jun 06, 2004 10:43 pm
Location: DTManistan
Contact:

Post by GORDON »

TheCatt wrote:
GORDON wrote:You fucking fuckers are fucking up my fucking fitness thread.
You started it.
He drew first script, not me.
"Be bold, and mighty forces will come to your aid."
GORDON
Site Admin
Posts: 54397
Joined: Sun Jun 06, 2004 10:43 pm
Location: DTManistan
Contact:

Post by GORDON »

Today in the pool I was feeling blah. Two hour school delay means the day was fucked from the get-go... I guess I just do better before 9am that at noon.
"Be bold, and mighty forces will come to your aid."
GORDON
Site Admin
Posts: 54397
Joined: Sun Jun 06, 2004 10:43 pm
Location: DTManistan
Contact:

Post by GORDON »

Oh but the water headphones worked. I've got them back on the charger right now.
"Be bold, and mighty forces will come to your aid."
Malcolm
Posts: 32040
Joined: Fri May 21, 2004 1:04 pm
Location: Minneapolis

Post by Malcolm »

GORDON wrote:Today in the pool I was feeling blah. Two hour school delay means the day was fucked from the get-go... I guess I just do better before 9am that at noon.

Really? I don't wake up until sometime around 2-3pm. I'm ambulatory and moving around, talking and all that other bullshit at 7-8am, but there's no synchronicity until the afternoon. Fuck mornings, they're made to be slept through.




Edited By Malcolm on 1449601829
Diogenes of Sinope: "It is not that I am mad, it is only that my head is different from yours."
Arnold Judas Rimmer, BSC, SSC: "Better dead than smeg."
TheCatt
Site Admin
Posts: 53725
Joined: Thu May 20, 2004 11:15 pm
Location: Cary, NC

Post by TheCatt »

Yeah, I'm best at athletic stuff later in the day rather than earlier. I hate morning stuff.
It's not me, it's someone else.
GORDON
Site Admin
Posts: 54397
Joined: Sun Jun 06, 2004 10:43 pm
Location: DTManistan
Contact:

Post by GORDON »

I don't know. I just felt like I didn't have much power in the pool today.
"Be bold, and mighty forces will come to your aid."
Malcolm
Posts: 32040
Joined: Fri May 21, 2004 1:04 pm
Location: Minneapolis

Post by Malcolm »

GORDON wrote:I don't know. I just felt like I didn't have much power in the pool today.
I've noticed my cardio results vary quite a bit, even when I keep my activity, sleep, and caloric intake roughly the same.
Diogenes of Sinope: "It is not that I am mad, it is only that my head is different from yours."
Arnold Judas Rimmer, BSC, SSC: "Better dead than smeg."
TheCatt
Site Admin
Posts: 53725
Joined: Thu May 20, 2004 11:15 pm
Location: Cary, NC

Post by TheCatt »

GORDON wrote:I don't know. I just felt like I didn't have much power in the pool today.
1) Bad days happen.

2) Your body generally likes to do what it does at the same time.
It's not me, it's someone else.
Post Reply