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

12:03 AM
There, fixed it with a hack.
> #Hackedy hack hack hack
Ugh, it half works. It works when calling the resulting function, but not when actually parsing RAD code.
 
@Zacharý :||||||||||||||||||||||||||||\\\
@ngn yes definitely
charcoal has a lot of tests
 
I think I know why.
 
and that's only for like half the functionality
but it's still insanely helpful
 
0
A: Sandbox for Proposed Challenges

Jo KingSelf-Identifying Coordinates Given an integer n, construct an array with n dimensions of n length, where each element is an identifier of its own coordinates. (todo: make this clearer) For example: n=1 ["1"] n=2 [ ["11", "12"], ["21", "22"] ] n=3 [ [ ["111","112","113"], ["1...

 
12:20 AM
I totally forgot about a f¨ b
 
12:39 AM
Anyone interested in a game of Codenames over at Puzzling.SE?
 
I ... just broke addition RAD (didn't push though, thank god)
 
@Zacharý :| see this is why you need tests...
 
I think I need a break.
I'm getting confused which arguments are supposed to be Segments and which ones aren't...
 
@Zacharý :|
 
:|||||||||||||||||||||||||||||||||||||||||||||:
 
12:57 AM
7 hours ago, by Leaky Nun
CMC: Print the last n digits of the 10-adic number that ends ...5781249 that squares to 1.
 
@LeakyNun yeah almost done :P
 
:o
 
(i'm cheating off wikipedia, but still)
 
sure
 
1:21 AM
@LeakyNun Third time's the charm?
 
@LeakyNun crap. it's kinda working now but 5th digit (and above) is off
 
@ASCII-only :(
 
@Zacharý do you know a nice way of getting the number of characters in a string other than str.byDchar.array.length?
(In D)
 
nvm
 
1:25 AM
no
we all make mistakes, you don't need to purge them :P
 
Didn't see you said "characters"
Just make everything a dstring.
 
@ConorO'Brien kinda works ninja'd
 
import std.stdio;
void main() {
dstring u = "┘";
writeln(u.length);
}
I think there's a suffix as well
 
ugh
it's a string in D why is it not a dstring by default :U
ty anyway
 
Glad to help!
 
1:30 AM
@ConorO'Brien reads it's actually utf32. which is a really bad idea (i.e. you're supposed to normally use string)
 
yeah.... so I can casually get cast type misalignment errors. I'm going with the byDchar approach :P
 
@ConorO'Brien If you need a raw string, "..."d should work
 
@ConorO'Brien :P
:|
ninja'd again
@ConorO'Brien MCVE pls?
 
no
:P I've fixed the error with the other approach
 
At least with D, we don't get ninja'd by a guy who actually programs in it (solely) for a living :P
 
1:34 AM
@ASCII-only Try it online!
 
@ConorO'Brien fixed
 
oh
cool
turns out I need the dchar array anyhow but thanks anyway!
 
You beat me ... to it
 
ohoho
 
1:44 AM
How many times has someone mentioned this?
 
wait why tho e_e
is ms trying to be google
 
@ConorO'Brien yes
 
ahahaha good luck
 
2:09 AM
@LeakyNun wait. is the process different to the 7-adic one here since 10 isn't prime
 
right
well the 7-adic case is boring
there's only 1 and -1
 
> Suppose that p is an odd prime number
oh.
>_>
 
hi @PhiNotPi
 
hallo
 
9 hours ago, by Leaky Nun
CMC: Print the last n digits of the 10-adic number that ends ...5781249 that squares to 1.
a mathy CMC that nobody has solved yet @PhiNotPi
 
2:21 AM
Sorry, I'm not really feeling like putting in effort right now.
 
ok
 
<- putting in too much effort but can't understand anything
like newton's method is easy but i have no idea how to do it with p-adic numbers
 
Right now I just feel like browsing reddit, listening to music on youtube, contemplating my finite place in this infinite universe... you know, the usual.
 
@PhiNotPi wow this is too normal for someone on PPCG
 
Even the most irrational numbers belong on the same number line.
2
 
2:30 AM
@LeakyNun :|
 
ngn
@PhiNotPi "the most"? are some more irrational than others?
 
why not
 
@ngn transcendental :P
 
some say that $\sqrt 2$ is the most irrational number
because its continued fraction has the smallest possible integer all over, i.e. 1
[1; 1, 1, 1, ...]
 
that to me seems to be the least irrational number
 
2:33 AM
That's not sqrt(2), that's phi.
as in, correct fractions
 
its not pi? :o
 
In number theory, Lochs's theorem is a theorem concerning the rate of convergence of the continued fraction expansion of a typical real number. A proof of the theorem was published by Gustav Lochs in 1964. The theorem states that for almost all real numbers in the interval (0,1), the number of terms m of the number's continued fraction expansion that are required to determine the first n places of the number's decimal expansion behaves asymptotically as follows: lim n → ∞ ...
You can "measure" irrationality by looking at how close an approximation is vs. length of continued fraction. By that measurement, phi is the most irrational. This basically means that phi has the worst tradeoff between size of denominator and accuracy of the fraction.
 
right, phi = [1; 1, 1, 1, ...]
 
ngn
@PhiNotPi right, in APL that's 1+∘÷⍣≡1 = 1.618033989
sqrt(2) is [1;2,2,2,....]: 1+÷2+∘÷⍣≡2
 
355/113 = pi * 1.0000000849, so pi is pretty rational in some sense. But 183/113 = phi * 1.0008869
 
2:41 AM
there was a numberphile video on this
 
ngn
@LeakyNun so how can the square of that p-adic number be 1? aren't the only square roots of 1 just 1 and -1?
 
@ngn 10 isn't a prime :)
there are 4 square roots of 1 in the 10-adic land
 
ngn
@LeakyNun ah...
 
2:57 AM
@LeakyNun +1.
Well...
Can I brute force?
 
sure
provided that the answer is correct, that is
and your algorithm must provably halt
just the usual rules
 
⁵*Ḷ²_5781249o⁵Ṁ’ in jelly should work.
The literal can be compressed more, and hopefully I didn't misremember any atoms.
Hm...
No...
⁵*Ḷ²’o⁵<³CT’ ...
... _5781249o⁵ <Drei> ÞṪ .
 
3:16 AM
the wikipedia page for the jackhammer calls it a groundbreaking invention
 
3 hours ago, by DLosc
Anyone interested in a game of Codenames over at Puzzling.SE?
 
@ConorO'Brien Who answered 0 ...
 
idk. someone answered infinity too
I suppose I should trim that 0
 
@LeakyNun 4? Should there be 8?
 
3:25 AM
@user202729 nah, just 4
 
Hm...
Something wrong with my brute forcer prpgram.
So...
 
4 gives [1, 1249, 3751, 4999, 5001, 6249, 8751, 9999]
5 gives [1, 18751, 31249, 49999, 50001, 68751, 81249, 99999]
there's something inconsistent there :P
 
ngn
@ConorO'Brien trim it to 37 :)
 
was that you?
 
ngn
@ConorO'Brien the infinity - yes
 
3:29 AM
ah
 
ngn
3:52 AM
"КУ!" - the most meaningful answer to "oaisdjf?" :)
 
4:15 AM
 
5:07 AM
He sorted it!
 
@Zacharý wait what
 
Holy crap, 7 15 year olds... jeez
 
O_o
kids these days
4
 
And I'm among the 2 14 yos o_O
 
@ASCII-only Totally agree with you ... DOUGLASSSSSSS (Student Competition)!
@Mr.Xcoder And I'm among the 2 17 yos.
 
5:10 AM
@Zacharý you mean 5
 
@ASCII-only What the ... are the rest doing with their time?
 
@Mr.Xcoder --- (lol)
 
Oh, looked at the wrong one
TFW you get beat by an 11 year old >_<
 
@Zacharý wait, what
 
@ASCII-only That's what I wanted to type lol and tried to correct it 4 times before I finally suceeded... mobile keyboards these days
 
5:12 AM
also: i was here two years ago so the insane number of 15-year-olds seems reasonable
 
I lost to an 11 yr old
I think I was here when I was 15 (PPCG, not TNB)
 
@Zacharý lol nice
 
This time, I'm going to try much harder. (As in, complete all three sets of problems)
AN ELEVEN YEAR OLD.
 
I forgot how mind-bending implementing a Python 5-liner or 12-byter in Jelly is in C++... I literally have about 60 lines and am not done yet...
 
@Zacharý only a junior last year, disappointing
@Mr.Xcoder well at least it's not an interpreter in C++
 
5:17 AM
WTF is Pythob ?
 
@Zacharý Whaaaa?
 
._.
 
@ASCII-only No, it's a simple CS olympiad problem which is designed to be very annoyingly simple in nornal languages (eg Python) but you're forced to compete in C(++) :DD:
 
@Mr.Xcoder solution: do project euler. you'll never complain again
 
5:19 AM
I am doing PE...
 
you'll magically find that you'll have created a bunch of macros to make programming PE in C++ easier than in Python
(disclaimer: I have not tried this yet)
offtopic: it's always fun when your laptop has been processing this for a few days straight and it's still not finished
 
@ASCII-only Macros are fun
 
And it's great. I love using the language which is more suited for the job. I've used all of these while solving PE: Python, C, Cpp, Jelly and Pyth
 
@Mr.Xcoder use Pypy because it's basically as fast as C++ for a lot of algorithm-focused programs
 
Yeah of course I use PyPy
 
5:22 AM
PE?
 
Project Euler
 
Project Euler
 
Jelly for PE? Wow.
 
@Bubbler Jelly does have an insane number of builtins
 
Anyway, I gtg do something I absolutely dislike :( Cya o/
 
5:23 AM
i managed to do this in <1s on Pypy IIRC
@Mr.Xcoder and what would that be :P
 
@ASCII-only Literature preparation for an exam :c
(Don't ask)
 
@Mr.Xcoder rip. good luck, I guess
 
Thanks
 
@Mr.Xcoder Same as well (sleep)
 
Jelly isn't even on the list of languages on PE
 
5:29 AM
@Bubbler why would you restrict yourself to such a small list though
@Bubbler also. what list
 
The one on the statistics page
And yeah, that's insanely small list, I agree with that
 
@Bubbler yeah. 99 languages vs 191 on TIO :P (well maybe only 150 excluding variants)
 
5:54 AM
:P
https://tio.run/##zTztctvIkb@lpxjTiQhKECXbe8mFlOSiTNrLKpnykdTtOraXBYFDEjEIsABQEuPozz1Dft7T3YOcr7vnA4MPkpLtrUu2YgEz0z09Pf09A7qLxeHUdb9@feoFrr8cc3bihXEScWd@tpu2zZ2F@RonjvvZbLgOAejI53ee6/gj14mT@myxKI5YJp7vJasjmMELpqOIT8rHOf40jLxkNpcjjwAlH7lhcKPGT8Z8wn7p9tqXvwwM8F@8YBzexvUZjOHB2JvsPl0GOLR3dXGx@xSevICzq3cj667GaK5GIwlHy8WCR4B/sYK1jRsNMeuZZbwAQM1AgPBm76Nx1XZ3j47Y8LJ92WDXTuy5DJYHjA0SNgn9MYxiVhxG0cpmQZgweqylIOOQdRlsk@@vWMD5mCUhW8Ycnm9fMqBxzMJlwryAJTNsvEsYX3hxCDwKJ2wcOdMwgGl9f3c3cOY8XjguZ/9xTnR82d3d4cFyzlzfiWM2SJyEQ@POTu@y/7Z1YcPT66veq2H3sjd61bqghs6v7zqvhoMR/O13BgPoKgwbFcfs7tw3s5MNVws515VAPBi@HdoM
 
6:13 AM
wait. wrong emote. *:O
 
7:01 AM
:D shunting yard works too
this is amazing
 
 
2 hours later…
8:33 AM
@Mr.Xcoder Then it should be simple in C++ too, except you have to type more.
Where is the "primitive roots" defined? (I understand that it means coprime root, but I cant see that bein defined anywhere
@Mr.Xcoder ... What builtin is that?
How can it be THAT bloated?
Sure C++ is more verbose but not THAT.
 
@user202729 i know right >_>
@user202729 maybe he's trying to implement like matrix ops and bigints from the bottom up :P
 
8:56 AM
It was about finding the level of similarity between two DNA samples (strings), according to some definitions, and then finding the largest submatrix of neighbors that all have similarity over some treshold to some given sample.
I don't have my Jelly code anymore, though, I could have shown it to you
 
 
1 hour later…
10:18 AM
-3
Q: PAPR reduction in ofdm

angel guptapls suggest the latest technique or some new algorithm for papr reduction in ofdm needed for my M.tech research work. Thanks

 
10:45 AM
@betseg +1 it's paper (what theme though? clearly anything other than adapta-nokto is bad
 
10:57 AM
@user202729 it doesn't mention primitive roots though?
 
11:17 AM
@LeakyNun interesting (well, I guess it is kinda expected since it's 10-adic)
i.e. they're basically negatives (right?)
 
@ASCII-only how work
 
@Cowsquack idk. i'm assuming I accidentally stumbled on some kind of manual version of Newton's method
@Cowsquack (newton's method for quadratic being n' = (n^2 - square) / 2 I think?)
so what I do to get the next digit is (n/2 / 10^pow)%10 (and then raise it back (* 10^pow) to the appropriate power)
and for some black magic reason it works
 
11:36 AM
is there a wiki page you used?
 
@Cowsquack no. i gave up on that after too many wikipedia pages and SE questions
 
how is n*n/10**p/2 parsed
 
@Cowsquack n*n/(10**p)/2
(* and / are same precedence)
 
@ASCII-only Oops bigint...
Tips: Just use InfInt when you can.
 
@user202729 infint? but bigint = arbitrary precision?
 
11:44 AM
@ASCII-only C++ header only library for bigint arithmetic.
It's just a name :\
 
@user202729 clearly gmp is way faster
 
@ASCII-only And 100% harder to use. Most onlune judges require the src to be in 1 file.
...
About LeakyNun's CMC...
 
@user202729 ah. fair enough. there are a lot of exceptions though. e.g. GCJ/PE don't even check the code
 
For those which dont check the src just use Python...
GCJ? Not now.
 
@user202729 hmm?
@user202729 what if Python isn't fast enough? also yeah. there's about an even split between Python and C++
 
11:49 AM
Then Python can't solve it "in 20 lines", and you should not complain anyway.
... the number is = 1 mod 2^n and = -1 mod 5^n.
@ASCII-only I think GCJ start verifying the src.
 
@user202729 no...
 
@ASCII-only shuoldn't it be / (2*n)?
 
@user202729 what does length have to do with speed...
@Cowsquack yeah >_> so it's not exactly newton's method then I guess?
 
12:12 PM
@ASCII-only adapta-nokto-eta with papirus-adapta icons
 
@betseg :D
 
use eta, gnome's default window border sizes are too huge
 
@betseg I'm not risking bricking my tablet again thank you very much
 
oh, eta is a different version of adapta with more acceptable window border sizes, not like a different DE or anything
 
@betseg no i think my laptop is allergic to linux
 
12:18 PM
tablet or laptop 🤔
 
@betseg it's a spectre x2. so i'm using it as a laptop but technically it's just a tablet with a keyboard
 
by the way you can copy emoji from gnome's overview mode :D i.stack.imgur.com/pjPx1.jpg
 
@betseg hang on. ew gnome
 
helps when im coding in emojicode 🤷
 
@betseg i wonder if it's any good? on my old laptop I had unity but unity's overlay sa insanely slow to load
like win10 slow
 
12:21 PM
unity is bad
even canonical is discontinuing it
 
@betseg ok. great. but gnome is worse
 
unity is based on gnome
wait, just noticed that that message can be interpreted in both ways
 
xfce is the only acceptable de
 
de? pfft
wm is the only way
 
guys
im writing a programming language
and it has stacks
infinite stacks
and how should i handle loops
should i only peek at the top of the stack
 
12:30 PM
@BoraCalim quite a few languages have that
 
or pop that value
which one should i use?
 
@BoraCalim some languages have both variants, but if i had to say then i'd go with peek
 
ok thx
maybe i may do both
 
(it doesn't really matter because the difference is potentially a pop for one vs a duplicate for the other)
 
is it turing-complete in both cases?
 
12:33 PM
@BoraCalim as long as you have pop and duplicate (or commands that do something equivalent), because with those you can have the exact same loop either way
 
i have pop but it does not store the value
it just discards it
 
@BoraCalim yeah, that's the version of pop i meant. it's not like there's any other type of pop in a stack-based language anyway >_>
 
i dont have duplicate but the language is way too primal rn
 
@BoraCalim *primitive
 
yes thats the word, thx
 
12:46 PM
another design change? >_<
 
hi
 
@EriktheOutgolfer wait what
 
if you have a bit string of length 8, how many distinct bitstrings can you make by inserting 3 bits anywhere you like?
it depends on which string you start with
 
@Anush so what's the point of asking >_>
 
12:52 PM
CMC Given a bit string of length 5, count how many distinct bitstrings you can make by inserting 3 bits wherever you like into the string
@ASCII-only it's a coding question :)
 
1:06 PM
(for LeakyNun's CMC) Good thing is Jelly have modular inverse builtin. ...
 
@user202729 will that help though
 
20 hours ago, by Leaky Nun
CMC: Print the last n digits of the 10-adic number that ends ...5781249 that squares to 1.
 
@user202729 yeah how will modular arithmetic help here
 
@LeakyNun Jelly, 15 bytes: Try it online!
@ASCII-only (do you know Jelly?)
Based on the observation
 
@user202729 :| no
 
1:16 PM
1 hour ago, by user202729
... the number is = 1 mod 2^n and = -1 mod 5^n.
 
@user202729 *-1 mod 2^n, and also -1 mod 10^n :P
 
So use CRT (Chinese Remainder Theorem) and the number can be computed as (1-2×(2^n × (1/2^n mod 5^n))).
@EriktheOutgolfer Yes of course...
 
Hey guys, anyone having trouble with github today? I'm trying to fetch a repository and fetching through https says the repo doesn't exist, while fetching through ssl says the host github.com is unknown. Never had that problem before...
 
@J.Sallé Probably Microsoft's fault.
(seriously. Probably just IP change or something. The website work fine for me.)
 
but it hasn't acquired GitHub yet, has it?
 
1:20 PM
@user202729 yeah the site works fine, and the repository is there
I've been working on it for months :p
 
@user202729 ... why is my repost starred and not the original message?
 
@user202729 1/what
 
@J.Sallé Nothing like that, but I stopped getting their email notifications because their SMTP server ended up on a blacklist.
I know this cannot be related to the current news, but it's still a weird coincidence.
 
0
Q: Get the sequence steps

Luis felipe De jesus MunozChallenge Given a sequence of numbers, create a function which returns the sequence steps. Assume a sequence will be N >= 3 Sequence will repeat it steps at least once Sequence will only contain natural numbers Example: Input: [1, 2, 3, 5, 6, 7, 9, 10, 11, 13, 14, 15] Output: [1, 1, 2] Ex...

 
@Dennis yeah I'm just slightly freaked out because my whole project is there and I can't fetch it on this new computer >.>
 
1:32 PM
@user202729 :| more languages should have an explanation mode
 
@ASCII-only 1/2^n mod 5^n.
Modular inverse of 2^n, mod 5^n.
 
@user202729 ah.
@user202729 i wonder how Jelly does that so quickly
 
Although...
@ASCII-only sympy igcdex.
 
@user202729 looks up oh yeah >_> it was on the wikipedia article
 
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.
 
1:40 PM
maybe I should post my CMC on main with variable numbers of bits?
 
@user202729 is n ...5781249 or is n the prec?
 
@Cowsquack The precision.
 
also how do you know that it is 1 mod 2^n and -1 mod 5^n?
 
@Cowsquack by checking
 
First, note that the question can be reduced to computing a square root of 1 modulo 10^n.
 
1:44 PM
@user202729 :| oh. this makes a lot of sense
 
1:56 PM
@ASCII-only but you only know that the last digit is 1 mod 2 and -1 mod 5
 
If it is 1 mod 2^n and -1 mod 5^n (for n>7), then it's = 1 mod 2^7 and = -1 mod 5^7.
And of course it's a sqrt of 1 mod 10^n.
 
@user202729 >_> oh wait nvm it can't be 1 mod 2^n then
@user202729 n>7?
 
@ASCII-only ≥ is enough, but that is not wrong.
 
@user202729 it wouldn't work with <7?
 

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