« first day (4478 days earlier)      last day (663 days later) » 

01:02
CMC: Given a non-negative integer of at most 2^31-1 (2147483647), determine the number of rotations in no particular direction that results in the largest integer. Direction of rotation (left or right) is programmers choice, and may be constant or not.
Digit rotations?
Correct, Digit rotations.
Decimal digit rotations in particlar.
Input may be as an int, a string, an array of numbers, a stream, etc.
Mind providing a quick example? I'm guessing 123 -> 1 (a single rotation to the right provides 312)
123 -> 1 (Rotated RIGHT) 19298 -> 3 Rotated LEFT (Gives 98192)
Leading zeros discarded?
01:09
yes I can chat markdown why do you ask
Oooh, Vyncode is new to me.
well, tbf it did only get added to the base language last Saturday
@lyxal of course
I'm not even surprised that Vyxal now has a way to have fractional byte encodings, and tbh, it looks more interesting that most other langs with it, but I still wasn't expecting it
neither was I
but then one day I saw this:
in Vyxal, Apr 20 at 21:00, by AndrovT
I made a range coder for Vyxal to see how well it works and it looks like it decreases length by about 10% on average.
https://github.com/AndrovT/Vycoder Here is the code if anyone wants to play around with it.
(and yes, vyx-µ was a thing a while ago, but for some reason it never got incorporated)
(besides, range coding is apparently better than huffman encoding)
> looks more interesting
It's more like packed stax than nibbles
The CMC was just formatted like that for convenience
The actual bit string is 101110100011100010011010001110010001110
Apr 21 at 1:36, by lyxal
CMQ: Say I have a language where programs are bit strings of any length. And say the length of the bit string is important, meaning that padding it to a whole byte is out of the question. Could I use an encoding like a = 0, b = 1, c = 10, d = 11, e = 100, f = 101... up until any arbitrary length to shorten the bit string for code golf answers?
why else do y'all think I asked that :p
Encoding theoretically never matters as long as it'll run :P
01:23
y'all might be interested in the fact that the encoding utility is written in scala, and turned into js for the website via scala.js and bundled as a jar for the offline interpreter
cursed, yes, but the best solution we could think of
01:58
Not sure if this is the right place to talk about it but we could use it like a library instead
Either publish to Maven Central or use Git submodules
Anyone here used Git submodules to be able to use another one of their projects as a library without publishing to some package repository?
And if so, how painful was it to get set up?
Any hacks required to keep it working and updating the submodule?
02:24
@user I've used submodules once but I never had to update it so I can't fully answer it. It was painful to move the submodule from one folder to another though
@user wdym library?
How tf is python gonna use a maven library?
maven isnt just java
gradle can famously work for c++ and swift
@Seggan Mmm except in this case this is java/scala
@lyxal most kotlin packages are on maven central as it seems to be the only repo that can handle kotlin multiplatform
like the direction of rotation doesn't actually have to be consistent, your program just has to output either the correct number of right rotations or left rotations for any particular input? ooh
i'm having a hard time thinking of what kind of solution could make that useful but i'd love to see one
02:31
@Seggan but getting the raw Java/scala isn't going to help. You'd need to upload just the jar to maven to make it of any use
@Seggan It can WHAT
@lyxal yeah
@Bbrk24 yep :P
There's already CocoaPods and Carthage and SPM, we don't need gradle too
apparently it can handle any lang, but builtin support is java, kotlin, scala, groovy, c(++), swift, and javascript
Why Swift? /gen
02:35
anyways DṙJ$M for 5 in jelly with consistent left rotations; remove the D$ if digit list input is allowed
@Bbrk24 I’m thinking bc perhaps they needed to support kotlin/iOS and adding official swift support was trivial
> kotlin/iOS
you what
yeah bc kotlin/iOS may need to have some code written in swift
@Bbrk24 never heard of kotlin multiplatform?
Like React Native but worse
there’s kotlin/jvm, kotlin/android, kotlin/iOS, kotlin/native, kotlin/js, and (new) kotlin/wasm
@Bbrk24 no
better
js and anything to do with it is near universally bad
03:03
I disagree
@Seggan ergo kotlin is categorically bad
more seriously, JS has improved a lot recently, especially with certain preprocessors such as what modern Angular does
Switching very suddenly from Angular 1.6 to 14.2 was an experience, but after the adjustment I can say I vastly prefer the newer one
03:31
@lyxal Oh you mean for v2, mb
@Bbrk24 Aww, okay
If moving stuff is gonna be painful, best to avoid them, I guess. I try to stay away from Git black magic :P
@Bbrk24 I mean, Gradle supports a TON of languages, doesn't mean it's actually used for them much. Some company out there may be a Java shop that only occasionally makes Swift stuff, so they might prefer to stick with Gradle even for Swift
I bet there's people out there using Make for languages that are nothing like C/C++
@lyxal Jython
@user oh hell no. Ain't no way
Man's really suggested the goofy version
You'd have to ditch PA, of course
@user there exists make for js called jake
aaaaaaaaaaa
Jake more like Joke
@user That was UnrelatedString's reaction too
03:39
@UnrelatedString I'm of the school of thought that where possible, a challenge should remove as many restrictions as possible, to open as many strange solutions as possible.
based
Nov 18, 2022 at 5:45, by Unrelated String
wait wait wait is jake fucking
make
in JAVASCRIPT
Quick, delete that before Unrelated sees it again or they'll have to take benadryl and go to sleep again
@UnrelatedString Please ignore the messages above this
03:58
and the ones below it for good measure
ignore this message if I can take all your money
04:26
I think there's been a change to chat that's broken one of the userscripts I use - something about s.data.replace being undefined when I use chat with userscripts keeps coming up in the error console. And it makes firefox start using a whole lot of RAM
05:18
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
jake, me taking your money, or the userscript thing?
I get this weird feeling, apropos of nothing, that Unrelating String is having trouble with something
@ATaco yeah same
this is just a way i've never seen it done before
and it's so cool
Nov 18, 2022 at 5:45, by Unrelated String
this isn't funny anymore
Apr 16 at 21:01, by caird coinheringaahin g
@RydwolfPrograms Disagree
Jan 28, 2022 at 21:07, by caird coinheringaahing
People can be very funny when they find a very bad idea :P
in Sandbox, 7 secs ago, by lyxal
ooh are we doing that talk in replies thing again?
05:23
Sep 22, 2021 at 21:35, by caird coinheringaahing
Ah, yeah, that's cheating
Jan 20 at 0:12, by lyxal
don't care + didn't ask + L + ratio + nerd
On the other hand, if I keep talking like this, then I'll eventually run out of messages to quote
Jan 9, 2022 at 3:03, by caird coinheringaahing
Possibly
Mar 22 at 22:10, by lyxal
@user "hey wait gosh dang it not again"
05:26
in Snowpaw's Den, Apr 25 at 22:39, by lyxal
@Snowpaw puts you in microwave for 3 minutes 30 seconds
Jun 9, 2017 at 15:57, by caird coinheringaahing
@programmer5000 i dont think so
in Snowpaw's Den, Apr 20 at 6:16, by lyxal
Oh well worth a shot.
in Snowpaw's Den, Apr 20 at 6:16, by lyxal
@Snowpaw there'll be plenty more chances.
05:48
It's like 7am here, my brain doesn't work yet :P
Side topic: it really is a shame SE isn't paying attention to community ads very much anymore
Honestly, I wouldn't care so much about them advertising to us, so long as we had competent community ads
06:10
Time for a community adds userscript :)
06:36
Aug 1, 2021 at 18:15, by user
Missed a fun conversation :/
07:28
Jul 4, 2017 at 21:12, by caird coinheringaahing
now I'm sad
2 hours ago, by lyxal
in Sandbox, 7 secs ago, by lyxal
ooh are we doing that talk in replies thing again?
On topic: We currently have 21 imgur links that are going to die soon: https://data.stackexchange.com/codegolf/query/1747560/imgur-links-that-are-about-to-go-down

Anyone want to help me edit them out?
@mousetail there's a userscript for this
I'll find it real quick
It archives images and links and gives you a replacement to edit in
07:44
Yea I already downloaded the spreadsheet with all the replacements
That's my second link
08:32
Does any known CPU architecture implement fused multiply-add for signed integers?
08:45
Nvm, I planned to make an OISC doing that, but I don't want the instruction length to be too long.
In my current sketch, the pseudocode is: if a == b then goto a else [*a, *b] = *a - *b
2^32 registers with 64 bits each; that's 32GB in total.
That's not really registers anymore, that's normal RAM
Yeah, just really quickly accessible RAM.
Would require a lot of silicon tho.
(Help me, Samsung!!)
@mousetail (for what reason?)
34
Q: Imgur TOS change on May 15th 2023 could cause the loss of thousands of Stack Exchange images!

qazwsxOn May 15th 2023, Imgur will implement its new TOS, in which We will be focused on removing old, unused, and inactive content that is not tied to a user account. I, and presumably many other users, have uploaded things to Imgur without logging in, and then posted those images to Stack Exchange,...

09:03
Wait, if a byte is supposed to be the smallest addressable unit of memory, does that mean 1 byte = 64 bits in my OISC?
Such an overkill to encode a character.
@DannyuNDos Yep
But only if there is no single instruction to access less values
20
A: Is the change of policy of Imgur going to create problems for all posts with images on SO?

CerbrusNope. SE runs a corporate version of Imgur, so image persistence is guaranteed. I also see no valid reason for nudity on SO, so that seems extremely unlikely to have any (negative) effect.

@lyxal That's why I'm specifically searching for images not posted with the corporate version of imgur
And replacing them with images that are hosted on the corporate version
Images on stack.imgur.com/* will work, but any other .imgur.com images will be deleted probably
 
2 hours later…
10:50
May the 4th be with you all
May the momentum prime be with you, too.
I have a feeling that this Imgur TOS change is at least partially for freeing space on their servers :p
11:13
crazy
I can't manage to get this gif under 2 MB, anyone else want to try? codegolf.stackexchange.com/a/111121/91213
Crop it?
Want to try?
11:31
> while cd
what
I had to crop it, maximally compress it, delete every 4th frame and slow it down 4x to counter that.
@Bbrk24 probably the shortest way to get a successful return code :P
@emanresuA TY
You may find ezgif.com helpful, I'm going to bed now
just make sure that whatever you need it for does in fact mandate the gif format :P
o/
oh for porting to stack imgur
hmm
11:47
in any case this is what just naively cranking the bitrate down in ffmpeg does
@UnrelatedString What about :?
ooh
true
maybe fish doesn't have it
@UnrelatedString Getting the size down if converted to webp is very easy but imgur doesn't support it
f
and it also seems that proper video formats are right out
APNG? /hj
11:56
Could work
JPEG2000
But it's fixed now so I don't really have any need to put more effort into it
4
Q: Could we support WebP image format when uploading images?

bandybabboonSE is a leading example of top multimedia streamlining for ease of use. WebP is currently unsupported when attempting to upload an image. It's fast becoming a very common image format because it is superior to other formats in various ways. If .webp becomes useable on SE it could be a good upgrad...

12:31
Can you link to badges like you can tags?
probably not but good question
[badge:code-golf]
no
my only post on workplace is at 2.5k views and voted +12/-9
a bit of a controversial subject, that :b
you get a silver badge for 2.5k views so within 36 hours of joining I got a silver badge
it’s also my first post to make it to HNQ
12:34
@Bbrk24 second
First one SE decided to send me a notification that it reached HNQ
must be a workplace thing
(was the other one my sort by duplication?)
it was
I've never received a notification for HNQ status before
 
1 hour later…
13:41
Yeah that must be new or sth
Do mods get automatically flagged if you do a lot of edits?
14:10
0
Q: Prefix notation in JS

gmendesThis challenge requires me to create an anonymous function that given a string in prefix notation, must return the result. The string can only contain the following operations +, -, *, /, ^ and integers (negative, zero, positive, etc). I've come to a point where I can't reduce my function any mor...

 
1 hour later…
15:11
@mousetail I don't think so, but it does clutter the homepage either way, which is very visible
holy shit you were not lying when you said "a lot of edits"
usually you should ask on meta before doing more than like 4-5 edits at once
jesus mousetail
my favorite religious deity
we all remember when he died on a mousetrap so we could all have cheese
15:30
ಠ_ಠ
@RydwolfPrograms Still about 200 to go
Planning to do about 50 a day
4-5 a day is typically the recommended rate
What exactly do you need to edit so much
We only have 2 weeks
It's not going to be done in time if I do it that slow
8 hours ago, by mousetail
On topic: We currently have 21 imgur links that are going to die soon: https://data.stackexchange.com/codegolf/query/1747560/imgur-links-that-are-about-to-go-down

Anyone want to help me edit them out?
Number was wrong, there are actually like 300
ohh
I saw that on another site's meta, didn't realize it applied to us too
Opinion: Restricting who can edit what in order to maintain the front page is dumb
It applies to the entire internet lol
Reddit is going to be a ghost town too
15:39
"noooo don't [necropost/do ...], you're ruining the front page" is what makes other forums absolutely suck
We shouldn't be sacrificing moderation for...what benefit even is the active page?
There really should be a way for high-rep users to edit without bumping
Maybe then going to some sort of queue for review
^
Maybe not a queue, just like, a page in that useless 10k tools thing
That would be fine too
Honestly, I'd appreciate if there was some system where someone checked my work. It's entirely possible I made some mistakes
Yeah but the review queue could be the bottleneck then
For mass edits the 20 reviews/person/queue/day would be annoying
You would need 2 people working in tandem
Reviewing each others posts in the queue when it fills up
16:01
someone's probably working to archive as much of imgur as possible before the cutoff
I don't think there is actually any kind of index though so you could list the contents
So you'd need to crawl the internet for links
16:35
@RydwolfPrograms recent meta said 10/day, I thought?
0
A: Sandbox for Proposed Challenges

Hippopotomonstrosesquipedalian2-Cyclic Quine In this challenge, you have to make a programme that satisfies these properties: The programme must output another valid programme. This second programme must output the original programme. It must obey all the rules of quines (see exception below). It must not print itself. This...

@Bbrk24 it's a different situation if you are editing your own posts or doing a moderation task
16:56
@TheThonnu then why is the tag still here? — Hippopotomonstrosesquipedalian 3 mins ago
Anyone know how to answer that better than I did?
Popularity contents are still allowed
But only in very exceptional circomstances
17:57
As far as I can tell it’s for the slightly subjective contests
0
Q: I'm in the process of replacing all ananymous imgur images with stack.imgur images, and I need your help

mousetailAs stated on mother meta all imgur images not associated with a account or the "stack.imgur.com" official corporate instance will be deleted on May 15th. If we don't replace those links before that date, they will be permanently lost. Some questions and answers may lose unessential fluff but many...

 
2 hours later…
20:02
The flag of Bangladesh is hard on colorblind people...
20:19
LDQ: When, if ever, is it okay to sacrifice consistency for readability?
Can you give an example?
I realize that was a bit too general lol
Gimme a sec
I think a lot of the time consistency is in service of readability, so if they're conflicting, readability is probably a semi-safe bet.
whoah
TIL Voyager 1 is 22 light hours away
thats far
20:23
How many hours has it been since it departed tho? :p
a lot
but still, 22 light hours is... considering the moon is a light second away
@RydwolfPrograms At least 22
still a while till a light year
@user Not necessarily, it may have travelled through a wormhole
just a bit till light day
20:24
@Jacob Like, adding sugar for some specific case?
Added sugar is unhealthy. Minimize how much you use.
@RydwolfPrograms But a spoonful of sugar helps the medicine go down, so in that case it may be a net positive for your health
hmm okay
@RydwolfPrograms (this was a joke btw. syntax sugar is often good)
the context is i’m making a language that’s somewhat golfy but less general-purpose
okay thank you for the feedback 👍🙏🪆🛎️💰
20:31
thumbs up clapping...russian nesting dolls...bell money?
You used this language to get hired as the well-paid bellringer in a russian church? :p
20:47
*orthodox
21:06
@RydwolfPrograms 🙏 isn't clapping, clapping is 👏
🪆 is just a box on my end
@Jacob Still a bit vague even with the provided context, so my answer is "sometimes" ;)
22:01
i can give a more specific example, i was on my phone on the train earlier so i couldn't really type
the idea i had was a construct for doing lookup-table-ish mappings
How do OISCs deal with syscalls?
where it's basically like indexing but somewhat more readable and concise
@NewPosts Damn that's kinda cringe ngl.
like "b"→"abcd"→[5, 23, 98, 2] would be 23, something like [5,23,98,2]["abcd".indexOf("b")]
That doesn't seem particularly readable to me, as the two symbols perform different actions.
22:17
@DannyuNDos maybe a certain memory value or jump location?
But register and volatile cannot mix?
@Seggan even the sun is only about 8 light minutes away, so 22 hours...
Swift generally favors legibility over brevity. As a counterexample, fuckingclosuresyntax.com
22:39
@Bbrk24 that just looks like scala syntax with extra steps
There’s a lot of orthogonal things on display there
> var closureName: (ParameterTypes) -> ReturnType = { ... }
Imagine not having inferred types
- you can omit the return type if the compiler can infer it
- you can omit the argument types if the compiler can infer them
- you can omit the parens if you omit the argument types
- you can use `$0` and `$1` instead of explicitly listing the arguments
- you can omit the word `return` in a non-Void closure iff the body is a single expression
@Bbrk24 as I said, Scala with extra steps
- you can use the same syntax for unapplied method references as for unapplied operators
hence .sorted(by: >)
22:43
Still scala with extra steps
@lyxal You can have multiple trailing closures
wait I just thought of the most cursed thing
calling swift users swifties
Button { doSomething() } label: { Text("Click me!") }
@RydwolfPrograms yes that is a thing
lol really
@lyxal Does Scala have $n? I would’ve thought it uses it like Kotlin
22:45
@Bbrk24 _
I wanted to be a Rustacean.
And we have Go → Gopher.
@lyxal Oh yeah that too. var ignoresFirstTwo = { (_: Int, _: String, x: Double) in x }
in x looks goofy
@Bbrk24 also, imagine not having last expression = return value
@lyxal I meant like { $0 > 3 } as opposed to { x in x > 3}
22:48
_ > 3
(>3) as a Haskeller
@lyxal Okay then, what about let f: (Bool, Int, Int) -> Int = { $0 ? $1 : $2 }
@lyxal That is a subject which has been vehemently debated on the Swift forums. The current consensus is that it’s not something that should be done, and regardless in some cases it would be breaking to add it
@Bbrk24 you'd have to ask user
@user ^
Underscores all the way
val x : Function3[Boolean, Int, Int, Int] = if _ then _ else _
x(true, 3, 4)
x(false, 3, 4)
22:59
you can what
okay then uh
let f: (Int, inout Int) -> Void = { $1 += $0 }
inout is equivalent to C# ref
That's called bad code
That's not very functional programming of you
inout params are cringe tbh
@lyxal Tell that to reduce(into:_:)
> Here's my favorite footgun in Swift:
```swift
func flatten1<T>(_ arr: [[T]]) -> [T] {
// O(n)
return arr.reduce(into: [], +=)
}

func flatten2<T>(_ arr: [[T]]) -> [T] {
// O(n^2)
return arr.reduce([], +)
}
```
That's just bad language design
Also, how
As to "why": += does the exponential (amortized O(1)) growth and can use realloc, while + has to allocate a whole new array to store the results
@Bbrk24 okay then
23:04
The compiler is allowed to optimize out your accidentally-quadratic performance, but not required to
@reduce(into:_:) inout parameters are cringe, as are you
Not having a reduce in O(n) by default is a skill issue
Perhaps writing it out in full instead of using the shorthand syntax will make the performance difference more obvious
reduce itself is O(n), it's the allocations that aren't.
Skill issue :p
reduce(into: []) {
  $0 += $1
  // appends into the existing reserved capacity,
  // only allocating more as needed
}

reduce([]) {
  let ans = $0 + $1
  // because all three coexist, you have to allocate new memory for ans
  // that is where the quadratic performance lies
  return ans
}
it's the same idea as using push vs concat
Why wouldn't the language create a variable ans = $0 and assign to that
23:08
neither reduce is inherently O(n^2), it only works this way with dynamically-sized collections
besides, there's already .flatMap { $0 } which is shorter and more performant
@lyxal Again, it's allowed to, but not guaranteed to. Especially if you use a custom collection type instead of Swift.Array
@Bbrk24 that sounds like a design flaw then
And really, custom collection types shouldn't change how it works
That doesn't sound like very good oop design
If you're calling into a third-party library that only provides + and not +=, it simply cannot make that optimization
Well that sounds like it breaks once you use operators not already defined
Like what if I want to use something that doesn't have an augmented assignment method
Also, there's a reason you don't see reduce too often in the first place
Like I've definitely used it before, it has its place, but it's no worse to just manually write the for loop
That's not very functional programming of you :p
23:16
@lyxal I'm genuinely curious: do you even have a way to do this that isn't O(n^2)? I'm not convinced it's possible
That's what I'm saying
The functionality of reduce into becomes wasted in that case
reduce is equally powerful as for. It's literally just a matter of imperative vs functional style
You can write an O(n^2) for loop to flatten an array. You can write an O(n^2) reduce call to flatten an array.
This shouldn't be surprising. I only call it a footgun because of how easy the latter is to write
@lyxal Okay, non-inout example. let f: (Double, Double) -> Double = { $1 / $0 }
The point was less about the inout and more about changing the order
23:37
@lyxal Function3[Boolean, Int, Int, Int] can be (Boolean, Int, Int) => Int, I think
@Bbrk24 Wait what's the question
how do you reference arbitrary parameters in a Scala closure without naming them
Oh you can't, there's only underscores
It doesn't have the dollar sign thing
just _ only works if you don’t reorder them and or use them multiple times
Yeah
I’ve used the dollar sign thing in a lot of code golf
23:39
To be fair, in real life, I try to avoid underscores if it gets over like 10 characters
But yeah, _0 or something would be nice to have for code golf
I’ve done it in practical code too, I just have no examples onhand
Ah here’s one: sections.map { SectionContent(id: $0.key.position, heading: $0.key.label, items: $0.value) }
I don’t think referencing $0 thrice there is unreasonable
Scala wouldn't even be able to reference the parameter once because it's inside parens
lame
Bad for code golf
But good for keeping people from doing shenanigans irl
@Bbrk24 I would probably use a named parameter here personally
Actually maybe not
The other thing is: if you want to discard the first parameter you can say { $1 }. If you want to discard the second parameter, you have to write { x, _ in x }
23:48
Guess that makes sense

« first day (4478 days earlier)      last day (663 days later) »