« first day (4418 days earlier)      last day (723 days later) » 

00:07
it's not like it;s an insignificant one :P
Yeah, Vladivostok has historically been incredibly important to Russia :P
 
3 hours later…
03:33
0
Q: Imtiaz Germain Primes

Aitzaz ImtiazDescription "Imtiaz Germain primes" is not a technical name in Mathematics, but my weird creation, in the memoir of the famous mathematician Sophie Germain. These primes can be generated by the following process: 1. Take a Safe prime 2. Apply 2p + 1 on it to obtain a composite number 3. Apply 2p ...

03:54
@lyxal 59 seconds ;P
If I hadn't bothered to write an explanation first, I'd have beaten you to posting :p
Honestly, I leave my explanations to after my first post, because I often find golfs in my explanations, and prefer just having an answer there, then working on it
I also just noticed:
> if bytes are equated then the earliest posted program wins.
time is a mystery :P perhaps someone can win by nano seconds
04:23
@cairdcoinheringaahing doesn't matter now :p
The power of collect until fixed point and lazy evaluation saves the day lol
04:51
@lyxal she still does not prefer you get the bounty on that question. despite of the fact you deserved that XD
05:37
@cairdcoinheringaahing I write explanations before posting because I hate doing captchas :p
05:48
This is the most taxing world-building SE post I've ever read. I thought I was pretty good at this abstract mathy stuff, but clearly physics is a whole 'nother thing.
45
Q: What does it actually mean to have two time dimensions?

Logan R. KearsleyThe trivial answer is that it just means "you have two dimensions with inverted sign in your spacetime metric". But the perceptual result of that kind of choice doesn't actually look qualitatively different from our universe. Consider the 4D case; our 4 dimensional spacetime has a a +,+,+,- metr...

I challenge you to read, and wrap your head around, each answer in one sitting :p
By the way, I was actually curious about this, because I was thinking about what it'd look like to have an esolang with two different time dimensions. If you figure out how to conceptualize >1 temporal dimensions, or how to esolang them, let me know!
(Specifically, the write-a-parser book I'm reading defines a program as an array of statements. So I immediately wondered about an esolang that defined a program as a 2d array of statements.)
type Program struct {
	Statements []Statement
}
type Program struct {
	Statements [][]Statement
}
??!!
wouldn't that just be a 2d esolang?
@lyxal i, uh...
interesting counterpoint you bring up there, my fair watson
but what if i say no?
well I'll just say it again then
and I'll keep asking it until the answer changes :p
@lyxal Amazing, haha :P TNB humor never gets old
I try my best :p
06:01
Or maybe... I never get old, lol
everyone gets old eventually
I mean, I guess it can be if you think of v and ^ as being able to move through the temporal dimensions at will
@lyxal and if not naturally, then by force
But, the way it manipulates through the time dimensions, doesn't seem thematic to most interpretations of >1 T dim
It seems pretty clearly designed with a spatial intuition, not a temporal one
(right?)
I mean, you have :, or whatever, that skips a command
You can sometimes, mirror, and then like skip over a "time dimension" or skip over the next event in the current time dimension, with the same primitive
I'm not really seeing how to think of it as >1 time axis the more I think about it, actually
I mean, you can rotate the whole thing 90 degrees, and it should still pretty much work the same
So what even are the time dimensions then? Every primitive?
tl;dr i think an esolang designed with a 2-time-dimension intuition/thematic would look very different from any "2d lang"/fungeoid i know
@lyxal
Two quick ideas: You might want there to be one arrow of time, but the two time dimensions can be manipulated independently. In this conception, the arrow of time is a function of the two temporal axes (a vector sum or something).
I forget the other quick idea, LOL
---
Yeah, I guess I'm thinking of two main sets of ideas.
One set is that you can't control time, just like in our universe, so the arrow of time goes through the evaluation of the program according to its own laws. However, you can manipulate the axes of time that together direct the arrow, so that the observable behavior changes.
The other set of ideas would be that you can, in a more typical sci-fi way, go back and forth through the two dimension of time, each one being its own arrow through spacetime. This may, or may not, involve things like time travel.
And if anyone would like to inform me of what the current physical theories are for how >1 temporal dimension actually work, I'd be very interested! Those are the two models I can semi-regurgitate right now, but I don't even know if any/either of these are currently posited to be plausible.
/end
06:55
now i'm just thinking about an esolang with one time dimension, but also time travel within one timeline
where outright contradictions are compiler errors, but origin paradoxes are a necessary part of the language :P
 
8 hours later…
15:12
does anyone else see 2 stars here
because i do
but only a single person is visible
I see the same.
It could be a bug, or maybe there
's an anonymising feature hiding a user.
How do you sandbox cops-and-robbers? Do you write both questions into the same sandbox post?
15:55
cmp: should i change my username to zoomlogo everywhere? (its my original username lol)
@CommandMaster i think many people just put both the cops and robbers into the same post because its easier to see that they are related
 
2 hours later…
17:37
I do not want to be the programmer who writes the datetime library in that universe! — Tim Jul 17, 2019 at 16:28
17:57
@PyGamer0 Yes. PyGamer sounds like you use Python and play games.
18:09
@AviFS there is one part of relativity in that if you observe something else travelling at constant velocity then the rate it appears to age compared to you and its velocity relative to light satisfy w²+x²+y²+z²=1, and that at least would still appear to work for multiple time dimensions (note that I have handwaved the definition of constant because that itself depends on time)
@lyxal maybe the answer will only change in the second time dimension
@Adรกm I zoomed his logo but I wasn't enlightened...
sorry, if I am disturbing an on-going chat, I am just announcing a 100 rep bounty to Neil, though it might not be a best gift to you, I and Aira really want to thank you for your extremely exceptional answer here
you really made a contribution for which we both had a thirst to recieve an algorithm for
bounty awarded, see now here :P
5
Q: Bumping Series Implementation

Aitzaz ImtiazI have a follow-up question here from my previous question on Math SE. I am lazy enough to explain the content again, so I have used a paraphraser to explain it below: I was considering arbitrary series, springing up as a top priority, when I considered one potential series in my mind. It is as p...

18:48
@AitzazImtiaz No need to announce bounties, there's a bot that does that already.
0
A: Sandbox for Proposed Challenges

Command MasterAll languages have their strengths, right? (Cops' thread) cops-and-robbers code-golf This is the cops' thread of a cops-and-robbers challenge. The robbers' thread can be found [here] (sandbox note: will add the link when posting) The main idea of this challenge is whether there are languages whic...

19:11
unaware of that earlier, expression of gratitude @WheatWizard :D
19:35
@Adรกm I do think that was idea of the username
But I'm pretty sure Pygamer0 hates Pygame, so agreed.
19:56
LDQ: Should I have length limits on package/version names?
20:13
Why would you?
@Ginger yes; do not allow names that cannot fit in RAM of the current machine.
@Adรกm luckily, I don't have to enforce that restriction :p
@Ginger Yes, make sure they have positive lengths
5D package naming with multiverse time travel
irrational lengths might be problematic too
20:30
@user Strictly.
I'd strongly recommend real lengths. Complex length names are slow to look up.
Strictly positive has a different meaning than you intend ...
20:53
iirc the semver spec says thereโ€™s no hard limit but a 255-character-long version number is likely more than enough
21:17
@mathcat okay yeah definitely not a bad idea to change it lmao
all i can think of is pygame
21:31
@Ginger Absurd package/version lengths should be undefined behaviour over a 255 characters, though not strictly forbidden.
21:59
update: due to implementation reasons I have to specify a maximum package name/version limit; I'm thinking 256 bytes
255 would be reasonable, allowing you to encode the length as one byte.
I don't need to, I'm using nul-terminated strings
@Ginger What if I want nulls in my package name?
too bad
cry about it
I for one support 7bit encoded int as a length specifier for strings
22:15
The Zero one infinity (ZOI) rule is a rule of thumb in software design proposed by early computing pioneer Willem van der Poel. It argues that arbitrary limits on the number of instances of a particular type of data or structure should not be allowed. Instead, an entity should either be forbidden entirely, only one should be allowed, or any number of them should be allowed. Although various factors outside that particular software could limit this number in practice, it should not be the software itself that puts a hard limit on the number of instances of the entity. Examples of this rule may be...
No
@pxeger well, uh, I hate to say this, but I cannot do that
I have to know the size of the array containing the title/version at creation-time
Rules of Thumbs and Principals are meant to be broken
there's probably a way to do arbitrary lengths, but it's almost certainly going to be jank as hell
if it's going to be jank as hell, you might want to figure out a way for it not to be jank
What's forcing the limitation?
22:19
the manner in which I'm processing the filetype containing the data
because eventually you'll probably find something that actually needs to allow arbitrary lengths
lemme see if I can fix it...
Linux MAX_PATH is 4096, if that matters
hm yeah CharBuffer wants an allocated length up-front, as does CharArray
No string types?
22:21
idk if Kotlin has mutable String types, lemme look...
StringBuilder, no?
wat that
google it?
huh, yeah
that could work, one second...
4
Q: Does Kotlin support mutable Strings?

CasebashThe following code doesn't work in Kotlin: var s: String = "hello" s[1]='a' Does Kotlin have a mutable string type or do I have to use an Array<Char> if I want to be able to edit?

The accepted answer demonstrates a string builder
22:30
well, I made it, and it is exactly as awful as I thought it'd be:
val name =
        StringBuilder()
                .also {
                    loop@ while (true) {
                        with(getChar()) {
                            if (this != Char.MIN_VALUE) it.append(this.toChar())
                            else break@loop
                        }
                    }
                }
                .toString()
The hell kinda file format are you using?
wait, that one's bugged, here's a fixed one:
val name =
        StringBuilder()
                .also {
                    loop@ while (true) {
                        with(getChar() ?: break@loop) {
                            if (this != Char.MIN_VALUE) it.append(this.toChar())
                            else break@loop
                        }
                    }
                }
                .toString()
1 min ago, by lyxal
The hell kinda file format are you using?
A custom-made one, which should tell you all you need to know :b
Well not really. I'm trying to say maybe there's a better way to read it
22:35
that awful mess reads an arbitrary-length nul-terminated string from a ByteBuffer
works great!
I love the aesthetic result of writing normal code with a large number of stupid golfing builtins that hgl's source code ends up with.
x_W errorString ordering =
  rFp (Prelude.errorWithoutStackTrace errorString) <
    lF' (zd' (maW ordering) ^. p) []
lmao
@Ginger why does it have to be null terminated? And why a byte buffer? Surely using even something like a Scanner or BufferedReader is a better idea
Scanner? I 'ardly know 'er!
/srs I don't know what a Scanner is and BufferedReader doesn't work for my purposes
...
A Scanner is like only the most common class taught in intro to Java classes
And because kotlin is jvm, it has it too
22:40
never done one
Well that explains a lot
lemme look it up
@Ginger why doesn't a buffered reader work?
It can only read CharArrays
I'm using ByteBuffer because I can read whatever I want as whatever I want
and Scanner doesn't look like it'll work either
@Ginger it's supposed to read files though
22:42
well now I'm in an argument with my language server
How are you opening the file to read?
it says the Elvis is useless because getChar() doesn't return a nullable type, but if I remove it it complains about unreachable code
When I needed to read a file in Java recently I just let Github Copilot right the code for me.
@lyxal I'm not, the code calling this library gives me a File object
Straight up just // Read file.cfg and it did the hard part.
22:44
but this is a custom format
so I have to write my own reader
@Ginger so then you just pass that to a file reader and then a buffered reader, get a list of strings and parse those
it's binary data
I have to manipulate the raw bytes myself
Why though
well I fixed the warning by casting the result of getChar() to Char? :/
@emanresuA what do you mean "why"?
Why not use something nice like json
22:46
@Ginger what library?
@emanresuA because I CAN
@lyxal the one I'm writing right now
3 mins ago, by Ginger
@lyxal I'm not, the code calling this library gives me a File object
So change it then to not return binary data
...what
what do you mean
I need the binary data
But you're parsing a package information file right?
Is that what you're doing?
I'm parsing a library information file, but yes close enough
22:49
Is this library information file saved locally in a directory?
yes
Open the file then and parse it yourself
Use buffered reader to get the file contents
@lyxal I am!
I am writing a library which will be called by my code
Why is it being converted to binary data at all?
my library, my code, my fountain, my world
@lyxal because that's the format it's in
22:50
@Ginger Too many fountains causes the roaring
@Ginger change the format then
don't wanna
Because you're stubborn and don't want to save yourself a whole lot of time?
yes
...
also, I think the decoder works now
22:53
@lyxal Okay Bigshot
wow, only 72 lines right now
now I just have to do the encoder
easy(?)
here, have some more cursed code:
fun serialize(): ByteArray {
    return ByteBuffer.allocate(3 + 16 + name.length + 1 + version.length + 1)
            .put(this.recordType.identifier.toByte())
            .putShort(this.installSource.toShort())
            .put(this.hash)
            .put(this.name.toByteArray())
            .put(0x00)
            .put(this.version.toByteArray())
            .put(0x00)
            .array()
}
*laughs in magic constants*
okay, it's done
95 lines of jank
thought of this last time i tried minecraft modding; you should really never have to write serialize and deserialize separately
including such gems as stream.write("๐Ÿ‡๐Ÿ“•".toByteArray()), with(this.getChar() as Char? ?: break@loop) {, and of course ByteBuffer.allocate(3 + 16 + name.length + 1 + version.length + 1)
or at least there should be some kind of shared format object/type
@UnrelatedString wdym?
oh, I forgot to add an internal modifier to that function :\
yeah that's for internal use only
@RydwolfPrograms come see what I hath wrought
23:11
like, you shouldn't have to write the format out twice, both as a matter of convenience and not being able to fuck it up
look upon my works, ye mighty, and despair
let's see if it buil- oop it's done
my favorite line is with(this.getChar() as Char? ?: break@loop) {, because (it looks like) I'm casting a type to a nullable version of itself only to immediately turn around and check if it's null
@UnrelatedString How would that work?
i tried to make some kind of format class and it failed miserably so i'm not sure how in java :P
the real story here is that this.getChar() can return null, because it's a Java function, but my typechecker apparently doesn't know that
23:15
iirc it just like
named the fields and enforced the order
weirdly, it does know that it could be null if I use getChar elsewhere, but that instance is inside an extension function, which I guess the typechecker has a hard time with?
now, let's see if it works
23:28
I don't remember how nullability works in Kotlin but Swift has three levels of nullability: T (not nullable), T? (nullable), and T! (an Objective-C function didn't annotate which one it is). That last one can be converted to plain T without having to explicitly check for nil, but then the compiler unwraps it for you (equivalent to !! in Kotlin, but implicit).
To unwrap nil like that is slightly more dangerous in Swift though, since it causes SIGILL rather than just throwing an exception
mfw gradle manages to build the library... without including the classes somehow
oh
I'm stupid nvm
> 'break' or 'continue' jumps across a function or a class boundary
oh no
@Bbrk24 Kotlin has a similar system: T for not nullable, T? for nullable, and T! for a type from a different JVM language
@Ginger I would recommend against putting stuff like break or return inside expressions like that. That's just asking for bugs
One fun part of the Swift type system is explaining the difference between as T? and as? T
Does the first error if the expr is null?
@Ginger Wait what does that mean out of curiousity
Like how does that work
23:39
@Ginger This does not be that complicated
@RydwolfPrograms They used a break inside a lambda inside a loop
as T? can be used to do things like Int? -> Any? or Int -> Int?. as? T can be used to do things like Any -> Int?, where it returns nil if the value isn't actually an int
val sb = StringBuilder()
var c = getChar()
while (c != Char.MIN_VALUE) {
  sb.append(c)
  c = getChar()
}
val name = sb.toString()
It's not the prettiest code ever but it sure is easier to understand than that stuff you have right now (@ Ginger)
What exactly is getChar()?
C brain is saying that it returns int and not char
Ah
But I'm probably wrong
23:48
No, you might be right. According to the docs, MIN_VALUE is a Char, but Ginger did do toChar in their code
char is barely a type in C. Most functions that could take or return a single char use int instead, and the default type for character literals is even int. (I've seen someone abuse this: sizeof 'c' == 1 ? "C++" : "C")
at least it's not bool
lol I thought you could use macros to determine that
ifndef CXX_VERSION or something
__cplusplus, but yes
1==sizeof 'c' is shorter for code golf
Ah
In that case, you could use > or <
yeah they probably did, idr
1<sizeof 'c'?"C":"C++"
23:57
Would 1<sizeof'c'?"C":"C++" not work?
No, that'd be parsed as a single literal in C++
L'c' is valid, MY_MACRO"C" is a compile error, so I can only imagine sizeof'c' would error too

« first day (4418 days earlier)      last day (723 days later) »