« first day (2425 days earlier)      last day (2418 days later) » 

10:19 AM
I used to not like golfing. Now I kinda almost like it. Sometimes people come around
+1 I don't golf, and every time I visited the site (until very recently) the only thing I saw on the front page was golf. This caused me to just plain ignore the site for a long time, and I think many users here see golf as somehow a "better fit" for the site than other challenges/puzzles. — Geobits Mar 3 '14 at 17:11
 
@Geobits Well it's significantly harder to write a good programming puzzle :P
 
Sure, but it's more rewarding imo too :P
 
I like KOTHs
 
I enjoy getting answers to my challenges and koths far more than getting answers to my golfs.
 
10:21 AM
And I enjoy answering them more as well
 
Hey
 
im bored and need something to do
i want to write a script but not sure
idk what i want to automate
 
@JesterTran Automate turning every website dark :P
 
Can you automate some coffee delivery to my mouth?
 
Make everything Comic Sans MS
 
10:23 AM
@ASCII-only That's not dark, that's twisted.
 
@Geobits i can automate planning your funeral
 
@JesterTran what O_o
 
im joking
lol
 
@ASCII-only Nah. I want coffee more than caffeine. Thanks though.
 
10:25 AM
how can i efficiently monitor gaming activity on steam of my friends?
im thinking of scraping websites
 
@JesterTran Activity?
 
@Geobits the trouble is our entire scoring and criteria system is built around golfing
it's not like puzzles SE where it's just "who can get the answer first"
there has to be a way to score the best answer
 
@Mayube Nope, we have complexity-golf, fastest-code, code-bowling and KOTH as well
 
which means either codegolf or fastest code/algorithm most of the time
 
Oh I know this well. But there are winning criteria that manage to do that. People choose golf because it's the easiest to tack onto a random challenge a lot of the time imo.
 
10:27 AM
@ASCII-only when a particular friend is online, what game they were playing etc
 
@ASCII-only afaik code-bowling is considered a deprecated tag
 
visualize
analyse
 
@Mayube Nope
 
@ASCII-only It's just (basically) impossible to do it right lol
 
Yeah
 
10:29 AM
I might start doing fastest-code programs
 
@ASCII-only any tips
 
see the thing is, with code golf, languages like jelly and pyth often come out on top
and with fastest-code, languages like C and Rust will usually prevail
 
@JesterTran :/ no, there appears to be no documented API I think? but Steam can do it so if you install some kind of sniffer you might be able to find out how to do it easily :P
Use Crystal then :P
 
@ASCII-only more interested in implementing it myself
 
@JesterTran I'd still say use an API, scraping is terribly hacky and not robust at all
 
10:32 AM
@ASCII-only what is API in your own words
 
@JesterTran Anything returning data given parameters I guess? Basically a black box function on the web
i.e. you open some kind of socket to Steam => they send friend online/game notifications etc.
 
ooh
thanks
 
But I'd say that isn't the best idea because you need you computer running 24/7 to be sure not to lose out on any data
 
are you saying you information is stored but not to the public?
 
I don't think it's stored at all actually
 
10:38 AM
whydo you think that?
 
They wouldn't have a reason to keep it (except maybe for analytics)
 
yes, that's the only reason i can think of
always some pattern in a data that may be useful in generating $$$
 
And I don't think they would want users to get that data :P
 
11:06 AM
After Dyalog APL 17.0 comes out, I'll post a challenge to convert CRLF into LF.
 
@Adám O_o
That is certainly an unusual
 
@ASCII-only Why?
 
-4
Q: Get the sequence from array

user74557I have array [1,3-9] and i want this array like [1,3,4,5,6,7,8,9]. if values is repeating then don't show duplicate value. E.g.[1,2,2-5] result:[1,2,3,4,5]. I want to use jquery or MVC.

 
@Adám Haha I guess I just haven't seen a non-pure-algorithm fastest-code before
 
@ASCII-only Explain "non-pure-algorithm" for the uninitiated, please.
 
11:25 AM
0
Q: If we can require a particular domain, can we require a particular path?

ShaggyFollowing on from this question where it was decided that, as we define languages by their implementation, JavaScript solutions could include a requirement that they be run under a specific domain. This allows us to use, for example, /questions/[id]?site=codegolf instead of //api.stackexchange.co...

 
@Adám I don't think that's an actual term, but to me most fastest code is pretty much "find this value" or "find this optimal result", not "perform a task as fast as possible"
But hmm depending on I/O format this appears to be pretty easy
 
@ASCII-only Oh, I didn't realise that. I never participated in a fastest code challenge, given that I mistakenly thought that an interpreted language like APL couldn't compete. It would be on-topic, however, no?
 
@Adám Certainly :P Just remember to make your testcases take a decent amount of time to process
 
@ASCII-only pure algorithm is usually fastest-algorithm
 
@ASCII-only It would be a challenge where you are simply given a long (KB-MB range) string (by whichever means) that contains about 1% CRLF, and you have to return the string where every CR that is followed by a LF has been removed.
 
11:30 AM
fastest-code is how fast does it run, fastest-algorithm is how optimally fast does it run
 
@ASCII-only Yes, we want to make the overhead insignificant. It is the actual processing that's interesting.
@Mayube Can you explain the difference for simple bears like me?
 
@Adám with fastest-code, all you need to know is how long it took to run for a given testcase, fastest-algorithm is about the time complexity
 
@Mayube Ah, then it is definitely fastest-code.
 
@Mayube True, I guess I meant the optimization problems
 
There was a discussion yesterday about the fact that Mathematica is an invalid language for fastest-algorithm as it's time complexity can't be accurately scored. Its functions are essentially black boxes, and because of its pattern matching can vary wildly
however Mathematica would be perfectly valid for fastest-code. You give it a testcase, see how many ms it takes to complete.
 
11:47 AM
@Mayube Right, I think the same applies to Dyalog APL. I might be able to find its time complexity, but AFAIK, few other PPCGers have access to its source code. Also, there are all kinds of special casings going on.
 
I like [fastest-code] for "perform a task as fast as possible". Like Filter a large file quickly for instance.
 
@Geobits Oh huh I've never seen that one before
 
It's a Lembik. He likes things like that :)
Also likes random processing of matrices, but that's a whole other topic lol
 
@Geobits Nice one, yes. Mine would be a really simple task though.
How do you set requirements for challenges like that? Like: Assume it has to run on a single thread, not using a GPU, hardware < 10 years old?
 
@Adám Preferably specify allowed instruction sets as well
e.g. SSE/AVX can make a difference sometimes
 
11:59 AM
@ASCII-only Ah, right.
@ASCII-only Both with and without is interesting.
 
Typically the challenge poser times entries on their own machine, so it's mostly up to you on how much you want entries to able to thrash your processor/gpu/memory/etc.
 
@Adám :P But you need to make sure you can run it
 
As long as you state what's allowed and what hardware/software you have, it should be fine.
 
I think Lembik's challenges are pretty good examples
 
@Adám Simple tasks are fine, as long as they take long enough to accurately time.
For a simple crlf->lf, you might want to use a very large input
 
12:02 PM
@Geobits The real challenge for me will be running and timing various submitted code.
 
Consider that filtering challenge for example. It was a 1.3 GB file, and the fastest times were under 30 seconds
Yes, it is a bit of work doing that for sure.
 
@Geobits Yeah, I'm thinking 10 KB < string length < 1 MB.
 
Is there a combinations command in 05AB1E?
 
@Adám It shouldn't be too hard to narrow it down. Do something naive to test various lengths, and assume somebody will find a 100-fold speedup to amaze us all :p
 
@Geobits Although I guess fastest-code tends to much fewer entries than CG, and that competitive entries mostly will be in C (which I bet APL will beat by a large margin).
 
12:05 PM
C does usually tend to win or come close, yeah
 
@Geobits Not this time…
 
You never know. I've often been surprised what people come up with for these and optimization challenges. That's why I like them better than golfs :)
 
@Geobits Right. I'm so looking forward to this. I just have to wait for Dyalog APL 17.0 to be publicly available, I guess.
 
You should talk to the Dyalog team and find out when that will be >_>
:P
 
@Geobits he is the Dyalog team :P
 
12:09 PM
@Geobits ⍨ (← selfie) 2018Q2
 
@Mayube That was kinda the point ;)
 
wait why was that flagged
 
Not sure either
 
voted as invalid
 
12:11 PM
weird
 
You don't really need to bother with deleting that, or requesting extra votes, since the roomba will get it. That said, I don't think it needed to be flagged either.
 
@Geobits roomba is slow...
 
Now I deleted it since.. you know... The power of community :)
 
@EriktheOutgolfer Yeah, but it's not like it was cluttering up the front page or anything, since that hides -3 or worse
 
and we generally don't want to keep that on the "new questions" list until "the roomba comes" which might be >24h slow...
 
12:13 PM
CMC: Given an integer N and a list L, return the element in L closest to N. There will be exactly one integer with minimum absolute difference.
[1,2,3,4,6,9,10], 7 -> 6.
 
Hmm, I think that's a challenge on main...
 
[1, 2, 3] -> 2
 
...already done?
 
@Geobits Now it's also a CMC :)
 
Not sure how to easily search it though
 
12:14 PM
Oh, c'mon Google.
 
it's actually writable (although I don't know how that makes readable in place of it make any sense at all)
@CodyGray relax the flag was invalid
 
ehh I'm not at all comfortable with trying to assemble a cabal of users in a chat room to delete stuff, so I wouldn't say "invalid"
3
 
@CodyGray Congrats on becoming a mod on SO! (P.S: I voted for you too :-) )
 
Thank you, @Mr.Xcoder.
 
@CodyGray what "cabal of users"? where?
maybe you need new rules for chat ;p like we did
 
12:17 PM
It creates a dangerous precedent, @Erik, if things like this get posted in chat rooms. It's been a big problem on Stack Overflow, and we did have to create a bunch of strict rules about it, with a lot of moderator oversight.
 
Is the SmokeDetector still around?
 
But anyway, I was mostly just checking up to make sure the flag didn't get validated and cause the user who posted it get kicked, because that's not reasonable either.
 
chat is slow :/
@CodyGray s/kicked/suspended for 30 minutes/
 
@Mr.Xcoder Dyalog APL, 13 bytes: ⊢⊃⍨∘(⊢⍳⌊/)∘|-
 
@Adám Nice.
 
12:20 PM
also "delete requests" in here aren't that bad, especially since code golf as a place isn't exactly q&a and there are the people who post low-quality questions that really belong to stack overflow (maybe because "programming puzzles") but instead of using stack overflow as a dumping place we delete them here right away
 
I...don't really agree with that. People post garbage questions on SO, too. Probably a lot more of them than you ever see (no offense).
 
Jelly, 3 bytes: ạÐṂ
(Keep elements with minimum absolute difference from right argument)
 
Ha, oh lord I've seen some garbage posted on SO too. You have to be fast to see a lot of it
 
@HyperNeutrino Exactly my solution too :)
 
I thought SO was 90% garbage >_>
 
12:22 PM
@Mr.Xcoder :P
 
@Geobits also so isn't just another part of stack exchange it's kind of independent
 
@HyperNeutrino Just in case, I am not joking
 
@Mr.Xcoder ⊢⊃⍨ pick from the right arg with (⊢⍳⌊/) the index of the minimum in |- the absolute difference.
 
SO has less of a community base IMO and gets a ton of new users, which means a lot of trash from new users who don't know how to do their own homework
 
12:23 PM
@Adám multi-line + markdown = mess
duh ninja
 
@Adám APL likes faces ⍨
 
19
Q: Take that frown and turn it around

AdámA celebration of the many faces of APL Given a string among those in column 1 or column 2 of the below table, return the string's neighbor to its right. In other words, if given a string in column 1 then return column 2's string on that row, and if given a string in column 2 then return column 3...

 
searches for APL faces - lol
 
@Adám Coincidence ^^
>_> The votes-to-answer ratio one was posted by me in the Secret Santa sandbox, guess I can remove it now
:O No mine is different
 
12:29 PM
@Mr.Xcoder Japt, 5 bytes: ñaV g
 
@Shaggy Just curious, what "algorithm" do you use?
 
@Mr.Xcoder ñ sorts the array as though each element were passed through a function; a gets the absolute difference between the current element and the integer (V) and g returns the first element of the sorted array.
 
@Shaggy Oh so similar to the Jelly approach :)
Nice
 
@Mr.Xcoder I don't know Jelly but, from @HyperNeutrino's explanation, it sounds like his solution is filtering rather than sorting but I'm open to correction on that.
 
@Shaggy yes
-> absolute difference, ÐṂ -> keep those with minimal value returned by function
 
12:36 PM
@Shaggy Well, ÐṂ gets the element with the minimum value when applied the given function.
For now, Pyth, 6 bytes: h.mavz
 
Could be interesting (but hardly feasible) to have
i.e. to compare the time it takes to write a correct solution, across languages.
 
@Adám Meh, I don't think the community would like the idea :P
 
@Mr.Xcoder doesn't work like jelly's
 
Because people are, unfortunately not available 24/7
@EriktheOutgolfer ?
 
@Adám How would that be measured, accounting for timezones, etc., etc.?
 
12:39 PM
ÐṂ actually returns a list of values, so it's not necessarily singleton
 
@EriktheOutgolfer I know.
 
@Shaggy Timezones‽ It is the absolute time it takes to write the correct program.
 
Similar.
 
@Mr.Xcoder yours will always return one element though
 
@EriktheOutgolfer Ik.
If a list can be returned (are we allowed to do this, @Mr.Xcoder?), then 5 bytes: .mavz
Jelly displays one-element lists as integers, lucky Hyper :p
 
12:41 PM
what if hyper's returns [6, 6, 12, 12, 6, 12, 6] for example?
then either ạÐṂḢ or ạÐṂX should solve the issue (the latter supporting equality among people...)
 
There will be exactly one integer with minimum absolute difference.
 
oh then hyper's must be a full program
 
@EriktheOutgolfer yes, exactly.
@EriktheOutgolfer Up for some Jelly training?
 
not sure
 
ok, another time maybe
 
12:55 PM
:/ when multiplication is harder than you thought
 
@ASCII-only CMC: Given two lists, each of two elements, [a,b] and [x,y]` return (a+bi)×(x+yi) without using built-in complex number support.
 
@Adám JS: (a,b)=>[a[0]*b[0]-a[1]*b[1],a[0]*b[1]+a[1]*b[0]]
Unless I'm misunderstanding
@Adám Also you're missing a backtick
 
@ASCII-only Where do x and y come from?
 
@Adám how is that possible without complex literals?...oh wait i^2=-1
 
oops >_>
 
1:01 PM
@EriktheOutgolfer You return a two-element list [c,z] meaning c+zi
 
@Adám Do you want us to implement complex numbers >_>
 
@Mr.Xcoder Nope
 
@Mr.Xcoder No, just multiplication.
 
unless I misunderstood
wait no
 
So that is ax + iay + ibx - by?
 
1:04 PM
@Mr.Xcoder yep
 
@ASCII-only Save 16 bytes: ([a,b],[c,d])=>[a*c-b*d,a*d+b*c]
 
lol, taking the Python answer and converting it to PowerShell is 45 bytes, all of the extras are dollar signs
 
Dyalog APL, 9 bytes: -.×,+.×∘⌽
Can we see some golfing lang solutions?
 
@Neil O_o never knew that worked, thought it was a Babel thing
@EriktheOutgolfer :O Does it work in Python too
 
1:18 PM
yes
that's how you tell it to take two tuples two elements each and assign the variables to the elements
 
1:30 PM
@Adám SOGL, 18 bytes: I{_*}H\n¹:H-;_№¹H+¹, could be 16 with taking input as array of the two arrays and output as separate items on the stack
 
@Adám Pyth, 17 bytes: ,-*QKE*JE=ZE+*JK*Z. The order of the inputs is: a, x, b, y.
@Adám Much more interesting, takes input as nested lists, 23 bytes: .e?k+Fb-F_bc2.>m*Fd*FQ1. Explanation to follow.
*FQ - Cartesian Product; m*Fd - Product of each pair; .>(...)1 - cyclically rotate 1 place to the right (brings the last element to the beginning); c2(...) - Chop into pieces of length 2; .e - Enumerated map, with the variable b representing the current value, and k representing the current index; ?k- If k (is equal 1), then +Fb - get the sum... Wait that can actually be sb :-/... Else -F_b - get the difference of the reversed pair
 
1:46 PM
@Mr.Xcoder Ah, I guess I should explain my code too. Sounds similar to yours: -.× difference of the element-wise products , followed by +.× sum of element-wise product ∘⌽ of the left argument and the reverse right argument.
 
@EriktheOutgolfer ð,ð
 
hey it ties dyalog apl!
 
Now I wonder why my solution is sooo long
 
@EriktheOutgolfer Can you explain it?
 
1:48 PM
@Adám Oh that would hurt the one that reads it :-/
 
Is that "reduce over subtraction and multiply with each in list, then pair the product list with the original, swap the two sublists, multiply corresponding elements, and sum"?
 
×_/: vectorize-multiply the two lists (x), then reduce (/) by subtraction (_) ðṚ×S: new dyadic chain: reverse () then vectorize-multiply the reversed first list with the second list (×) then take the sum (S) ð,: fork ×_/ and ðṚ×S with ð, pair (,)
@Adám ^
 
huh interesting
 
@EriktheOutgolfer Cool. Although it does seem a bit involved, I guess it is more or less equivalent to my APL solution.
 
CMC: Generate the Nth term of this sequence: 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5
 
1:56 PM
@Mr.Xcoder wat? oh
 
Fixed
 
jelly, 5 bytes (untested): ịRx`$
 
what algo?
 
makes range, repeats each element itself times takes index
 
oh ok
 
1:59 PM
yay first ruby program
 

« first day (2425 days earlier)      last day (2418 days later) »