« first day (1931 days earlier)      last day (2912 days later) » 

8:03 AM
hi all
what do people think about APL answers and if they should always get the bounty for code-golf questions?
@Dennis hi.. I suppose as a Jelly person you might have a view
 
@Lembik hi part of all
 
:)
 
8:45 AM
@Lembik nah
 
@Downgoat Uh, doesn't let declare a variable in the local scope, making it undefined out of the scope indeed?
 
@wizzwizz4 Hello?
 
9:39 AM
@Dennis You should have an Android app for Try it online!.
 
@orlp Re: your comment, that's why I said "I'm not sure whether this was an intended approach" - (*F) and (*SKIP) are PCRE-only. If I have time later I'll work on an answer more in line with what the OP intended though.
 
Like there's Run the Code for main stream langs.
 
@Sp3000 first you gotta answer my new question
 
What's the new question?
 
@Sp3000 the latest one on the site
 
9:47 AM
@orlp To ninja or not to ninja?
That's the question.
 
wait
why isn't it showing my question
oh now it does
guess it takes a while
 
@orlp You say the Fibonacci product - surely the product is not unique?
(and yeah I was confused because it wasn't showing up til now)
 
@Sp3000 yes it is
you must repeatedly subtract the largest possible fibonacci value
 
Oh, right.
Sorry, writing's a bit confusing because you say "You do this" for the addition example, as opposed to "You can do this"
 
let me make that bold in the question
 
9:51 AM
0
Q: Fibonacci products

orlpYou can decompose a number greater than 0 as a sum of Fibonacci numbers. You do this by repeatedly subtracting the largest possible Fibonacci number. E.g.: 1 = 1 2 = 2 3 = 3 4 = 3 + 1 12 = 8 + 3 + 1 13 = 13 100 = 89 + 8 + 3 Now, I call a Fibonacci product the same lists as above, but with the ...

 
No runtime requirements? :P would have been interesting I guess, but I dunno
 
@Sp3000 why?
 
Okay, now you've added "unique" and that's confusing o_O
 
@Sp3000 why?
 
Re: second why, because there's more than one way to express a number as a sum of Fibonacci numbers
 
9:53 AM
@Sp3000 I thought we've been over this 1 minute ago
You can decompose the numbers into unique sums. You do this by repeatedly subtracting the largest possible Fibonacci number.
there are other algorithms that produce unique sums, but this is one of them
the unique sum is a property of the algorithm generating the sums, not the sums themselves
 
Well, I mean the first sentence reads like there's a unique way to write it as a sum, rather than this being a way to get a unique sum
 
@Sp3000 that always holds
 
(I get what you mean though)
What always holds?
 
You can write numbers as a sums of powers of two. You do this by repeatedly subtracting the largest possible power of two.
I just described binary numbers
but I could also write 5 = 1 + 1 + 1 + 1 + 1
see that there's nothing inherently unique about 5 = 4 + 1?
it's the process which you use to decompose numbers that determines if the decompositions are unique
 
Well, what I meant was something like "Any positive integer can be written as a sum of Fibonacci numbers. One way to do this uniquely is by repeatedly subtracting the largest possible Fibonacci number, e.g."
Yeah I know what you mean, just trying to word it better (if you don't think that's necessary, just ignore me)
... yeah that sounds a bit better. Sorry about that.
 
10:00 AM
@Sp3000 why
back to the first question :P
 
k, so that one
Hmm yeah, nvm. Doesn't really matter.
Thought there might be an interesting way to do it, but I can't think of anything atm
(wasn't sure whether you'd thought of any other approaches yourself)
 
nah
fun fact: the sequence is not on oeis
 
On the one hand I wouldn't have expected it to be because it looks pretty arbitrary, on the other hand it is OEIS
... okay Peter's now got the same confusion as what I had :P
(probably both thinking Zeckendorf when we first saw it)
Out of curiosity orlp, have you tried in Python yet?
 
@Sp3000 how did you think I generated those test cases?
I didn't golf it though
 
Well by "tried" I meant golfed
 
10:13 AM
@Sp3000 quick golf attempt gives me 75 bytes
 
Hmm k
So, back to regexes
 
f=lambda n,a=1,b=1:a*(b>n)or f(n,b,a+b)
p=lambda n:n and f(n)*p(n-f(n))or 1
@Sp3000 that's what I had
you just combined them into one
 
Ah, pretty similar yeah
 
@Sp3000 you win this FGITW :)
 
Ah xnor, sorry :/
(I hate it when that happens)
 
10:20 AM
i've had more than my fair share of having the browser open at the right time
 
@xnor define fair share
 
Well I've toned down on Python golfing lately, but it still always irked me to see you finally come up with a golf that beats FGITW two days later and not get many upvotes for it
 
@xnor To address something to one person, you don't reply. You just ping. :P
 
10:39 AM
@xnor why did you edit my question?
the algorithm I provided generates unique sums
 
10:58 AM
I have good news: I officially don't have node on my laptop anymore :D
 
@orlp So anyway, re: regexes, I wouldn't be surprised if the top 118 char solution made use of PCRE in a different way (specifically, (?R), which since that is supported by PHP)
Seeing as the question came from another source, OP's not very clear on the rules, unfortunately
Oh, actually I'm thinking of (?1), nvm
But still, PHP =/= theoretical regexes, so it's not quite clear what was intended to be allowed
 
@Quill D: Then what do you use for JavaScript?
 
nothing
 
Then you use C#?
 
It's a Mac
 
11:06 AM
Then you now have no compiler to work with! D:
 
Actually, PHP should have (*F), the heck o_O
 
PHP should've been a better language.
 
Okay, I'm fairly convinced the Finnish site meant theoretical regexes, since it doesn't accept the use of ^ outside of a character class
 
I really think that was the spirit of the question
not all this extended bullcrap
 
Well that's why I said "I'm not sure whether this was an intended approach"
 
11:27 AM
Hi, anyone has an idea, how can I put a for in a blockless lambda statement in javascript?
like (ab)=>for(...)...;
 
@orlp fyi I feel similarly for this question: codegolf.stackexchange.com/questions/3503/…
Just as a side note
 
@Doorknob Don't have the money and doing boy scout stuff, so no. I'll get a job soon, so hopefully next year. Last year was an online class
Warning: transcript reply
 
12:10 PM
@AlexA. remember that vegan intern in ergonomics? I told her and got her phone number, WOOOOOOO
with the bluntest approach in dating history
 
@QPaysTaxes figuratively blunt, you savage ಠ_ಠ
 
That seems like a conspiracy by the plum industry to entice people to purchase more plums.
 
TIL what plum means
which begs the question of the link with plumbers
 
plum != plumb
 
12:20 PM
it's pronounced the same way though isn't it?
 
Depends upon if you're from Boston or not
 
isn't plumber pronounced without the b??
why is it pronounced when it's not in comb, tomb, bomb, climb,…
WHYYYYY ENGLISH
o and i
why not u
no b in dumb right?
so
why not plumb
makes no sense
 
Don't worry, English is the number one language for making you brain go number
 
^ cheeky
number and number are not pronounced the same
thanks Obama
^ wrong, it's (reed, leed / red, led)
 
I do believe that row of words just started a row
 
12:30 PM
I sure as hell am not british
 
Well excuse me, I'm Australian, so I have an excuse :P
 
That's even worse
exiled british
 
Nov 5 '15 at 21:51, by TimmyD
> English is weird, yes, but it can be understood through tough, thorough thought, though.
"plumber" comes from Latin for lead (the metal), like how Pb is the element symbol
 
this I know, in my native language lead is called plomb
 
"plum" comes from the same roots as "plume" as in a feather
 
12:34 PM
not sure what plumes and plums have in common
 
I think it's because "prune" was more common, since it was the dried version of the fruit and we didn't have refrigeration
The species is Prunus somethingsomething
 
Maybe you should have two functions, like printf and println or something
 
-.- English ...
 
Why invent plum when prune exists
 
Also halp why is gcc breaking on True (not true)
 
12:37 PM
To distinguish between the dried and regular versions ... like raisins vs grapes
 
… why not call them dried prunes like normal languages
 
Google reckons plume is from pluma = down
 
Because English.
 
facepalm
 
Fun fact: because "prunes" now have a somewhat negative connotation in American English (being associated with the elderly and bowel regularity in popular culture), companies are starting to market them as "dried plums"
 
12:41 PM
wtf
you mean market prunes as plums and plums as dried plums?
 
No, they're phasing out the word "prunes" from their marketing
So plums are the fresh fruit, and dried plums are the dehydrated and packaged variety
 
that's what I sayed
should have instead marketed prunes as wet plums
 
hah
 
would be funnier
 
Prunes are dehydrated plums ... plums are, and have been, the fresh fruit
 
12:45 PM
wait I thought you said the opposite of that
 
@TimmyD I was about to say that I thought prunes were associated with avoidance or hatred towards sexual topics, but then I realized that those people are prudes.
 
Haha I love the definition of prude. "a person who is or claims to be easily shocked by matters relating to sex or nudity."
 
^ tbf that's how I see a lot of prudish american media
 
The definition kinda implies that most prudes are just faking it
 
12:53 PM
Most are
 
Sex is a basic need of life like water or food
 
Amish: 1. the members (or people who claim to be members) of a strict Mennonite sect that established major settlements in Pennsylvania, Ohio, and elsewhere in North America from 1720 onward.
 
I don't see people shocked by water
 
It seems to be a vaguely-moral view ... a way of self-aggrandizement
 
@Fatalize The fact that celibacy exists kinda disputes that.
 
12:54 PM
"cover that droplet!"
@El'endiaStarman masturbation is part of sex
 
Or, not to turn the topic too dark, the fact that there's the whole priest molestation scandal kinda disputes celibacy
 
Also, the fact that some people starve themselves to death for a cause doesn't mean that food is not a basic need :p
 
@Fatalize Well okay, when you define "sex" that way, your statement is somewhat more accurate.
 
although it's true that sex is not as vital as food or water
 
in The late night show with JavaScript, 3 mins ago, by Duga
[The-Quill/SE-Flag-Bot] The-Quill pushed commit 6b25cc5e to master: how do travis, I tri for 30 commit but no bild
 
12:56 PM
Or air/shelter
 
Isn't that what "basic" means in that context? Vital?
 
I guess "being in a social environment", or shelter would be closer
 
never mind
 
some people can live without it, by choice or not
doesn't mean it's not important though
 
this is literally my 28th build commit and it finally works
 
12:57 PM
Huh, this one puts sex with the other basic needs: hugelol.com/lol/175687
 
I would move it one rank, but I guess it's vital on a macro scale
debatable really
 
@Quill RTD
 
Ready To Drink?
 
Read the Docs ~_~
 
 
1:00 PM
I can design you a build structure.
 
5 mins ago, by Quill
this is literally my 28th build commit and it finally works
I had to reinstall node and everything
 
\o/
Huh, traviscistatus.com/incidents/whpdrnsw0722 says the incident is resolved but the main page still says status yellow.
I don't know what to write for zyabinVI :/
 
You say that every week :/
 
@Fatalize ಠ_ಠ
 
Find some inspiration and go at it ಠ_ಠ
 
1:13 PM
@_@
ಠ_ಠ
 
do you have a shortcut for ಠ_ಠ or what
 
@Fatalize Just type @
And the first guy you see
is @ಠ_ಠ
 
that's convenient ಠ_ಠ
now we need someone with the lenny face as nickname
 
inb4 () isn't allowed
 
who's ready for a chat mini challenge?
@NathanMerrill @El'endiaStarman ^
 
1:24 PM
depends on what it is
 
a simple computation
 
depends on your definition of "simple" :p
 
@QPaysTaxes Whoops, forgot to reply to this last night. Well, I had been writing up a reply when my fiancée made me do more research. I had been planning to say that ASL's grammar is very similar to French, meaning the spoken language, but really, it's very similar to FSL, the sign language. That's because Gallaudet, an American, went to France to learn about teaching deaf people, and brought Clerc back with him to help start deaf schools in the USA.
 
 
^^ virtual +1 for the accute accent and the final e of fiancée
 
1:27 PM
the chat mini-challenge
 
(assuming your fiancée is a woman)
 
The biggest reason for the difference between signed languages and written or spoken languages is that signed languages are 3D, they use space, and oftentimes, signs have temporal information encoded.
@Fatalize :D I put the accent and final e in because that distinguishes it from fiance. Of course, when spoken, I don't try to distinguish them. :P
Well, except for the "e" sound being slightly more drawn out in the case of fiancée.
 
fiancée? more like financée
 
fiance? you mean fiancé?
 
@Fatalize Oh, I guess I do.
 
1:30 PM
Fiancé and Fiancée are pronounced the same :p
 
Doggonit ye frenchies!
 
To think that I was criticizing English and their plum/plumbs/prunes…
 
PS C:\Tools\Scripts\golfing> $x=77617;$y=33096;333.75*[math]::pow($y,6)+$x*$x*(11*$x*$x*$y*$y-[math]::pow($y,6)-121*[math]::pow($y,4)-2)+5.5*[math]::pow($y,8)+$x/(2*$y)
-1.18059162071741E+21
 
@TimmyD wrong answer
 
1:31 PM
Sweet
 
@NathanMerrill wrong answer
 
did I type it wrong?
if so, I blame your terrible image resolution
 
@NathanMerrill the image is fine
just click on it
it's the oneboxing that sucks
 
That is the literal PowerShell syntax of that calculation
So, I'm guessing this is one of those precision things
 
@NathanMerrill and no you didn't
 
1:32 PM
well, given the choice between trusting Wolfram Alpha and trusting you...
 
you're off by about 20 orders of magnitude btw
so not really close
 
I'm still going with Wolfram here
 
>>> x=77617; y=33096; 333.75*y**6 + x**2*(11*x**2*y**2 - y**6 - 121*y**4 - 2) + 5.5*y**8 + x/(2*y)
1.1805916207174113e+21
 
@El'endiaStarman yep, also off by about 20 orders of magnitude
 
I literally typed it exactly as it is in the image.
 
1:34 PM
so?
 
(maybe it is in base64)
 
nope
 
How many other people have to be off by 20 orders of magnitude before you question your own result?
 
(or hexadecimal)
 
@Rainbolt my result is correct
 
1:35 PM
?- X=77617,Y=33096,A is 333.75*Y^6+X^2*(11*X^2*Y^2-Y^6-121*Y^4-2)+5.5*Y^8+X/(2*Y).
X = 77617,
Y = 33096,
A = -1.1805916207174113e+21.
lol
 
also incorrect
 
Well, do we all agree that y^8 is the largest component?
 
I pretty much typed the equation verbatim
 
@TimmyD maybe. There's also a x^2*y^6
 
@NathanMerrill And that one is negative
 
1:36 PM
hint: all of you have posted approximations
try to get an exact answer
 
They can't be approximations if they're off by 20 orders of magnitude.
 
@El'endiaStarman sure they can
the error is just very big
 
what's the expected answer?
 
the challenge hasn't been solved yet
that is the challenge
 
Just for kicks, @orlp how many orders of magnitude is 1001 off from 1010?
 
1:38 PM
@Rainbolt about 1?
 
No, zero
 
maybe 0
 
I believe I just crashed Pyth for doing that calculation
(which happens a lot)
 
They are both in the 1000's, so they are on the same order of magnitude
 
it's very close to 1 though
oh right derp
 
1:39 PM
....wat
 
Rainbolt is now a sand block? o_O
 
>>> x=77617; y=33096; (333*4+3)*y**6//4 + x**2*(11*x**2*y**2 - y**6 - 121*y**4 - 2) + 11*y**8//2
-2
 
It got hotter
 
@El'endiaStarman that's already much better
 
Yeah, I left out the x/(2*y) at the end.
 
1:39 PM
still not the correct answer though
 
-0.8273960599468213
 
correct!
 
@El'endiaStarman what?!
 
That's quite curious.
 
the exact answer is -54767 / 66192
 
1:40 PM
Is this an integer overflow test?
 
so most of you did quite poorly...
 
@Rainbolt No, since Python doesn't have overflows.
It has to do with floating point shenanigans.
 
new xkcd
 
hey, the question was fair and square
just evaluating a simple two-variable polynomial
yet most of you were off by 20 orders of magnitude :P
 
got it
X=77617,Y=33096,A is (33375*Y^6+X^2*(1100*X^2*Y^2-100*Y^6-12100*Y^4-200)+550*Y^8+100*X/(2*Y))/100.
X = 77617,
Y = 33096,
A = -0.8273960599468214.
 
1:43 PM
Is there a detailed analysis of this somewhere? I presume it has something to do with the least significant bits of intermediate results being truncated.
 
Prolog has infinite precision with ints but not floats so I just multiplied everything by 100
 
first group:   4.0042696e+20
second group: -7.9171118e+36
third group:   7.9171113e+36
fourth group:  1.17260394005
I get it now
 
@El'endiaStarman Can you help a non math guy understand this transformation you did? 5.5*y**8 became 11*y**8//2 . When I plug y=3 into both expressions, I get a different result.
 
The first group and the third group is supposed to cancel out the second group
but because of floating point issues
 
1:46 PM
the first group didn't cancel out anything
 
@Rainbolt // is flooring division
 
Yeah, I changed everything to integer division to ensure that Python was always dealing with arbitrary-precision integers.
 
>>> from fractions import Fraction as F
>>> x, y = 77617, 33096
>>> F("333.75")*y**6 + x**2*(11*x**2*y**2 - y**6 - 121*y**4 - 2) + F("5.5")*y**8 + F(x, (2*y))
Fraction(-54767, 66192)
>>> float(_)
-0.8273960599468214
 
I guess I was just lucky that it happened to give the right answer anyway. :P
 
by changing all division to fractions you can get an exact answer in python
and F("333.75") is the same as writing F(33375, 100)
 
1:49 PM
-.-
 
Guys, use ideone with an user account. The time limit there is large.
 
I am loving some of the answers to my challenge
how could anyone diss ppcg after seeing
n=head -1 $2|wc -c;shuf -i0-$((stat -c%s $2/$n-1)) -n$1|xargs -i_ dd if=$2 ibs=$n skip=_ count=1 status=none
 
no cheating
 
:)
 
don't look up (in the chat log)
tell me the answer
 
1:54 PM
15 seconds per run, after compile, and also you can label runs.
 
@orlp I can't!
 
@Lembik why?
 
do you mean in my head?
 
no
 
But the contra-feature is that you only get 1000 runs per user, per month. But that's still a large amount.
 
1:55 PM
you can use any tool you want
I just want a correct result
 
oh :)
 
(let's say to at least 5 significant digits)
 
If you post this in the math room, I want to watch
 
OK, what am I missing
 
@Rainbolt Which math room?
 
1:55 PM
@zyabin101 Whichever room is most popular on Mathematics SE.
 
Also, I should make a chat room that only has acronyms to chat.
 
wolfram alpha no good for this?
 
@Lembik that's up to you
 
Because .NET (and thus PowerShell) doesn't have the equivalent of BigDecimal, only BigInteger, I followed the trick above to get rid of the decimal points by multiplying everything by 100
 
I'll call it TAC (The Acronym Chat).
 
1:56 PM
I just want a correct answer to 5 significant digits
 
you are confusing me :)
is there some trick going on?
 
it's your job to choose the correct tools
 
but it's a trick question, right?
 
Motto: SAHAAH (Sometimes Acronym-Hot, Always Acronym-Heavy)
 
1:57 PM
you are the mathematician :P
surely you can tell whether your answer is somewhat correct :P
 
I then factored the x^2 through the parens, and wrote out literal multiplication rather than using exponent, since that's not supported by BigInteger
 
@KennyLau Good! IWLAM (I Won't Lose A Minute).
 
And now I get 7125400206602065224991021231372448563000
PowerShell, why you no math?!
 
hai
 

« first day (1931 days earlier)      last day (2912 days later) »