« first day (4439 days earlier)      last day (399 days later) » 

2:08 AM
@NewPosts there was a smallest scratch file challenge
 
 
2 hours later…
3:49 AM
LDQ: Feedback request for a feature I've just come up with: "generic wrapper types"
So basically
This is for a lang with Rust-like OOP. As in, traits.
So a Generic Wrapper Type, or GWT, would wrap any type (with optional trait requirements ofc), hence the name
However, you'd be able to implement more traits on the GWT, and store additional information inside of it
E.g., let's say I have a Vec class
I could make a GWT that stores a pointer alongside the Vec
Which would simplify things that involve keeping track of a position within the Vec (e.g., implementing a tape, or overwriting part of the Vec gradually)
Here's the important part tho
Any methods I run on the GWT would pass through to the Vec inside if they aren't handled by it
So I could .map() it without having to worry about reimplementing map in the wrapper class, or implement a new trait on Vec and have it automatically available in the GWT
Or for example, making an iterator peekable
You could make a Peekable<T: Iter> wrapper which stored an additional &Option<T::Item> (the peeked item), and just wrapped .next to update it
 
 
1 hour later…
5:26 AM
okay not a single answer I found online actually accomplished anything for me so I figured I'd ask here since this feels like a one line fix - how do I stop VSCode automatically completing imports as import db from "../../../../../../../Documents/projects/websites/main/src/db.js";
like, sure it is technically importing a relative path, so setting the module specifier to relative does nothing and setting a base url in the tsconfig compiler options just makes the imports incorrect
 
 
3 hours later…
8:43 AM
0
A: "Hello, World!"

ceilingcatAlpha AXP machine language on OSF/1, 40 bytes 0x00: d2200004 bsr a1, 0x14(zero) # Set a1 to pointer of string 0x04: 6c6c6548 "Hello, World!\0\0\0" 0x08: 57202c6f 0x0c: 646c726f 0x10: 00000021 0x14: 43e09400 addq zero, 0x4, v0 # Select write() syscall 0x18: 43e03410 ...

 
 
2 hours later…
11:09 AM
0
A: Sandbox for Proposed Challenges

PeterHow many xor'ed waves? In this challenge, you're given a list of overlapping waves. Each wave is a finite list with n truthy values, then n falsy values, then n truthy and so on, where n is the wavelength. The values of a wave may have an offset, so a wave of wavelength 3 could be something like ...

 
 
1 hour later…
12:24 PM
@RydwolfPrograms don’t use gwt, people will conflate it with the gwt for java
@RydwolfPrograms that’s called “delegation”
Kotlin already has that feature lol
And it’s a sorta common patters in java
 
 
6 hours later…
6:30 PM
Is SE down for anyone else?
... never mind?
 
7:17 PM
@emanresuA look like its working rn
also guys am i going crazy or is imposter supposed to be spelled impostor
well anyways, i am kinda pissed rn cuz i spent a while planning out a desmos answer to that sonar impostor question and its not working. like its not giving errors but its just wrong
obviously somewhere my brute force went wrong but like i cant print out intermediate results like in other langs so idek where went wrong
 
7:53 PM
I just had a (probably bad) language idea: for-else
for el in array {
  print(el)
} else {
  print("array was empty")
}
 
isnt for else literally a thing in python
 
wait is it
wait yes it is what
 
lmfaoooo
it just detects if the loop has ended early i think, not if an array is empty or whatever
 
>>> arr = []
>>> for el in arr:
...   print(el)
... else:
...   print("hmm")
...
hmm
>>> arr = [1]
>>> for el in arr:
...   print(el)
... else:
...   print("this makes sense")
...
1
this makes sense
>>> for firstElement in arr:
...   print(firstElement)
...   break
... else:
...   print("wut")
...
1
ah yep that seems to be the case
 
ye, i think while else works too
 
 
2 hours later…
10:29 PM
@Bbrk24 Slightly more useful is while else.
 
10:49 PM
@ATaco no, my idea works differently than Python's. In Python, the else is run if the loop ends without break (or presumably return or raise). My idea was that the else is run iff the loop body is never even run.
 
11:46 PM
0
Q: Record Least Uncommon Multiple Counts

Kip the MalamuteThe Greatest Common Divisor, or gcd, of two positive integers \$x\$ and \$y\$ is the largest positive integer that divides both \$x\$ and \$y\$. The Least Common Multiple, or lcm, of two positive integers \$x\$ and \$y\$ is the smallest positive integer that is a multiple of \$x\$ and \$y\$. We d...

 

« first day (4439 days earlier)      last day (399 days later) »