« first day (2466 days earlier)      last day (1365 days later) » 

5:00 PM
@HyperNeutrino does Proton have an assert statement?
 
@HyperNeutrino I like the arrow operators ↙ ↘ ↶ ↷ ↻
 
:P they're great
 
ಠ_ಠ It can't be too difficult to implement
@HyperNeutrino Do you mind if I make a PR with that added (if I can)?
 
if you can get through the mess of code, sure :D
 
5:04 PM
I was reading through some code earlier today and I found a good comment on a class
/*
 * free (adj.): unencumbered; not under the control of others
 * Written by jrandom in 2003 and released into the public domain
 * with no warranty of any kind, either expressed or implied.
 * It probably won't  make your computer catch on fire, or eat
 * your children, but it might.  Use at your own risk.
 *
 */
It might.
 
@LangeHaare Can I return 1In Thehand instead of 1in Thehand? (referring to your email challenge)
 
@HyperNeutrino What's the difference between = and := in Proton?
 
@cairdcoinheringaahing I think := clones the object so like a = [1, 2, 3]; b := [1, 2, 3]; b[0] = 2; a would give [1, 2, 3]
I forget though xD
 
> I think
ಠ_ಠ
 
Am I supposed to remember how my languages work?
12
 
5:09 PM
@HyperNeutrino Nah.
 
@HyperNeutrino Yes. I've made more, and I remember how they work. Or rather I can read my code after I've written it :P
 
Well I can obviously read Positron and Proton code even if they're golfed ಠ_ಠ it's just that I can't recite the specs from memory
also, := is an operator I never use :P I can tell you the function-related overloaded operators (except >> and <<) because I actually use those
 
@HyperNeutrino I broke Proton
Also, is there a way to retrieve all declared variables?
 
I don't think so :P
@cairdcoinheringaahing no you didn't
 
5:15 PM
That's odd. print(<) should be printing the __lt__ function...
But <operator><operator><value> doesn't do anything so they're mostly separate things so the first evaluates as < as a function, then =10 as a function, then print(<) should be printing (<) as a function
that's strange
 
@EriktheOutgolfer Sorry no
 
then ovs's answer is invalid
 
@EriktheOutgolfer Thanks dude, your string generation trick allowed me to save 3 bytes!
 
you've outgolfed me by a byte right?
 
Yes I did.
 
5:30 PM
grats then :-)
 
waits to be outgolfed :P
 
@Mr.Xcoder Jelly?
 
@cairdcoinheringaahing Python.
 
no python 2
ninja
 
Eh, Dennis will still be able to outgolf you :P
 
5:31 PM
ugh I hate how my school blocks Imgur so I can't see any of the profile pictures in chat
 
@cairdcoinheringaahing He doesn't really like ascii-art IIRC
 
ascii art is a little bit out of his coding style
afaik there's no discovered perfect such style yet
 
Yes cause he is good in maths :-)
 
@EriktheOutgolfer SOGL and Charcoal are close to perfect :P
 
talking about the style not the language
i.e. the details of your golfing method
which can very between languages
 
5:34 PM
wtf length isn't implemented in Enlist yet
 
@HyperNeutrino L
 
Yes I know it's L :P I just implemented it :P
 
@HyperNeutrino THANKS for the write access
(didn't mean to caps lock, won't bother to edit now)
 
@HyperNeutrino TIL what the gamma function is. Thanks!
 
@cairdcoinheringaahing np :P
 
5:36 PM
ooh what is the gamma function :P?
 
it's like factorial for floats :P (AKA I don't know)
 
@Mr.Xcoder Factorial for complex numbers
In mathematics, the gamma function (represented by the capital Greek alphabet letter Γ) is an extension of the factorial function, with its argument shifted down by 1, to real and complex numbers. If n is a positive integer, Γ ( n ) = ( n − 1 ) ! {\displaystyle \Gamma (n)=(n-1)!} The gamma function is defined for all complex numbers except the non-positive integers. For complex numbers with a positive real part, it is defined via a convergent improper integral: ...
 
ಠ_ಠ two conflicting definitions
 
Ė Enumerate; push [[1, z[1]], [2, z[2]], ...] chat.stackexchange.com/transcript/message/40854000#40854000 ಠ_ಠ
 
it's defined for everything except non-positive integers
@J.Salle did I really use push ._. brb fixing
 
5:38 PM
@HyperNeutrino Where is decimal to integer?!?
 
@HyperNeutrino hahahah I just found it funny because you said that like 30 minutes ago
 
@HyperNeutrino -1 for tacit, it should be stack and tacit :P
 
ಠ______ಠ
 
how does that even make sense
@Mr.Xcoder oh yeah forgot to implement the backwards base conversion for 2,10,16 :P
 
facepalm I just realized....
 
5:39 PM
@HyperNeutrino Use the stack to store the values, but have the "top of the stack" as the return value, which works the same as tacit programming. Dyads pop a value from the stack if needed
 
huh weird
 
It's how Levant works :P (or doesn't D:)
 
lol :P
 
What's the language with a list of pokemon as a builtin? Is it Pyke?
 
Yes, Pyke it is.
New faces borrowed from Charcoal: ←_↖ or ←_←
 
5:41 PM
I'm so proud right now
 
Of what?
 
@DJMcMayhem Why?
 
I just golfed a V answer down by 5 bytes, when it was already the shortest answer, beating Charcoal by 1 :D
So now it's beating charcoal by 6
 
The funny thing though is that I completely forgot about an operator that I added ages ago
And that was what I used to golf 5 off
 
5:43 PM
@Mr.Xcoder I think something is wrong with my fonts...
 
Oh wow nice. (shh the Charcoalers now may golf theirs too accordingly)
 
@Mr.Xcoder Knowing @Neil, that very well may happen...
 
@DJMcMayhem Do you say that he is a great "porter"? :P
 
Huh?
 
5:44 PM
No nvm, he is just a great golfer
Gtg explaining the string generation... That might take a while :D
 
well, it would first require me to know which question
 
14
Q: Bake me a cake!

user68614This is a cake: _========_ | | +________+ | | +________+ | | +________+ It is 8 wide, 3 tall, and 1 deep. You must write a program that makes a cake from 3 inputs. The first input controls how many underscores there are in the middle and =s on the top. Here's the first ca...

 
Oh BTW, the first to solve this in Jelly using a reasonably low amount of bytes has my instant upvote.
 
@HyperNeutrino 0! is -1 by that definition and you would probably want it to be 1.
 
5:47 PM
CMC: write code to sample a random multiset (uniformly) from the integers 1...n
 
it is 1 I guess my definition is wrong then :P
@Lembik it's just called a CMC :P
 
Huh. That challenge was originally posted by eartinmnder, who is now deleted
 
@DJMcMayhem such name. very wow
 
@HyperNeutrino thanks
 
np :P
also I think I have two TNB windows open because SE is giving me two notifications per ping
 
5:48 PM
I don't know any language that has it built in, although maybe mathematica does
 
@Lembik Examples?
 
@HyperNeutrino fixed it thanks to the editable wiki ;)
 
yay thanks :P
 
@muddyfish What command is used to access the pokemon dictionary in Pyke?
 
@Lembik you can safely assume Mathematica has a built in for any given function and you'll be right about 85% of the time
 
5:52 PM
@cairdcoinheringaahing ~_ or ~{ IIRC
 
I'm guessing ~{ but it outputted 802, which is the number of pokemon
 
@cairdcoinheringaahing Try it online!
 
why is pokemon dictionary a thing in pyke
 
@Lembik What? You just want a random int in the range 1…input?
 
@Mr.Xcoder Nice. Do you know how to do head?
 
5:55 PM
@Adám No he doesn't. A multiset is a set but which allows duplicate elements. Random multiset is any combination of the range IIRC.
@cairdcoinheringaahing [0]?
 
@Mr.Xcoder No, first n elements
 
: Is there a better way of writing this:
for line in foo.split('\n'):
    print('    ' + line)
 
@cairdcoinheringaahing <
@DJMcMayhem Define better. Golfier? More efficient?
 
@Mr.Xcoder OK, so he wants a subset of a given multiset, but of which length?
 
A random one.
 
5:57 PM
@Mr.Xcoder More idiomatic/pretty?
 
@Mr.Xcoder So, given the code ~{F~_+.o, how would you get the first 151 elements?
 
@DJMcMayhem "\n".join(4*" " + line for line in foo.split("\n"))
 
Doesn't necessarily need to be golfy
 
doesn't print it
 
5:57 PM
@cairdcoinheringaahing I guess ~{F~_+.o151< but not sure. BRB testing
 
"\n".join(map(" ".__add__,foo.split("\n")))
 
@HyperNeutrino ew please no
 
@Mr.Xcoder Ah, so a random multiset of length rand(0…len(input))?
 
(•◡•)
 
@Adám No...
It can have any length.
 
5:58 PM
@Mr.Xcoder No, it acts as a no-op :(
 
@cairdcoinheringaahing Oh that's because <... Vectorizes.... (why muddy, why?!?!)
 
Would wrap, then < work?
 
Ummm
 
@Mr.Xcoder HOw can it have more elements than the input‽
 
@Adám [1,1,1,1,1,1,1,1] is a multiset of [1, 4] for instance.
 
6:03 PM
@Mr.Xcoder Slowly, I'm getting this… So, given n, I'm supposed to return any multiset of 1…n. But there are infinitely many!
 
@Adám Yes. A very easy algorithm would be to choose a random integer in the range [0, +∞) and get N random elements of the range.
Got it?
 
@Mr.Xcoder Random each in range [0, +∞)‽ It's a joke, right?
 
0
Q: Don't repeat yourself in Rock-Paper-Scissors

mschauerUpon the rumor that Codegolf will have a Rock-Paper-Scissors tournament you look into the topic of square-free words. A word made of the letters R, P, S is square-free if it does not contain a sequence that repeats twice. That is to say, the word can not be written as a x x b where a and b are...

 
@Adám No. 1. Get an integer X in the range [0, +∞) 2. Generate X random integers from [0, N].
Sorry, I addressed a slight mistake :P
 
@NewMainPosts Dennis answered before you posted it here. Be ashamed.
 
6:09 PM
And Note that Dennis ≠ Leaky.
 
@Mr.Xcoder How do you get a random into from 0 to ∞ with uniform distribution?
 
Built-ins only :P
 
@DJMcMayhem Do you know if we still count Vim answers in keystrokes?
 
@Mr.Xcoder What language has a built-in for that?
 
@AdmBorkBork Good question, slightly contentious issue
 
6:13 PM
@Adám If Husk has a "random element of" built-in, Husk does, since it has the infinite list of natural numbers.
 
IMO, they should be, but I think right now the consensus is that they should be scored in bytes, which is only an issue if you're using arrow keys
 
@Mr.Xcoder TIO link, please!
 
@DJMcMayhem So is this an acceptable answer?
 
@AdmBorkBork Yes, and because all of those keystrokes map to ASCII bytes, it could be scored as 29 keystrokes or 29 bytes with no issue
 
6:14 PM
OK, thanks!
 
@Mr.Xcoder I mean, with the pick random element.
 
@Adám IDK if there is a built-in for that, and I cannot be bothered to search. It's not in the docs, I just asked the creators of the language if there is a random element built-in.
 
@Mr.Xcoder Oh, right, those two features don't go well together.
 
@Adám Umm, why?
PL theory :P?
 
@Mr.Xcoder Statistics. You could have it with a different distribution though.
 
6:24 PM
Nevermind...
 
CMC: Given N, output the N'th value of A029578, the natural numbers interleaved with the even numbers
 
@DJMcMayhem Can we return floats (with .0) instead?
 
Sure
 
36 bytes, Python 2 so far.
 
I wonder how you'd do it in brain-flak
 
6:31 PM
oh damn, far over 500 bytes using my approach
(methinks)
 
@DJMcMayhem PowerShell, 31 bytes
 
@Mr.Xcoder default consensus ;-p
 
@DJMcMayhem Python 2, 23 bytes Try it online!
 
6:37 PM
@cairdcoinheringaahing That would be Mathematica
 
nope that's Pyke :P
 
And also mathematica
 
If you wanna test it
 
too lazy to click "Quicks"
--- Pyth, 10 bytes: *.c2%Q2/Q2
 
9 bytes: ?%Q2tQ/Q2 (untested)
 
Was just about to try that
 
@EriktheOutgolfer Dang, I was up to 12 before I gave up
 
there's also the 6-byter Ḃȧ’ȯHḞ which uses no quicks at all
 
6:47 PM
See, I still think too much like PowerShell, so I was building two ranges and interleaving them
 
at least that makes you good in powershell :D
 
Haha, I suppose that's true
 
not many users here do powershell
 
AFAIK only one
 
no not only one but not many either
 
6:52 PM
I think I'm the only PowerSheller in chat, though.
 
Yes you 99% are
CMC: Given a=a1a2a3...aN and b=b1b2b3...bN (two strings of the same length), return a1bNa2b(N-1)...aNb1
 
yeah jelly 2 bytes żṚ
 
abcd, efgh -> ahbgcfde
 
wait no
huh
3 bytes: ɠżṚ (a is from stdin, b is from argument)
 
6:56 PM
@Mr.Xcoder PowerShell, 46 bytes
 
Hehe, rm -rf is valid code in Deorst :P
 
@EriktheOutgolfer Invalid.
 
@Mr.Xcoder wat
 
nvm sorry
@EriktheOutgolfer Anyways, invalid.
 
>_>
but Ṛɠż is valid
 
7:00 PM
@EriktheOutgolfer ಠ_ಠ why STDIN?
 
I suppose it's interesting how I can come up with and type out a 46 byte PowerShell answer in the same time as a 3 byte Jelly answer.
 
because that came to mind first
still it's valid :p
 
it also looks nicer
 
@Mr.Xcoder Because you use superscript numbers too much :P
 
@ConorO'Brien stdin?
 
7:01 PM
yeah
 
you don't really have much experience with jelly then...you try to avoid stdin as much as you can
 
@ConorO'Brien ಠ_ಠ Jelly is antonym with the word "Nice". You could describe it as golfy, not nice...
 
(note:speculation)
 
@cairdcoinheringaahing Even better. rm -rf deletes every value on the stack :D
 
1ಠ/1ಠ
 
7:06 PM
@Mr.Xcoder yet I find subscripts less aesthetically pleasing than solid characters.
 
@cairdcoinheringaahing ~!+.oTry it here!, it's basically just using the regular dictionary and looking up a regular word in it given an offset. ~! returns the offset needed to lookup Pokemon by their ID. .o is just look up the word at this index in the dictionary
 
@muddyfish How do you get the first N elements of a list?
We tried < but it didn't work
 
@cairdcoinheringaahing Q3< Try it here!
 
@muddyfish So why doesn't this return the first 151 pokemon?
 
@muddyfish He still want the Pokemon list first N elements.
@cairdcoinheringaahing Because vectorization.
 
7:15 PM
@cairdcoinheringaahing Try it online!
Because you're doing a comparison in the for loop rather than changing the length after it's closed
 
@muddyfish Does the ) act as a separator?
Never mind
 
) closes the for loop
( closes all loops and if statements and whatever
 
And one last question. How do you get the nth element?
 
~{F~_+.o)Q@
@ does index and at depending on which order you put the int. Really it should be the other way around but I can't really make that change without breaking a load of scripts
 
\o/ Thanks. Does the Pokemon dictionary need to be included in this qestion?
 
7:19 PM
I have no idea. The file's included with Pyke as a standard thing just like the builtins for planets and stuff
 
15 bytes as compared to 800-900 byte answers seems wrong
 
It should be marked as non competing regardless :P
 
@muddyfish Hmm, asked the OP
@muddyfish Are you saying that Pyke wasn't around in 2012????!!!!
 
@cairdcoinheringaahing huh
that's not done anymore btw
 
7:21 PM
I might have to update the list as a new generation's come out
 
@EriktheOutgolfer 'Twas merely a jest
@EriktheOutgolfer Huh?
 
you don't mark answers to old challenges with new langauges as "non-competing" anymore
 
huh
 
What a nice day to get fast acting construction glue all over your hand. Incidentally, it's also a nice day to have run out of glue remover.
 
:D
 
7:22 PM
@mınxomaτ sorry!
 
@mınxomaτ It's night here :P
 
Fortunately, painful scrubbing is so much nicer.
 
Though I feel answering that question with a language that has pokemon names built in might be considered cheating especially as it came out later. I didn't see that challenge when implementing it though
 
yeah pokemons is a must-have builtin :-p
 
I'm just waiting for that challenge
And then I'll strike
Just you wait
 
7:25 PM
Random coding style question (C++). Would it be better to check if a directory exists before attempting to read it, or try and read it anyway in a try/catch block?
 
@muddyfish yeah that's just essential especially if you have kinda forgot the actual date and you can't trust system time and you're out in the wild so you feed a pyke program in with what date you have a blurry memory of and then you wait for the next full moon
 
@DJMcMayhem Definitely check first.
 
So it's better to ask permission than forgiveness? :P
 
@DJMcMayhem no c++ expert, but I'm afraid that you might be creating a new directory instead of erroring out
 
Which file API are you using?
 
7:27 PM
@EriktheOutgolfer No, right now it's definitely erroring out
@feersum boost::filesystem::directory_iterator
 
@DJMcMayhem still you want to prevent the errors, not stumble over them and work around then ;)
 
But just because it exists doesn't mean you will be able to read it.
It could get deleted in the meantime or have permission errors for example.
 
So you would recommend a try/catch? Or should I check permissions also?
This might be a good question for software engineering (nee programmers)
 
@feersum if such thing happens then something is very wrong, either with you or with your program (no offense)
 
You should check whatever errors the API can generate.
 
7:33 PM
@Phoenix That would be parsed as associative indexing on a sigilless variable named start, so no. — Brad Gilbert b2gills Jun 12 at 23:01
This comment makes no sense.
 
@EriktheOutgolfer It's easy enough to have permission to see a directory exists but not have permission to browse the directory.
 
Perl 6 makes no sense.
 
@Pavel s/ 6//
 
@AdmBorkBork Agreed, however it's a directory in the programs working directory, and not a user-selectable directory, so that shouldn't ever happen unless someone's intentionally being an idiot
Although I still plan on handling permission errors
 
@cairdcoinheringaahing Perl 5 code basically makes sense after an explanation is supplied.
 
7:37 PM
@Pavel Of course, you could use Python, which is basically pseudocode with some syntax sugar added
Which is more readable, print(input()) or $_=<>?
 
Some day I'll learn Perl. I'm still deciding if that'll be 5 or 6.
 
You should learn PowerShell.
7
 
@cairdcoinheringaahing 0/10 if $_ is implicitely printed, it's using the -p flag, which means $_ implicitely contains the input already, so no code at all is needed.
 
@Pavel Ok, which is more readable, print(input()) or
 
@AdmBorkBork I kinda have? Shell languages tend not to be rocket science.
I wouldn't golf in it but I basically understand how to do things in it.
 
7:40 PM
@AdmBorkBork and there's also some weird permission that lets you read the directory but not get a listing
 
@Pavel Excellent. Now to convince you to golf in it...
 
eh
 
@Pavel shell languages by definition depend a lot on external commands >_>
like sh or bash for example
 
How to use PowerShell: Step one: run the command bash. On windows this may require installing LSW. Step two: Use bash.
 
yes
that is the correct way
 
7:45 PM
(I actually think PowerShell as a language is better than Bash, but Bash can use grep, and PowerShell can't, so Bash wins)
 
@AdmBorkBork what is the PowerShell Hello, World?
 
@cairdcoinheringaahing 'Hello, World!'
 
Yeah, super boring.
Or you could do "Hello, World!" for the same byte count.
 
Notice the lack of echo, which is unnecessary.
On bash that would try to run a command called Hello, World!
 
A much better version:
python
print('Hello, World!')
 
7:47 PM
it really isn't
 
@cairdcoinheringaahing no
 
@Pavel PowerShell doesn't need to use grep because everything on the pipeline is object-oriented. Transliterating bash commands with grep to PowerShell is fundamentally misunderstanding how PowerShell functions.
 
this will execute python, wait until it exits, then try to execute print('Hello, World!')
 
@AdmBorkBork What's the Windows/PowerShell equivalent of /dev/tty? On Linux, writing to /dev/tty will make the text appear in the console, even if stdout is being piped to another program or file.
 
@cairdcoinheringaahing and what if Python's not installed?
 
7:48 PM
@Pavel Write-Host
 
@FlipTack Install Python
 
Thanks.
@AdmBorkBork So given a file foo, how would I get all the lines in it that match a given regex bar?
 
Non-golfy version -- get-content foo|where-object{$_ -match 'bar'}
 
Can we agree that grep bar foo is better than that mess you've got there.
 
That's because grep is fundamentally a text-parsing tool, and PowerShell isn't.
 
7:52 PM
Exactly. And powershell can't use grep, since even with WSL, grep is a linux binary.
 
Still not understanding your point. That's like saying that Bash can't use Java reflection.
 
My point is that even though PowerShell is a better language than Bash, I'll continue using bash as my shell language because it can call Linux utilities on windows.
I'd use PowerShell on Linux since that restriction doesn't apply there, but currently I do not have a Linux computer.
 
Ah, gotcha. That makes sense.
 

« first day (2466 days earlier)      last day (1365 days later) »