« first day (2311 days earlier)      last day (2550 days later) » 

Anonymous
10:00 AM
The number of times I saw if condition == true...
 
Anonymous
(actually it was If condition = True because it was mostly VB.NET, but still)
 
@Mego for a minute there I thought you were replying to my code ;_; but you weren't (this time ;u;)
 
Anonymous
When my boss insisted that it make the code cleaner and clearer to explicitly compare a boolean condition to true or false, I updated my resume.
 
@Mego not that bad
but to be honest it's not so great to me because True == 1 in my native programming tongue
also fairly sure [some list] or "some string" have different results
depending on the condition name, it might be more ok than other kinds
 
Anonymous
@DestructibleLemon It's not the code that was bad, but the logic behind it. The only people it could make the code clearer to didn't have a solid grasp of if-statements and conditionals. If there were people working there who didn't grok if-statements, it was time to leave.
 
Anonymous
10:03 AM
If list.Count < 5 == True
5
 
ok that doesn't really make sense
 
@Mego uggh... I see what you mean
 
at least it isn't if condition == true: return true
 
Anonymous
@DestructibleLemon Plenty of that too
 
how about if condition?true:false == true: return true
 
Anonymous
10:06 AM
There was also this one guy who wrote the worst code I have ever seen, who stopped working there before I was hired. He never wrote a single useful comment. Half of his code didn't work. He left commented-out code in every file he touched. Generics were apparently completely foreign to him. The only things he knew how to write were god objects/functions, so cohesion was also a foreign concept.
 
Anonymous
My wife (then girlfriend) would get daily rants from me about how he should not be allowed within 10 feet of a keyboard ever again.
 
generics are completely foreign to me
explain pls
 
Anonymous
@DestructibleLemon I'll explain it in Java terms because VB.NET is terrible
 
well, I don't know java great...
s/great//
 
Anonymous
A generic class is a class that has at least one type parameter, a la ArrayList<T>. When you instantiate an object of that class, you specify the type(s) for the parameter(s) (ArrayList<String> foo = new ArrayList<String>()). The class can work with (theoretically) any type, but it has to know what type it is working with.
 
Anonymous
10:09 AM
C++ templates work similarly if you're more familiar with C++
 
ArrayList<T> is what
 
Anonymous
The generic class
 
Anonymous
The T is the type parameter to be filled in
 
ok. I don't see the issue with not using them?
 
Anonymous
They exist for a reason - in statically-strongly-typed languages, you have to know the types of stuff at compile time. You can't just have a List type that can accept any objects (unless you cast those objects to some universal superclass like Object, but then you lose type information).
 
10:12 AM
hmmm kay. but I guess I just don't understand statically typed languages yet
 
Anonymous
So, you have a List<T> generic class, and you write the class so that it can work with any type (but only one type).
 
You can have a List type that accepts any Objects, in fact that was the only choice before Java 5 or 6.
 
Anonymous
@feersum Yep, and really type erasure is performed after the static type checking by the generic, but those implementation details weren't really relevant to the explanation
 
But you don't want to have a List accepting any objects.
That's the point of Java generics.
 
wait a minute, I can't use this font with my program!
 
Anonymous
10:15 AM
@DestructibleLemon A statically-typed language is a language where types are checked at compile time. Take C, for example. You can do int a = 5; (because 5 is an int), but you can't do int a = 3.6; (because 3.6 is a float, not an int).
 
What should be a good precision for Float outputs?
 
Anonymous
If you have type mismatches anywhere, the compiler complains before the code is even run
 
Anonymous
@Arjun In what context?
 
@Mego In context of PPCG challenges. I need help with this one.
I have posted in that challenge that precision is required up to 10 decimal places.
Is that too high/ low?
 
Up to? That implies 1 is okay.
 
Anonymous
10:18 AM
@Arjun I agree with Level - 5 significant figures would be a much better requirement
 
Please use relative errors instead.
 
Anonymous
@DestructibleLemon Python is an example of a dynamically-typed language. Types aren't checked at compile time - they're checked at runtime. If you're expecting a string and you get an int, you don't get the error until you try to run the code. This makes it easier to write code, but harder to verify that the code is correct. In fact, Python takes it a step further by employing duck typing - the types aren't nearly as important as the operations they support.
 
i.e. | (output - real answer) / real answer | < epsilon
 
Anonymous
@feersum Relative errors are better for large values, but completely fail for values close to zero.
 
@Mego I'm taking the specific challenge into account when not providing a second conidtion for that.
In general yes, you need a second condition for near-zero values.
But the challenge is a strictly increasing sequence.
 
10:20 AM
the |s are all slashy in my font
this will not do for my ascii art
 
Anonymous
@feersum That's fair. I didn't thoroughly read the challenge.
 
> required up to
I think that it is kind of ambiguous though
 
@Mego Mego, Edited. Better now?
I hope that won't invalidate any answer, will it?
 
hmmm. I just realised I should probably make bots classes
rather than functions
I'm making it so the bots return their turn, and an object that represents their memory for a game
how do class variables work again?
brb figuring out
 
CMC: generate a random permutation of 1 A, 7 Y's, 8 B's and 9 R's, with uniform distribution.
 
10:33 AM
that's random
 
at least this way I don't have to worry about class variables
 
why those letters in particular?
 

 Codenames

For playing the game Codenames. New players, see puzzling.meta...
A stands for blAck
 
Anonymous
@JanDvorak Actually, 17 bytes: 'A'Y7*'B8*'R9*kΣ╚
 
nice
 
10:43 AM
@Mego Can you arrange that in a 5 by 5 grid?
 
Anonymous
 
Anonymous
@KritixiLithos Why?
 
Because codenames, again. It would be a separate CMC.
 
@JanDvorak Jelly, 16 bytes: “AYBR”ẋ"1789D¤FẊ
 
Anonymous
The 16-byte version can't, but the 17-byte version can
 
Anonymous
10:44 AM
Oh wait you mean the output not the code >_<
 
Anonymous
 
05AB1E, 16 bytes: 1789S"AYBR"S×J.r
Python 2, 75 bytes:
from random import*
s=list('A'+'Y'*7+'B'*8+'R'*9)
shuffle(s)
print`s`[2::5]
 
11:08 AM
nice
print`s`[2::5]
print''.join(s)
shorter by one byte apparently
I have learned new golf skill
 
Python 2, 98 bytes:
from random import*
s=list('A'+'Y'*7+'B'*8+'R'*9)
shuffle(s)
for i in range(5):print`s`[2+5*i::25]
 
11:34 AM
why is that better?
 
It isn't, it just splits into segments of length 5
Also Mathematica DatePattern matches invalid dates too :| why
 
0
Q: Tip? Short way to generate up to 12 repeated characters in JavaScript

Steve Bennett'---------' '-'.repeat(9) // longer! '------------' (x='----')+x+x '-'.repeat(12) // same length Is there any cleverer way of generating strings of up to 12 repeated characters in JavaScript?

 
12:19 PM
stupidest Jelly dyads ever: eÐf and eÐḟ
 
is it an issue that my koth bots are going to be functions rather than classes, when they have persistent memory @ASCII-only
especially since class variables are a thing is one argument for functions
 
@DestructibleLemon it isn't an issue
but seriously why not just use classes
 
class variables are builtin things
also now I already done did it with functions
 
What is a good Python library for vectors and matrixes?
 
probably numpy or something
 
12:28 PM
numpy
 
user165474
question: are alex, doorknob, martin, and dennis our only community elected mods? or am i missing someone?
 
thx
 
@HyperNeutrino there's only been 1 election
and it seems we won't need another mod for a long time empirically
since Dennis is very active, and Martin is considerably active too, while Doorknob contributes too (where did Alex go btw?)
 
user165474
ok
 
user165474
good question
 
user165474
12:32 PM
Last seen May 21
 
user165474
so not too inactive
 
well, he might've clicked the button that says "I won't be available" or something (yes there is such a button for mods I think)
also "last seen" doesn't always indicate activity
 
user165474
ooo interesting
 
user165474
that is true
 
this is his last visible activity
> 2017-04-11 03:23:38Z
 
user165474
12:36 PM
:o
 
user165474
including meta?
 
no
of course there are actions not visible here
 
user165474
oh true
 
user165474
like i don't think it would show anything if he nuked something/someone
 
user165474
but idk
 
user165474
12:39 PM
anyway i got to go now
 
user165474
o/
 
deleting/nuking/destroying etc. aren't visible
btw this is his last visible action on meta
> 2017-01-07 00:33:55Z
 
0
Q: User Appreciation Challenge #1: Dennis ♦

Hyper NeutrinoI got the spontaneous idea of making a series of challenges of users that have helped and continue to help the PPCG community be an enjoyable place for everyone, or maybe just specifically for me. :P If you convert Dennis's name to an array of 1s and 0s where each consonant is 1 and each vowel i...

 
1:04 PM
I must have made a mistake, APL is too verbose D:
 
this is a good number
@ASCII-only well, either way I can justify it as spite now
 
@DestructibleLemon yeah I changed that :/
 
1:40 PM
user image
7
 
2:20 PM
As discussed on meta, I've now opened a chatroom for nominations for the monthly necro contest.
11
 
2:31 PM
...what
 
Hey
Is this a valid answer?
Java has become weird
 
@betseg For once, documentation in MSDN which tells you something that wasn't obvious from the name.
 
@betseg Haha
 
@PhiNotPi or @Sherlock9 We're either of you the person who donated some Bitcoin to the old PPCG Minecraft server on Jan 5, 2016?
I'm locked out of my BitGo account and they say I need the old transaction hashes to reset 2FA but I don't have a record of those transactions except on BitGo :/
Also, Bitcoin is really confusing
 
anybody who golfs in java?
 
2:51 PM
@totallyhuman Occasionally
 
19 mins ago, by totallyhuman
Is this a valid answer?
 
It's not an answer at all, so I think you've posted the wrong link
 
...right
waiting for server-side permalinks :P
 
I think so, based on what I can find on meta about anonymous functions in Java
 
ok, thanks
imma post it and see if i get downvoted :P
i mean, it beats python
 
 
1 hour later…
4:09 PM
people who use JavaScript & position: absolute to answer CSS problems on SO deserve to never touch a computer again :P
 
Have you really never used it?
I used it once to get pixel-perfect positioning on a custom widget
 
@JanDvorak noooooo D:
 
... and I liked it.
 
@JanDvorak position: absolute is having a program output 0 for a binary search and says it works for you.
 
false
 
4:13 PM
@JanDvorak brb never hiring you to do CSS :P
there are very few cases when position: absolute/fixed is relevent
 
Yes, and I hit that case
 
one of those is alert boxes, the other one is sticky headers
 
OK, replicate the <input type=number> widget so that it looks the same in every browser and can be styled to the company's whim (image everything).
 
you mean like outline/glow?
position: relative is what you want
 
I mean those arrows
 
4:17 PM
you can still use top/left/right/bottom and all
@JanDvorak like a submit arrow at the end of textbox?
or like resize arrow
 
position:absolute lets me place parts of the widget with pixel precision, no cross-browser inconsistencies, and with no restrictions or extra HTML.
 
oh wait why do you need to replicate it
 
It can't be styled to the company's whims
 
seem simple enough w/ basic tables for cross-browser support
basically small vesion of golden layout
 
Wait, you propose using a table for styling because absolute positioning is too uncool?
 
4:20 PM
absolute positioning is like handing someone an iPad because they're starving because it's an "apple"
:D that was good analogy
 
no, it's not even close to being similar
 
what is next, px for layouts? D:
 
like I said, pixel-perfect image everything. Not my idea.
And yes, our front-end had a 960px frame around it. Deal with it. I did.
 
but position absolute takes something completely out of the flow layout and now everything is hardcoded with weird px values and now everything is weird and blows up and now you have a webpage that doesn't work on new or old computers because it's inconsistent filled with too many hacks, fails to resize, and as the universe slowly collapses due to blasphemous use of position: absolute, the sheep come out and take over the world and now everything is bad and evil
 
Absolutely positioned elements can't fail to resize. They won't even attempt to resize.
 
4:24 PM
see that is porblem
 
Au contraire.
 
:OOO Vous utilisez francais dehors la chambre de francais :O
 
would A002375 be a good challenge? (given 2n return how many ways it can be written as the sum of 2 primes)
 
The less to think about, the faster you can roll out iterations. Why bother with rows and columns when you can just drag form elements onto a square grid and have it compiled into HTML.
@Downgoat BTW, I think what you describe has already happened at least once
 
@betseg seems cool, but also seem like similar to something like factorization challenge
 
4:27 PM
@betseg Personally I don't like challenges involving permutations
 
@Downgoat Well this isn't factorization
 
and what appears to be brute-forcing
 
@betseg Personally I'd solve it by factorization + permutaitons + filter + count
@TuxCopter wait would it be la salle francais or la chambre de francais
 
Embrace the simplicity. Dev time first. Who has <1024px anyways? Phone users? Yeah, your Android app is on the roadmap.
 
@Downgoat "la salle française"
 
4:30 PM
oh ok thanks
 
yes i know
 
>____<
 
Anyone here still using JellyBean 4.1 on android?
 
4.2.2
 
no, I use Marshmallow
I've never had Jellybean, my earliest was KitKat
 
4:42 PM
jb>kk regardin'stability
(tis's golfed English)
I've been thinkin'4 a while'bout it
aposz'n'slangz r golfier than normal spek
 
english, please
 
We enjoy here.
 
well code bowling is another thing
 
0
Q: Generate Hamming codes

DoorknobGiven a stream of bits, output the shortest possible Hamming code that encodes it. The steps to generate the Hamming code are as follows, although your submission does not necessarily have to conform to them as long as it produces identical output. The input 110100101 will be used as an example....

 
5:06 PM
Code Bowling is one of the finest arts of "playing" with code, by trying to make full programs or functions, either eponymous or anonymous, while keeping your code as long as possible. You may think it would be too easy at first, since you can use comments of an arbitrary length, but, in fact, if any chars can be removed from your code without affecting its validity, then those chars must be removed, and would not count towards your total score. Code Bowling is, in fact, way more difficult than what you may think at first, since you will be challenged to write, in fact, useful code, and not
@betseg ^
is this bowled enough?
 
5:22 PM
> useful code
Doesn't sound like they've seen it done well...
 
@trichoplax what do you mean?
 
@EriktheOutgolfer you said that sentence was golfy, i said we like bowling
 
If it's written in a way that leaves useful (readable) code when all redundant characters are removed, then it doesn't have the convoluted indirect methods of calculating things that I'd expect of code bowling.
I suppose "useful" in that sentence was intended to mean "not a no op" but it makes it sound like the code won't be horrible to read
 
"useful" means that it in fact contributes to the whole code
 
XML really needs one line comments
 
5:29 PM
Incidentally, for some reason I thought that block message was a quote, but just realised it isn't a quote block at all, so probably just part of the current conversation, so "they" probably didn't make sense - sorry about that
@EriktheOutgolfer It just amused me that in any context other than bowling, it would be the opposite of useful...
 
in any other context you will not be trying to make the code as long as possible
 
5:43 PM
Whoa
 
6:00 PM
Question: how does this look
 
Suppose a language only has strings and numbers. There is a "special" type of string called a "function"; it is written differently, but is stored the same as a string, and can in fact be used as a string. This language otherwise has no functions. By this answer, since it is defined to be a function, it is a function by our standards; but this language has no variables/names.
Is this a "function" by our standards?
 
@ConorO'Brien I mean it still has to follow the specific bullet points, what the language defines takes precedence in cases of dispute of what is "function" in that language
 
why dont more golfing langs have internet capabilities
 
6:21 PM
0
Q: Maximal discrepancy-2 sequence with minimal entropy

DennisBackground As noted in the PPCG challenge Compress a maximal discrepancy-2 sequence – which inspired this challenge the authors of the paper Computer-Aided Proof of Erdős Discrepancy Properties found a maximal discrepancy-2 sequence, namely -1, 1, 1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1...

 
@xnor Went for it. :)
 
6:33 PM
@KuanHulio Good question. Jelly does, but it's fairly new, and I don't think anyone has used it in an answer yet.
 
@KuanHulio 05AB1E does
 
6:49 PM
Hey everyone, I had a question regarding the following: https://light-theme-hurts.my-ey.es/c412ae.png

I answered this question 2 hours earlier in the same language, and my solution has less bytes. Now a few hours ago I noticed it was there already, but I didn't think it'd be much of an issue.

Back then we were both at 0 points, but right now their answer has 4 points whereas mine only has 1.
Is there anything I can do about this, and if so, what?
 
it's just that more people were interested in the other answer
also pleading for votes is frowned upon
 
I'm not pleading for votes, it's just that I'm concerned about people instead of commenting or editing, submitting equal answers and profiting from it, which in my opinion should simply not be allowed.
 
@Downgoat so.. it's a function
 
@Martmists there's consensus which allows it
 
@KuanHulio I know MATL does, at least, implicitly so
 
6:57 PM
@EriktheOutgolfer Could you point me to where it's said that this is allowed?
 
19
A: Definite policy about duplicate answers

xnorAllow duplicate answers I think we shouldn't take action against duplicate submissions, even when the code is identical. We should assume good faith: the second submitter almost surely came up with the code on their own. We see on anarchy golf that identical submissions are common among experien...

 
@EriktheOutgolfer "asking for an explanation on voting tendencies" is not precisely "pleading for votes"
 
@Martmists The answers aren't identical. In fact, your answer was substantially longer (15 bytes) than the other answer when the latter was posted.
 
@ConorO'Brien I just left that as a note
 
The only thing you can do is keep golfing your answer. For example, the space between input() and if can be removed.
 
7:03 PM
0
A: Sandbox for Proposed Challenges

ETHproductionsSame length, different string code-golf string Challenge Given a string S of positive length L consisting entirely of printable ASCII chars and newlines, output another string of length L that also consists entirely of printable ASCII chars and newlines, but is not equal to S. For example, ...

 
x->(x>199?"\033[31m":"")+"NO\033[31m VACANCY\033[m" what happened to Java
 
7:36 PM
@HyperNeutrino If you wrote a challenge about me i would be happy :D
</humor>
 
7:47 PM
@ThomasWard :O oh noes did evil sheep posses you!! D:
 
not evil sheep
my Dark Chaos Mage is currently controlling me HAIL CHAOS
 
@VoteToClose That's a bug. github.com/git-rest/spooky
 
@Dennis I can't get bubblegum to read my deflate stream correctly https://tio.run/nexus/bubblegum#BcHZokJAAADQD/LQ2HkcsgxzZWvQm6RGyc6kn@@e86u9fTm3s88YRCt/1JUQbAEr2@ybeaDgzZ5cA6bF8uZxUr65/LvsP/5QjWoB6go98uIz9PE0GytBQ9tlt8hqxIMVHHEPXqirg1mwQCFP9Tkdk4YtQmTEgCYQnx2TUq9Y6QUH@km7Pw3xdOlwI5o0Nywb@OkQ5sKY/k0lzFb3q5q6qMmx5OzkMsBn4BgqnJbD/olkBMa4NBtt9Rm0E6TgrlVvLoflnbZJtaVzxQ5HiwcK2SPthqgyhJg40lz4Mmc7HK8H2d1rs3iZhWErnfwB1etbhDRCL/xci7BD5C4RW3MTNje/3z8
:
 
You have to use an xxd-style hexdump.
 
Thanks that gets output but not the right one, compression algo I used is wrong :(
 
7:56 PM
@Christopher Please don't edit posts just because you prefer an alternate and equally valid spelling.
 
@Dennis Gah! Sorry, still getting used to insta-edits. I used to propose edits like that since I didn't know if that was better but know I get insta edits
 
It shouldn't be suggested as an edit either.
 
Ok now I know, thanks!
How do you compress the string for bubblegum? (Not general question but you)
 
Depends on what I have to compress. Usually zopfli.
At least try to find a more compressible sequence than the one in the spec though. That's the core of the challenge.
 
I will, tio.run/nexus/retina#xVdBDsIwDPuKH4APfIUrQuL/… is the example without whitespace. I just wanted to see how compressed it got
 
8:01 PM
@ThomasWard what are you doing here??
 
8:13 PM
CMC remove all spaces from input
5 bytes
 
print input().replace(' ','')
 
@Dennis +1 for making talk.tryitonline.net redirect to the chat room
 
What is zopfli?
 
8:19 PM
@Downgoat Thanks
I just found this amazing Chrome extension "The Great Discarder"
Everyone should install it. It's awesome
Saves >80% of your ram when you have a lot of tabs open
 
The great suspender?
Oh they changed the name huh
 
@totallyhuman No
Suspender is different
Discarder uses a newer Chrome feature to make it a seamless experience, instead of having that click through page
 
Oh
I like to choose though, so I'll stick with suspender
 
I'd like a chrome addon that warns me when I have identical tabs open
10
 
0
A: Sandbox for Proposed Challenges

MD XFPrint your system's logo code-golf graphical-output ascii-art This is a system-specific challenge, meaning you must use a language that is generally implemented on / was made for a system (e.g. Swift for Apple, Visual Basic for Windows). The challenge Pick a system (an OS or a specific compute...

 
8:30 PM
I'd like a chrome extension that warns me every time I have ppcg open
 
id like a chrome extension that ip bans ninjas
so i can post my stuff first
 
8:49 PM
@Mendeleev Unable to prevent a tab from reloading when it gains focus No, thank you.
 
Huh?
It doesn't reload
Tab discarding basically puts the tab into swap-ish
 
It says so right in the description.
 
so the state of the page, its content, even your scrolling is saved
it's not like the refresh action
 
I don't want anything that kills all page javascript - and the data it held - without even telling me so.
 
honestly, it's one of the most useful extensions I've ever used.
 
8:51 PM
Just no.
 
also, if you pin a tab, it will never get discarded.
so pin important tabs like I do, and you're set
 
yeah, but it will get tiny and I won't see the title
 
so?
all my tabs are tiny anyway /s
 
In any case, I have more than enough RAM. I don't need these shenanigans.
 
at which point it might as well be unloaded
@Mendeleev two words: this chat
 
8:52 PM
Please elaborate.
 
zram is like a much better alternative, assuming you're on Linux. For practical purposes, it doubles your RAM.
 
@Mendeleev isn't chrome really that bad with RAM O_o
 
> zram
> swap in ramdisk
pls no.
 
@Mendeleev fail
 
8:53 PM
@JanDvorak how?
 
RAM compression sounds performance intensive
 
@Mendeleev Why on Earth not? TIO uses it successfully.
@JanDvorak Not really. It uses LZO or LZ4, which are really fast.
 
Not for a desktop system... I would be better off putting swap on a SATA drive, but with the extension, I end up using basically none of it
 
That makes no sense.
 
% free -h
              total        used        free      shared  buff/cache   available
Mem:           7.8G        2.9G        1.7G        277M        3.1G        4.3G
Swap:          8.0G          0B        8.0G
@mınxomaτ I get that a lot
 
8:56 PM
Oh yes, a SATA drive is so much faster than in-RAM compression. /s
 
It's not faster...
However, with a ramdisk, you end up using a static chunk of RAM to hold it, taking up a block of memory regardless of whether it's being used
 
I don't think you understand how this works.
 
Is there a Windows version?
 
AFAIK it's swap inside a compressed ramdisk?
 
@JanDvorak Windows 10 comes with Superfetch. I've never tried it though.
 
8:59 PM
{} or { } for empty curly braces in production code?
 

« first day (2311 days earlier)      last day (2550 days later) »