« first day (2262 days earlier)      last day (2878 days later) » 
00:00 - 21:0021:00 - 00:00

user165474
21:02
yup :/
@PhiNotPi our CS teacher showed us this in class last week :P
there's a channel with like 5 or 6 of them
@Alt-F4 isn't Code Jam going on at the moment? someone should probably check to make sure that people aren't just using PPCG as a crib sheet
the number of questions asking for the same, inflexible input format has made me suspicious that they're being copied from elsewehere
@ais523 Code Jam has the same style of questions, but I honestly think they're either original or copied from previous years' Code Jam problems, but Code Jam is CC BY-SA so that's fine with most people
21:08
CC-by-sa still requires you to give credit to the original author, even if you're copying to a site that's also CC-by-sa
Question: theoretically, would you say an unbounded bogosort would always eventually terminate
0
A: Sandbox for Proposed Challenges

ckjbgamesReal Programmers Don't Comment Their Code code-golf (Disclaimer: I do think programmers should comment their code.) Your task is to write code in one language that removes comments from code in another language. Both single-line and multi-line comments should be removed from your program. You ma...

@Downgoat theoretically no, practically yes
but isn't like entropy finite and stuff
theoretically the RNG can generate the same number everytime
21:17
@Downgoat the mathematical term for this is "probability 1"
which is distinct from "always"
Yes it almost surely terminates
it means that there's no finite positive number that's less than the probability that the event won't happen (i.e. the value of the probability is indistinguishable from 1), but leaves open the possibility of an infinitesimal such number
incidentally, if you're using a PRNG rather than a true random number generator, the sequence will repeat after a bit
meaning that you can prove an infinite loop for certain sufficiently large inputs, and prove no infinite loop is possible for sufficiently small inputs
user165474
@NewSandboxedPosts I'm pretty sure this is a dupe of this, what do all of you think?
user165474
16
Q: Remove single line and multiline comments from string

Mathieu RodicGoal Using the programming language of your choice, write the shortest program to eliminate comments from a string representing a C program. Input The string can be... given as a function parameter passed from standard input set as an initial variable Instructions Two different kinds ...

the sandboxed challenge is mostly about finding a Y that trivialises the problem
come to think of it, isn't there an esolang that's nothing but various sorts of comment, none of which do anything? use that for Y, and many languages have a 0-byte solution
21:30
@quartata so if CS teacher says "write a program to sort an array that terminates", and I do bogosort will she won't take off point?
in CS, the teacher would typically request you to implement a sorting algorithm
and an algorithm has to provably terminate to be valid, thus you couldn't use bogosort
btw, bogosort is a terrible sorting algorithm in almost all contexts; the only times I've seen it useful are in golfing languages which happen to have shuffle and is-sorted as builtins, and the question bans sorting builtins
well, it's not a sorting algorithm, but it's a terrible sorting almost-algorithm
if you don't happen to have most of bogosort as a builtin, it tends to be more complex than more efficient algorithms for doing the same thing
ary.sort_by!{rand} until ary == ary.sort
you do realise that sort-by rand doesn't actually randomise the array, right?
Microsoft once either ended up getting sued for making that mistake, or almost getting sued, I forget the details
also, given that you called a built-in sort as part of that, just ary.sort would be so much shorter, clearer and faster
21:37
OK... this time for realz: ary.shuffle! until ary.each_cons(2).all?{|x,y|x<=y}
@JanDvorak here's one of the earlier reports on the subject; I don't have the "what happened next" available
but basically, Microsoft were forced by the EU to give people a choice of browser when people bought a new Windows computer within the EU, rather than just defaulting to IE
@ais523 that was a random comparator, not a random key
oh, right; I don't know which language you were using
and assumed that sort_by took a comparator
hint: by
I missed that there was no subtraction of / comparison to 0.5
hmm, that's got to be a language which ignores extra function arguments by default, and where rand takes no arguments
maybe it's Ruby, a lot of the syntax reminds me of Ruby
but I don't know it well enough to say
21:40
rand can take an argument. If it doesn't, it returns a float. If it gets an argument, it's used as the upper limit
Yep, it's Ruby
I'm trying to figure out how the argument to sort_by! ends up being called once for each array element, but with no arguments
{...} denotes a block. Normally it's {|args|...} but you don't need that section
@Downgoat In the time it took you to write these messages you could have written an insertion sort and been done
oh, so it creates a 0-arg function by default? no need for a || at the start?
Pretty much
21:43
@quartata when a programming exercise is very easy there's something of a tendency among experienced programmers to want to solve it in a stupid way
Useful in Array.new
that's why was so popular, back when it existed
@ais523 Well since he seems to care about his grade on the exercise there's a conflict there
Array.new(i){row} is a nice shortcut for i.times.map{row}.
0
Q: Rock, Paper, Scissor game in java using methods and while loop

PedramI have an assignment to do and requires to write the game using three methods (besides main): void method "showMenu", int method "computerChoice" that uses "Random" to randomly generate a number between 1 to 3 and char method "findWinner" which accepts the user and computer choice and picks the ...

21:45
isn't it a byte longer, though?
Array.new(i){row}
i.times.map{row}
Only when you don't need extra parentheses
Then it's the same length
Array.new i{row} right?
user165474
i.times.map{row}
user165474
21:47
Appears to be the same length...
even shorter: (1..i).map{row}
@NewMainPosts that code indentation
user165474
@PhiNotPi I didn't even want to look at the code because of that... -.-
I didn't look at the code because it seems difficult to make a workable out of it and it doesn't fit any of our other question categories
@NewMainPosts This indentation... ._.
user165474
user165474
(It's about the Yulin Dog Meat festival)
0
Q: Power Law for Derivatives

HyperNeutrinoBasic Calculus in one sentence (not really) If we have a function f, then the derivative f' of the function returns the slope of f. Let's take f(x) = x^2 as an example. If we look at the graph at x=2, we see that the slope appears to be (close to) 4. It turns out that f'(x) = 2x. The Power Law...

0
Q: How fast is my Hot Wheels car?

PhiNotPiSeveral years back, Hot Wheels made a simple flash game called "Formula Fuelers Racers". To play the game, you select three ingredients from a fridge to put into your car, which is then raced against the computer's randomly-generated car. It turns out the mechanics of this game are pretty simpl...

^ that was fast
how long was that sandboxed for? a couple of minutes?
A couple days.
@ais523 why, you think it's terrible?
22:10
no, it's just that I literally just saw it at the top of the sandbox
having not seen it before
just before it was posted
I assume the sandbox post got bumped just before posting, as opposed to being posted just before posting to the main site
but that's fairly rare, which is why I was surprised
as for the challenge quality, I don't think it's a particularly good or particularly bad challenge; I'm likely to not vote on it and not answer it
(I do think that Mattel's method of determining the victory in their flash game is ridiculous, though)
look at all my sandboxed things! codegolf.meta.stackexchange.com/…
-1
Q: Harshad numbers

Ronaldo WillieA Harshad number is one that is divisible by the sum of its digits. 201 is a Harshad number because it is divisible by 3 (the sum of its digits.) It is also true in the case of the integer 201 that when we truncate its last digit, we get 20 which is a Harshad number. When we truncate the last dig...

TODO: figure out how to cook lamb chops
22:26
grill
oh huh, I'm on 15k rep exactly
it's weird to look at your rep and see it ending with three zeroes
likely won't last long, rep's kind-of chaotic and gets perturbed a lot
@Downgoat Multiline string wrapped in array
@Downgoat pls read tyvm
@ASCII-only oauth
@Downgoat yeah how does the app get the oauth code
@ASCII-only from access_token query param
22:36
@Downgoat how do you get URL from browser thing though
from the URL? (location.search)
yeah but how does app get URL if it can't access browser
Very confused. Why do you need browser to get URL
and andorid doesn't allow access to browser??
@Downgoat because doesn't user need to authenticate via browser
Yes, for oauth they need access to web
23:08
@Downgoat Yeah how do you get the token from the browser or whatever
@ASCII-only from URL? App opens embedded browser -> User logs in -> Get token from URL from embedded browser
:| i think android has no embedded browser capable of oauth
The fact that location is not a string has thrown me off too many times.
23:27
@Downgoat why did you even want to know how to pass multiline string input to charcoal anyway
@ASCII-only was attempting to answre challenge >_>
@ASCII-only O_o all you need is ability to grab URL from browser
@Downgoat but it needs js right?
@Downgoat :D
on a side note, thanks to @Okx, @KritixiLithos, @Emigna and Steadybox for bothering to learn Charcoal
For those who do not know, use var loc = location.toString();. Never suffer the location ills unless you really want that functionality.
@ATaco ... always use location.href
@ASCII-only why do you need JS?
23:36
I... I didn't know that...
@Downgoat idk i just think the GH login screen would use js?
@ASCII-only document.URL is proper solution for full path
@ASCII-only oh I thought you meant injecting JS
it probably doesn't
but does it seriously not allow JS O___o
And right now I'm using request.url
Yay! Node.js!
@Downgoat the embedded one, yeah
Speaking of, I'm transitioning my MathJax imagifyier to the/mathjax/ which will mean nothing for anyone who just uses it via the userscript.
is now hosted at.
23:42
> tehflamintaco.com
10/10 quality domain name
It was available, I wanted it.
I used to only go by the name TehFlaminTaco, but I've been transitioning to ATaco
I need to buy this name.
oOoOo, Free WhoIs Protection.
0
A: Sandbox for Proposed Challenges

ais523Cyclic Levenquine code-golf restricted-source quine Background As most PPCG regulars will know, a quine is a program which outputs its own source code when run; and the Levenshtein distance between two strings is the minimum number of insertions, deletions, and edits needed to change one strin...

user165474
23:59
lol This is so expensive: namecheap.com/domains/registration/…
lol
what would you use it for though?
00:00 - 21:0021:00 - 00:00

« first day (2262 days earlier)      last day (2878 days later) »