Return to “Everything & Anything”

Post

Re: Things That Made You Happy Today

#1549
I made a DOS script in work, that in turn calls powershell to email the report to whomever, in a single day!
Doesn't sound like much tbh, but I completely forgot how to get the date into variables:

Code: Select all

for /f "tokens1-3 delims=/" %%I IN (%DATE%) do (...
Something that I had written in my sleep 6 months ago in the last job.
For the completenists out there, here's the working code:

Code: Select all

@echo off
setlocal
for /f "tokens=1-3 delims=/" %%I IN ('DATE /T') do (
  call :PROCESS %%I %%J %%K
)
echo Today's date is: %MONTH% _ %DAY% _ %YEAR%
:: Mostly because most of the people on here are in the US :P
goto :END

:PROCESS
:: Depending on your locale, swap as required
set DAY=%1
set MONTH=%2
set YEAR=%3
goto :EOF

:END
:: echo. prints a blank line
echo.
endlocal
I was so happy, I wrote out a little ditty in a single run, when I got home, using copy con from CMD prompt :D :)

Code: Select all

@echo off
setlocal
if /i "%1" equ "/?" goto :HELP
echo.
echo Nope, it didn't work
goto :END

:HELP
echo Well Done, It Works
echo.

:END
YAY PYTHON \o/

In Josh We Trust
-=326.3827=-
Post

Re: Things That Made You Happy Today

#1550
FormalMoss wrote:
I made a DOS script in work, that in turn calls powershell to email the report to whomever, in a single day!
Doesn't sound like much tbh, but I completely forgot how to get the date into variables:

Code: Select all

for /f "tokens1-3 delims=/" %%I IN (%DATE%) do (...
Something that I had written in my sleep 6 months ago in the last job.
For the completenists out there, here's the working code:

Code: Select all

@echo off
setlocal
for /f "tokens=1-3 delims=/" %%I IN ('DATE /T') do (
  call :PROCESS %%I %%J %%K
)
echo Today's date is: %MONTH% _ %DAY% _ %YEAR%
:: Mostly because most of the people on here are in the US :P
goto :END

:PROCESS
:: Depending on your locale, swap as required
set DAY=%1
set MONTH=%2
set YEAR=%3
goto :EOF

:END
:: echo. prints a blank line
echo.
endlocal
I was so happy, I wrote out a little ditty in a single run, when I got home, using copy con from CMD prompt :D :)

Code: Select all

@echo off
setlocal
if /i "%1" equ "/?" goto :HELP
echo.
echo Nope, it didn't work
goto :END

:HELP
echo Well Done, It Works
echo.

:END
Congrats on getting back to the most basic form of coding, DOS. :D
Automation engineer, lateral thinker, soldier, addicted to music, books and gaming.
Nothing to see here
Flatfingers wrote: 23.01.2017: "Show me the smoldering corpse of Perfectionist Josh"
Post

Re: Things That Made You Happy Today

#1551
I found the BOFH archives.. the first line from '99 BOFH has me in stitches already:

It's quiet. Possibly too quiet - The kind of quiet you get when you shove a thick chunk of copper wire in a circuit breaker, a nail in the phase circuit breaker and a bolt in the floor circuit breaker... then drop a screwdriver down one of the ventilation holes of the mainframe's power supply.

I make my way carefully through the emergency-lit computer room to my office, my only detour being a quick circuit breaker replacement tour and a stop at the bin to drop off a badly scarred screwdriver.

I always prefer to start the year off with a bang - or, to be more precise, a series of loud hums, a crackle or two, and a muffled BOOM from the sub-basement.

After all, it's just good manners to let the great unwashed know just who's still at the helm of this operation.
YAY PYTHON \o/

In Josh We Trust
-=326.3827=-
Post

Re: Things That Made You Happy Today

#1554
Workmate gave me a Violin!

Now, I should have prefaced that with: I have always been a massive fan of violin, and always wanted to learn, but for reasons didn't go through with lessons as a kid. (If I ever got a chance to change just one tiny choice from my life, it'd be that)
And I have been thinking of buying one, but been putting it off to get my PC.

But a co-worker was cleaning up his stuff, and had bought a violin as an impulse purchase ages and ages ago, but never got around to learning it, as he already had an acoustic guitar, an electric guitar, and an electric keyboard.
So was looking to find a new home for it.

I happened to overhear and mentioned how much I like violin. And boom, free violin!


Now I just need to get it tuned (have no idea how tight the strings need to be, and my hearing doesn't seem capable of telling different notes apart :V ) and then I can start putting in effort to learn it and git gud.
Am very excited.
Finally get a chance to get rid of one of the few regrets I have in life.

Code: Select all

<+BMRX> Silver Invokes Lewdly Verbose Experiences Readily With Absurd Rectal Expeditions
Image
Image
Post

Re: Things That Made You Happy Today

#1555
Silverware wrote:always wanted to learn [the violin]
Silverware wrote:my hearing doesn't seem capable of telling different notes apart :V
I'm afraid I have bad news for you - if there's one instrument where you really really need to have a good musical hearing it's violin, since it has no frets and the only way not to play out of tune is hearing when you're playing out of tune :|

Edit: for tuning there are a ton of apps for smartphones btw, I use one for my guitar
Warning: do not ask about physics unless you really want to know about physics.
The LT IRC / Alternate link || The REKT Wiki || PUDDING
Image
Post

Re: Things That Made You Happy Today

#1556
Dinosawer wrote:
Silverware wrote:always wanted to learn [the violin]
Silverware wrote:my hearing doesn't seem capable of telling different notes apart :V
I'm afraid I have bad news for you - if there's one instrument where you really really need to have a good musical hearing it's violin, since it has no frets and the only way not to play out of tune is hearing when you're playing out of tune :|

Edit: for tuning there are a ton of apps for smartphones btw, I use one for my guitar
I'm guessing it's mostly just practice. I have never taken the time to learn music, and I'm not tonedeaf (I think)
And yeah I'll have to have a look for one. Won't be putting any more time in today. (went out with the wife for drinks after work so its late)

Code: Select all

<+BMRX> Silver Invokes Lewdly Verbose Experiences Readily With Absurd Rectal Expeditions
Image
Image
Post

Re: Things That Made You Happy Today

#1560
Completed a 2x40 march this weekend. Man, the emotions when we (group of about 40, in a column-of-four, with 2 guidon and a flag at the front, all marching in step the last 100m and singing loudly) finally reached the finish. The situation gave me shivers! It fantastic. I afterwards took a shower while sitting on a chair because my feet hurt so much (we walked with 6km/h and my shoes weren't optimal, my ball of the foot got kinda crushed), but it was worth it. Today my right hip joint hurts a little as well as my knees, but I'm so proud of myself. :mrgreen:
Automation engineer, lateral thinker, soldier, addicted to music, books and gaming.
Nothing to see here
Flatfingers wrote: 23.01.2017: "Show me the smoldering corpse of Perfectionist Josh"

Online Now

Users browsing this forum: No registered users and 4 guests

cron