« first day (4508 days earlier)      last day (355 days later) » 

12:18 AM
0
Q: Very basic four operations calculator

OmegaO333This is my first question so here goes... I want a calculator that handles the four basic operations. The input is a string containing two one-digit numbers with one operation symbol between them. The output should be a number or string that is or contains the answer to the input. You can use any...

 
I smell dupe
 
you're right
21
Q: Basic Calculator

Kevin Brown-SilvaYou must write a program to evaluate a string that would be entered into a calculator. The program must accept input and output the correct answer. For languages that do not have standard input/output functions, you may assume the functions readLine and print. Requirements Does not use any k...

it's not every day I get to hammer things
:p
 
Just a reminder to be cautious with downvotes to new users posting dupe challenges - we're familiar with the site, and know to search for dupes before posting. They aren't and don't, and downvotes can be discouraging
 
^
 
@lyxal Beat me to it by a few seconds cause my laptop refusing to click the "share" link :/
@cairdcoinheringaahing Note that I'm not saying "don't downvote them", just that they are less downvote "worthy" than a lot of other posts :)
 
12:26 AM
@cairdcoinheringaahing it could have been a quality downvote though
Still, leaving a downvote explanation on new users posts is a good idea
Regardless of why
 
@lyxal Yeah, absolutely. Again, I'm not saying that people shouldn't downvote posts just because a new person posted them
But I wanted to get ahead of a potential mass downvoting
 
Fair
 
Also, I haven't written a challenge on the site in a while, but regularly write latex for my degree, and the switch from $ to \$ is getting to me :P
 
SE post writing will do be like that
 
12:46 AM
welp, I managed to crash Inkscape :/
YES
@Bbrk24 I did it!
whaddaya think?
 
Sandbox posts last active a week ago: German pharmacy payment
 
1:08 AM
0
A: Sandbox for Proposed Challenges

caird coinheringaahin gConstruct this number Given a constructible point \$(x, y) \in \mathbb R^2\$, output the steps required to construct \$(x, y)\$ Constructing a point Consider the following "construction" of a point \$(\alpha, \beta)\$ in the Cartesian plane: Begin with the points \$(0, 0)\$ and \$(1, 0)\$. Then, ...

 
@Ginger Wow, that looks nice! I will say though that part of the appeal of the symbol I have is that the two things sticking out the sides are at different angles
 
@Bbrk24 but of course, we can't have them be straight now can we? :p
 
@SandboxPosts If I could get some quick feedback on this? I intend to post in a couple of days if there aren't any obvious issues
 
I can do that pretty easily, one sec
 
@SandboxPosts Also, damn: This is the first time I've posted in the Sandbox since becoming a moderator
 
1:11 AM
:O
 
That is a very interesting challenge that I have no idea how to even attempt it without golfing
 
May or may not be inspired by the exam I sat this mroning :P
 
wrong layer?
:P
 
@Bbrk24 does ^^^ look better?
@Bbrk24 nah, I wanted to make sure you were satisfied with the angle before I composited it all back together
that's a screenshot of my editor :b
 
1:15 AM
they're still straight :P
 
straight is relative
 
They're still parallel though, both 70 degrees
(yes I measured)
 
@Ginger Add some curvature to them :P
 
you want them to... not be parallel?
 
Also, given that this is coming up on 3 years in the Sandbox: any feedback?
 
1:17 AM
@Ginger The ones in my current pfp are 79 and 67 degrees respectively
 
3 years?!
ain't no way
 
Namely, a) is it understandable, and b) do I need more test cases?
> answered Jun 9, 2020 at 0:43
 
@Bbrk24 *internal screaming*
 
@cairdcoinheringaahing I mean dang I rember when it was posted no way was that that 3 years ago
 
I will do it if you want, but it will pain me to do so
 
1:18 AM
yes please
 
ok, if you're sure
 
@lyxal I have a monopoly koth proposal in the Sandbox from 2017 :P
But aside from that, complete the landscape is the longest challenge I have in the Sandbox
 
@cairdcoinheringaahing I more mean it doesn't feel like 3 years insert something about time quote here </end quote chain>
 
I know what you mean, I'm just remarking on how long some of my posts have been in the Sandbox :P
Huh, of my 77 (undeleted) Sandbox posts, 15 are still "pending"
 
done
 
1:26 AM
they're backwards
it's a good idea to test how that looks at small sizes though
 
please do not make me swap them
I'm going to bed soon
 
hm
really doesn't work at 16x16
 
yeaaah
 
0
Q: Complete the landscape

caird coinheringaahin gCarcassonne is a tile-based game, where the objective is to construct Roads, Cities and Monasteries, in order to score points. The game works by players taking turns to draw and place tiles to construct a landscape, then claiming roads, cities and monasteries. An example landscape is: There are ...

 
Well, thanks anyways
 
1:29 AM
@NewPosts oh hey, that's fun: my previous challenge was also posted on the 3rd of the month (April) :P
 
@Bbrk24 no problem!
who am I to turn down a chance to practice my vector art skills d:
 
completely different topic: I really hate working with backslashes. They are painful
 
2:05 AM
> type 'T?' cannot be converted to contextual type 'T?'
Swift, what did I ever do to you
 
What's a contextual type?
 
The type it expects based on the rest of the expression
like if you have 1 + x, the contextual type of x is Int
 
So then what are you doing where an object can't be converted to the same type as itself?
 
What does the \T? do?
I get it's optional T but what's the backslash
 
2:14 AM
\T.foo is equivalent to { (x: T) in x.foo }, modulo compiler oddities
(actually it can be a bit more than that but when it appears where you'd expect a lambda that's what it means)
 
What does { (x: T) in x.foo} do?
 
uh, equivalent to C# (T x) => x.Foo? it's a lambda
 
Ah
See I don't know swift
I now remember how I disliked the usage of the word in for lambdas in swift
 
5
A: What are common options for lambda function syntax?

Bbrk24Swift-style If you haven’t seen it yet, let me introduce you to https://fuckingclosuresyntax.com. More seriously, the full syntax is this: { [byValueCapture] (argName: ArgType) -> ReturnType in body } …but most of that is optional. A few things to note: Only by-value captures are specified; by-...

 
Yeah we had a whole conversation about it here once
 
You have been put in timeout.
Go stand in the corner and think about what you did.
 
@UnrelatedString got bamboozled then, thinking "I didn't accidentally put the room in time out did I?" lol
 
@DLosc upper left
 
@UnrelatedString What pronouns do you use? I feel like I must've asked this before
 
2:35 AM
he/him (but they/them is fine)
i feel like i had it in my chat bio at some point but i guess i forgot to keep them when i set this one :P
 
@Bbrk24 Dammit, don't tell me I have to timeout the room :P
On the other hand, it is funny :P
This room was placed in timeout for 2 hours 46 minutes; Cause I can :P
Damn, didn't realise I could go for that long
Timeout cleared
 
@cairdcoinheringaahing well done chief
Excellent time outing
10/10
 
I could try 99999 seconds if you want :P
 
You won't :p
 
This room was placed in timeout for 1 day; I could do with a day off
That's the max, sadly
 
2:45 AM
The worst part is that I can't tell if that's real or not :p
 
Timeout cleared
Any regular user can confirm that was legit :P
 
Is this some sort of normal user thing I'm too room owner to understand? :p
 
If you want, I can demote you so you can verify it :P
 
That takes effort tho
 
Might as well just use an alt :p
 
Done
 
@cairdcoinheringaahing Desmos, 28 bytes: f(l)=[1...l.length][l=1].max Try It On Desmos!
 
@cairdcoinheringaahing well actually no I don't see because I can't talk in there anyway
There's no time out box for it to display
 
Your bot has write access
 
Oh
I didn't refresh the page
So I didn't see it :p
 
2:52 AM
@cairdcoinheringaahing i cant
 
Saw it now :p
 
@Seggan That's cause, unsurprisingly, I didn't leave TNB frozen for any significant amount of time
I don't want to put y'all in timeout for any proper amount of time, unless necessary
 
 
1 hour later…
3:58 AM
Is it possible to write arch-agnostic llvm ir? The stuff clang generates includes things like target-cpu
Hm, it seems to work just fine without that
 
4:41 AM
terrible meme I know
 
5:26 AM
oh I mistyped one of the registers — they’re supposed to be the same thing, not one rdi and one rdx
 
 
3 hours later…
8:30 AM
hi!
how can this be golfed?
mask = []
for _ in range(20):
    prefix_length = np.random.randint(1, 20)
    mask.append([True]*prefix_length + [False]*(20-prefix_length))
mask = np.array(mask)
 
List comprehension?
 
I need an numpy array at the end
 
Yea
mask = np.array([.... for ...])
 
yes that would save some bytes, thank you
 
 
2 hours later…
10:20 AM
@Simd best I could find was mask=np.mgrid[0:20,0:20][1]<=np.random.randint(1,20,20)
 
CMC Given a length of a string, output the number of ways to divide it into words. Each word must be at least 1 character long and the spaces seperating them cost exactly 1 character
 
I feel that that's a dupe of an existing challenge
 
Probably
 
10:38 AM
@Neil that is really good!
 
actually that should be <; <= results in off-by-one errors
 
@Neil hmm... Actually I am not sure I understand it. Why does it give Trues followed by Falses on each row?
Oh I see
I had to look up what mgrid does
 
np.mgrid(0:20,0:20)[1] returns an array of 20 rows of 0..19, and then the < compares each row with each of the 20 random numbers from 0 to 19
 
@Neil that is cool
 
ugh, I mean 1 to 19 of course
 
10:49 AM
Although I am very grateful, SO people keep on answering questions I don't ask?! stackoverflow.com/questions/76395255/…
 
11:39 AM
@Simd That's weired, your question is quite clear but the answers but the answers don't seem to understand it
Why does the one that just fills the whole space with red have a upvote
 
12:26 PM
s.replaceAll("\\\\\\\\", "\\\\\\\\\\\\\\\\")
Thanks scala
very cool
for reference, s.replace("\\", "\\\\") suffices in something like python
one does not need 8-16 backslashes
 
Is that because it's regex?
 
apparently
 
No raw string option?
 
I'm not aware of one
looks like it only needs to be .replaceAll("\\\\", "\\\\\\\\")
which still requires an unholy amount of backslashes
 
12:48 PM
You think that is much?
    $subject = preg_replace("~(\.\s*''\s*)+\.~is", '.', $subject);
    $subject = preg_replace("~([^\\\\](\\\\\\\\)*|^)''\s*\.~is", '\\1', $subject);
    $subject = preg_replace("~\.\s*''~is", '', $subject);
This is from my companies code base
Actually that's the same amount
 
1:39 PM
@mousetail who knows!
 
1:59 PM
@mousetail If I encode each character along with a cryptographic hash function of it and then along with that encode that hash with a cryptographic hash function and then along with that encode that hash with a cryptographic hash function and then..., i might be able to make it so that a single character is $10^{15}$ bytes!
 
That wouldn't fill the codespace
Hashes don't typically increase the size
 
@mousetail Idea from this twitter post.
 
Doesn't actually have the required number of builtins though
 
But still takes $10^{15}$ bytes
 
It's very boring though
redundancy is hardly a challenge
 
2:08 PM
@mousetail Yeah, I know. It's boring to crack hashes as they take YEARS unless you have a hash dictionary with the hash inside it.
 
It's not if it's just hashing one character
you can do that in milliseconds
 
@cairdcoinheringaahing This room was placed in timeout for 1 day; I could do with a day off
No, not real.
 
 
2 hours later…
4:29 PM
0
Q: Maximum code-golf length

DadsdyIf we have a code-golf question that we have a golfed answer to in, say, Python, how long does that program have to be for it to not be a good idea to ask that question/for that to be code-golf (if there is a cut-off at all)?

 
5:20 PM
How is it that I have clang but not llc
How do I compile my LLVM IR
 
@lyxal Wait what is this from
Can't you use the same Python code?
Python and Scala use the same escape or whatever right
Make sure to use replace instead of replaceAll. The latter uses regex (the names are dumb but they're what Java uses)
 
6:13 PM
(I figured it out, btw: clang accepts .ll files just as well as .c files.)
 
6:39 PM
Me: clang -emit-obj
Clang:
LINK : warning LNK4044: unrecognized option '/e'; ignored
LINK : fatal error LNK1181: cannot open input file 'mit-obj.obj'
 
6:52 PM
5d411da8fa2191251e7075e5361285d044ccd9c8686da7719f4f95763cda2bdcf293356a1f4e81e9a3416917da00c6ec0d17d0b701d74861f6bdaf2db6ab043f
 
7:03 PM
@PlaceReporter99 Do you have a question?
 
 
2 hours later…
8:33 PM
@Mast no it’s a SHA512 string.
It’s been hashed
@mousetail dictionary attack?
 
You don't even need a dictionary attack when there are just 256 options
but yes that would make it even faster
 
@mousetail I think the hash would be more for integrity of data than security?
@mousetail but I would also hash the hash…
 
Integrity is security right?
Ability for a malicious actor to modify
 
9:30 PM
@Mr.Xcoder have you answered my “logarithmic incrementation” challenge? It has .
@mousetail could also be from transmission error.
 
9:42 PM
@PlaceReporter99 Please don't ping people from literally years ago unless necessary
 
 
1 hour later…
10:43 PM
@user I thought replace only replaces the first occurrence
 
No
Java dum
replace replaces all occurrences, but without regex. replaceAll uses regex
 
Well there was one of those string functions that only replaced the first occurrence
@user well guess I need to go change all the places I've used replace all
 
if a submission is a function, do you have to include importing the standard library in your byte count?
 
imports you need yeah
 
i know that, but is it different for standard lib or no? ig not
 
10:49 PM
if you recall seeing something to the contrary it was probably c
 
You need it for stdlib too
 
where you can literally just use stuff without importing headers and just get warned because it was never declared
it's very funny
 
The C compiler is like a Rottweiler owner who puts a leash on their dog before taking it for a walk but doesn't bother holding the end of the leash
8
 
Tangential: does anyone here have clang 16 on a Linux machine and would be willing to help me test something? My VM only has clang 13
 
11:05 PM
me when I only have clang 11
 
11:17 PM
I would hate to put this out there and only have it work on Windows
 

« first day (4508 days earlier)      last day (355 days later) »