« first day (2684 days earlier)      last day (2159 days later) » 

2:00 PM
@user202729 so you chose 7 arbitrarily?
 
@Cowsquack No, because Leaky gives 7 last digits.
 
@user202729 hmm. so the 4 roots of 1 are just ±1 mod 2 and ±1 mod 5? (idk how to check)
 
@ASCII-only There are 8 roots apparently.
Also 2^(n-1)±1 mod 2^n. Somehow those doesn't work.
 
2 hours ago, by user202729
... the number is = 1 mod 2^n and = -1 mod 5^n.
@user202729 bingo
sorry :P
 
And that's why initially the brute force program report 8 roots.
@LeakyNun Takes me a while to think about CRT, nice challenge.
 
2:06 PM
@user202729 okay so we know that it is 1 mod 2^n for the first 7 digits, but how do we know it carries on to the other digits
 
@Cowsquack Assume n>7. If it's 1 mod 2^n and -1 mod 5^n, then it ends with that 7 digits. Therefore it satisfies the CMC.
 
Don't tell me that you implement gcdex ...
32 mins ago, by user202729
It's not too hard to compute it without builtin, it's just ((5^n+1)/2)^n mod 5^n. Although it would be a bit slower.
 
@user202729 oh?
lol
you're a genius
then 32 bytes...
 
0
Q: Solve for 100 (game)

Muhammad SalmanChallenge : given 4 numbers as inputs display one possible solution that results in 100 using operations. +-*/()^ (the ^ is for exponent) Input : You will be given 4 non-decimal positive integers as input. You can alternately take input as an array of numbers. Output : Arrange the value...

 
2:12 PM
I didn't mean that literally...
I mean the inverse can be computed like that.
Wait I forgot the formula...
Like this. 49 bytes.
 
oh, right
 
Without 3-arg mod, 42 bytes. Still reasonably fast.
Same trick I used with your last CMC...
 
what was my last CMC?
 
I forgot it...
Which one @_@
 
lol
 
2:17 PM
Mar 24 at 1:17, by Leaky Nun
CMC: Solve 8x≡-3 (mod p), 0<x<p, where p is a prime greater than 5
 
Jan 10 at 16:09, by Leaky Nun
CMC: given n positive integer coprime with 10, output the last 100 digits of 1/n in 10-adic integers
oh
hi @DJMcMayhem
 
i hate this. i have 21 rep. can not comment on anything. but i cant learn without commenting on stuff. this is an infinite loop
 
@BoraCalim (what would you like to comment on?)
 
no i dont want undeserved rep. so dont artifically boost my rep
but
like
idk
 
@LeakyNun o/
 
2:21 PM
some questions need many clarifications
 
@BoraCalim just vote to close as unclear instead
 
@BoraCalim everyone here went through that
 
(yes of course that's a joke. it needs more rep to vtc)
 
btw, imgur is banned here so i cant see questions with images
 
If they're new they will be fixed (or closed) soon (by other members).
 
2:23 PM
since imgur is banned, i can not see the image
 
Haha :D The consequence of we not having MathJax...
> the sum of the results for E(k), with each k in [1;5]
But it's already described in words...
(with new Jelly the 5-byte answer there can be 4 byte)
Anyway...
At least you have the flag. A flag to close as unclear is not very useful, and moderator flag ... well ... don't ab use it, mods are busy, ...
Probably the best way is to bring up in chat.
 
@BoraCalim : You could answer some questions and get rep to comment. I got 50 rep on the first day. I suggest that you post a challenge.
 
Voting on this site is kinda arbitrary, just post some answers.
Especially because of HNQ effect.
 
im not good at golfing
 
Post challenges instead then
@BoraCalim : No one is good at start, we all learn, I learned mine here, still suck but better than before
 
2:33 PM
You don't need to be optimal, just make an attempt.
 
@user202729 : what is the HNQ effect ?
 
(read 'serious contender')
Hot Network Questions.
Basically users who are not very familiar with PPCG visits those questions from HNQ, and just upvote "arbitrarily".
 
^ didn't think PPCG challenges were posted on HNQ ?
 
CMP: Should I add a ceildiv operator in Proton?
@MuhammadSalman any site's questions can be put on HNQ though some sites like SO have their HNQ rates nerfed
 
@HyperNeutrino Yes.
@BoraCalim (useful resources: Try it online!)
 
2:36 PM
@HyperNeutrino : Oh, Okay
 
(actually, mostly for formatting posts.)
 
^ The most useful resource.
 
it'll be a bit annoying because then I need to custom-define it instead of using the Python semi-wrapper, but I need to implement my custom definition of and and or anyway
 
@MuhammadSalman Every site other than Math Overflow is posted on HNQ
 
should I implement list-by-number division (as in split into parts)
@DJMcMayhem wait why does MO not get HNQ o_O
 
2:38 PM
@DJMcMayhem : what's wrong with Math overflow
Poor math overflow :(
 
They requested to not have their questions on HNQ iirc
 
@HyperNeutrino Because they chose not to.
 
oh ok
 
Actually, some people (Peter Taylor for example, IIRC) think that HNQ is bad for the site. Reason above.
 
Can't you guys request that too. (wonder why they did)
 
2:39 PM
actually no list-by-number div is a bad idea
 
@MuhammadSalman We could. Personally, I don't think we should
 
Aww man, my challenge was closed.
 
And even if we do request it, it would probably take ages before SE responds.
 
^ ? why ? they can't be that slow
 
16
Q: Can we have MathJax back (part II)?

Mr. XcoderMore than a month ago, we've reached a consensus: We want MathJax back. The reasons why it was turned off in 2015 no longer seem to apply, and details about why MathJax is needed on this site are detailed in the linked post. After a while, I asked a Community Manager about what we shall do next, ...

 
2:41 PM
Speaking of which, we still need to get mathjax enabled. Ninja'd
 
what is mathjax ?
 
52
Q: Can we raise the privilege levels?

DJMcMayhemPPCG has graduated. Some features for graduated sites come immediately after graduating. However, other features are held off for an indefinite amount of time: The site gets a custom theme, and Privilege levels, which are initially lowered to help growing beta sites grow, are raised to match th...

 
Jun 1 at 2:58, by user202729
https://codegolf.meta.stackexchange.com/revisions/16447/2
That one was edited by Shog9.
 
0
Q: Creating challenges from homework.

Luis felipe De jesus MunozRecently I've been posting a lot of challenges on the site. This is because I am in a class where the homework are programming challenges (Algorithm Class). Is that OK? or should I stop posting them? I ask because I know this is not site for homework (Yes, the answers helps me to create better ...

 
@MuhammadSalman Comments will still be at 50. It's just moderation related privileges that would be adjusted
 
2:47 PM
@DJMcMayhem : Yeah, I like the privilages I have, and I think I would prefer if they stay with me.
 
Oh whoops, I guess I confused you with Bora lol
 
yes
 
@DJMcMayhem ???
 
why do you guys want to raise it anyway ?
 
finally
 
2:52 PM
@MuhammadSalman (read the linked question please)
 
@MuhammadSalman long story short, the current levels are for beta sites, and we are not a beta site
 
^ Okay, done and now voted as well. I am considering down voting the question and nominating to close it as well :) JK
We can say we are the only non-beta site that still has these. that makes this site unique
^ probably a lame excuse
 
@MuhammadSalman Downvote if you want, but don't abuse close votes.
People abusing their close votes are the exact reason why the mods want to raise the privilege levels.
@MuhammadSalman Not really...
 
@MuhammadSalman we aren't the only site that's graduated but doesn't have a design & privilege levels (e.g. anime)
 
^ I was just joking, I barely down-vote anything and the comment was exactly meant for that
@dzaima : Thanks for informing me :(
 
3:01 PM
guys any of you know alternatives to brainfuck-style loops in a language which does not have numeric literals?
 
@BoraCalim How is numeric literal related to loops?
 
^ I think he meant doesn't support numbers directly ?
 
yes
the language does not support numbers
 
@user202729 I meant to ask how do we know that it doesn't change from, say, -1 mod 5^n for some of the digits to 1 mod 5^n to the other (sorry if stupid question)
 
and i tried to implement a brainfuck style loop which would execute commands until the popped value from the stack is zero
but it did not work properly
and i got mad and deleted the loop code
 
^ LOL (the site name)
 
@Cowsquack I don't understand the question. As long as it ends with <those 7 digits> and it's a square root of 1 it should be fine, right?
 
@user202729 i did not ask how to fix it
 
@BoraCalim Then?
 
i asked for an alternative to brainfuck-style loops
thats not fixing
 
3:06 PM
There are goto ...
 
we have to say goto x
 
(For an esolang it should be fine)
 
and only values from a stack is reachable
 
@user202729 why isn't there a root to 1 that ends in those 7 digits (where the numbers follow -1 mod 5^n), but also from the eighth digit it follows 1 mod 5^n instead
 
and those values can only be manipulated with + and - like in brainfuck
 
3:07 PM
Then why don't you just implement the BF loop ?
 
because i cant
it did not work
and i cant program properly
 
The CMC says "the root". Assume Leaky is correct, there is only one root.
 
(just so I'm clear, I'm not talking about the cmc anymore, I'm just talking about 10-adic roots of 1)
 
Ok...
 
"Assume Leaky is correct" is there a proof for why there is only 1 such root that ends in those digits?
 
3:09 PM
O_o ? goto statements as user202729 suggested ?
 
there are no numbers so goto can not work
you can push 0 to stack
and then the only thing you can do is
 
CMP: Have you actually migrated your GitHub projects to GitLab?
 
increment and decrement the top of the stack
and sometimes pop it or print it.
 
lol
there are 4 roots of 1 in the 10-adic world
every 10-adic number correspond uniquely to a pair of 2-adic and 5-adic number
this correspondence respects addition and multiplication
this is just Chinese Remainder Theorem
 
3:13 PM
@BoraCalim : why not post a question on SO instead ?
 
@Cowsquack do you follow?
 
@LeakyNun how so? could you give an example?
 
@MuhammadSalman because my code is like 100 lines long and people on SO will not like my asking style
and most lines are connected to each other
 
@BoraCalim Then MCVE-ify it...
 
thats impossible
 
3:15 PM
^ why ?
 
Then....
If it's impossible to reduce it further, then it's already minimal.
By its definition.
 
@Cowsquack for every m, integers modulo 10^m correspond uniquely to a pair of (integer modulo 2^m, integer modulo 5^m)
 
no like i should not delete the other 80 lines because i can not display what i want to display to SO without them
 
Go to SO, ask the same question and paste a link to GitHub instead of posting the whole code (I assume that the code is commented)
 
@MuhammadSalman -1. Questions should be self-contained. VTC as "lacks a minimal example".
 
3:17 PM
@Cowsquack 11(ten-adic) corresponds to (1011(two-adic), 21(five-adic))
1011 is written in base 2
 
@user202729 : Did I get a -1 vote. Hay I'm not exactly the master of writing questions ?
 
21 is written in base 5
@Cowsquack consider the number ...123123 (ten-adic), you can view it as the limit of the sequence (3, 23, 123, 3123, 23123, ...)
you can convert each number in the sequence to binary, and I can guarantee that the new sequence converges
and you can do the same for base 5
 
(first input = number of terms; second input = base)
the sequence in base 2 reads:
11
10111
1111011
110000110011
101101001010011
11110000011110011
1011111010011110110011
1011000001101010010110011
111010101101011010110110011
10111010001001110001001110110011
10101100010001111101101101110110011
1110010101010101101011100001110110011
101101011100101000101001001111001110110011
base 5:
3
43
443
44443
1214443
12414443
1244414443
21404414443
223004414443
22344004414443
334324004414443
4004124004414443
402132124004414443
@Cowsquack if you know some abstract algebra, the p-adic integers form a ring
for prime p, the ring of p-adic integers is an integral domain
 
Wheeeee a Pyth program being used in chat :)
 
3:24 PM
which is to say, that if ab=0, then a=0 or b=0
(the same is not true in the 10-adic land since 10 is not prime)
 
(I don't know rings)
 
ignore that then
in the p-adic land, where p is prime, ab=0 implies a=0 or b=0
(to see how this fails for 10-adic, take that square root of 1, call it x, then x^2=1, i.e. (x-1)(x+1) = 0, but clearly neither x-1 nor x+1 is 0
54 secs ago, by Leaky Nun
in the p-adic land, where p is prime, ab=0 implies a=0 or b=0
should I prove this?
 
@LeakyNun No.
 
I'm fine with this, please go on
 
13 mins ago, by Leaky Nun
every 10-adic number correspond uniquely to a pair of 2-adic and 5-adic number
13 mins ago, by Leaky Nun
this correspondence respects addition and multiplication
in particular, every integer n is sent to (n,n)
[integer as in, really an integer]
 
3:27 PM
(they're just finite p-adic numbers without a fractional part)
 
@LeakyNun what is (n,n)?
 
the pair of n and n
 
@Cowsquack A tuple of 2 elements, each one is n.
 
okay
 
in the p-adic land, if x^2=1, then x^2-1=0, so (x-1)(x+1)=0, so x-1=0 or x+1=0, so x=1 or x=-1
 
3:29 PM
(gtg, I will be back later)
 
this fails in the 10-adic land because (x-1)(x+1)=0 does not imply x-1=0 or x+1=0
so there are 2 square roots of 1 in the 2-adic land and the 5-adic land respectively
which gives 4 square roots of 1 in the 10-adic land by the correspondence
 
Are we still on this CMC?!
 
yes
just found this OEIS oeis.org/A091661
 
2
Q: count ones in range

Muhammad SalmanChallenge : Count the number of ones 1 in the binary representation of all number between a range. Input : Two non-decimal positive integers Output : The sum of all the 1s in the range. Example : 4 , 7 ---> 8 4 = 100 (adds one) = 1 5 = 101 (adds two) = 3 6 = 110 (add...

 
Obviously.... SO is affected more by HNQ effect than PPCG.
 
3:49 PM
Except that PPCG hits HNQ way more often
 
0
Q: How strict are we with [restricted-complexity]?

user202729(mostly for restricted-complexity. For fastest-algorithm it's the algorithm that matters, not the code. Answers without code are allowed.) Consider a simple function: lambda a,b:a+b What should be the time complexity of this function? If it's O(log(a)+log(b)), most of the current restrict...

 
guys i got an upvote for an answer!
 
Yay for you! I got RAD's ¨ to work, sleep for the win!
 
@Zacharý well done
Same as apl?
 
0
A: Sandbox for Proposed Challenges

JoshMI want to do this, Render an ASCII maze but with ascii pipe characters. I know this is similar, but I think the extra logic required to figure out which character to put at each position makes this sufficiently different. here is what I am thinking of asking. Write code that replaces non wh...

 
4:05 PM
@LeakyNun ah I see
thanks by the way
 
Conclusion: Votes on SO is even more arbitrary than here.
(some of them are really good, but some others are just normal)
 
@user202729 broken link for me (FFQ) nvm, flaky internet
 
How can that broken? ...
 
Food frequency questionnaire?
4
 
Well I know somebody would star it...
(although seriously what is FFQ?)
 
4:09 PM
@user202729 Firefox Quantum
 
I think eveyone's on Quantum by now
 
@Pavel if they're not, they should be
 
@J.Sallé No, they both should and shouldn't be.
 
@LeakyNun what if I phrase the question in a different way, x is a number that ends in 249, it is congruent to -1 mod 5^3 and 1 mod 2^3. It is given that x*x is congruent to 1 mod (5^3, 2^3, 10^3). How do you know that x is congruent to -1 mod 5^4? (and likewise, 1 mod 2^4)
 
@Adám It's Firefox Quantum, not Firefox Schrödinger
 
4:17 PM
@J.Sallé Speaking of which, I so hope we'll get one day.
 
@Adám wait is that a Schrödinger operator? I'd totally dig that, doesn't matter what it'd do
 
@Cowsquack you don't
 
ok icons8
 
@J.Sallé Yes, it is. f⍰A returns a future value which won't actually be computed until needed. E.g. you can do list←⍳{⎕←⍵}⍰4 and 4 won't actually be printed until you ask for list (which itself will be 1 2 3 4).
 
@Downgoat FINALLY they have login strawberries! I was wondering when would these come about.
 
4:21 PM
aaaaaaaaaaaah now it all makes sense, I thought I was missing some obvious way to determine that, but the only way you know is through using p-adic numbers and the number of roots
 
@Adám ah, that sounds very handy actually
 
4:33 PM
63
Q: Golfing A Weasel Program

NoelkdRichard Dawkins in his book The Blind Watchmaker, describes a Weasel program. The algorithm can be described as follows: Start with a random string of 28 characters. Valid characters are all upppercase letters, and space. Make 100 copies of that string, with a 5% chance per character of ...

 
@Adám um, are you sure such a thing will be called ⍰?
 
@Adám How will that work? Won't the be asking for "{⎕←⍵}⍰4"? Or would there be a separate operator for "asking" for the value>
 
@Zacharý Maybe. Replace with 3⍴ then.
@EriktheOutgolfer Pretty sure.
 
@Adám So only certain functions will cause it to be "asked" for?
 
@Zacharý Yeah, anything that actually requires a value.
 
4:46 PM
@Adám 3⍴ does require a value (i.e. 3⍴1 2), unless it's implemented weirdly and cleverly
 
@Zacharý No it doesn't. Any array will suffice.
@Zacharý Only computational and I/O functions require the actual value. All structural functions don't care what their argument is.
 
O(ln(n)) algorithm for
4
Q: count ones in range

Muhammad SalmanChallenge : Count the number of ones 1 in the binary representation of all number between a range. Input : Two non-decimal positive integers Output : The sum of all the 1s in the range. Example : 4 , 7 ---> 8 4 = 100 (adds one) = 1 5 = 101 (adds two) = 3 6 = 110 (add...

 
@Zacharý You can ask @MortenKromberg in the APL Orchard if you want to know more details.
 
@MuhammadSalman I recommend adding something similar to this to the rules: "you can take input in any order, as long as it's consistent"
@EriktheOutgolfer : okay, previous comment deleted. — Muhammad Salman 3 mins ago
(don't want to clutter there)
 
5:10 PM
0
A: count ones in range

Leaky NunRetina 0.8.2, 43 bytes \d+ $* M!&`(?<=^(1+),.*)\1.* +`(1+)\1 $1x 1 Try it online!

can someone translate it to Retina
 
you can use .+ for first line and replace comma with newline
 
5:26 PM
@HyperNeutrino, how are variables done in your languages?
 
@Zacharý I store a scope and a global scope and pass them down in the recursive evaluate function, and accessing variables is done by using scope[name] and modifying is with scope[name] = value
I usually make a separate assign function because of multi-assignment
 
I'm struggling to figure out how to not torture myself, as the only way I see to implement variables is to create a LazyObject class that overrides EVERY SINGLE MAGIC METHOD, as things like A+(A←2+A)+A←3 need to work properly.
 
oh you meant like how I make objects work
well I write my languages in Python so I have numbers and lists as Python objects and everything else can be represented as those
 
@LeakyNun tio.run/##K0otycxLNPz/…, there may be more bytes to golf
 
@HyperNeutrino No, not like that. I'm trying to work out variables to make sure stuff like A,(A←3),A←2returns 3 3 2
 
oh I see
 
also hm the ^ from the lookbehind can be removed
 
Maybe I could rearrange some stuff, moving CodeObject (the thing that turns atoms into values) into CodeObject_ (the backup, giving a dummy object) and add an activate method for getting gthe value. Let's just hope I don't break 1 + 2again >_<
 
o :/ yeah it is annoying
 
I just need to remember to NOT PUSH to bitbucket >_<
 
5:58 PM
why not
can't you just version-control then
 
> TypeError: unsupported operand type(s) for +: 'CodeObject' and 'CodeObject'
That's not what I wanted to see.
I broke 1+2+3 as well >_<.
 
Hello anyone her ?
 
I don't think anyone is her, but I don't want to assume anyone's gender xD.
Yes, there are a few people here.
 
Forgive the mistake.
I had a question which I wanted to ask
 
@HyperNeutrino I'm going to have to override every single magic method, TWICE!
 
6:13 PM
Is there a BrainF**k answer for the primality question ?
 
there should be, although I'm not really sure if one is currently posted (you can use brainfuck inquestion:<id> to search)
 
Or just control-f each page.
 
no, that won't work with multiple pages
 
Dennis answer doesn't seem to work for me ?
 
6:16 PM
Works just fine for me.
 
Did you input the integer as a character?
 
O_o , It works for C for other character seems to print something that I can't see
 
@MuhammadSalman NUL, meaning it's not a prime.
 
If it's not prime, it'll output NUL
 
Ninja'd
 
6:18 PM
Does BF have nul ?
 
@Zacharý NUL != Null :p
 
@MuhammadSalman Sure it does. Code point 0
 
.
 
Just like in many other languages
 
6:19 PM
Annnnnd that explains why I can't see it.
@AdmBorkBork , @Zacharý thanks
 
Sure thing. To show that it's working, try lowercase e (code point 101). It'll print back e.
@Zacharý Nice ninja-edit. :D
 
Yep, that worked.
 
@AdmBorkBork Thanks :P
 
 
2 hours later…
8:19 PM
Variables are done (no assignment) for RAD. Anyone have any idea how on earth I can implement assignment correctly ((A←A,3)+A,A←2 should return 5 5)
 
@Zacharý why would that be particularly hard? Just parse name← differently (as a monadic function) that assigns to the variable (that might have bad implications around ops though)
@Zacharý also shouldn't that return 4 5?
 
Yes, it should be 4 5
 
@Zacharý In Dyalog APL, is implemented as a hybrid (like /). Only, it takes a symbol as left argument.
 
@dzaima I think I've tried that already. The problem I'm having is with order of evaluation.
 
@Zacharý Can you evaluate (A-A,3)+A,A-2 correctly?
 
8:32 PM
@Adám Yes.
 
@Zacharý And does it actually happen in the right order?
 
is there some problem just having be a regular operator and just make it have special actions for certain structures of the left argument in the AST?
 
@Adám I don't know if that's the case.
@dzaima NF←N, M←M, and D←D are the issues with that (N is nilad, F is function, M is MonadicOp and D is DyadicOp)
 
A←1 ⋄ (⎕←A-⎕←A,3)+⎕←A,⎕←A-2
¯1
1 ¯1
1 3
0 ¯2
1 ¯3
 
@Adám Hold on, I'm going to implement (the output function)
Yes, it does go in the correct order.
 
8:44 PM
@Zacharý what do M←M and D←D even do?
 
@Zacharý Then you're almost there.
 
@dzaima Assigns to a monadic op or dyadic op
@Adám It might be an issue with Python modules, actually.
 
@Zacharý oooh with M and D being actual variables..
 
@dzaima Yeah.
 
@Zacharý Will you allow M←⍣=?
 
8:47 PM
@Adám Yeah, I allow ⍣= (that is, once is implemented) anyways. I did it as a way to implement dyadic operators without having to go through NDN NDF FDN FDF
 
@Zacharý And also D←⍣? (which isn't allowed yet in Dyalog)
 
@Adám Yeah
 
@Zacharý How about M←¨¨?
 
yeah I did not think of that. feels like it should be impossible to do as to correctly parse an expression all variables need their arities used correctly but needs the raw variables (though Dyalog obviously got around that somehow)
 
@Adám No, one would write that as ∆M←⦃⍶¨¨}, or possibly ∆M←⍶¨¨
 
8:50 PM
@dzaima Imho, should have been a regular monadic operator.
 
Then what about user-defined operators?
 
@Zacharý Why do you need special braces for operators, couldn't you use [⍶⍵} and {⍹⍵]?
 
@Adám That might have been too confusing for say A[f[⍶⍵}2] (My brain would not like that + possibly the interpreter would not work)
 
@Zacharý Looks unambiguous to me.
 
@Adám I never have understood why a←{(⍺⍺⍣⍵⍵) ⍵} works but a←⍣ doesn't
@Adám unambiguous? yes. readable? no.
 
8:56 PM
@dzaima There's really no reason other than lack of urgent need.
@dzaima RAD is a golfing language.
 
@Adám Not really. Semi-esoteric/semi-golfing. It's not fully practical nor golfing/esoteric.
 
@Adám I meant from a parsing perspective. How is {(⍺⍺⍣⍵⍵) ⍵} any different from (well, except that there's no use of , but functions should be able to handle both cases)?
 
Wait ... how is that any different? Both are dyadic operators.
 

« first day (2684 days earlier)      last day (2159 days later) »