Crestwave's recent activity
-
Comment on x86 assembler in Bash in ~comp
-
Comment on The future is Niri in ~comp
Crestwave The author might simply be used to disguising their age online, since they seem to have been deep into tech since they were 13. They're likely being more open about it now that they're 20, but...The author might simply be used to disguising their age online, since they seem to have been deep into tech since they were 13. They're likely being more open about it now that they're 20, but still defaulting to old habits. :P
-
Comment on Why Dua Lipa is so good at asking questions in ~books
Crestwave (edited )Link ParentI'm not too familiar with him, but a quick search gets me a list of his favorite books. I might have been surprised to learn this if it was during his OneDirection days, but I am not surprised...Harry Styles is one that comes to mind.
I'm not too familiar with him, but a quick search gets me a list of his favorite books. I might have been surprised to learn this if it was during his OneDirection days, but I am not surprised that a rich man in his 30s reads books.
-
Comment on Why Dua Lipa is so good at asking questions in ~books
Crestwave I believe Taylor Swift has promoted quite a few books in the past and makes references to various novels in her songs. I'm sure she's not the only one, either; as @json mentioned, literature tends...I mean how many pop artists use their platforms to promote authors, or even discuss books to any degree.
I believe Taylor Swift has promoted quite a few books in the past and makes references to various novels in her songs. I'm sure she's not the only one, either; as @json mentioned, literature tends to go hand-in-hand with songwriting.
-
Comment on Steam Spring Sale suggestions in ~games
Crestwave The game even has actual Don't Starve content due to a crossover. :-)The game even has actual Don't Starve content due to a crossover. :-)
-
Comment on Mozilla sees surge in Firefox users thanks to EU’s Digital Markets Act in ~tech
Crestwave It does work on macOS since browsers can use their own engines there. Their FAQ specifically states that Orion can run uBO on Mac. Meanwhile, it is not supported on iOS for the same reason why...It does work on macOS since browsers can use their own engines there. Their FAQ specifically states that Orion can run uBO on Mac. Meanwhile, it is not supported on iOS for the same reason why Firefox and Chrome cannot support extensions on iOS (until now).
-
Comment on shite: the little hot-reloadin' static site generator from shell (assumes Bash 4.4+) in ~comp
Crestwave Quite a few of the ones posted have required later versions. The reason why these requirements are specified even though Bash 4.4 was released back in 2016 is because they relicensed to GPL v3 on...Quite a few of the ones posted have required later versions. The reason why these requirements are specified even though Bash 4.4 was released back in 2016 is because they relicensed to GPL v3 on version 4. Due to this, proprietary vendors like macOS ship an ancient Bash 3.2 from 2006 (with added security patches).
-
Comment on Mozilla sees surge in Firefox users thanks to EU’s Digital Markets Act in ~tech
Crestwave (edited )Link ParentHave you tested it with Orion's adblocker disabled? Orion's uBlock Origin support has been a popular misconception for many years because while you could "install" it, it was nonfunctional and...Have you tested it with Orion's adblocker disabled? Orion's uBlock Origin support has been a popular misconception for many years because while you could "install" it, it was nonfunctional and what was actually powering the work was the built-in adblocker, which was much weaker than uBO (e.g., you'll typically ads flash as they get skipped on YouTube).
I believe that the DMA opens up the possibility to run actual uBO on iOS, although I'm not in the EU so I'm not too up to date on efforts to do so.
-
Comment on HTTP.sh: a web framework written entirely in Bash in ~comp
Crestwave External dependencies? Meh. Is my script calling python3 -m http.server a Bash web server, then? Real programmers write web servers using only Bash builtins!written entirely in Bash
...
Dependencies- either Ncat (not openbsd-nc, not netcat, not nc) or socat, or a combo of both
External dependencies? Meh. Is my script calling
python3 -m http.server
a Bash web server, then?Real programmers write web servers using only Bash builtins!
-
Comment on I hate the new internet. I hate the new tech world. I hate it all. I want out, and I can't be the only one. in ~tech
Crestwave Not all of them are bots, but I think the 35% figure OP gave is quite a conservative estimate. Reddit always had tons of low-effort jokes and memes, but nowadays it is chock full of bots reposting...Another eh to a point. I don't think they're just bots. I think low effort content has the widest appeal. The reason i started going to reddit was because even if there was something kinda low effort, you usually could find interesting conversations about the topic at hand.
Not all of them are bots, but I think the 35% figure OP gave is quite a conservative estimate. Reddit always had tons of low-effort jokes and memes, but nowadays it is chock full of bots reposting threads with comment sections that are 99% other bots reposting the comments (actual ones, not copypastas) from the original thread and 1% unaware users who think they are interacting with real people. Reposters aside, there are also quite a few bots posting obvious ChatGPT responses.
Of course, this varies by subreddit, but it is absolutely chilling to see so many threads which look completely normal until one user is perceptive enough to post a link to the original thread with the exact same comments. Slowly, these people will dwindle out and leave while the rest will be stuck interacting with bots.
-
Comment on What is China’s DeepSeek and why is it freaking out the AI world? in ~tech
Crestwave Well even if it was a data harvesting scam site, at least it's open source and you can run the models locally for privacy unlike OpenAI's models.Well even if it was a data harvesting scam site, at least it's open source and you can run the models locally for privacy unlike OpenAI's models.
-
Comment on Slay the Spire 2 | Official gameplay trailer in ~games
Crestwave It used to a have a different thumbnail parodying typical YouTube strategy guides.It used to a have a different thumbnail parodying typical YouTube strategy guides.
-
Comment on Day 5: Print Queue in ~comp.advent_of_code
Crestwave Like many others here, I was initially very worried about part 2 but I managed to hack my way through it. AWK solutions: Part 1 Pretty straightforward. I iterate through each page then go through...Like many others here, I was initially very worried about part 2 but I managed to hack my way through it. AWK solutions:
Part 1
Pretty straightforward. I iterate through each page then go through its rules to see if I already encountered anything that is defined to come after it.
#!/usr/bin/awk -f BEGIN { FS = "[|,]" } /\|/ { rule[$1] = rule[$1] $2 "," } /^[^\|]*$/ { for (i in pages) delete pages[i] for (i = 1; i <= NF; ++i) { pages[$i] = 1 r = rule[$i] n = split(r, a, ",") for (j = 1; j < n; ++j) if (pages[a[j]]) next } total += $(int(NF/2)+1) } END { print total }
Part 2
As I have mentioned quite a few times here already, AWK doesn't provide any sorting option, much less an advanced one where you can provide custom rules or weights, so I was initially worried about this. However, I decided to try the naive approach of simply swapping the pages in each violation until they were sorted and it worked surprisingly well.
#!/usr/bin/awk -f BEGIN { FS = "[|,]" } /\|/ { rule[$1] = rule[$1] $2 "," } /^[^\|]*$/ { # clean up all arrays and variables from previous iterations # in hindsight, there would probably be less of this boilerplate if I used a function instead for (i in pages) delete pages[i] for (i in order) delete order[i] temp = 0 # set this separately now since it will be modified during the loop for (i = 1; i <= NF; ++i) order[i] = $i for (i = 1; i <= NF; ++i) { pages[order[i]] = i r = rule[order[i]] n = split(r, a, ",") for (j = 1; j < n; ++j) if (pages[a[j]]) { # swap the places of the updates in the rule violated temp = order[i] order[i] = a[j] order[pages[a[j]]] = temp # restart the processing again to correct any cascading errors for (i in pages) delete pages[i] i = 0 break } } if (temp) total += order[int(NF/2)+1] } END { print total }
-
Comment on Day 7: Bridge Repair in ~comp.advent_of_code
Crestwave This one was surprisingly simple. Part 2 especially required very, very minimal changes for me, at least as far as AWK goes. Part 1 Simple recursive solution. I actually accidentally...This one was surprisingly simple. Part 2 especially required very, very minimal changes for me, at least as far as AWK goes.
Part 1
Simple recursive solution. I actually accidentally misinterpreted it initially and thought I was supposed to find the number of possibilities for each equation, but it runs quick enough that doing so doesn't really have any downside.
#!/usr/bin/awk -f function check(a, ptr, len, val, test) { if (ptr > len) return (val == test) else return check(a, ptr+1, len, val+a[ptr], test) + check(a, ptr+1, len, val*a[ptr], test) } BEGIN { total = 0 } { sub(/:/, "") for (i = 1; i <= NF; ++i) a[i] = $i if (check(a, 3, NF, a[2], a[1]) > 0) total += a[1] } END { print(total) }
Part 2
This one was very simple, I just copied another function call into the chain on line 6 and deleted the operator (which automatically leads to concatenation in AWK). I finally felt the consequences of recursively finding all possible solutions here, but it still completes within a few seconds so I just let it be.
#!/usr/bin/awk -f function check(a, ptr, len, val, test) { if (ptr > len) return (val == test) else return check(a, ptr+1, len, val+a[ptr], test) + check(a, ptr+1, len, val*a[ptr], test) + check(a, ptr+1, len, val a[ptr], test) } BEGIN { total = 0 } { sub(/:/, "") for (i = 1; i <= NF; ++i) a[i] = $i if (check(a, 3, NF, a[2], a[1]) > 0) total += a[1] } END { print(total) }
-
Comment on Day 4: Ceres Search in ~comp.advent_of_code
Crestwave This was one problem where rushing it worked surprisingly to my favor. AWK solutions: Part 1 My approach here was to locate X's and look for occurrences of "MAS" in all directions. I generally...This was one problem where rushing it worked surprisingly to my favor. AWK solutions:
Part 1
My approach here was to locate X's and look for occurrences of "MAS" in all directions. I generally would have used loops for this, but I was in a rush so I just hard-coded everything. Quick and dirty.
#!/usr/bin/awk -f BEGIN { FS = "" total = "" } { for (i = 1; i <= NF; ++i) grid[i, NR] = $i } END { for (i in grid) { if (grid[i] == "X") { split(i, xy, SUBSEP) print(xy[1], xy[2]) x = xy[1] y = xy[2] # upper-left if (grid[x-1, y-1] == "M" && grid[x-2, y-2] == "A" && grid[x-3, y-3] == "S") total += 1 # upper-right if (grid[x+1, y-1] == "M" && grid[x+2, y-2] == "A" && grid[x+3, y-3] == "S") total += 1 # lower-left if (grid[x-1, y+1] == "M" && grid[x-2, y+2] == "A" && grid[x-3, y+3] == "S") total += 1 # lower-right if (grid[x+1, y+1] == "M" && grid[x+2, y+2] == "A" && grid[x+3, y+3] == "S") total += 1 # left if (grid[x-1, y] == "M" && grid[x-2, y] == "A" && grid[x-3, y] == "S") total += 1 # right if (grid[x+1, y] == "M" && grid[x+2, y] == "A" && grid[x+3, y] == "S") total += 1 # up if (grid[x, y-1] == "M" && grid[x, y-2] == "A" && grid[x, y-3] == "S") total += 1 # down if (grid[x, y+1] == "M" && grid[x, y+2] == "A" && grid[x, y+3] == "S") total += 1 } } print total }
Part 2
I was expecting to have to switch to a smarter approach, but this was even easier than part 1 for me. I locate A's and look around diagonally for M/S pairs.
#!/usr/bin/awk -f BEGIN { FS = "" total = "" } { for (i = 1; i <= NF; ++i) grid[i, NR] = $i } END { for (i in grid) { if (grid[i] == "A") { split(i, xy, SUBSEP) x = xy[1] y = xy[2] if ((grid[x-1, y-1] == "M" && grid[x+1, y+1] == "S") || (grid[x-1, y-1] == "S" && grid[x+1, y+1] == "M")) if ((grid[x+1, y-1] == "M" && grid[x-1, y+1] == "S") || (grid[x+1, y-1] == "S" && grid[x-1, y+1] == "M")) total += 1 } } print total }
-
Comment on Day 3: Mull It Over in ~comp.advent_of_code
Crestwave Pretty standard AoC stuff so far. AWK solutions: Part 1 Everything went pretty much as expected here, regex worked excellently. #!/usr/bin/awk -f BEGIN { input = "" } { input = input $0 } END {...Pretty standard AoC stuff so far. AWK solutions:
Part 1
Everything went pretty much as expected here, regex worked excellently.
#!/usr/bin/awk -f BEGIN { input = "" } { input = input $0 } END { while (match(input, /mul\([0-9]{1,3},[0-9]{1,3}\)/)) { mul = substr(input, RSTART+length("mul("), RLENGTH-length("mul()")) split(mul, arg, ",") total += arg[1]*arg[2] input = substr(input, RSTART+RLENGTH) } print total }
Part 2
I had to change my approach here for detecting the other operators. I probably could have made it more efficient by using
match()
all-around, but I took the quick and easy route by iterating over each character.#!/usr/bin/awk -f BEGIN { input = "" } { input = input $0 } END { b = 1 while (length(input)) { if (b) { if (input ~ /^don't\(\).*/) { b = 0 } else if (input ~ /^mul\([0-9]{1,3},[0-9]{1,3}\)/) { match(input, /mul\([0-9]{1,3},[0-9]{1,3}\)/) mul = substr(input, RSTART+length("mul("), RLENGTH-length("mul()")) split(mul, arg, ",") total += arg[1]*arg[2] } } else { if (input ~ /^do\(\).*/) b = 1 } input = substr(input, 2) } print total }
-
Comment on Day 2: Red-Nosed Reports in ~comp.advent_of_code
Crestwave Part 1 was fun, although I got stuck for a bit on part 2. AWK solutions: Part 1 Pretty simple. I calculate a multiplier using the difference between the first two levels and use it to convert...Part 1 was fun, although I got stuck for a bit on part 2. AWK solutions:
Part 1
Pretty simple. I calculate a multiplier using the difference between the first two levels and use it to convert negative steps into positive ones.
#!/usr/bin/awk -f BEGIN { total = 0 } { m = $1-$2 > 0 ? 1 : -1 for (i = 1; i < NF; ++i) if ((($(i)-$(i+1))*m > 3 || (($(i)-$(i+1))*m <= 0))) next total += 1 } END { print total }
Part 2
I spent a bit overthinking this and trying to create a non-brute-force solution, but it turned out to be much more complicated than I initially thought. I eventually gave up and just went for a simple brute-force, which did the job excellently.
#!/usr/bin/awk -f function check(a, p , i) { m = a[1]-a[2] > 0 ? 1 : -1 for (i = 1; i < p; ++i) if (((a[i]-a[i+1])*m > 3 || ((a[i]-a[i+1])*m <= 0))) return 0 return 1 } { for (n = 1; n <= NF; ++n) { p = 0 for (i in a) delete a[i] for (i = 1; i <= NF; ++i) if (i != n) a[++p] = $(i) if (check(a, p)) { total += 1 next } } } END { print total }
-
Comment on Day 1: Historian Hysteria in ~comp.advent_of_code
Crestwave Late to the party, so I'm sticking to my default and using POSIX AWK again as always. :P Quite an interesting day 1, I already had to reach for further tools... (details in part 1) Part 1 I knew...Late to the party, so I'm sticking to my default and using POSIX AWK again as always. :P
Quite an interesting day 1, I already had to reach for further tools... (details in part 1)Part 1
I knew the quicksort function I wrote way back for 2021's day 10 would come in handy again some day! For reference, POSIX awk does not have
asort()
norabs()
; they are available as GAWK extensions, but I've been too much of a purist to use them so far. Simple loops are usually enough to get me by most sorting-related problems, but I made my own sorting function for when they aren't quite enough.Most of my solution is just a pasted copy of my old
qsort()
then a couple of lines for the actual logic.#!/usr/bin/awk -f function qsort(arr, left, right, i, j, tmp, pivot) { if (left >= 0 && right >= 0 && left < right) { pivot = arr[int((left + right) / 2)] i = left - 1 j = right + 1 while (1) { do { i = i + 1 } while (arr[i] < pivot) do { j = j - 1 } while (arr[j] > pivot) if (i >= j) break tmp = arr[i] arr[i] = arr[j] arr[j] = tmp } qsort(arr, left, j) qsort(arr, j + 1, right) } } { left[NR] = $1 right[NR] = $2 } END { qsort(left, 1, NR) qsort(right, 1, NR) for (i in left) total += left[i] - right[i] > 0 ? left[i] - right[i] : right[i] - left[i] print(total) }
Part 2
Very simple changes for part 2.
#!/usr/bin/awk -f function qsort(arr, left, right, i, j, tmp, pivot) { if (left >= 0 && right >= 0 && left < right) { pivot = arr[int((left + right) / 2)] i = left - 1 j = right + 1 while (1) { do { i = i + 1 } while (arr[i] < pivot) do { j = j - 1 } while (arr[j] > pivot) if (i >= j) break tmp = arr[i] arr[i] = arr[j] arr[j] = tmp } qsort(arr, left, j) qsort(arr, j + 1, right) } } { left[NR] = $1 right[$2] += 1 } END { for (i in left) total += left[i] * right[left[i]] print(total) }
-
Comment on I just bought a 64GB iPad, anything I should know/do? in ~tech
Crestwave Another 64GB iPad user here. iOS has a very long-standing issue where deleting a file that is bigger than the available free space will instead move it to the system data, where it gets stuck in...Another 64GB iPad user here. iOS has a very long-standing issue where deleting a file that is bigger than the available free space will instead move it to the system data, where it gets stuck in an unusable limbo—you cannot restore it nor can you delete it directly. Over time, your system data will grow to overtake and suffocate your storage space; you will then desperately delete things to free up space, only to find that the system data only consumes it and grows further.
This is probably part of why everyone in this thread is aghast at your choice of "just" 64GB. Sometimes it misattributes it to other apps, which is quite fun as well. It's very thrilling to delete a 2GB app only to see the next app on the list magically grow by 2GB to compensate.
Thankfully, workarounds do exist to free up space, so it's important to be aware of them. They include restoring backups, downloading huge files, or turning off WiFi, setting the clock a year forward and rebooting.
Another thing to note is that there is only one browser engine available on iOS. All other browsers are simply frontends to the default Safari engine, so you might want to just stick with Safari unless you want certain integrations like tab syncing.
By default, the app store will ask for auth for every installation. This is configurable and you may want to set it to install free apps without permission if you feel like it. I find that having it on makes it easy for me to accidentally authorize payment for paid apps.
The camera's Live mode may be turned on by default; this makes it take a series of photos in succession to make a gif-like result rather than a regular photo, which takes up much more space. If you don't care about the animation, there's a setting in the camera where you can preserve the setting of Live mode. Then you can turn it off in-app and it will stay that way instead of resetting back to on every time.
Shaking your device will trigger a pop-up for Undo by default, which may be confusing the first few times it happens. You can make use of it or turn it off in the settings.
Double tap to select a word, triple tap to select a paragraph.
The iPad does excel at stuff like browsing, reading books and lightweight office work. Microsoft apps like OneDrive, OneNote, Office and Teams work very well (or at least as well as they usually do, anyway) so no worries there. Enjoy!
-
Comment on United States Department of Justice will push Google to sell Chrome to break search monopoly in ~tech
Crestwave From my understanding, it used Shadow DOM v0 specifically, which was an experimental spec and deprecated at the time of the article*. V1 was in-development at Firefox Nightly and could be turned...From my understanding, it used Shadow DOM v0 specifically, which was an experimental spec and deprecated at the time of the article*. V1 was in-development at Firefox Nightly and could be turned on with a config.
* I don't recall for sure whether it was deprecated at the time of the redesign, but as you mentioned, it was experimental and should not have been used. Malicious or not, I think it's clear that they design for Chrome as a target platform and give it preferential treatment. They would never adopt an experimental Firefox technology and put a 5x slower placeholder for Chrome.
From my understanding, this converts x86 asm into an executable file, similar to regular assemblers like yasm except it's written in Bash.