« first day (2614 days earlier)      last day (2228 days later) » 
00:00 - 14:0014:00 - 00:00

2:02 PM
@user202729 The inconsistent formatting is distracting
 
@flawr For which one?
 
first one
and I still don't get it
is it correct that g is a function from {0,1}^n to {0,1}?
 
... I was confused between f and g ...
 
oh hey do I hear maths
 
Hopefully fixed now. So f is the function that need to be created, and g is the variable bound to the for-all.
(I mean, fix my memory)
@flawr Yes.
@flawr Challenge edited.
(...I'm not even the OP of that challenge...)
 
2:13 PM
@user202729 I noticed, I wouldn't any of your challenges expect to have such bad formatting...
 
@flawr Fixed, {a_k...} is a submultiset of {-1,0,1,...,n}.
 
hello
some C# golfer here?
 
Sort of.
 
I think is my only golfing answer where I ever used C#!
 
(why don't you just use TIO?)
 
2:28 PM
1. because at the time I posted I did n't know about TIO
2. because TIO has no directories below the current one
3. Yes the site I used now is not in a good state for testing — at least I don't know if I can pass program arguments!
 
/opt exceed 128 KB limit.
 
thanks @user202729
 
@sergiol So run mkdir a couple times: tio.run/…
 
curl http://parrot.live you're welcome
 
@Poke Blocked here, what was supposed to happen?
 
2:33 PM
 
@Pavel party parrot, my dude
 
Uhh... I'm making a scraper for a website that doesn't like bots. It checks if the bot requests it too often and possibly ban the bot for a very short amount of time (~0.1 second). Somehow, my Python bot has problems with it. When it sees the warning "you are requesting too fast", it's waiting 5-10 seconds and then continues. Somehow, it keeps getting the warning, even when it works slow. When I login to the page with the same account as the bot does, I have no problems, no warning showing.
The page uses user's database record to check the last request, not by IP or session ID. Any ideas? :/
 
@user202729: I can default init n, but not i :(
 
@sergiol I removed i from the code at the "248 bytes" change.
 
2:50 PM
@user202729 Java has var now.
 
@Soaku reminder to be careful that you're not going against the TOS for that website. The website might be taking your user agent into consideration
 
CMC: Output the first n strings of the following sequence:
>
<
->
<-
-->
<--
--->
<---
...
 
@dzaima both arrows are not on the same end
 
@Pavel SOGL, 16 bytes
@moonheart08 yep, still angry that I made mirror strings bot not reverse them...
 
lol
 
3:02 PM
haskell: (`take`concat[['-'<$[1..i]++">",'<':'-'<$[1..i]]]|i<-[0..]])
untested :P
 
i would make a golfscript-# joke, but it's rather boring
 
nope doesn't work
*sighs*
 
@Pavel Canvas, 13 bytes
 
3:08 PM
@totallyhuman Your markdown appears to have borked
 
indeedy ;-;
 
You can't have spaces right after the opening `.
(deleted)
 
there you go
 
Do we allow challenges that is originally posted on another site? (this sandbox challenge)
 
I'm trying to figure out behavior for subtraction, multiplication, and division of an array that's not just a matrix operation. (Addition is append)
What do you guys recommend?
 
3:21 PM
@moonheart08 Don't. Use explicit method names.
 
Even for a golfing language?
(Forgot to state i'm doing another golfing language, because i like reinventing the wheel endlessly)
 
CMP: In Python, do you prefer list(map(Point,zip(xcoord,ycoord))) or [Point(x,y)for x,y in zip(xcoord,ycoord)]?
@moonheart08 Vectorizes?
 
Sure.
 
@user202729 The latter, I don't use constructors like other functions.
 
@user202729 The latter
Although even better is [Point(x, y) for x, y in zip(xcoord, ycoord)]
Spaces are important
 
3:33 PM
@DJMcMayhem In my opinion, (somewhat influenced by ngn) only spaces that help separating the code logic are important.
 
You could also totally do [Point(*coords) for coords in zip(xcoord, ycoord)]
 
I often don't include spaces after ,.
 
@user202729 blech
 
Basically I don't do what "IDE/Code format" can do.
class P:
	def __init__(self,x,y):
		self.x=x;self.y=y
	def __add__(a,b):return P(a.x+b.x,a.y+b.y)
	def __sub__(a,b):return P(a.x-b.x,a.y-b.y)
	def __mul__(a,b):return P(a.x*b,a.y*b)
	def dot(a,b):return a.x*b.x+a.y*b.y
	def cross(a,b):return a.x*b.y-a.y*b.x
^ is that too few spaces? Probably.
 
My eyes are bleeding
class P:
    def __init__(self, x, y):
        self.x = x
        self.y = y

    def __add__(a, b):
        return P(a.x + b.x, a.y + b.y)

    def __sub__(a, b):
        return P(a.x - b.x, a.y - b.y)

    def __mul__(a, b):
        return P(a.x * b, a.y * b)

    def dot(a, b):
        return (a.x * b.x) + (a.y * b.y)

    def cross(a, b):
        return (a.x * b.y) - (a.y * b.x)
 
3:38 PM
P*n works but n*P doesn't. is that intended?
 
@NieDzejkob Work in what?
Uh... no.
 
in @DJMcMayhem's code?
 
That's not mine, it's @user202729 but with PEP8 formatting
 
Actually my code, DJ reformatted it (or just run it through an autoformatter)
 
No, I did that by hand
 
3:39 PM
yeah, your code. Didn't follow the conversation for a moment...
 
Anyway... I can't remember to implement everything. If something breaks I will fix it.
 
@user202729 I haven't done operator overloading before. Is that correct without a self?
 
@DJMcMayhem Python always require self. Class.methodname(self,*args) == self.methodname(*args).
Same for operator overloading. a+b == a.__add__(b) == P.__add__(a, b).
 
Makes sense
 
3:47 PM
@Cowsquack the inbrowser version doesn't seem to work for me
 
I don't think the example was supposed to give output
 
@flawr 10/10
I also love how some posts there are just tagged 'russia'
lol
 
Anyone know of a onlne plotting tool (for example I give input
(23,30)
(10,45)
(8,47)
(-2,38)
(-11,27)
(-13,13)
(-8,3)
(0,0)
(5,5)
(18,22)
and it draws the points)
(except Wolfram|Alpha)
 
desmos? (but it takes input in another format)
 
Input format is not important.
 
3:55 PM
@user202729 you could also remove zip
 
desmos should work
 
@totallyhuman ... I forgot it ...
 
@user202729 I tried to do exactly that before asking here!
@user202729 I am using your golfing suggestions and editing my answer one step each time because I want to know what is going on behind the scenes
@user202729: I used a different order of steps
 
0
Q: Facey McFaceface

AJFaradayAnyone remember Boaty? You could totally make any old word, right? Write a function to turn a string into Somethingy McSomethingface. It should accept one string as input. Ignore the case of the input. If the word ends in 'y', your function should not add an additional 'y' to the first instanc...

 
4:15 PM
@user202729 Thanks very much, I understood all the changes you made :)
 
@Poke Well, this is against the TOS, but I got permission from administrator. And I've set the client already, forgot to mention.
 
now I'm curious which TOS you're breaking lol
 
How can I set the locale (for Jelly)?
Do I need export?
(I still didn't fully understand how Linux works...)
 
4:35 PM
@user202729 If you don't export, only the current process will "see" the variables, ones you create won't.
 
Anyway I found a workaround.
 
@user202729 variables in shell scripts start with the values of the "environment" of the parent process. You can use export to update the version of the environment which will get passed to programs you run
 
Unrelated, but curl parrot.live for a fun time.
 
@El'endiaStarman Dupe of previous message.
 
@user202729 Would've been nice if you had linked to it.
2 hours ago, by Poke
curl http://parrot.live you're welcome
Am I expected to search chat history every time I want to say/post something that might've been shared before?
 
4:44 PM
Feb 26 at 16:29, by Mr. Xcoder
Hey I don't search in TNB to see if someone posted the same meme before ¯\_(ツ)_/¯
 
that's.... agreeing with el'endia
>_>
anyway nice to see you again @El'endiaStarman been a while
how's c.se going?
 
@Riker c.se?
 
christianity.se, his mod site
 
I typoed christianity like 5 times so I gave up
 
4:45 PM
@Riker Sure has been a while. Anything new/exciting happen in TNB over the last few months?
 
@El'endiaStarman not really
I presume you saw the mod election?
(since that gives a little notice bar beep)
 
Yeah, voted in it.
 
Is there a way to let Jelly take input from file instead of command-line argument without changing the source code itself (only the interpreter)? Because this fails.
 
IIRC the results matched my votes, so yay, but I would've been happy with any result considering the candidates.
 
yeah, not much else going on in TNB / main since then
@El'endiaStarman lol
 
4:47 PM
C.SE has been active but fairly quiet, which is nice.
 
@El'endiaStarman C.SE?
 
2 mins ago, by Riker
christianity.se, his mod site
@El'endiaStarman only other thing that happened was the best of ppcg 2017, that's viewable on meta
 
And when you type ppcg.se everyone understand... (hopefully)
 
@Riker Ah yes. I didn't really have time/motivation to look at all the links, unfortunately. Work has been keeping me decently busy.
 
actually not turns out
they don't get "codegolf" from "ppcg"
 
4:55 PM
(or is that customized just for me?)
 
Google results typically are customized to some extent to try and show you more relevant results. PPCG.SE is second in the results I got.
 
@user202729 >implying people immediatley use google when they don't know something
 
Google most often changes the results so they fit the location and language. I get "PPCG stock"... Wish Google understood that I want English results, not in Polish, but it won't understand...
 
@Soaku DuckDuckGo has a switch in the top left for that. Does Google do too?
 
@NieDzejkob Sadly, Google has an option for changing the language, but of the site, not the results
There is one in settings, but it doesn't do what it should - it only hides the "Search only in Polish" message when searching in English
 
5:55 PM
@betseg @Riker /r/SeeYaLaterLosers/ 11/10
 
5/7
2
 
hi all
coding question.... say you have an array of n positive integers and you want to put them into b buckets
Each bucket covers some range of the indices of the original array of size n/b. Each bucket should just contain a single number which is the sum of the integers in the bucket
is it easy to do that in linear time?
it is making my head hurt
I feel it should be easy
 
can you give us an example?
 
6:11 PM
here is a really simple one
(1,0,5,1) into two buckets would be (1,6)
if n/b is not an integer then we will need to round suitably
 
could it also be (2, 5)?
 
@Cowsquack no.. how would you get that?
the array is in order
think of it as 1 egg sold on day 1, zero on day 2, 5 on day 3 etc.
 
make a new array with b entries
 
oh, the order matters, I thought "bucket covers some range" meant that they cover an arbitrary range
 
set a counter c=0
 
6:13 PM
@Cowsquack ah right.. I wasn't very clear sorry
 
loop over all entries: increase the conter at each entry, and check every time whether c> n/b. If yes, reset c=0 and use the next bucket
 
sounds simple now you put it that way :)
 
Or use Matlab's accumarray :-P
 
oh do any free languages have it built in?
I am happy to use anything pythoney
 
Octave, yes
 
6:14 PM
yes, Octave
 
Probably numpy too
 
hmm.. let me see if I can get that to work.. 2 secs
 
@Lembik alternatively split your array into b chunks of equal size and sum each of them
 
6:16 PM
@LuisMendo I am not sure bincount does
unless I have misunderstood how to use it
@flawr ah yes I suppose that can be linear time too
 
@LuisMendo I always wondered why there is not repmat that just pads/cuts off the array if the size you specify doesn't match
 
does accumarray allow you to specify the number of buckets?
 
I think accumarray is more general
 
ok I can't actually see how to use docs.scipy.org/doc/numpy/reference/generated/… to do this
it seems to do something completely different
that is count how many times each number occurs in the list
 
the actual array goes into weights
 
6:22 PM
<reads backscroll> wait, @flawr so convolution isn't the answer to everything? :p
 
you need to compute a second array that contains labels that say in which bucket each entry goes
@Riker hoo sed dad?
you could actually solve this using convolution
in matlab this would be something like x = conv(array, ones(1,n/b)); answer = x(1:b:end)
 
Okx
I don't see Elixir being used at all in PPCG
 
May 15 '16 at 21:57, by flawr
@CᴏɴᴏʀO'Bʀɪᴇɴ I know, convolution can do anything
 
@Okx Be the change you want to see in this world
 
Okx
I am. Posting quite a few Elixir answers
 
6:31 PM
 
0
A: Sandbox for Proposed Challenges

DevelopingDeveloperElectronic Piggy Bank A piggy bank is a container used to collect coins in. For this challenge use the four US coins: quarter, dime, nickel, and penny. Challenge Your challenge is to create an electronic piggy bank. Write a program (or function) that when run (or called), outputs (or returns) ...

 
@flawr I guess I don't really get much of a choice other than bowing to the might of convolution, hm?
:D
 
fft + multiplication = convolution confirmed
 
fft + convolution = multiplication confirmed
=> 2*fft = 0
and this implies 2 = 0
 
6:38 PM
@flawr thanks
 
np!
math rocks
 
Why is floating point so annoying (ノ°Д°)ノ︵ ┻━┻
I'm sticking to integers for everything from now on
 
why don't you go all the way and stick to natural numbers?
 
lol
 
nobody needs those fantasy "negative" numbers anyway
 
6:43 PM
Why even bother. You only need a '1' to represent a brainfuck program
No-one needs the fancy 2 through 9
just 1
 
I just spent two hours fixing like five seperate major problems in a group project that were pretty much all caused by comparing floats for equality.
 
you only need 70818400575684102291859867004917893470532314351736139503167322734980393838011937‌​859778003735372196763609736264517534703641721495914192366762928523336030601697875‌​1166690464736541968556 ones to represent "Hello, World!"
totally didn't just look up unary and steal the number
 
@Pavel lool :D
some floats are more equal than others
 
@Pavel whatever floats your boat i guess.
 
6:55 PM
That's really unintuitive, even for JavaScript
 
@mbomb007 variable declaration hoisting?
 
@mbomb007 have you tried [100, 11, 1].sort()?
8
 
that's why i declare all of my js variables at the top
use strict doesn't let you use undeclared variables though
 
> In JavaScript, hoisting is a powerful and an expressive feature
Hoisting is complete BS, is what it is.
 
it's how you can use a function that isn't defined yet
 
7:02 PM
Yeah but it's still a horrible way of doing that
 
i mean if you run into a situation where you have a problem because of it
it's kinda your fault anyway
 
1D: A+A: Zip.
A+N: Zip with 0..n
A+M:
N+N:
N+M:
M+M:

I'm going to have a tough time filling in all of these possibilities (A is Array, M is Map, N is Number)
I'll just leave it for later
Seriously, just having 3 types gets convolted fast
 
7:18 PM
@flawr Heh, use MATL (assuming you mean reshape?)
 
@LuisMendo d'oh of course, reshape :)
 
@Lembik I've never used it, sorry
 
np.reshape(L,(num_bins,-1)).sum(1) does it if num_bins divides len(L)
but not so useful otherwise
I am tempted to pose a challenge for this now :)
stop me if you think it's crazy please
 
CMC: given a positive integer representing an xkcd comic, output whether its link has ever been starred in TNB
It's been five years. Can someone ungolf this for me so I can finally understand how it actually works? — J B Feb 17 '16 at 22:56
 
7:39 PM
foo, 1 byte: "1"
 
challenge posted
 
returns 1 for true cases, anything else for false
@Lembik +1, looks good to me
do you have a reference code?
 
@Riker me? No
@Riker thanks!
in principle it is trivial :)
I thought I would ask a code-golf question which might get a 2 byte answer :)
 
2
Q: Put an array into bins

LembikIn this simple challenge you are given an input array L of non-negative integers and a number of bins b greater than 0 but no more than the length of L. Your code must return a new array M whose length is b and which has binned the array L. This easiest explained with examples. L = [1,0,5,1] and...

 
7:48 PM
@Poke But what if you don't want to declare every variable conditionally used in the function at the top of the function?
 
@totallyhuman False :P
 
Then you have to deal with variables bleeding out of their intended scope, or use let.
 
@mbomb007 then you're not understanding javascript variable scopes
 
still invalid anyways
some of them haven't even been linked
and if you try and fix that, you will get kicked :P
 
7:58 PM
challenge accepted?
:x?
 
8:17 PM
@Poke No. A sane person wants his variables declared as close to their usage as possible.
That's why they're called "local"
 
@mbomb007 that's not how javascript variable declaration works
you don't get "block scope"
you may as well define them at the top of the scope
because that's what's happening anyway
 
@Riker already subbed:)
 
darnit
but it's glorious anyway
 
8:27 PM
oh noes where has cat gone
 
*shwoomp*
 
8:45 PM
@Poke It has block scope if you use let. Scoping is a feature, and the only reason it didn't used to be available was because JS was created in 10 days.
 
@mbomb007 ok then just use let for everything
and stick use strict on all your files for good measure
or
declare everything at the top
those are the options you get
scope as a feature is pretty shitty, though, haha
For the record I was just giving you the javascript know-how. When I code with real programming languages I declare variables as close to their usage as possible as you mentioned.
 
9:02 PM
@Poke I like the implication that JavaScript isn't a real language.
 
9:33 PM
@Poke ... you don't need use strict
@mbomb007 because it's in a function?
@Pavel :|
 
@Poke Not allowed to.... :'(
@ETHproductions eyes moles
 
is it possible for me to take a SE id and find their chat id?
I want to see if a particular user is in chat anywhere
 
Mar 24 at 3:29, by quartata
@user202729 go to chat.stackexchange.com/accounts/<network profile id>
 
oh, it's their network profile id
thanks :)
 
@NathanMerrill not exactly
it redirects to chat profile
 
9:51 PM
@ASCII-only I didn't say you did but why not add it
 
@Poke because a random string literal is really ugly
 
@ASCII-only I wouldn't call it random or a string literal
 
@Poke well having a string literal at the top of your code is kinda weird
 
not in javascript
;)
idk if that changed in es6
 
:|||||||||||| i guess
@TonHospel :D finally found the short quine hang on 19 bytes wat
is this supposed to happen
 
10:21 PM
What's the shortest current Brain-flak quine?
 
50
A: Golf you a quine for great good!

user56656Brain-Flak, 9.8e580 1.3e562 9.3e516 12818 11024 4452 4332 4240 4200 4180 3852 3656 3616 3540 2485 + 3 = 2488 bytes Now fits in the observable universe! (())(()()())(())(())(()()())(())(())(()()())(())(()()()()())(()())(()()()()())(())(()()())(())(()()()()())(())(())(())(())(()()()()())(())(())(...

 
@Pavel 9.8e580 I... You... what?
 
Yes
 
Interesting explanation though...
On another note, why are some people just called "User######"?
 
@MagicOctopusUrn That's a default name, you don't have to pick one. In this case it just Wheat Wizard being annoying though.
3
 
10:28 PM
:| did i break perl
i got a shorter perl 6 quine than current shortest too
 
@Pavel Wait what? How is that user wheat wizard?
 
@MagicOctopusUrn They just changed their name to test something
Mar 15 at 22:37, by user56656
I changed my name to test something. And now other people want me to change it back
 
Wait... So my older posts will show my old username?
 
well that answer has wheatwizards new name, not the one he had
 
I... wait what?
@DestructibleLemon user56656 shows on that answer for me
 
10:39 PM
Right
That's his current name
 
LOL ohhh...
I was thinking this happened in the past for a second, had me confuzzled.
 
11:04 PM
0
Q: Given a grid, starting at the center and spiraling out, and an Position what is the ID?

Justin808Related: Determine the position of a non-negative number in the infinite spiral Wind me a number snake! Challenge: Given a grid, with an ID starting at the center and spiraling out, what is the ID given a position in the fewest number of bytes? Grid: +---------------+---------------+------...

 
11:15 PM
CMC: Given a word (whose length is less than 10) output a unique number for each unique word, consistent between executions. No word may use the same number.
Wait... woah I'm in the top 100 for rep count?
 
11:46 PM
@MagicOctopusUrn is the word only alphabetic? uppercase or lowercase?
For only lowercase a-z: Python, 18 bytes
 
00:00 - 14:0014:00 - 00:00

« first day (2614 days earlier)      last day (2228 days later) »