« first day (4741 days earlier)      last day (400 days later) » 

 
4 hours later…
05:29
0
Q: Longest Repeating Subarray (With Overlapping)

user23274861Earlier I asked about this problem on stackoverflow (link), but now I also want to see the golfiest solutions Problem: Given an array of arbitrary numbers, what is the longest subarray that is repeated (appears more than once)? In case there are multiple distinct repeated subarrays that all have ...

 
1 hour later…
06:46
Why keyboard don't give each key a single wire, but scan(they'd rather diode to anti conflict)?
07:08
I got a new, relatively expensive, keyboard last month that promised N-key rollover but it turns out just qweasdzx and the arrow keys have separate wires, the "non-gaming" keys still have shadowing. IDK but it seems like even gaming keyboards don't give every single key it's own wire
 
3 hours later…
10:34
0
Q: Validate a codice fiscale

Nicolas FormichellaValidate a codice fiscale Every Italian resident/citizen is given a 16-character alphanumeric codice fiscale Challenge The final letter is a check code, which is calculated as follows : Characters of the code are split up into even and odd character according to their positions (check letter exc...

I don’t understand this challenge
11121 is already composite so why would the test case result be 1112
Ok I think the test case is just wrong
 
4 hours later…
14:42
0
A: Sandbox for Proposed Challenges

Alan BreadelHow quickly can you type this string? code-golf string ascii Given a string consisting of only printable ascii, how many keystrokes are required minimally to type out this string from scratch? The allowed keystrokes are: one character from printable ascii (1 keystroke) Ctrl-C, Ctrl-V, and Ctrl-A...

15:22
CMQ: Does only apply to producing a single, fixed output, or more generally to any challenge that requires taking no input and producing some output?
Tag description seems to imply the first, usage seems to imply the second
the first and second definition seem pretty much the same to me
although maybe randomness would seperate them
15:48
@emanresuA There are so few random output no input challenges it seems not worthwhile to have a seperate category for them. While not technically kolmogorov complexity it seems close enough
 
3 hours later…
18:58
@emanresuA the first
19:49
@mousetail It's not necessarily just random output, sometimes it's "output anything fitting this description/criteria"
CMC(XD) Output string with smallest SHA256
What's the current world record?
20:12
@emanresuA From the tag wiki:
> Kolmogorov complexity, informally, is the amount of code it takes to describe or produce a constant object, such as a string or image.
(emphasis mine)
20:59
@l4m2 smallest as in lexicographical?
21:30
0
Q: Complete a Mystery Sequence

nyxbirdGiven a sequence of three integers, determine if the sequence is arithmetic (of the form [a, a+d, a+2*d]) or geometric (of the form [a, a*r, a*r^2]) by outputting a fourth term that completes it (a+3*d for arithmetic, a*r^3 for geometric). Examples: [1, 2, 3] -> 4 (This is an arithmetic sequence ...

22:22
I added an algo question here stackoverflow.com/questions/77861790/… in case anyone is interested or has comments
I just noticed that sorting items can be done without comparison operators.
Given two items x and y, do std::make_pair(x, y) = std:make_pair(min(x, y), max(x, y)).
This could be useful for sorting finitely many infinite lists in lexicographic order.
aren't min and max implemented with comparison operators?
Oh, see this:
7
Q: Why do most programming languages derive min/max from comparison operators, rather than the other way round?

Dannyu NDosFor example, recall the Ord class of Haskell: class Eq a => Ord a where compare :: a -> a -> Ordering (<) :: a -> a -> Bool (<=) :: a -> a -> Bool (>) :: a -> a -> Bool (>=) :: a -> a -> Bool max :: a -> a -> a min :: a -> a -> a compare x y = if x <= y th...

no but like implementation wise
to find the maximum of two things you need some way to determine what's bigger
More like "the bigger which".
22:36
apart from numbers where you could use signof(x-y), you'd need some sort of comparison operator to determine which is bigger
min and max allow us to pick the bigger without deciding which is bigger; that's my point.
yeah and how are you going to pick the bigger?
2 mins ago, by lyxal
apart from numbers where you could use signof(x-y), you'd need some sort of comparison operator to determine which is bigger
min(x, y) is the smaller, max(x, y) is the bigger. At least value-wise.
what's your comparison operatorless implementation of min and max that works for more than numbers?
because otherwise you're just abstracting away the comparison
There's the demonstration for infinite lists, in the linked question.
22:41
do you mean:
instance Ord a => MinMax (InfList a) where
    min x@(xh :! xt) y@(yh :! yt) = case compare xh yh of
        LT -> x
        EQ -> xh :! min xt yt
        GT -> y
    max x@(xh :! xt) y@(yh :! yt) = case compare xh yh of
        LT -> y
        EQ -> xh :! max xt yt
        GT -> x
> compare xh yh
looks like a comparison operator to me
That's for items inside the infinite lists, not for lists themselves.
yeah but it's still a comparison operator
your "sorting items can be done without comparison operators" still relies on comparison operators, just not as directly
@lyxal ez, just add to x and y until they overflow, whichever one overflows first is bigger
> works for more than numbers
:p
besides, as I said signof(x-y) works well for numbers
add/concatenate
22:44
what if it doesn't overflow :p
@lyxal Oh, what about this?: Sorting std::future objects on the durations that would be taken by waiting.
what are you comparing? what are you comparing by?
@lyxal then keep going
@DannyuNDos timesort does do things without comparison operators, but do you really want to potentially wait a long time? :p
and then how do you guarantee a consistent ordering of object -> time?
Aw right... they may hang forever.
Anyway, my point was this: sort :: Ord a => [a] -> [a] is an overkill, and sort :: MinMax a => [a] -> [a] is better.

« first day (4741 days earlier)      last day (400 days later) »