« first day (2725 days earlier)      last day (2126 days later) » 

Anonymous
12:08 AM
The explanation there is too difficult for me to put into words, because I'm not great at Haskell
 
running around like a dumbass Seinfeld character trying to do last minute optimizations to this hideous 80KB JS output from emscripten
TIL: git has a rebase.autoStash setting: When set to true, automatically create a temporary stash before the operation begins, and apply it after the operation ends. This means that you can run rebase on a dirty worktree.
 
I mean you can always reflog or --abort if something goes really long and that way your commit history won't be weird
 
I think the use case is more: working on something, new commits come in, just run git pull --rebase without worrying about anything
 
 
2 hours later…
2:38 AM
0
Q: Complexity of assembly built-in?

user202729Consider a challenge: Given a positive integer \$n\$, compute \$n^2\$. fastest-code (let's temporarily ignore that it's too boring or too trivial) Is it clear enough? Assume it's clear enough. Consider this C++ answer. On normal machines, int is the same type as int32_t, which can only ho...

 
3:38 AM
@user202729 Let's take this to chat :)
I don't understand your question: If there is no range specified, the question is closed
if a bound is specified, then a O(1) answer is given, which is dumb
if it is specified to be unbounded, then the answer is invalid
 
Most of our code-golf challenges have no bound. Which is both good (people can use their native integer type upper bound), and bad (standard loophole "Abuse native integer data types")
 
For fastest algorithm, you have to have a bound
 
Practically there is usually some wishy-washy language like "you must implement an algorithm that theoretically works for arbitrary large inputs"
 
As far as I see, no [fastest-algorithm] has a bound. For example this.
 
With codegolf, people are pushing the bounds of the source code. This is why we have lots of rules around what counts as source code.
 
Anonymous
3:41 AM
@feersum Either that, or language like "all inputs and outputs will be within the representable range of your language"
 
however, with fastest code, the goal is to push the bounds of N
 
@feersum Yes, the "algorithm" works if the assembly instruction is extended to larger bit-width.
 
so you have to have rules around it
 
@Mego Yeah, but I find that eminently bogus.
 
Actually people also generalize it to "all intermediate values will be within the representable range".
 
3:43 AM
@user202729 Right, for arrays, the bound is basically infinite, as is common with arrays
 
Anonymous
@feersum What do you mean by that?
 
I think most people assume that arrays can go infinitely
 
I think Beatnik multiplication will overflow for A=24,B=2 and produce wrong result, although 48 is within integer range.
 
It's bogus because the challenge should not have different requirements for different programming languages.
 
Anonymous
@user202729 Sometimes, sometimes not. If there's multiple ways to solve the problem, then not giving that guarantee can affect which approaches are valid in a given language, which may or may not be desirable
 
3:44 AM
@NathanMerrill But it isn't true. As arrays in most languages are not lazy (not Haskell) or linked, their length must be stored. And if integers are not infinite width by default ...
 
Anonymous
@feersum While that's true, integer bounds are one of the least problematic things to allow to be dependent on the programming language.
 
@user202729 oh, for sure, practically, speaking, but in terms of challenge specs, I think it's fair to assume that we consider lists to be infinite
 
Anonymous
@NathanMerrill I think you mean unbounded, which is a different thing entirely
 
IMO most code golf challenges should have input bounds.
 
Anonymous
Most challenges don't require infinite lists, but do require unbounded lists
 
3:45 AM
right :)
sorry, forgot that infinite lists are a thing
 
Then do we "assume list length to be infinite" too? ... (remember "list length" === "integer")
 
It's only awkard to have bounds for things that involve asymptotic complexity (as then, everything is O(1)).
 
Anonymous
@feersum The problem with that is, either the bounds are tight to accompany all languages (opening up avenues for abuse), or some languages (like bf) get excluded.
 
then let's exclude them?
 
(this meta post is related to @msh210 's last question and I don't know how much does reading an integer take. link)
 
3:47 AM
@Mego I don't see the problem. Can you give an example?
 
Anonymous
@user202729 Not infinite, but unbounded.
 
@Mego Ouch.
@feersum BF cell is usually 8 bit.
 
So? It has "unbounded" number of cells.
 
Anonymous
@feersum Say we go for option 1. We restrict the integer bounds to one byte to accompany brainfuck. That causes a lot of sequence challenges to be able to be hardcoded, since many sequences with challenges have only a few values under 127 (or 255 for unsigned).
 
Anonymous
@feersum But its native integer type is 8-bit, so we would restrict the bounds to 8-bit integers.
 
3:50 AM
Technically they're not excluded, but we would make the work much harder for them. Implementing bignum is hard, regardless of language.
 
It's silly to say that integers have to be represented as single cells in brainfuck.
 
@user202729 what's so ouch about it
 
A chain of N nonzero cells to represent N often works better anyway.
 
@feersum Then it would be hard to store extensible 1D array.
 
@user202729 you don't need bigints to have unbounded lists
 
3:51 AM
(which is as hard as storing 2D array of bytes)
 
Anonymous
Either that, or you completely defeat the purpose of setting integer bounds (making it fair across languages), because the bounds force at least one language to do much more difficult computation due to native limits.
 
@user202729 easy. a bunch of numbers with precisely one zero cell in between each nuber
 
@ASCII-only (wrong reply target)
 
@user202729 nope
 
I would suggest something around 10^9 for a typical integer bound.
 
3:52 AM
Why not just do 2^32-1?
 
@feersum Bf users will complain.
 
@user202729 let them?
 
@NathanMerrill unsigned > int...
 
@user202729 awesome. I've given you more room to golf
 
Anonymous
1 min ago, by Mego
Either that, or you completely defeat the purpose of setting integer bounds (making it fair across languages), because the bounds force at least one language to do much more difficult computation due to native limits.
 
3:52 AM
@user202729 I don't think so. It's not that popular.
 
@user202729 most languages have unsigned though. and long for that matter
 
@Mego since when are we trying to make it fair across languages
 
@feersum Much more popular than Dodos or Malbolge. dodos...
@NathanMerrill "All languages should be treated equally." – Mego
 
We should cancel PPCG because pretty much every challenge is more difficult in Brainfuck.
 
@user202729 right. Treated equally. But we don't do cross-language competitions
 
Anonymous
3:53 AM
@feersum That's an absurd reductionist strawman. You can't just dismiss the criticisms like that.
 
I treat all languages the same: They all get the exact same challenge
 
^
 
I don't give certain language benefits because they can't handle it as well
 
Hm. Fair point. If it's harder for BF, all solutions would be longer.
Still, it kinda detracts from the main challenge. The main challenge is "do X", not "implement bignum and do X".
 
Don't we permit unary I/O?
This makes implement bignum not required.
 
3:55 AM
@user202729 just use a BF variant with unbounded cells if you're too lazy
 
@feersum yeah, which is something I voted against
 
@ASCII-only ... well that will make clearing a cell harder... [-] no longer works.
 
Anonymous
@NathanMerrill What that actually means is, you give every language the same text describing the challenge, but some languages must jump through extra hoops. Which is fine, but that's not the way I prefer to write my challenges. I prefer to try to make the challenge as fair as possible across languages, by eliminating stuff that can cause significant additional challenge in some languages (which is the same ideal that guides our flexible I/O policies).
 
@user202729 why not
 
@ASCII-only Anyway, that's not the main point...
 
3:57 AM
@user202729 why not
 
Anonymous
@user202729 I agree with you there
 
@Mego Yeah, I do agree with this sentiment. I just think that there really aren't hoops for many languages
 
@user202729 it's like saying "implementing char is too difficult in boolfuck so we're just going to use bools"
 
for mainstream languages
 
Anonymous
@NathanMerrill The most significant hoop in many languages, across most challenges, is integer bounds, which sparked this discussion.
 
3:58 AM
I completely agree with golfing languages: you'd be completely gimping some of them
 
@NathanMerrill "not many mainstream" is still a lot in PPCG
 
Doesn't PPCG consist of mostly recreational languages...
 
@NathanMerrill >_> don't golfing languages usually have more features than mainstream languages
 
Anonymous
But golfing languages (and esoteric languages in general) are central to this community
 
@user202729 nope. mostly golflangs and mainstream
 
3:58 AM
@Mego I think most mainstream can handle integers up to 2^32-1 really well. If a golfing language's default integer isn't that big, then yeah, that's a big hoop
so yeah, I think golfing languages are hard to deal with
 
@NathanMerrill what kind of golflang would do that intentionally though :P
 
perhaps 2^31-1?
 
@NathanMerrill Esoteric, not golfing.
 
Huh? how could something without ints claim to be a golflang?
 
also basically all modern golflangs use a language with bigints
 
3:59 AM
@feersum Retina!
 
@feersum My specific limit is unsigned ints.
I do think that signed ints is more practical
 
Anyone think CPU draw most power should be reopened? It has objective winning criteria, but oddly it is a .
Also, currently Integer square root (older) has 4 unclear close votes.
 
@user202729 It doesn't seem good that the specific processor in not specified.
 
@user202729 there's a hard cap on power so you'd end up with a too-many-way tie
 
4:14 AM
> or measuring personally i use AIDA64 on Windows, Computer/Sensor/Power/CPU Package wattage reading; My configuration is i7 3770k @4.2Ghz @1.21V, with all 4 cores and HT enabled. Room temperature is 25C, i have ~1kg Noctua NH-D15 cooler. And Prime95 v294b8 shows 85W in that particular configuration.
 
Otherwise you could win by owning a processor with the most scores rather than writing special code.
 
or programs that just break the processor instantly
 
It says any AMD64-based processor is allowed.
 
@ASCII-only I don't think there is any program like this...
 
Why? Breaking stuff doesn't help a malware developer make money.
 
4:15 AM
^
 
@feersum Right. To make people annoying perhaps?
@ASCII-only Actually all challenges have hard cap. Some are easier to reach than others.
 
4:36 AM
For breaking the processor instantly (though without permanent damage): en.wikipedia.org/wiki/Pentium_F00F_bug
 
5:18 AM
What command line program should I use for password-protecting files?
Is there anything better than openssl?
 
Anonymous
OpenSSL is kinda the gold standard for that
 
Anonymous
Most other things you'll find are just wrappers around OpenSSL
 
Some sources seem to be claiming that the key derivation is not very good
It seems that as a library it has PBKDF2 utilities, but I can't find any way to use them in the command line tool.
 
 
7 hours later…
12:21 PM
0
Q: Search text for a prefix and list all its suffixes in the text

DrQuariusI use "suffix" loosely here to mean "any sub-string that follows the prefix". "Prefix" here means the START of a word, where a word's start is defined as either after a space or from the first character of the input text (for the first word). A "prefix" in the middle of a word is ignored. E.g. ...

 
 
3 hours later…
3:10 PM
I just found the following piece of code in our product: :If (⊂expr)Contains SWEARWORDS
 
@Adám then what happens? I'd assume it speeds up
like when fib(100) is just too slow, you gotta fib(100) FUCK to make it faster
11
 
@orlp No no, SWEARWORDS is a global variable with a list of things the expr(ession) may not contain, so it continues: msg←'APL expression: 'expr'tried to execute one of these functions:'(⍕SWEARWORDS)
 
LOL
 
4:18 PM
1
Q: Intersection Point of Two Line Segments

BeefsterGiven two line segments, determine if the line segments intersect and if so, where. In the case that the two given line segments are co-linear and overlap, determine the midpoint of the overlapping segment. Lines will be specified in pairs of (x, y) coordinates. Examples [(-1, -1), (1, 1)], [(...

 
I recently copied an example from StackOverflow, std::string(std::istreambuf_iterator<char>(stream), {}). I understand that this copies the stream content to a string, but what does the {} mean?
 
It's some required parameter which is a list of some sort ... but IDK.
 
5:06 PM
 
@Pavel Empty initializer list
 
Ooohhhhhhhhh
 
That particular constructor takes two iterators, one pointing to the beginning and one to the end
You want the whole string until exhausted though so you don't care about the second iterator
 
 
2 hours later…
6:40 PM
0
A: Sandbox for Proposed Challenges

Beta DecayCalculate the Christoffel Symbols code-golf math Challenge Given a metric tensor as input, \$g_{\mu\nu}\$, output the corresponding Christoffel symbol, \$\Gamma^a_{\phantom a bc}\$ where a,b and c are also given as input. Calculating the Christoffel Symbols \$\Gamma^a_{\phantom a bc} = \frac...

 
Windows 10 is soooo close to amazing. But the way it manages user accounts is just absolutely horrendous.
I don't think they could have made it worse if they tried
 
@DJMcMayhem What do you not like about it?
 
I extremely dislike how it tries to tie local accounts to microsoft accounts.
Setting up parental controls is a nightmare
 
Well, can't say parental controls are a thing I've ever touched in my life.
 
Renaming user folders is impossible. For some reason it decided my user folder should be DJ.desktop.<random characters> and it is near impossible to rename
I ended up creating a new admin account to get around it and deleting the old one (which again, prompted me to make an MS account that I don't want)
@Pavel I don't care about them, but I've attempted to set them up for other people in the past.
 
6:51 PM
Can't say I've ever had issues likke that
 
@DJMcMayhem same happened to me
 
And onedrive causes lots of issues too
 
I just have C:\users\pavel
@DJMcMayhem You can just not use onedrive
 
For some reason it just decided my user folder would be called johnn
 
Which of course I do
But it's constantly begging me to turn onedrive and cortana and other similar MS features on
 
ubuntu ftw
 
no
outdated packages
ew
 
7:09 PM
huh
I thought laziness only makes sense for pure functions
 
How do you spell Christoffel? I thought it was Christoffel but Leonard Susskind spelled it Cristoffel
 
> Suss[kind's ]kind[a wrong]
 
@EriktheOutgolfer Lazy parameters, in this case
 
@BetaDecay His name was Elwin Bruno Christoffel according to wikipedia
 
It just is a nice way of implicitly wrapping it in a function
 
7:15 PM
@J.Sallé I see. Thanks
 
7:35 PM
0
Q: Drawing convex polyiamonds

Peter KageyDescription OEIS sequence A096004 gives the Number of convex triangular polyominoes [polyiamonds] containing n cells. It begins: 1, 1, 1, 2, 1, 2, 2, 3, 2, 2, 2, 3, 2, 3, 3, 5 For example, a(8)=3 with the following three convex polyiamonds: Input: 8 Output: *---*---*---*---* / \ / \...

 
Now I feel as if I may have wasted my time programming LazyCall
facepalm I've been using peek!T instead of get!T, no wonder I was getting pointers.
 
7:51 PM
.oO( hm...I guess that peek starts with p, so it should result in a pointer, and... )
 
If you use an #include in both a .cpp file and its .h file, do you generally add the #include to both or just to the .h file?
 
Just to the h, with very few exceptions
(there are cases where an include needs to be the last in a file -- then you might put it in the cpp instead)
If you're ever bored, grep for // memdbgon must be the last include file in a .cpp file!!! in Source SDK
 
8:25 PM
0
Q: Is the matrix centrosymmetric... and so is the code?

Mr. XcoderDefintion A centrosymmetric matrix is a square matrix that is symmetric about its center. More rigorously, a matrix \$A\$ of size \$n \times n\$ is centrosymmetric if, for any \$i,\: j \in ([1, n] \cap \mathbb{Z})\$ the following relation is satisfied: $$A_{i,\:j}=A_{n+1-i,\:n+1-j}$$ Examples o...

 
8:41 PM
user image
2
Do I win?
 
would a fastest code edit distance challenge be acceptable?
 
Why not?
 
was Why not for me?
 
@DJMcMayhem Can't say I've ever had more than that
 
ah no
 
8:43 PM
@Anush Yes
 
somebody starred the wrong message...
 
@Pavel Sometimes PPCG doesn't like some things and I don't know why :)
I suppose because there is a standard algorithm for it?
 
@EriktheOutgolfer I don't think "ubuntu ftw" should be starred either.
 
@Pavel And it's all from a single missing file...
 
9:12 PM
what are you missing?
 
"pyconfig.h" wasn't in my python path
 
@NMP I just noticed... Perfect challenge for 05AB1E...
Actuallly, Jelly too. lol Erik just posted the solution I was thinking about... But I have something different in Osabie
 
lol that ninja
 
9:58 PM
@NewMainPosts So, flatten, check if palindrome?
I feel like that would make it a duplicate of just check if palindrome.
 
the difference is that your code must also be centrosymmetric
 
Pretty sure we had a restricted-source where code must be a palindrome... hmm...
Yep. It's this closed question from 2011: codegolf.stackexchange.com/questions/1798/…
What was the policy on duplicates of crappy ancient questions?
Meh, doesn't really matter
 
@Pavel You probably mean this one: codegolf.stackexchange.com/q/110582/56433
 
Yep
I'd say that it's basically the same question.
 
10:24 PM
For what the code needs to do yes, but not for the required code layout which is much easier to get palindromic than to get to a center point symmetric square matrix.
 
@NewMainPosts First I couldn't think of a solution. Then I found a 7er, and thought of writing something about that being demonstrably optimal. I never imagined being able to find a 6er. Nor a 5er. Nor a 4er. I think I'm done. I can't do anything at all in 3 chars of APL.
 
Great, now I cannot dismiss that That solved my problem! banner... ugh!
 
@Mr.Xcoder I gave it some more thought, and retracted the CV on the basis that there might be a solution that isn't flatten->check palindrome
 
it will be reduced if you edit the question to explain why it's not a dupe (or just wait until it gets closed and reopened again, if the community thinks it's not a dupe, or all the votes are retracted)
there's also reverse each → reverse → check if equal to original
 
@Pavel I'm working on one...
 
10:31 PM
My original idea actually looked like s=>s.SequenceEqual(s.Reverse().Select(i=>i.Reverse())) but flattening was shorter
 
CMC: Centrosymmetric?
 
> I can't do anything at all in 3 chars of APL. citation needed
 
@Adám PalindromeQ@*Flatten
 
@Adám _Is (Pyth, 3 bytes)
 
10:36 PM
@Mr.Xcoder, would taking n as an input be allowed? (Main post)
 
@Pavel Well, thanks I guess
@Zacharý yeah edited
 
@Laikoni A full program needs one character () to get input which leaves just two. Now I could do two monadic function applications, e.g. -+ (negate the conjugate), but to continue an algorithm, I need a single letter variable name and a copula; X←⎕. This would then fully dictate the last line to be ⎕←X (output X), so only the middle line is left to actually do anything. One character is needed to reference the variable from above, again leaving only two to do anything.
 
Thanks.
 
@Laikoni Oh, and any sort of comparison would need one character for the comparison function and two for the arguments, so the arguments can't be modified before the comparison.
 
@Adám Does it have to be a full program?
 
10:53 PM
@Pavel A traditional function would either need a header, which would be f x dictating the last line to be the erroring x f and leaving three chars to do stuff. A direct function would need to begin with an open brace and end with a close brace, which breaks the symmetry. A tacit function could do it as ⌽≡⊖ but must be on a single line (or contain a multi-line direct function).
@Pavel One could possibly allow the direct function:
{⍝}
xxx
}⍝{
with xxx being the code to do stuff, but that's not enough.
@Pavel Wait, I have an idea! — Nah, it only looks somewhat centrosymmetric:
⌽{
⍺≡⍵
 }⊖
 
11:15 PM
@DJMcMayhem when you try to build something with automake..
 
11:25 PM
-1
Q: Daytime Protocol

Martin ThomsonChallenge Implement STD 25, the Daytime Protocol. Rules Any valid implementation of the server is acceptable. Note that STD 25 doesn't specify a particular format other than the answer being a single line of ASCII, which you can use to your advantage. Serve either TCP or UDP (or in the secon...

 
11:42 PM
0
A: Sandbox for Proposed Challenges

Luis felipe De jesus MunozNumber decomposition Given a natural number N > 1 output all posible decomposition (addition) using numbers < N Example N = 4 N | Decomposition ======================= 2 | 1 + 1 3 | 1 + 1 + 1 3 | 1 + 2 4 | 1 + 1 + 1 + 1 4 | 1 + 1 + 2 4 | 1 + 3 4 | 2 + 2 Input...

 

« first day (2725 days earlier)      last day (2126 days later) »