« first day (2284 days earlier)      last day (2574 days later) » 

3:01 PM
@Riker /r/jesuschristreddit/
 
@Riker looks like LastPass
 
3:13 PM
yea
@flawr yes
 
what's wrong with using lastpass
 
nothing, I was just wondering
 
That moment when you try to downvote an answer, then realize it's your own answer.
 
@mınxomaτ the parallel by default is quite interesting
I think that would work very well with funktional langauges too
 
3:34 PM
@flawr You can kind of do this with shell scripting. Consider each line a separate program, return control flow immediately. You would need to store live pIDs in a map or something though
Also, ANI is just a very trivial form of a saner task scheduler for graph-parallel programming (functions == interdependent nodes). You can do this in production with C++, using TBB: threadingbuildingblocks.org/tutorial-intel-tbb-flow-graph
 
@Mego Either one would be fine. :) Let's go with Jelly.
 
Anonymous
@Dennis Done :)
 
Thanks!
 
@mınxomaτ That Prolog example, OMG
I'm not sure permutation sort is a very good example
 
Make a comment, it's clear the author appreciates feedback
 
3:42 PM
I just got a badge by being the 1000th view on my own question! lol
29
Q: Pythagorean Triple Sequence

mbomb007 A Pythagorean triple consists of three positive integers a, b, and c, such that a2 + b2 = c2. Such a triple is commonly written (a, b, c), and a well-known example is (3, 4, 5). If (a, b, c) is a Pythagorean triple, then so is (ka, kb, kc) for any positive integer k. A primitive Pythagorean tr...

By chance!
 
It mentions its complexity after that, didn't see
 
user165474
3:54 PM
Yay I can protect questions now ^-^
 
user165474
@mbomb007 You gave yourself a badge? :O
 
@mbomb007 I'm sorry, I meant it as a joke, but clearly it wasn't
 
@mbomb007 I think I will atm. Would removing the ruby script perhaps increase clarity?
 
user165474
lol cross-room ninja? :P But yes, I will add an explanation and update.
 
@ConorO'Brien I think it would. Idk Ruby.
 
3:59 PM
ok cool
maybe I'll just post it on gist.github and provide the link that way
 
Or maybe just link (ninja'd)
@ConorO'Brien Also, it should maybe be tagged
Not sure.
 
I guess it depends on the implementation, but mine seems similar to a quine
 
it definitely is similar
 
user165474
Great I can't vote anymore for 7 hours ;_;
 
4:02 PM
I think that fits for the tag
ok I edited it with tags and an example
 
Looks good
 
1
A: Sandbox for Proposed Challenges

Conor O'BrienExit code string output code-golf quine You must write a program or function that, when given a nonempty string S of N printable ASCII characters†, outputs a program that will exit with exit code C, where C is the ASCII codepoint at position 0 in S. It will additionally output a program P, such...

Alright, I'm about to post this--any final thoughts? (just getting it out there)
 
@ConorO'Brien I wouldn't do it.
 
why not?
 
because it's too difficult
 
4:07 PM
I already have a solution.
It's not that hard
 
well I'm just saying that I wouldn't do it
 
it's stupidly simple
 
this does not mean, in any way, that the challenge is bad
 
I made one in two minutes
ohhhh
 
I'm not good at making quines
 
4:08 PM
I thought you meant "I wouldn't do it [if I were you]"
 
heh
 
22
Q: Tips for writing quines

ais523A quine is a program that produces output that's identical to the program's source code. On this website, we generally only care about proper quines (at the time of writing, the current definition is "some part of the output is encoded by a different part of the program"). What advice do you hav...

 
@mbomb007 oh heh
 
@mbomb007 posted
 
@ConorO'Brien upgoated
 
4:11 PM
hehe
 
@ConorO'Brien for a function is exit code the same as return code?
 
function codes have no exit
 
It's not possible to write a function for this
 
you may only use a function for the first program
read the first paragraph again
 
well you can for example exit('S'); System.exit(50); etc in a function
 
4:13 PM
Not after a return, though.
 
Yes but I specified a program for the secondary programs
 
You'd have to print in the function instead, right?
 
2
Q: Exit code string output

Conor O'BrienYou must write a program or function that, when given a nonempty string S of N printable ASCII characters†, outputs a program that will exit with exit code C, where C is the ASCII codepoint at position 0 in S. It will additionally output a program P, such that, when run, it exits with exit code C′...

 
user165474
4:29 PM
CMC: Given a chatroom ID, output the last user who posted a message there.
 
user165474
@LeakyNun ^
 
I don't like having to search for other data lol
 
user165474
Oh ok lol
 
user165474
CMC: n -> -1/n (perpendicular slope)
 
user165474
I expect this to be too easy. :P
 
4:31 PM
Pyth, 4 bytes: _c1Q
 
user165474
Yay
 
J, 3 bytes: -@%
 
Anonymous
@HyperNeutrino Actually, 2 bytes: ±ì
 
user165474
Hm. Interesting. What does the fancy i operator do?
 
user165474
@HyperNeutrino Jelly, 3 bytes: N1÷
 
Anonymous
4:32 PM
Multiplicative inverse
 
Anonymous
aka 1/n
 
user165474
Oh cool. What does the +/- do then?
 
Anonymous
Sign swap
 
user165474
Interesting.
 
Anonymous
aka additive inverse
 
user165474
4:33 PM
So you can't just negate it?
 
user165474
Wait, that is negate.
 
Anonymous
That is negating it
 
APL, 2 bytes:
 
It's two bytes in Dyalog APL: ÷-
 
ninja
 
4:34 PM
÷ takes the reciprocal while - negates (both of these are monads in a train), actually the program goes right to left, so it does - first
 
user165474
tbf, they're slightly different. :P
 
Stacked, 3 bytes: 1/_
 
@HyperNeutrino Jelly, 2 bytes:
 
user165474
Oh.
 
CMC: range from A to A + B (inclusive or exclusive on either end)
 
user165474
4:36 PM
Nice. I was looking for "reciprocal"
 
@ConorO'Brien example?
 
2, 4 => [2, 3, 4, 5, 6]
 
user165474
@ConorO'Brien Jelly, 3 bytes: R+⁴
 
@HyperNeutrino you don't need the
 
user165474
Also it doesn't work...
 
4:37 PM
why?
 
user165474
2, 4 -> [5, 6]
 
you just need to swap them, which is allowed by default
 
user165474
...oh
 
user165474
lol
 
user165474
Okay.
 
user165474
4:38 PM
@ConorO'Brien Jelly, 2 bytes R+ (-1 byte thanks to Leaky Nun!)
 
I saw that >.>
 
Pyth, 4 bytes: }hQs
 
user165474
hehe
 
If 2, 4 => 3 4 5 6 is valid output, then 3 bytes in Dyalog APL: +∘⍳
 
user165474
Python, too many bytes: lambda a,b:range(a,a+b)
 
4:39 PM
It is valid @KritixiLithos
J, 3 bytes: +i. (returns 2 3 4 5)
 
CJam, 5 bytes: {,f+}
 
Anonymous
@ConorO'Brien Actually, 5 bytes: ;)+@x. Takes input as B\nA, outputs [A, A+B).
 
user165474
Java, even more too many bytes: int f(int a,int b){int[]i=new int[b];for(int j=0;j<b;j++){i[j]=a+j;}return i;}
 
user165474
@Mego +1 for winky face
 
Anonymous
@HyperNeutrino You can do way better than that
 
4:41 PM
^
 
user165474
I know, I didn't really try.
 
just output consecutively, no need to make a function
 
user165474
Oh
 
*return
 
user165474
int f(int a,int b){for(i=0;i<b;i++)System.out.println(i+a);}
 
4:44 PM
 
@ConorO'Brien It sounds in your description like the first program should output two programs, because you didn't assign a letter to the first output program.
 
Maybe assign a letter to each.
Or use a bulleted list.
 
How's that?
 
Anonymous
Java 8 in 47 bytes: (int a,int b)->java.util.IntStream.range(a,a+b)
 
4:46 PM
It always makes me really happy inside when brain-flak is golfier than Java.
9
 
user165474
@Mego I forgot about Java 8 stream functions ;_;
 
Anonymous
Streams and lambdas make everything better
 
Tell that to Geobits lol
 
I finally just installed the team spirit script
It looks great guys, gj!
Main thought: Blue has unfair advantage cause of pinned message. Clearly this proves that red is superior if we're winning anyway :P
 
@ConorO'Brien I outgolfed you!
 
4:52 PM
beg pardon?
 
I outgolfed you.
 
where? I'm confused
 
look at your notifications
 
I'm still confused
 
Anonymous
@ConorO'Brien C++, 109 bytes:
 
4:53 PM
did you mean to ping mbomb?
 
Anonymous
#include<numeric>
#include<list>
[](int a,int b){std::list<int>c(b);std::iota(c.begin(),c.end(),a);return c;}
 
@ConorO'Brien oh, heh
@mbomb007 I outgolfed you
 
@ConorO'Brien in your challenge the answers output programs that take input and return nth character, I don't think that's what the challenge wants?
@Mego woo a C++ lambda
 
Anonymous
Trying to do that with fancy C++11 stuff is gross
 
4:54 PM
@betseg The C one works at any rate, and does what I want
 
Anonymous
71 with no C++11 features:
 
Anonymous
#include<iostream>
int f(int a,int b){for(;b;--b)std::cout<<a++<<'\n';}
 
can't you do cout<<a++ instead?
 
doesn't C++ have ++ and --
 
Anonymous
Yeah I'm too used to Python
 
4:57 PM
@ConorO'Brien first program outputs a program, 2nd program takes input and returns 2nd character, 3rd program takes input and outputs 3rd character, etc.
 
@ConorO'Brien SWI Prolog: 80 bytes
 
@LeakyNun I still like my quiney solution better.
 
@mbomb007 I hate quines.
@Adnan oh hey, do you Brachylog?
 
Anonymous
They're coarse and they get everywhere
5
 
@LeakyNun just prolog
 
5:00 PM
@LeakyNun me too, the only quines I can write are 2D ones
 
@LeakyNun Your solution is invalid. The final program is supposed to exit with code 0.
 
@mbomb007 what do you get if you execute an empty program?
 
@Mego they aren't rough or irritating?
 
Oh
Still, you didn't list the program before.
 
I listed it now, sorry
 
5:03 PM
@LeakyNun Unfortunately for you... I CAN USE THE SAME TRICK
hahahahaha
I will be outgolfing you shortly
 
:(
 
Just kidding
But it will save a lot of bytes
Oh wait...
I'm looking at the wrong program. It might outgolf you
 
what?
 
Yeah, one sec. it will be 107 bytes
 
5:06 PM
or less
 
@mbomb007 do you think I can't golf my own answer?
 
I'm talking about MY answer.
Which will be shorter than yours soon
:D
 
by 1 byte.
 
More
 
we'll see
I really like how %= performs formatting
 
5:09 PM
@ConorO'Brien Does a program printing nothing count as printing the empty program?
It makes sense, I guess.
 
@mbomb007 can't you make your program into a lambda (to save more bytes)?
 
hmm
No
It requires assignment in order to do the quine-like string formatting
Oh wait.
optional parameter. let me see
 
0
Q: Calculate Wind Chill

catThe Australian Apparent Temperature (aka, wind chill) in °C AT is given by this algorithm from the Australian Bureau of Meterology (wp, source): AT = Ta + (0.33 * e) - (.7 * ws) - 4.0 Where: Ta = Dry bulb temperature (°C) e = Water vapour pressure (hPa) ws = Wind speed (m/s) (at...

 
@mbomb007 I have done quine-like lambdas in the past that print themselves, so it might be possible.
 
5:19 PM
Well, it's not really a quine, just a program chain
Yeah, I can do it
 
0
A: Sandbox for Proposed Challenges

AdámScramble words while preserving their outlines It is well known that a text can still be read while the innards of its words have been scrambled, as long as their first and last letters plus their overall outlines remain constant. Given a text, scramble each word according to these rules: Scra...

 
@mbomb007 here
 
Already did it
 
@mbomb007 oh heh, someone out-golfed us both
 
Yeah. I still think the quine-like way is cooler.
 
5:25 PM
yet it is my method which out-golfed us both
 
It'd be interesting if the score included the sizes of all the programs
Or if it was the size of the first output program
 
-1
A: Minus, Plus, Times, Exponentiation?

AmirI have the following code: import java.util.Scanner; import java.lang.Math; public class CodeGolf{ public CodeGolf(){} void start(){ // initialize the scanner object Scanner input = new Scanner(System.in); System.out.println("Enter a positive integer: "); int positiveInt...

 
@LeakyNun I "outgolfed" him using his own method. But I'm just giving it to him as a suggestion to save 10 bytes
 
Delete votes pls?
Dang that was fast
 
5:33 PM
I forgot I was able to do that now
 
@DJMcMayhem He forgot break;s in the cases in the switch. That was most likely to be the culprit here
 
@mbomb007 oh heh
@DJMcMayhem I wanted to help him/her fix it :(
the switch is missing breaks
 
ninja'd
 
oh hey, I can edit that in
 
And he took the %4 instead of &3
 
5:35 PM
You'd think that Python string formatting would be smart enough to recognize when it can do r"\\\\some string" instead of "\\\\\\\\some string".
 
And @LeakyNun ^^
 
@KritixiLithos they are equivalent?
 
@LeakyNun I don't think that's appropriate
 
@DJMcMayhem I don't see any other way
 
@LeakyNun huh, didn't realise
 
5:40 PM
When I type ^V it just pastes what I have in my clipboard, instead of the number... — Leaky Nun 3 hours ago
@LeakyNun Windows?
 
@DJMcMayhem ya
 
Try ^Q, vim Windows is dumb by default
 
@DJMcMayhem the rest of the code also doesn't work
huge dependency problems
 
Oh yeah, cause bc, of course
 
@DJMcMayhem then is it appropriate to delete an answer just because it isn't working properly?
(would you delete my answer because I missed some testcases?)
 
5:42 PM
It's not an answer though. It's a request for help
 
You could have used another reason to delete it, i.e. it is ungolfed
 
I think I got my first 1-byte solution
 
@KritixiLithos, I knew there would be builtins for this in many languages. I hope people will give it a go in languages where the aren't any... :)
 
@KritixiLithos congratulations!
 
2
Q: Find the indices of values in one list in another

Stewie GriffinYou must take two lists of positive integers as input, let's call these n and m. You may assume that: All integers in n are part of m All integers in m are unique The lists are non-empty Challenge: Return the indices of where you find the values in n, in m. That might be confusing, but I t...

 
5:48 PM
@LeakyNun, yes it is! :) Many people do at least!
 
@StewieGriffin At first, I thought the solution would be >5 bytes, but now it's plain simple
 
The shortest builtin is not interesting in my opinion. Answering it in a language where the solution isn't as obvious or straight forward.
 
^ I agree, I don't think my solution should've gotten that upvote
 
@KritixiLithos I upvoted it.
 
I'll try it in Retina
 
5:52 PM
@BusinessCat that would be interesting
 
I am faced with a dillema: golf or do homework that is due tomorrow was due last Friday?
 
OK it was actually not too hard
 
You're done already?
 
@KritixiLithos Do the homework.
But do it golfily, so that you don't have to write much.
4
 
@wizzwizz4 hi. what brings you here?
 
5:57 PM
Thank you, that's the best advice I've ever heard
 
@LeakyNun Prolonged absence and new Chatiquette.
 
@wizzwizz4 I've always golfed my homework, even essays... "Very well written, but very short" - B
 
Oh, by the way - i.stack.imgur.com is down.
 
Not for me
 
Yes for me, apparently. And it's down too often.
 
6:01 PM
It's 503ing for all of the mods in the mod room. NOT A REAL PLACE!!!1
 
@BusinessCat 4 upvotes in 2 minutes :o
 
@wizzwizz4 deleted room = mod room, certainly possible place, theory debunked
 
{ ~ }  » curl -I i.stack.imgur.com/YQ853.png
HTTP/1.1 200 OK
Date: Mon, 01 May 2017 18:02:31 GMT
Content-Type: image/png
Content-Length: 17496
Connection: keep-alive
 
OK so it seems i.stack.imgur.com is back again.
 
6:04 PM
0
A: Find the indices of values in one list in another

Leaky NunJava, 104 bytes void f(int[]a,int[]b){for(int i=0,j;i<b.length;i++)for(j=0;j<a.length;j++)if(a[j]==b[i]){b[i]=j;break;}} Try it online!

Can anyone help me golf this?
 
@DJMcMayhem Nice! Looking forward to the explanation, cause that doesn't make any sense :P
 
On the way now
 
6:14 PM
@LeakyNun you just caught what i was going to mention
 
@Poke oh heh
 
Same I was going to say the b[i++] thing
 
@StewieGriffin Explanation added. Is it clear/readable?
 
@BusinessCat heh
double ninja
 
@DJMcMayhem How does Ò<C-a> take care of numbers with more than 1 digit?
 
6:19 PM
In the original revision, that was a bug. But now I'm removing non-whitespace instead of whitespace
So it's ÓÓ<cr>Ò<C-a>
 
Ah, that was the change between ó and Ó
 
Or in vim, :s/\S//g<cr>Vr<C-a>
 
@DJMcMayhem Yes, very nice explanation :) I have to scroll up and down to see what actually happens on each command :)
 
@LeakyNun 81 bytes
 
Cool, I'm glad to hear it. :)
 
@BusinessCat wat is dat witchcraft
 
@betseg that is some weird behaviour in the TIO link in the comment
 
no, s[i+j] doesnt have to be empty if i+j is bigger than strlen(s)
 
C is weird
@betseg but why? Is it just memory allocation issues?
 
@KritixiLithos ¯\_(ツ)_/¯
@KritixiLithos UB
 
6:26 PM
UB?
 
undefined behaviour
 
@Dennis I am working on a golfing language. Do you mind if I use the Jelly code page?
You will get credit, of course.
 
@ComradeSparklePony Go ahead, I don't mind at all.
 
Thank you.
 
@HyperNeutrino did you read this?
38
Q: Programming with Bits and Bytes

bitsnbitesIn this challenge you are going to write an interpreter for a simple language I've made up. The language is based on a single accumulator A, which is exactly one byte in length. At the start of a program, A = 0. These are the languages instructions: !: Inversion This instruction simply inverts ...

Let's make this language!
 
6:50 PM
If any of you updated to the most recent version of Chrome only to find that the theme you were using broke, it seems you can revert to the default theme and then reinstall the theme you were using to fix it.
PSA
 
I don't use a Chrome theme, partly because I don't trust most extensions
 
a theme is not an extension
 
Poll: which programming language is the easiest to understand, in terms of syntax, to a layman?
 
Spanish
 
Brainf***
 
6:52 PM
probably python
 
@Dennis por favor, estoy en serio
@KritixiLithos please
 
you guys
 
Norwegian. There aren't any is/are, have/has etc. Everything is just plain and simple...
And so are Norwegians.
 
@LeakyNun The syntax of brainfuck is actually very easy to understand. Trying to get things done is another story...
 
6:53 PM
@Dennis hmm...
 
if you don't know how to do something in python you can basically write the pseudocode and it will work
or at least there's a library that will work
 
@Dennis Like, trying to say "a glass of water please"... seriously?
 
What?
4
 
@Poke There's always a library!
 
yay for community support i guess
ruby is similar in that regard
 
6:56 PM
@Dennis Try to say that phrase in brainfuck casually. Is it possible?
 
> Trying to get things done is another story
 
CMC: print a circle of radius n. You must pick two consistent symbols. The grid is of radius 2n+1, with center being (n,n). A grid is "colored" if the floored Euclidean distance from the grid to the center is n.
e.g. for n=5:
00111111100
01100000110
11000000011
10000000001
10000000001
10000000001
10000000001
10000000001
11000000011
01100000110
00111111100
Sample implementation in Python:
n = eval(input())
size = 2*n+1
for i in range(size):
	r = ""
	for j in range(size):
		if int(((i-n)**2 + (j-n)**2)**0.5) == n:
			r += "1"
		else:
			r += "0"
	print(r)
 
@StewieGriffin I always thought Danish to be quite similar to Norwegian. Danish has is/are, have/has, etc. So how do you say something like "the book is red" in Norwegian?
 
7:14 PM
@LeakyNun CJam, 35 bytes: ri:R2*):Q{Q{XR-YR-mhm[R=}fY}fX]Q/N*
 
> tabs
 
I use tabs in Vim
 
ಠ_ಠ
 
I don't see any problem with using tabs for indentation
 
It feels most natural, although for me, in order to insert a tab I have to do <C-v><TAB> in insert mode instead of just tab because I've mapped the tab key to something else
 
7:18 PM
@KritixiLithos Huh? Danish doesn't have singular/plural for is/are, just er, or have/has, just har.
 
doesn't he live in denmark though?
 
turkish doesnt have a perfect tense :P
 
Oh, I thought Stewie meant that Norwegian doesn't have any words for "is" or "are" in Norwegian, but instead he would have meant what you said, that is/are are the same word
@Riker who are you talking about?
But yeah, conjugation is easy in Danish
 
you
 
then yes
 
7:22 PM
Hebrew (usually) doesn't even use the word "is".
 
@KritixiLithos s/in Norwegian//
 
How do you reply to your own message?
I see you do it fairly often
 
get the ID from a permalink
 
I don't think that's possible
@DJMcMayhem Replying to your own comment sounds really difficult.
 
@Riker This is what i've done in the past
 
7:32 PM
@Adám Can a post be its own reply?
 
yeah if you guess your post id or edit it
 
@DJMcMayhem Oh, I forgot about edits.
 
@Adám Apparently it can
 
@Poke It doesn't work if you guess your post ID: chat.stackexchange.com/transcript/message/35453490#35453490
 
oh well that's a shame
 
7:33 PM
That's cool
 
But the outcome was disappointing, no self-ping :(
 
@KritixiLithos I got a self-ping.
 
Me too
 
You don't ping yourself if you guess your post ID like I did here ^^^^^^
 
7:56 PM
Chat Mini Challenge: Print this: Try it online! (the output not the code obviously)
 
user165474
Ooh, interesting.
 
Actually, that could be an interesting challenge on main
 
user165474
It could be. There's a somewhat related challenge on main about country codes, but that one requires a creative way to only output some of them.
 
@DJMcMayhem ØAṭþ`G
 
user165474
It's that short???
 
user165474
7:59 PM
Wow.
 
@HyperNeutrino Yeah, I was trying that in V, which is what inspired my CMC
 
user165474
I see.
 

« first day (2284 days earlier)      last day (2574 days later) »