« first day (2282 days earlier)      last day (2579 days later) » 

12:01 AM
@trichoplax A more general one
 
0
Q: Tips for golfing in Logo

goatmealLogo is a programming language that was designed back in 1967 that has great potential for creating graphics in relatively few bytes compared to other languages. Logo is an educational programming language that utilizes Turtle Graphics. There are multiple interesting implementations of Logo inc...

 
@mınxomaτ The security question almost killed me. :'-)
 
12:29 AM
0
Q: Is a "tips for fastest code" question on-topic?

Qwerp-DerpI'm noticing that the tips tag is dominated by code-golfing questions (e.g. the hundreds (exaggeration) of tips for golfing in {language X} questions), but our site isn't just about golfing (e.g. fastest-code, metagolf, etc.) Is it on topic for me to post a tips challenge about a topic other tha...

 
12:45 AM
@isaacg oh, when I left (8 months ago), if I ran a program that won't halt, some minutes later I would not be able to access the online interpreter.
 
1:42 AM
yo
 
user165474
Hello.
 
@DJMcMayhem planning on adding an explanation to your vim solution soon?
 
@Phoenix we're holding a game in Contact, join?
 
One added, lemme pull out my laptop
*second
 
1:59 AM
@Phoenix hmmm... I could in about 4 hours (if I don't fall asleep first)
 
Busy with something?
 
Life
 
Ahh, feelsbadman
:P
 
Apr 25 at 6:42, by DJMcMayhem
@Mego Mobile, since I have a nasty habit of using chat at all times even when I'm busy.
:P
 
@Downgoat
William "Billy" Windsor I is a cashmere goat who served as a lance corporal in the 1st Battalion, the Royal Welsh, an infantry battalion of the British Army. He served as a lance corporal from 2001 until 2009, except for a three-month period in 2006 when he was demoted to fusilier, after inappropriate behaviour during the Queen's Official Birthday celebrations while deployed on active duty with the battalion on Cyprus. He retired to Whipsnade Zoo in May 2009. His young replacement is known as William Windsor II. == History == The tradition of having goats in the military originated in 1775, when...
 
2:29 AM
CMC: flip a 2D square array along its main diagonal
wait, that's just transposing, never mind
 
Is the main one the one that goes top left to bottom right or the other one
 
the former
 
user165474
@LeakyNun If I understand correctly, is that what zip does?
 
@HyperNeutrino yes
 
user165474
Alright.
 
2:31 AM
@Phoenix hmm, what matrix operation would flipping about the other one be?
 
@HelkaHomba just reverse and transpose (or the other way round, I have no idea)
 
Horizontal reflection + Transposition?
Ninja'd
 
but "reverse" is not a common matrix op from linear algebra
iirc...
 
it is
 
user165474
It isn't but it can be achieved using n/2 elementary row operations for an n x m matrix
 
2:34 AM
@HyperNeutrino ninja'd
or just multiplying by a matrix with the other diagonal filled with 1's (and the other elements 0)
 
user165474
Right...
 
user165474
:P
 
3:05 AM
What is the rule WRT using libraries?
 
declare it in the title
and count the import towards the byte count
 
in java specifically?
 
Nah, Julia
I only golf in julia
 
oh cool
julia is fun
 
Julia is great, we are getting there.
 
3:06 AM
well, if your code is syntactically valid without the import, then it's okay
what library specifically?
 
idk,
I was looking at: https://codegolf.stackexchange.com/questions/117986/linear-interpolation-of-the-fibonacci-sequence

And I feel like there is an Interpolation.jl library that would make it really easy, and also really elegant
 
ah
 
It is going to become interesting once julia gets a standard library
Or rather once 30% of Base is moved to a standard library that is in separate packages
 
3:31 AM
What do people think of this challenge? Is it ready for posting?
4
A: Sandbox for Proposed Challenges

Wheat WizardUnrestricted Languages One of my favorite types of challenges on this site are restricted-source challenges. These challenges impose a computer tractable restriction that the sources of potential answers must pass. I like these challenges so much I have been working on a golfing language desig...

 
4:02 AM
@Dennis What would $ do here?
RḂÐf
²RsµU³Ç$¦
 
4:21 AM
How do I explain continued fractions?
 
Picture doesn't work with SE... :(
 
what?
convert it to png and reupload
 
4:43 AM
0
Q: Reachable numbers

Leaky NunDefinitions Euler Phi Function (AKA totient function): a function which takes in a positive number and returns the number of positive numbers less than the given number which are co-prime with given number. It is denoted as φ(n). Reachable number: if there exists a positive integer x such that ...

 
@LeakyNun I think it would group U³Ç.
 
@Dennis eras tu que has inventado el lenguaje
 
4:59 AM
Believe it or not, I'm aware of that. :P
 
Are we speaking Spanish now?
 
user165474
gasp you are? :P
 
Es extraño que español tiene palabras diferentas por idiomas y lenguajes.
 
user165474
something something that spanish something something different for something and languages?
 
Spanish has different words for spoken languages and programming languages
 
user165474
5:00 AM
Ah. I see.
 
Most others just use the same word.
 
user165474
I see. So idiomas means programming languages, or the other one?
 
literally, "It's strange that Spanish has different words for spoken languages and programming languages"
idioma is a spoken language
 
user165474
Oh I see.
 
user165474
Hm, interesting. I wonder why that is.
 
5:02 AM
All of the beginning computer science texts were written in English?
 
@LeakyNun That issue doesn't seem to exist, though if you see it happen again, absolutely let me know.
 
How does pushing a magnet make it spin?
 
@Phoenix lenguaje is a superset of idioma and not necessarily related to programming.
When used for spoken or sign languages, you'd usually choose lengua over lenguaje though.
 
;-;
WordReference lied to me
 
Looks like it. There's lenguaje corporal, lenguaje de señas, etc. To say programming languages, you'd use lenguaje de programación.
 
5:31 AM
parseInt("")
NaN
parseInt("") == NaN
false
But... why?
 
user165474
Nan != Nan
 
user165474
That's how to test for NaN. isNan(x) is equivalent to x != x.
 
I see.
That actually kinda makes sense
Still stupid
But I can see why that happened
 
user165474
I don't get it either, but I suppose it does kind of make sense.
 
because NaN could be anything. One NaN is not the same as another
some NaN is warm and toasted...
 
5:34 AM
Idea: NaN == NaN yields Maybe
Like Haskell's data type
 
user165474
There's a Maybe data type? D:
 
Not in JS
 
0																												'
What kind of Maybe? Or just the incomplete data type?
Speaking of functional programming languages has anyone tried programming in grass?
 
The Haskell Maybe, I guess.
 
user165474
Strange. I can't imagine how that would work
 
0																												'
5:37 AM
Yeah but that is like saying we'll have it return an array and not specifying any further. Maybe needs something to go into it.
 
Hmmm, IDK
 
user165474
What would Maybe ? "Hi" : "Bye" (or equivalent) give?
 
0																												'
@HyperNeutrino Not quite sure what you are getting at. Haskell's maybe is kinda like an an array except it can contain either one or no items
 
user165474
Oh.
 
user165474
Whoops, I thought it was a boolean with identity crisis :P
 
5:45 AM
That's what I thought too tbh
It's confusing
 
0																												'
You can kinda treat them like that if you do something along the lines of if a /= Nothing then "Hi" else "Bye"
 
Better idea: NaB: Not a Boolean
 
user165474
lol
 
user165474
NaN: Not a NaN.
 
Mathematica has neither... kinda. If takes 4 paramters: condition, iftrue, iffalse, and else.
 
5:52 AM
I guess I shouldn't post a challenge at this time of the day.
Nobody would answer it.
 
I like to post challenges around this time, since its stays at the top of active for longer.
 
Then perhaps you should answer it
 
I'll try
@LeakyNun ಠ_ಠ Mathematica can't solve EulerPhi even with FindInstance
I can't think of any other way but brute force, and I don't really want to do that.
 
6:26 AM
@LeakyNun idk, I'm just about to post one
I like posting one before I go to bed because then I get to wake up to a nice rep-counter
 
I'm hoping to have delete privelages by tommorow.
I need 9 more rep
@DJMcMayhem What about? BFBD?
 
0																												'
Here's a fun challenge: Perform a flip around w in Grass
 
@Phoenix Yup
I'm also planning on posting an explanation to yours :P
 
I'm always really curious to learn how Vim answers work
They're completely unreadable to me and I find it's more intresting that Golfing langs.
 
Do you have vim installed? It's fun to watch it run
 
6:30 AM
I have Vi (comes with Linux), I can install Vim/Gvim
Ok I have Vim
 
Cool. Do you know what the <C-a> notation is?
 
Control a
 
Yup. So put the input in the buffer (with i...<esc>), jump to the first column (with 0) and type out my answer
 
Is there I shortcut to jump to the very first column and row?
 
gg
Unless there's leading whitespace, then you'd need gg0
(or go if you're going for golfy)
 
6:35 AM
@DJMcMayhem I do know some things.% seems to jump to the closing bracket, D deletes everything remaining on that row. Then there's some stuff I don't understand, @ is for recording into registers?
 
Yes on % and D
@ is for playing back a register, q is for recording into registers
So to record and playback <foo> you would qa<foo>q@a
@Phoenix Just posed the explanation
 
Ye, I saw
Wow. You were right, that's beautiful.
The <C-a> trick is really clever.
 
:) Thanks, I'm glad you like it
 
Hey, is there a way to unbind default keybindings?
 
Unbind or remap?
Like, you want a certain key to have no effects when pressed?
 
6:42 AM
Either one. I'm looking at codegolf.stackexchange.com/questions/61115/… and I had the idea of making it impossible to insert text by unbinding i and a (and probably some other things)
 
Ah. Well you could do :nnoremap i <nop> but there are tons of workarounds for that
Not to mention the dozens of ways to enter insert mode (i, I, a, A, o, O, s, S, c, C, R)
 
Hmm
 
It would probably be easier to do something like au InsertEnter * :call feedkeys("\<esc>")
(Although that still has many workarounds)
 
I've been trying to get a way to call :%d every instant, and then unbind :
 
0
Q: Appends or Prepends? Depends

DJMcMayhem Brain-flak turns one year old tomorrow! In honor of it's birthday, we're having a PPCG style birthday party, where several users post brain-flak related questions! Help us celebrate! :) Brain-flak is an esoteric language I wrote where all of the commands are brackets and all of the bracket...

 
6:47 AM
That was fast
I was literally the first person to see that
Ok, the internet is not helpful when it comes to timers in Vim
 
I think this would suffice:
au InsertEnter * call feedkeys("\<esc>")
nnoremap : <nop>
nnoremap Q <nop>
 
What's Q do?
 
Enters command line mode
(Technically called ex mode)
 
Actually, au InsertEnter * call feedkeys("\<esc>") just makes no sense to me.
It does something to the text insertion behaviour?
Eh, I'm not getting any solutions to challenges in Vim for a while.
Some day.
 
I recommend vimtutor
It's easier to start using vim as a text editor than as a golfing language
 
6:54 AM
Yes
 
To answer your last question, it defines a command that happens every time insert mode is entered. And that command is call feedkeys("\<esc>")
 
*Install Evil for emacs*
HAHAHAHA
 
So basically whenever you enter insert mode, vim will press <esc> as if you had typed it
 
Neat.
nvm, I just opened emacs and it's somehow more confusing.
 
Oh, duh I just realized a really obvious workaround
v:
 
6:57 AM
Didn't you just unbind :?
 
Yeah, but only in normal mode
If you enter visual mode (with v) you can still press :
 
nnoremap v <nop>
 
Wow, I'm having too much fun finding workarounds. There's another one though
 
I'm sure there's dozens
I should sleep, it's a new day already.
o/
 
grnyl7plrullrmlralrplr:Yq:p<cr> will recover it
 
7:03 AM
How and why
 
7:35 AM
i.imgur.com/fgsTkDu.png 0,5° tilted flag of Switzerland (image is 2000x2000, trying to prevent onebox)
 
8:11 AM
@betseg why‽
you monster
 
8:33 AM
Can someone here do me a favor? Pick a post of mine, upvote or downvote it, and then remove that vote again tomorrow (you must make a small edit, otherwise it won't be possible remove the vote (my grammar is horrible so it shouldn't be hard to find something to change).
I want to see if there is a code for it in this list.
I suspect it will be removed from today's summary when it's reversed tomorrow, but I'm not sure. Hopefully it will get a code between 4 and 7.
 
8:54 AM
Never mind all of the above, I asked on meta instead.
 
9:04 AM
currently discovered: 00001, 00010, 00011, 01000, 010001, 10000
 
what are those?
 
known rep identifiers in binary
1, 2, 3, 8, 9, 16
 
@KritixiLithos Currently discovered: 1-12 & 15-16 :)
(Meta post, link above)
 
10:14 AM
You got ninja'd 26 days ago :P
 
@KritixiLithos, well that was ridiculously fast!
DJMcMayhem posted it in lower case though... That's just plain wrong! It appears the DJ forgot to have CAPS LOCK turned on...
 
11:16 AM
@LeakyNun you challenge is also all multiplicative combinations of p-1 where p is any prime
 
11:46 AM
I offer a bounty to a one-line Retina answer, where the one line is a plain regex (no backticks). — Leaky Nun 51 secs ago
@orlp I beg to differ, considering that phi(9) = 6.
 
@LeakyNun huh?
6 = 7-1
 
phi(16)=8
oops, 8=(3-1)(5-1)
so every reachable number is somehow the product of p-1?
I know the formula for totient number
 
@LeakyNun yes
 
why?
 
well, for any prime p totient(p) = p-1
and totient(a)totient(b) = totient(ab)
 
11:53 AM
as long as a and b are coprime
 
right
 
oh, i am stupid
wait, that's only one of the directions
 
@LeakyNun I think I'm not right though
 
how do I prove the other direction of the "iff"?
 
I believe I'm missing prime powers
 
11:56 AM
yes you are
 
for any prime p, all p^k - p^(k-1) are reachable
and any multiplicative combination of those are also reachable
because a multiplicative combination of those represent totient(p1^k1 p2^k2 ...)
and since the fundamental theorem of arithmatic that any n can be written as p1^k1 p2^k2 ...
so for any n we can write totient(n) as totient(p1^k1 p2^k2 ...)
therefore for any totient(n) we can represent it as a multiplicative combination of p^k - p^(k-1)
@LeakyNun now the question is, what is the smallest p/k for which p^k - p^(k-1) is not a multiplicative combination various p - 1s
(e.g. for which number would my incomplete conjecture have failed)
oh that's actually easy, any k > 2, p > 2
because p is a factor of p^k - p^(k-1) and p is not reachable
3^3 - 3^2 = 18 would have failed
totient(27) = 18 so it's reachable
but 18 = 2*3*3, which does not factorize into p-1s
 
i see
CMC: determine if, for given n, exists prime p and positive integer k such that p^k - p^(k-1) = n
 
12:28 PM
0
Q: The bunker of the math lecturer

AntoineBACKSTORY After giving back the results of the last topology exam to his students, Pr. Manifold was worried about complaints. Since he is aware his students know where his office is located, Pr. Manifold decided to transform his office into a bunker with a 10 digits password. But he suspect...

 
Someone said phi?
 
12:53 PM
Is it okay to advertise Area51 proposals on chat?
 
Sometimes.
 
Well, I just created this new proposal
I think it might be a better idea to put it on my profile
 
1:10 PM
What's a good simple benchmarking challenge (where having a smart algorithm won't help you)
 
1:27 PM
@PhiNotPi yeah, phi, not pi.
 
Which reminds me of a really simple proof of phi's irrationality, involving the golden rectangle...
 
@PhiNotPi well, sqrt(5) is irrational
so (1+sqrt(5))/2 has to be irrational
 
The definition of the golden rectangle is that, if you remove a square from the rectangle, the remainder of the rectangle has the same proportions (phi). If phi were rational, there would be some x-by-y rectangle that represents phi in its lowest terms... but then you could remove a square to get a smaller rectangle, a contradiction.
 
that's nice
 
I don't see how this argument proves anything.
 
1:36 PM
@feersum any rational number can be expressed in smallest terms
 
@LeakyNun So?
There's no reason to assume the next smaller rectangle will have integer side lengths.
 
@PhiNotPi please defend your dissertation :p
 
@feersum it will, because removing a square is subtracting an integer (since the square has integer sides).
 
Oh, you mean since it shares a side with the rerctangle.
I see.
 
I mean, it works better with a diagram.
 
1:40 PM
^ I agree
Has there been a challenge for converting floating point numbers into binary?
 
I mean...floating point numbers are binary
you mean a binary string?
 
@KritixiLithos what does that have to do with floating point?
 
The number has a decimal point and digits after it (if that's what floating-point means)
 
I think the term you are looking for is real
in math, a real number is any number with decimal expansion
 
1:53 PM
@NathanMerrill Ah, okay
 
but computers cannot store real numbers
so we approximate with floating point
 
Floating point numbers are real
 
then rational numbers, so that the numerator and denominator will be given as input
 
@LeakyNun I have an algorithm
 
@orlp show me
 
1:54 PM
p^k - p^(k-1) = n
p^(k-1)(p - 1) = n
 
@JanDvorak yeah, but only a small subset of them
 
2**64 is a lot
 
I should have said they cannot store any arbitrary real number :P
 
so n must be a prime power multiplied by one less of that prime
 
like pi
 
1:55 PM
@LeakyNun so we factorize n
and for each prime in its factorization
 
@KritixiLithos so, convert a fraction to N decimals?
 
we check if n/(p-1) == p^k for some k
 
I think that has been done
 
actually we don't even need to guess k
since p-1 and p are coprime
 
@orlp then?
 
1:57 PM
@NathanMerrill It's decimal to binary for rational numbers. So 1/4 = 0.01 (example taken from Wikipedia)
 
well we already factorized n, right?
so we know n = p^k * <some other stuff>
 
But then again, the output can be non-rational
 
since p-1 and p^k don't share factors we know that k doesn't change
 
but we don't know what p is
wait, p is the largest prime factor
 
@LeakyNun we try for every p
that we found
in the factorization of n
@LeakyNun why the largest?
 
1:59 PM
@orlp because p-1 must be smaller than p
so must the factors of p-1
 
@KritixiLithos So, basically, cast a fraction into a floating point number?
 

« first day (2282 days earlier)      last day (2579 days later) »