> that's what peak programming according to Microsoft looks like
> the author
>>107505188It's what peak keeping your job looks like. You can't be replaced if nobody else knows what the fuck is going on.
>>107505188What's the point of this? Doesn't bash already have a built-in sleep command?
>>107505569It does. The absolute retard who wrote it seems to think you can’t rely on sleep being present in the runner environment despite>gh actions use Ubuntu images for their runners>ubuntu has all core utils (including sleep) installed by default>if you manually remove sleep a fuckload of other basic things break>the rest of the actions scripts make very deep assumptions on what utils are installed and they’re ones in the same suite sleep comes from>$SECONDS is a bash-ism that might not exist in different shellsThis script that’s supposed to be “better” is hot garbage btw. Instead of actually waiting it hotloops taking up an entire CPU core and if the thread scheduler for whatever reason deprioritizes it for more than a second it might hotloop until INT32 overflows (effectively forever). I wouldn’t be surprised if it was added specifically to increase billable time
>>107505188Doesn't this run the risk of locking up?
>>107505738>riskit was a frequent and known issue there was a PR up to fix this by making it less than instead of less than rather than != but it was up for a while before it was closed. they just merged it recently after like several yearshttps://github.com/actions/runner/pull/3157
>>107505188What the fuck are they teaching people?Isn't the entire point of the diploma handout system to make sure people are at least aware that there are really, really bad ways to do things and that you should at least try to do it the right way?
>>107505861it's indians
>>107505861>he thinks the point of college is to actually educate anyonelol
>>107505690what is microsoft doing about the impact of carbon footprint this does?
>>107505435Based. Just write everything in Perl and they basically cannot get rid of you.
>>107507607If ms actually gave a single fuck about that then copilot wouldn’t exist and W11 would be officially compatible with 15 year old shitboxes
>>107507607>all of that shit>mfw the work laptop battery discharges in 1.5 hoursit's like I shouldn't have asked the IT department for an upgrade
>>107505690ubuntu replaced coreutils with rust so you can't really except the sleep to be there or work
That code was written by HUMAN hands back in 2016. I prompted ChatGPT for the same thing and it already called out on the bullshit.One more time, AIs being clearly superior to the average SWE.TOTAL SWE DEATH
>>107508383The only windows laptops with actually good battery life are the ultrabooks with the intel 258v.
>>107505569it doesn't even sleep, it will sit there looping forever.
I love how big tech is destroying itself with AI slop code no one properly looked at, full of subtle mistakes.
>>107508801>TOTAL SWE DEATHyou have something against swedish people??
>>107509111yes i don't like somalis
>>107505188>OS doesn't schedule your process during the one second you're waiting for>Keeps busylooping foreverHow. How. I know MS is now Pajeet vibe coding, but even ChatGPT knows better than this. How. How the fuck.
>>107508500That hasn't happened yet dumbass. Its only in the non LTS ubuntu 25.
>>107505188>according to MicrosoftYou mean Unix trannies. Windows has a sleep function. Unix bolted it on so you can't depend on it being there.
>>107505188MSFT has a market cap of $3.66 trillion USD. You are a neet deciding which anime wallpaper to put on your riced desktop.
>>107509147do you know why tech CEOs are pushing AI within their companies?to avoid code like thisyou get code like this when a jeet is not using AI
>>107509274You could just, iunno, not ever let jeets anywhere near computers. Just a thought. You'd save a pretty penny too by just having one White guy writing code instead of an army of jeets shitting out bugs. That might require a de-jeetification of big tech CEOs, too.
>>107509351Unfortuantely, the decisions are made by managers who have no idea that code quality is even a feature. Their metric is LOC/Dollar. Jeets excel here. Jeets with AI do it even better. A jeet with ChatGPT can generate more lines of code in 5 minutes than a normal person can in an entire work day.So many code bases would seriously benefit from a feature freeze and REMOVING tens of thousands of lines. Good luck convincing any manager of that, though. Just add a new "Ask Copilot" button for an easy promotion instead, that's how it is at Microsoft.
>>107509435Fortunately this won't last longIn a few short years AI will be advanced enough to write good code without much human prompt"ChatGPT, create Windows 13" and it will write millions of lines of clean(tm) code
>>107505569windows doesnt have sleep and GHA runners need to work on Windows, Linux, and fagOS
>>107509097you're a moronalthough the OP thread is probably intentionally misleading, and he deserves a bullet$1 isn't the same as 1$1 means the first argument given
>>107509097LMAO. You would hope so but this is what eating stuff between your feet gets you. $SECONDS is a special bashismhttps://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html#index-SECONDS
>>107509476you're a moron too
>>107510181:Oi didn't know that, cool
the tech board gets real quiet when a thread becomes about tech instead of twitter shitflinging or racebait:/
>>107510181cool, didn't know that. thanks yo
>>107510256>>107510181$RANDOM$SRANDOMneat
$RANDOM$SRANDOM
>>107510181> if seconds is unsetuh what?
>>107510366unset SECONDScan be used for any variable
unset SECONDS
>>107510387so it's set by default?
>>107510402>>107510387nvm I get it, unset disables the feature
>>107505188Link the repository
>>107505192>there is a white person at Microsoftcrazy
>>107510433>white
>>107509179Jew peso market caps are a meme.They’ve done a little trolling recently unloading their jew pesos to download all the ram, but there’s only so many times you can do that party trick before normies start asking some very uncomfortable questions about central banking.
>>107505188that'll be $200k a year, thanks. no refunds.>>107510433>((((white))))>>107510415https://github.com/actions/runner/blob/main/src/Misc/layoutroot/safe_sleep.sh
>>107505188found a script there that's copied from stackoverflowhttps://github.com/actions/runner/blob/main/src/Misc/layoutroot/run.shhttps://stackoverflow.com/questions/59895/how-do-i-get-the-directory-where-a-bash-script-is-located-from-within-the-script
>>107508801It's unironically hard to beat what AI suggests for such simple tasks because it has everything covered. Once I asked Gemini 2.5 to write a LEB128 decoding function, it wrote practically the same code I wrote on my own earlier except for one clause that it got right and that I missed. AI can't think but it reads all the stuff I didn't read.
>>107513004gemini is pretty good. errors are minimal but for some reason i find it will give me overcomplicated solutions depending on what i ask so i have to rewrite a sentence in a way where it'll respond with something more efficient. they don't understand that part of programming very well. being rewarded for arriving at a solution the quickest is all these memebots understand (under the hood).
>>107505188>>107512953Why is Microsoft even using bash? Did they forget powershell exists?
>>107505188apparently some guy ran a `safe_sleep` routine for 5000 hours
>>107505821R. Kelley bringing the heat
>>107505435what do you mean noone else knows what is going on? it is a .sh script that does nothing infinitely. ... or as long as $1 is not 0, in other words it is a pause loop. it is not that interesting really. without more information i can either say it is bullshit or it is good enough.
>>107515840It's an extremely retarded script because it checks like a billion times per second if enough time has passed. It's like babby's first wait loop. Anyone who's not a fucking moron never does this because we have ways to wait for a number of seconds that don't use an extra 50 watts to keep a CPU core busy checking the time every nanosecond. Things like sleep or read -t.
>>107515869i did not know that... maybe i should go work for microsoft as i do not need to know a lot it seems. I know exactly enough to work for microsoft :D
>>107515737>06:29:17>incel virgin samefags himself every hour to save his dead troll thread from page 10>againhow shocking and unexpectedwhy havent you killed yourself yet loser?do something useful for your mom and fertilize her compost pileeveryone wishes you were dead, especially your momhow embarrassing it must be for her to have to explain to her friends all the time that her son is still a fat 50 year old incel NEET loser eating all her food and stinking up her basement spending every waking minute of his incel life "owning M$/loonix"there is no bigger no-life loser on this entire shithole of a site than you, and that's saying a lotjust end your worthless life already, the world will be a better place with you dead
>>107505192Boomers, zoomers, and jeets are a menace to society.
>>107505188no wonder CPU was maxing out... what a fucking retards.
>>107515934meds now
>>107515926Yeah you have the right stuff, I on the other hand am clearly overqualified.
To be fair, I just ran into an issue where sleep was broken on my PC because my wifi card wouldn't sleep.
>>107516056suicide now
>>107516084That's not the same kind of sleep