« first day (2139 days earlier)      last day (2707 days later) » 

2:00 PM
I don't like what some people try to consider as reasonable input.
6
A: Binary to decimal converter

nimiHaskell, 16 111 + 57 = 168 bytes import Data.String instance IsString[Int]where fromString=map((-48+).fromEnum) f::[Int]->Int f=foldl1((+).(2*)) +57 bytes for the compile flags -XOverloadedStrings, -XOverlappingInstances and -XFlexibleInstances. The challenge has some cumbersome IO format, be...

This answer originally tried to go with the idea that you could input a list of integers, and claims that not being able to do so was cumbersome IO
I'm conflicted on the idea that one should be able to take an array of characters as a reasonable substitution for a string.
 
A list of characters ['0','1','0','1','1'] is a string. A list of integers [0,1,0,1,1] shouldn't be a string equivalent to "01011" imo.
 
lists of characters are allowed by default
 
@Poke I am aware. That is what I'm conflicted on.
 
what you have to be on the lookout for is singleton strings
('f', 'o', 'o')
 
I mean, if a language doesn't actually have a string type, and has to operate though character arrays, sure.
 
2:11 PM
In python is a tuple of singleton strings
 
@Lembik I mean, I like pretty hard golfs too.
 
> In computer programming, a string is traditionally a sequence of characters, either as a literal constant or as some kind of variable.
 
@seequ ok but ... why are you telling me this ? :)
 
Yes Geobits, I know
 
damit
"people only like simple and small tasks for code-golf"
 
2:13 PM
np :)
 
Even a Java String is just a char[] under the surface (for the most part).
 
That's where my conflict comes in.
 
@seequ oh ok... you should speak up when people are slated for asking hard code-golf questions!
 
I did now. :P
 
:)
 
2:14 PM
Java, in this case, has a built in String type
 
I still think we should crowd fund the purchase of a GPU that people can use to test GPU challenges
 
Java has a built-in Integer type, too, but that isn't enforced. We just use int.
 
it's strange we don't have any really
given how important GPU coding it.. and it's non-trivial
 
It also has a built in Hashtable
but no one uses that
sometimes you just want to add a null
I'll stop spouting random info in this discussion now. Please continue
 
In general I'd say custom datatypes that perform the same task are just as valid as builtin ones.
 
2:16 PM
@Geobits That's my problem.
 
Did someone say char[]? Puts on brass knucklesAlex A. ♦ Jul 5 at 17:49
 
@Geobits I think I used that in programming class to pass an int into a method, modify it inside of the method, and retain the value without returning it
 
@Dennis Thank you!!
 
@GabrielBenamy hang on.. is Dennis actually here?
 
@Lembik No, but he implemented COW on TIO last night and I wanted to thank him
 
2:18 PM
oh.. from 8 hours ago!
 
Dennis is always here. Dennis is Legion.
 
But in Java, you can't do, say, char[] q = "Hello world!";
 
Dennis is the Matrix.
 
char[] q = "Hello world!".toCharArray();
 
Dennis is Lawnmower Man.
 
2:19 PM
@Rainbolt Oh, it's definitely useful on the whole. Very rarely for golfing though (but you'd usually use Long then).
 
14
A: Golf you a quine for great good!

Wheat WizardBrain-Flak, 976266390372758483258456997330285583602920521120063176028064287661292611590116252099227036743110136042555489889035633850709900008911379721051545620231727569905454062086708153676586155716204327064986548850918095030874479575959146118624787852065688934284844567935023551066470413311518574...

 
@Rainbolt That's an explicit conversion.
 
Oh we're talking golf
 
An extremely impressive quine. ^^^
 
@TimmyD what does that mean here?
 
2:19 PM
that's a big number
 
He just golfed it down to 12k
 
/me is a huge Matrix supporter ;P
 
how did he calculate the original number
 
97626639037275848325845699733028558360292052112006317602806428766129261159011625209922703674311013604255548988903563385070990000891137972105154562023172756990545406208670815367658615571620432706498654885091809503087447957595914611862478785206568893428484456793502355106647041331151857429971039950045423652177372472135301003290059383108972806408271668082252641329909065524884787774612748101039355471845625663172639850682982053103420418789371130489209847896305511222969175942313667686487697200141245645289662081451125889649945768550742684215475040224797026437431559376445516849879221 bytes golfed. T
 
@Xanderhall You also can't do String q = {'a','b','c'}. If you're saying that Strings and character arrays are initialized differently, I agree.
 
2:21 PM
Yeah, it takes up the entire screen on my phone, haha
 
But that doen't mean they aren't equivalent.
 
@Lembik It's a sci-fi movie
 
ok but why is Dennis like a character from that movie/film
 
@TimmyD nonono matrix.org :P
 
The Java writers know and accept that char[] is used the same way as strings: ideone.com/wxjBuz
 
2:24 PM
 /** The value is used for character storage. */
    private final char value[];
Additionally:
char data[] = {'a', 'b', 'c'};
String str = new String(data);
works fine
as does
String str = new String("abc");
 
@Poke Just because there's a constructor to do the conversion, doesn't mean anything.
Your first answer was more valid.
 
ok
 
@Lembik Because he just keeps getting smarter and smarter until (spoilers) he turns into pure energy inhabiting the world's computer and communications infrastructure.
 
Yes, but String is literally just a wrapper for a char[] with some useful methods (and made immutable). Saying we can use the wrapper for a thing but not the thing is just the same as saying we can't use int, but must use Integer instead.
 
What are we talking about? Seems like Xanderhall is trying hard to reinforce that char[] and String are not the exact same thing, but I have no idea why.
(in Java)
 
2:27 PM
@TimmyD aha! :)
 
@Rainbolt I'm talking about IO for challenges.
And what's considered reasonable.
 
How fast is Java relative to C these days?
 
Ah okay. I didn't scroll far enough then
 
@Rainbolt Argument about cumbersome IO (specifically codegolf.stackexchange.com/questions/102219/…)
 
Hey, I'm trying to find the post on JavaScript golfing tips. Does anyone know where I can find it?
 
2:27 PM
Has the JVM improved much over the years? For gcc I can read all about their new optimisations but I am not sure how to do that for the JVM
 
81
Q: Tips for golfing in JavaScript

mellamokbWhat general tips do you have for golfing in JavaScript? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to JavaScript (e.g. "remove comments" is not an answer). Note: Also see Tips for Golfing in ECMAScript 6

 
@Fatalize Awesome, thanks!
 
@Poke The problem with that though is that it isn't a list of characters. It's a list of integers.
Which is quite different unless the language has a code page mapping 0 to '0', etc.
 
What about PHP?
 
@Lembik Much much better than it used to be, but obviously is and will be slower than C. You can pretty often reach very reasonable performance however, so it's not really a problem for most things.
 
2:29 PM
@Geobits yus
 
$x = 0 and $x = '0'
 
I don't know the ins and outs of PHP types all that well. It's been years since I've messed with it more than very simple stuff.
 
@seequ Are there benchmarks showing the improvement?
 
@Lembik The problem with benchmarks is that Java uses JIT compilation. You can't really see the effects in a small benchmark.
But, lemme see.
Hm, can't find any reasonable benchmarks, but en.wikipedia.org/wiki/…
(note that I don't actually work with JVM these days, so haven't really followed it in a while)
 
@seequ ok thanks. I need numbers :)
it's amazing to me actually how rarely they claim performance enhancement
I mean every release of gcc has many
 
2:41 PM
@Lembik Well, numbers are lies, but you can check out The Benchmarks Game benchmarksgame.alioth.debian.org/u64q/java.html
 
@Lembik Probably because it's basically the one thing they can still claim over competing languages ;)
 
Rust <3
 
@Geobits :)
@seequ thanks but I want to see how much the performance of the JVM has improved relative to the performance of gcc, say . Looks like no one has done this
 
It's pretty hard to do that, considering that old gcc and Java don't work anymore and you can't use the newer ones on a sufficiently old OS/hardware.
 
He's a man with a plan. Get oudda' way
 
2:47 PM
Numbers from two entirely different systems are not comparable in general.
Even the performance ratio between the two will vary greatly.
 
well yes and no
I mean if you really never had any idea then you might as well run python :)
 
Eh?
 
@Poke @Geobits On an unrelated note, don't suppose either of you has any links to a discussion on imports? I've been trying to hunt through, but it mostly seems like everyone just says "Yes, imports count towards your byte count" with no reference to any consensus.
 
@seequ I mean if it's really impossible to tell if one piece of code is faster than another
 
It's not.
See the benchmarks I linked.
But do note that benchmarks never tell the full story.
 
2:53 PM
It is so annoying to see trivial answers to the answer-chaining challenge getting so many upvotes
My Minkolang answer for example has 6 upvotes, and it is just the 3rd answer
 
The most commonly linked post regarding imports seems to be meta.codegolf.stackexchange.com/questions/8287/… , but even that one simply says "There are lots of questions about whether to count the bytes in an import statement"
 
@Xanderhall I can look for a meta post but I think it comes down to what is a valid function versus code snippet
Without imports you're still kinda submitting a code snippet which is not a valid default
 
I'd argue that imports count unless said otherwise. They're code so why not?
 
@seequ Because they severely limit certain languages in terms of byte count. (Yes, I mostly write Java answers, but it's not the only language that needs imports)
 
The idea is that you should be able to copy/paste the entirety of a "function" submission into a full program and have it work
 
2:57 PM
@Xanderhall Competing with golf languages is pretty impossible anyways, so does it matter?
 
@seequ Yes.
It does.
 
but if you leave out the imports that criteria is not possible
 
I like the idea of competing only with the same language far more than inter-language.
 
@seequ I think this is the general consensus of similar metaposts. You sort of end up grouping languages. For example C# and Java can compete to some extent because they're similarly verbose
 
Yep.
 
3:00 PM
@Poke See, I don't agree with that. I'd like to actually be able to post a decently competitive answer without having to spend bytes doing import java.util.*.
 
The lack of a straightforward answer on meta is odd, but the lack of any answer (or even a comment really) saying they shouldn't be counted is at least some kind of consensus.
Not a great one though.
 
Counting imports also motivates ingenuity (to find out shorter solutions than the import), which I like.
 
I don't like the implicit consensus that "Oh, because your language is never going to compete with Jelly, it doesn't matter what your byte count is"
 
I'd be okay with stdlib imports not counting towards it (like java.util.*, or for C# System), but then there'd probably be arguments over what actually counts as core libraries in each language and it would be kinda complicated.
 
@Yodle I'd be ok with even just saying you've imported it, but not counting it towards your total bytes.
 
3:02 PM
@Xanderhall When you pick a language, you fight within that language's limits. I don't think there's a reason to change the rules because you don't like those limits.
 
@seequ So just because golfing languages are built to have a great many built-in functions, means they don't have to care?
Excellent.
 
Although if you have to use System at some point, chances are having a single System.Console or using System; isn't going to be the main factor in your byte count anyway.
 
Yes.
 
@Xanderhall Let's say you've imported java.util.* implicitly. Heck you can even have all the static imports you want. "a".substring(0,3) or (using a List) list.get(0) is still going to be longer than a golfing language's ability to perform those tasks
it's a completely different league
 
@Poke I'm not saying Java is going to compete with a golfing language.
 
3:04 PM
What is the point then?
 
Because some of us like to golf code?
For fun?
 
@Xanderhall Golfing languages have other limits. You don't see much image output with them, for example. It's a tradeoff.
 
I mean, golfing out imports is golfing too.
 
Listen, I'm not arguing against golfing languages.\
 
I like to golf with Python and such. I'm not gonna win, but I don't think I should be awarded free characters either.
 
3:07 PM
This is an amazing answer to the answer-chaining challenge, it was golfed over 30 bytes! codegolf.stackexchange.com/a/102433/41805
 
There's just no gain in ignoring imports that I can see.
 
I don't understand your logic. Why would you not want "free" bytes?
 
Why golf then?
 
?????
I'm lost.
 
I don't like to be given a handicap when I play games.
 
3:09 PM
There are some answers where the shortest way was to import a library, and others where it lead to longer answers
If you don't count imports then the shortest answers will pretty much always be the ones with imports
 
I wish ^ was allowed.
 
@Xanderhall Well technically, if we just start removing things we don't see fit, we could argue that types don't alter the outcome of a program either. Could just go get rid of all the variable definition types. Sure it won't compile as is, but you saved some bytes right?
 
that post is about golfing languages
but i think it might pertain to your conundrum
also all the posts that one links to
 
@Xanderhall I think one good reason not to allow free imports is that we want to allow all languages to participate, and it would be a big hassle to determine which imports are free in every single one. It would also make scoring less obvious for newcomers.
And making all imports free would be overkill, since golfing would mostly be about finding a good library.
 
3:18 PM
Also, this:
from pylab import rand as r
from pylab import plot as p
from itertools import product as x
from itertools import chain as c
 
Apparently I had upvoted that for being cheeky.
 
It plays within the rules set for that challenge. I don't like those rules, though :P
 
codegolf.stackexchange.com/a/82327/41805 is another answer to that same question, lol
 
That link doesn't point to any answer for me.
 
It's deleted, so you won't be able to see it without enough rep.
 
3:21 PM
Oh, it's deleted
I got ninja'd so many times this week
 
It's a 2k privilege IIRC (until we get design, then 10k).
 
Ninja'd is a 2k privilege? :P
 
Yes
 
There should be badges based on ninja'd
 
Might be a bit hard to automate.
 
3:24 PM
Geobits [ninja]
 
Geobits
 
wait, is ninja-ing a 2k privilege, or being ninja'ed
 
How?
 
@NathanMerrill ninja-ing. Anyone can be ninja'd.
 
[tag:ninja]
\[tag:ninja\]
...
 
3:26 PM
 
but you could argue that ninja'd would never happen without the person being ninja'd which occurs after the ninja
aka, the person being ninja'd is the one that makes the ninja happen
 
@NathanMerrill Someone could always remove their post, undoing the ninja'd.
 
true, but that's still after the fact. The ninja is definitely caused by the person being ninja'd
 
That's a nice paradox.
 
@NathanMerrill True. Just like the person who has their answer deleted is what caused the deletion, though they may not have the deletion privilege.
 
3:29 PM
That's a very Zen philosophy:
Only by being ninja'd can one be ninja'd.
 
import this
 
wait, so if I was about the press enter, then got ninja'd, then didn't press enter, was I really ninja'd?
 
@NathanMerrill In your soul.
 
> Buddhaweiser beer. The less you want it, the better it tastes.
 
3:34 PM
 
-1
Q: Squirrel can carry nuts from point a to b ,how much can the squirrel transport efficiently (If anybody already know this please help)

ARUNA Squirrel has to transport nuts from location A to location B. The distance between two locations is “X” kms. The Squirrel will consume one nut for every 1 km it travels. The Squirrel can carry at max “Y” nuts at a given time. If there are “Z” nuts at location A, what is the maximum number of...

 
@TimmyD It's hard to tell from the story overview whether that would be terribly bad or terribly good.
 
"(If anybody already know this please help)" What does he even want to say by that?
 
> please help
The sign of a bad question
The worst thing: He's a 1k user on SO
 
@NewMainPosts You done messed up A-ARUN
 
3:37 PM
I just realized the problem with "if a tree falls in a forest and nobody is around to hear it, does it make a sound?". If nobody is around, then the sound is not the issue. The issue is whether it fell in the first place. For all we know, the forest simply randomly changes every time we visited it.
 
Sounds like the "water through the desert" question.
 
@Geobits The Gamers is to RPGs as The Guild is to MMOs. So, if you're into that genre of activity, you'll probably enjoy it.
 
@NathanMerrill Or if it even existed
 
exactly
 
@NathanMerrill I think science will disagree that forests change randomly
 
3:38 PM
Maybe we are living in a dream
 
@NathanMerrill Well, technically, the whole tree could just get displaced in a fraction of a second
 
@Rainbolt Science would just say it makes a sound, period :P
 
@NathanMerrill There is a branch (no pun intended) of statistics related to that: en.wikipedia.org/wiki/Random_forest
 
Well there's an algorithm called Random forest so… DUN DUN
 
ninja'd
 
3:39 PM
 
@mbomb007 Nice reference.
 
I don't get the one about the pope's hat..
 
Because the pope's hat is funny.
 
..some people define 'funny' strangely.
 
3:42 PM
Also what does it mean for a hat to be ironic
 
@Rainbolt I think one of the fundamental tenets of science is that the universe follows the same laws everywhere (this wasn't always the case). However, there's simply no way we know that that is true.
 
I disappeared for lunch, and it seems like I'm still firmly on the losing side of the import argument.
 
@Adowrath To me, all of Catholicism is a joke, but in the comic, it's probably referring to the hat's appearance.
 
How can an appearance be ironic
doesn't make any sense
 
@mbomb007 Welp, guessed that, I just don't find it funny ^^ And religion on its own is pretty much the world's biggest joke, that's why I'm a proud pastafari :V
 
3:45 PM
also, this is totally off-topic, but the fact that 90% of our challenges are has one large benefit: We are less useful for homework and off-site challenges
 
Plenty of results for ironic hats.
@Adowrath I disagree. Though Pastafarianism is definitely a bigger joke than Catholicism.
 
Let the man wear on his head what he wants
 
If you had even glanced at those results you would see that ironic does not apply to the hat but something else (like The ironic catholic) so this doesn't answer the question
 
@Poke I'm honestly not put off by golfing languages always being short
 
He still has to wear the damn robe(s)
 
3:47 PM
@mbomb007 Depends on how you define "bigger" ;)
 
@mbomb007 It is, it is, and I accept that. To many people, religion can be their salvation, and for that, it's good. I just can't find myself 'good' in it
 
Pastafarism is a religion ;)
 
@Yodle Technically, a Java program won't compile without an entire class around it, but we still allow those to be posted.
 
@Fatalize I think a better word for that would be "satirical", but some people use the word ironic for that as well.
 
@Xanderhall That's because we allow functions and lambdas.
 
3:49 PM
@Xanderhall That is why some people hate lambdas used in code-golf
 
@seequ And I am no believer in any of it. I think it's just hilarious to call yourself that.
 
@Xanderhall Yeah but I think the points in that post can be applied to other languages too. Python vs Java, for example, usually leans in Python's favor
 
@KritixiLithos Why do people hate lambdas?
@mbomb007 I know.
That's my point
 
Nobody hates lambdas.
 
Well, obviously someone does.
 
3:50 PM
There are two types of people in the world. Those who like lambdas, and those who do, but don't realize it yet.
 
@Xanderhall I don't hate lambdas. I don't like the way they are counted in some languages (Java, for example), so I don't use them (for golf).
 
@Xanderhall *Java lambdas
for example, since they don't work on their own
 
^ Java lambda is weird
 
But are they not just anonymous functions?
 
@Geobits In what way do you mean "counted"?
 
3:51 PM
@mbomb007 Let's not go there. We all have strong opinions on one religion or all religions, and this is not the place to express them.
 
Technically?
 
I also don't like anonymous functions
 
Of course.
 
@Xanderhall no, you must first make class that implemenets runnable or something
 
That is why I always use named functions in JS golfing
 
3:51 PM
@Adowrath Mainly the way they strip the type definitions of inputs and return.
 
@Downgoat No?
You have to assign a lambda to a function. That's it.
 
@Geobits As in how it introduces the type inference into its "system"?
 
0
Q: Java function literals

YpnypnIn this meta post, it's decided that function literals are valid when a function is required. What about lambda expressions in Java 8? These are similar to function literals in other languages, but aren't really the same thing. Actually, these can be used in place of an instance of a functional ...

> A simple take might be that with the full declaration, it could be pasted into any class and work as-is. Without it, you have to paste both the function and something else. I don't see it as any different than requiring import statements to be counted if needed. Yes, they're outside the function, but you need them for the function to work in any given class.
 
It turns out that the only difference between a bug and a user story is how I react when I discover that the work item is not covered by requirements. User Story: "Yea, that's a cool feature. I should implement this when I have some free time!" Bug: "Why would the user ever want to do this?!"
 
It's also a thing that Java's lambdas aren't actually functions but anonymous classes. :P
 
3:57 PM
Ah, okay. Yeah, the way they actually solved it with dozens of interfaces that do the same thing instead of introducing either simple Function1, Function2... "classes" with an automatic-if-not-declared-otherwise Void return (which diverges a LOT from the language) or just (which never, ever happens in Java) introduce a Callable<Parameters, Return> with Tuple types (Ceylon got me hooked) and thus polymorphic generics...
 
@Rainbolt It's all about framing your arguments :D
 
@Adowrath Yeah, there's almost nothing in Java that's "Automatic if not declared otherwise" :P
 

« first day (2139 days earlier)      last day (2707 days later) »