[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: microsoft_code.png (273 KB, 1423x832)
273 KB
273 KB PNG
> that's what peak programming according to Microsoft looks like
>>
File: horner.jpg (29 KB, 460x460)
29 KB
29 KB JPG
> the author
>>
>>107505188
It's what peak keeping your job looks like. You can't be replaced if nobody else knows what the fuck is going on.
>>
>>107505188
What's the point of this? Doesn't bash already have a built-in sleep command?
>>
>>107505569
It 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 shells
This 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
>>
>>107505188
Doesn't this run the risk of locking up?
>>
>>107505738
>risk
it 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 years
https://github.com/actions/runner/pull/3157
>>
>>107505188
What 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?
>>
>>107505861
it's indians
>>
>>107505861
>he thinks the point of college is to actually educate anyone
lol
>>
File: 1741520455633017.png (292 KB, 1197x859)
292 KB
292 KB PNG
>>107505690
what is microsoft doing about the impact of carbon footprint this does?
>>
>>107505435
Based. Just write everything in Perl and they basically cannot get rid of you.
>>
>>107507607
If ms actually gave a single fuck about that then copilot wouldn’t exist and W11 would be officially compatible with 15 year old shitboxes
>>
File: rofl XD.png (316 KB, 720x540)
316 KB
316 KB PNG
>>107507607
>all of that shit
>mfw the work laptop battery discharges in 1.5 hours
it's like I shouldn't have asked the IT department for an upgrade
>>
>>107505690
ubuntu replaced coreutils with rust so you can't really except the sleep to be there or work
>>
File: 1713908849663.png (2.7 MB, 1600x900)
2.7 MB
2.7 MB PNG
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
>>
>>107508383
The only windows laptops with actually good battery life are the ultrabooks with the intel 258v.
>>
>>107505569
it 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 DEATH
you have something against swedish people??
>>
>>107509111
yes i don't like somalis
>>
>>107505188
>OS doesn't schedule your process during the one second you're waiting for
>Keeps busylooping forever

How. How. I know MS is now Pajeet vibe coding, but even ChatGPT knows better than this. How. How the fuck.
>>
>>107508500
That hasn't happened yet dumbass. Its only in the non LTS ubuntu 25.
>>
>>107505188
>according to Microsoft
You mean Unix trannies. Windows has a sleep function. Unix bolted it on so you can't depend on it being there.
>>
>>107505188
MSFT has a market cap of $3.66 trillion USD. You are a neet deciding which anime wallpaper to put on your riced desktop.
>>
>>107509147
do you know why tech CEOs are pushing AI within their companies?
to avoid code like this
you get code like this when a jeet is not using AI
>>
>>107509274
You 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.
>>
>>107509351
Unfortuantely, 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.
>>
>>107509435
Fortunately this won't last long
In 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
>>
>>107505569
windows doesnt have sleep and GHA runners need to work on Windows, Linux, and fagOS
>>
>>107509097
you're a moron
although 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
>>
>>107509097
LMAO. You would hope so but this is what eating stuff between your feet gets you. $SECONDS is a special bashism
https://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html#index-SECONDS
>>
File: 1751482276343296.jpg (54 KB, 512x505)
54 KB
54 KB JPG
>>107509476
you're a moron too
>>
>>107510181
:O
i didn't know that, cool
>>
the tech board gets real quiet when a thread becomes about tech instead of twitter shitflinging or racebait
:/
>>
>>107510181
cool, didn't know that. thanks yo
>>
>>107510256
>>107510181
$RANDOM
$SRANDOM

neat
>>
>>107510181
> if seconds is unset
uh what?
>>
>>107510366
unset SECONDS

can be used for any variable
>>
>>107510387
so it's set by default?
>>
>>107510402
>>107510387
nvm I get it, unset disables the feature
>>
>>107505188
Link the repository
>>
>>107505192
>there is a white person at Microsoft

crazy
>>
>>107510433
>white
>>
>>107509179
Jew 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.
>>
>>107505188
that'll be $200k a year, thanks. no refunds.

>>107510433
>((((white))))

>>107510415
https://github.com/actions/runner/blob/main/src/Misc/layoutroot/safe_sleep.sh
>>
File: file.png (89 KB, 1210x699)
89 KB
89 KB PNG
>>107505188
found a script there that's copied from stackoverflow
https://github.com/actions/runner/blob/main/src/Misc/layoutroot/run.sh
https://stackoverflow.com/questions/59895/how-do-i-get-the-directory-where-a-bash-script-is-located-from-within-the-script
>>
>>107508801
It'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.
>>
>>107513004
gemini 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
>>107512953
Why is Microsoft even using bash? Did they forget powershell exists?
>>
>>107505188
apparently some guy ran a `safe_sleep` routine for 5000 hours
>>
File: 2025-12-11 15.28.47.png (52 KB, 715x382)
52 KB
52 KB PNG
>>107505821
R. Kelley bringing the heat
>>
>>107505435
what 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.
>>
>>107515840
It'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.
>>
>>107515869
i 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
>>
File: 1736270507811717.jpg (84 KB, 800x534)
84 KB
84 KB JPG
>>107515737
>06:29:17
>incel virgin samefags himself every hour to save his dead troll thread from page 10
>again
how shocking and unexpected

why havent you killed yourself yet loser?
do something useful for your mom and fertilize her compost pile
everyone wishes you were dead, especially your mom
how 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 lot
just end your worthless life already, the world will be a better place with you dead
>>
>>107505192
Boomers, zoomers, and jeets are a menace to society.
>>
>>107505188
no wonder CPU was maxing out... what a fucking retards.
>>
>>107515934
meds now
>>
>>107515926
Yeah 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.
>>
File: 1739872715941240.png (634 KB, 700x1600)
634 KB
634 KB PNG
>>107516056
suicide now
>>
>>107516084
That's not the same kind of sleep



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.