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

12:00 AM
well I just managed to kill my X server in bash
 
12:21 AM
@Christopher2EZ4RTZ No. Talking in chat is a privilege and must be earned.
 
12:35 AM
@Christopher2EZ4RTZ is that a real user or a bot?
 
well, technically you could just by upvoting enough of their posts to give them 20 rep, but that isn't allowed
 
@ppperry Their only post is closed
 
closed posts can still be upvoted (unless you mean deleted)
in any case, I'm just being ridiculously pedantic about "can" vs. "may"
 
It is both
 
@Dennis ok that works
I honestly don't understand my kick. I was saying that I would not use caps in the future with a light hearted joke. I guess it was taken the wrong way. Sorry.
 
 
1 hour later…
2:13 AM
@Christopher2EZ4RTZ They are all online
 
@MagicOctopusUrn my AP java class doesn't want us to use autocomplete because, quote, "You wouldn't have autocomplete as a real software developer". I get the real reason is because they want students to learn it but sheesh lol
 
@ConorO'Brien As an actual software engineer, I am most definitely using autocomplete to develop in Java. It would be practically unbearable otherwise.
 
@ConorO'Brien I'm a real Developer, I autocomplete. Feel free to use me as a reference.
And as El'endia said, I'd be lost without it.
 
What IDE do you use? I'm using IntelliJ IDEA.
 
I use Eclipse, because it's what i learned on.
 
2:22 AM
yeah I'd be too. fortunately the only things we have to memorize are System.out.print(ln), Scanner methods, and 4 Math methods, so far
I use notepad++, but our class uses DrJava, which I think is (de)glorified eclipse
 
This is really a "Real Programmers use Butterflies" problem, you shouldn't feel lesser because you use Autocomplete, but some people prefer to not use it.
 
@ATaco Similarly, I'm using IntelliJ because my coworker uses it. :P Does Eclipse also have that feature where it'll autocomplete based on other code you wrote/work with? Like, not just stuff in Java's standard library.
 
Yeah, And it will also give preference based on if you wrote it / how common you use it.
Eclipse is pretty good, but it's not very customizable.
 
Real software developers use whatever tools they think will help them increase their productivity.
 
Use MSNotepad, show them the true power of your \r\n!
 
2:28 AM
(hey, that'd make a neat challenge: implement MSNotepad)
 
a=>a.replace(/\n/g,"\r\n") :P
 
Is Java even doable without an IDE? I wanted to try it once but I couldn't even figure out how to compile it without getting a whole IDE, which I really don't have space for on my computer.
 
Yep, just download the JDK and use javac
 
Doable? Yes. Feasible? Ehhh...
 
I never use IDEs, if that counts as an answer
 
2:30 AM
If you want a lightweight but powerful editor I recommend VSCode.
 
(Well, as lightweight as microsoft products get)
 
I use VSCode for TypeScript. Again, because a coworker does.
 
VSCode made learning C++ / C infinitely easier for me.
Mainly because I could use MinGW with it and it was just like "Yeah sure"
 
Oh, that's right, I use VSCode for C++ (when I have to work with C++). I use Sublime for Python, HTML/CSS/JS (well, when the JS is mine), and general text editing (though sometimes I use Notepad on Windows and TextEdit on Mac for real simple stuff).
 
2:35 AM
I use Eclipse for Java, VSCode for C(++/#) (don't tell pavel I use C#), and Sublime for anything else.
I used to use Notepad++, but I was quick to fall in love with Sublime.
(Oh, and I use vim when I'm working on my remote server and want to patch something)
 
Likewise, both with the Notepad++ and vim things. I think the main thing that really blew my mind was the Cmd-D hotkey and multiple cursors.
 
(I didn't know about Cmd-D, that's great)
 
:O Really?!
 
I've been using Ctrl + Shift + Arrows
But that's principle of least astonishment.
 
Oh man, you're in for a treat. You can also use the Find utility to put in a specific regex or whatever and then it's Cmd-G (I think) that selects all instances that match.
Will also work if you highlight a section of text.
 
2:43 AM
I knew about that, it's pretty great.
 
@ATaco 😀
 
Anyone here know some basic chemistry?
 
@LegionMammal978 I passed Year 12 Chemistry, does that count?
 
@LegionMammal978 A couple high school chem classes and one college class here.
 
@LegionMammal978 I am currently one week into a high school chem class
 
2:50 AM
@ATaco Trying to figure out these polyatomic ions ending in -ate, I don't see any pattern here:
Carbonate ion: CO_3
Nitrate ion:   NO_3
Phosphate ion: PO_4
Sulfate ion:   SO_4
Chlorate ion:  ClO_3
Arsenate ion:  AsO_4
Selenate ion:  SeO_4
Bromate ion:   BrO_3
Iodate ion:    IO_3
@Pavel 5 weeks here :P
 
...[points at Google because that's what I would use to find out anyway].
 
But yeah, I can't figure out how many oxygens these are individually supposed to have
 
> The -ate suffix is used on the most common oxyanion (like sulfate $SO_4^{2-}$ or nitrate $NO_{3-}$).
 
Ah, so just the most common one
I guess I'll just have to memorize them, then D:
 
do we allow function submissions if the language doesn't allow you to name the function
 
2:53 AM
Yes, @Downgoat, as long as you can call it, iirc
Forget what the exact consensus was on the subject
 
I think it just needs to be callable, anonymous functions are fine.
 
ok so I golfed JS solution to increment an array to: [].map(i=>i+1) :D
you just do [1,2,3]::[].map(i=>i+1)
:D
 
its the amazing bind operator
 
That ES7 or something?
 
2:54 AM
it's really great:
 
That is going to be difficult to justify.
 
you can golf:
string.split``.map
string::[].map
for shorter loops
 
Because you're applying an operator to it, rather than calling it.
 
@ATaco ¯\_(ツ)_/¯ fits perfectly inside the definition though
 
2:55 AM
@ATaco no I am calling it :: is binding the input and () calls it
 
@Downgoat What does .split`` mean?
 
(Which is difficult to argue, because in many languages calling is a complex operator)
 
Those backticks are scaring me
 
@Pavel Split into individual characters.
 
@Pavel shorthand for split("") which basicallly gives you array of characters
 
2:56 AM
It's like saying +, the operator, is a valid solution to the "add two numbers" challenge
 
@LegionMammal978 no not really
more like ((a,b)=>a+b)(1)
 
Bind is like a very particular curry, which we do allow, but I'm not sure if we should.
 
D: invalidating curries would invalidate lot of answer
 
Is .split`foo` equal too .split("foo")? Howabout arbitrary func`foo`?
 
@Pavel yes
it's really bad (and slow) abuse of template strings but it works for golf ¯\_(ツ)_/¯
 
2:58 AM
.split`foo` should actually be something along the lines of .split(["foo"])
 
A function can be called with template strings without brackets arbitrarily.
 
Same for func`foo` === func(["foo"])
 
Lua steps it up and lets you call a function with any constructor :P
 
An important distinction
 
@LegionMammal978 yeah, but internally [[ToString]] is called so it becomes a string :D
 
2:59 AM
To illustrate, try console.log`foo`
 
func"foo" func{key = "bah"}
in the case of split, ToString is called, not in the case of console.log
 
also try console.log`foo${1}bar${2}`
@ATaco you can check the ES6 spec for more infos on which do call [[ToString]] but console.log is implementation-specific
 
3:20 AM
@cairdcoinheringaahing language, please
 
iirc console.log isn't actually in the JS spec?
 
It is however what console.log does specifically is whatever
It specifies things like log order, differentiates between .error and .log, but that's about it
 
 
1 hour later…
4:33 AM
Quick question: is anyone familair with USB protocol? I'm not clear on something: with usb 1.0 will devices always operate at very near the 1.5 mbps defined max or can they operate much slower then this if they are designed too?
also wow its been a while huh?
 
I'm not sure if this is the right place to ask that
 
its not
its also the Nineteenth byte
lol nvm be that way if you must, people used to be chill here
 
They still are, I think Wheat Wizard was just saying it's unlikely that someone will be able to help you.
 
Okay lol thats fine, thanks anywayz, I'll ask elsewhere
 
What would code golfers know about USB?
 
4:42 AM
We're not exactly electrical engineers here.
 
hah well I've gotten some random help before, thought I might try
 
@AshwinGupta I believe not here or stackoverflow but cs.stackexchange.com is the suitable place to ask the question.
 
¯\_(ツ)_/¯
 
What are you trying to do, you might be falling to the XY problem?
 
@Pavel I'm (almost) an electrical engineer
I don't know jack-squat about USB 1.0 protocols though
@officialaimm CS is more theoretical stuff like algorithms and whatnot. I think EE would probably be the best bet. They even have a USB tag
 
4:45 AM
Do things like microcontrollers and proccessors count as electrical engineering, or is that just things like wiring up circuits for buildings and such?
 
I can do redstone, does that count? :P
 
@Pavel Programming for microcontrollers? I'd say that's pretty dang close to EE. That's like the firmware half of EE
That's pretty much what I do for a living
 
@DJMcMayhem Hmm... I made the guess because it was about USB protocol, but yea electrical/electronics might also be relevant.
 
Hmmm. I guess if you're more focused on the software/protocol side of things, you might want SO or maybe SU.
 
As I said, depends what you're trying to do with it.
 
4:53 AM
@Pavel yea definetly (assuming you're talking about creating/interfacing with them not programming)
 
trying to answer an email about someoen asking me if he can transmit with a USB device slower then 1.5 mbps
 
> A change in the force of gravity on an object will affect its...
This is both kinetic energy, and mass right?
whatever mediates the gravitational force (gravitons?) would add to the object's weight when being attracted no?
 
Is it at rest on a surface at the start?
 
Not mass, Mass is constant.
 
It will increase weight
 
4:58 AM
@Pavel this too
@ATaco no
 
Mass != Weight
 
same reason a hot cup of tea weights more than a cold one
@ATaco both mass and weight would increase, no?
 
Actually, for moving objects it's closer to:
 
wait do virtual particle count as part of mass
 
 
5:01 AM
quantum gravity is still a WIP though so idk if applicable to mix the two concepts
 
Afaik, mass in traditional pyhsics is constant. But when we enter the relativity stuff, mass is changing as per velocity. Generally, the change is so small that we neglect it, but we should consider the changes while dealing with huge things like stars, etc.
 
An increase in gravity causes an increase in $p$ which causes an increase in $e$, although $m$ is left unaffected.
Or at the very least, the effect is $\sqrt{n}$
 
@ATaco you're thinking from a special relativity perspective I'm talking from a quantum perspective
> the graviton is expected to be massless
 
Well they only taught me Special relativity in physics.
 
ok well that answers question
 
5:06 AM
Welcome to Codegolf.se, which is sometimes Mathematics.se, and now apparently Physics.se
 
btw @Downgoat is this user one of your distant relative? :D
 
wait what
who is that O_o
>I like Downgoat's userscript, but I prefer being friendly and I chose Upgoats.
:( downgoat is friendly
 
5:41 AM
@officialaimm Ew
White background + serif = D:
 
 
2 hours later…
7:50 AM
hi all
 
Ven
8:25 AM
Hi
 
that second one is really more appropriate for IPS than workplace
 
8:57 AM
0
Q: how do i echo each multiple same result with different rows

Obinna ObiloI have a page that echo same result multiple times just according to quantity example: id | qty | name 1 | 4 | gun 2 | 3 | jet 3 | 2 | cup result: gun gun gun gun jet jet jet cup cup My problem is how do i add a variable to echo differents row...

 
Biv
9:08 AM
I'm torn between accepting which answer in this question: codegolf.stackexchange.com/questions/142216/…
by definition the JS would win
it takes advantage of some features of the language.
on the other hand the two C versions are quite elegant too.
>_<
 
@Biv if you're going to accept an answer, accept the one that best matches the winning criteria (in this case the fewest bytes), however personally I'd recommend not accepting an answer
 
9:31 AM
0
Q: Sort the points by linear distance in a 3D space

MarioSpecs You have a cubic 3D space x,y,z of size S integer units, such as 0 <= x,y,z <= S. You get from default input methods an array of points P represented as x,y,z integer coordinates, in any reasonable format as you like, for example: [x1,y1,z1],[x2,y2,z2],[x3,y3,z3] ... [xn,yn,zn]. All the ...

 
Ven
whoops
Did I kill tryapl?
oh, it's back
 
9:57 AM
Any python coder here ?
Is there any inbuild list method in python for doing this: If an element e is in list L, then do nothing, otherwise append e to L ?
 
Ven
@AlexKChen are you looking for a set?
 
@Ven I mean I am writing a programme to list all the primes dividing f(x) upto a certain numbers. Is a set more natural than list for holding that? (I don't know anything about sets in python)
 
Ven
@AlexKChen it's more natural becaus eyou never want dupes
 
def app(l, p):
	b = l
	for i in p:
		if i[0] not in b:
			b.append(i[0])

	return b
^Handles dupe, but in sorta artificial way.
 
10:19 AM
@AlexKChen def app(l, v): v in l or l.append(v) ?
There's no built-in method for this
 
10:52 AM
I think you want a set
unless you want it to be ordered
 
11:11 AM
hi all
 
harumph :)
 
@AlexKChen no but there is a set one
 
@RomanGräf there is a huge amount of nonsense in the chat room (most of it great fun)... Hi is not your biggest time waster :)
I still want to pose some SIMD challenges.. I feel we are missing these
and GPU ones but they are harder to do without shared hardware
 
11:54 AM
Hmm, another question: Why is water H₂O while phosphine is PH₃? What determines the order?
 
Electro-positivity?
Or rather I think it's called electro-negativity
The more electro-positive element goes first, as a general rule
 
Ah, I see, phosphorus is less electronegative than hydrogen
 
Yup
 
And the Wikipedia page says electropositivity is the opposite
Yet another rule to remember for these things...
Although I guess all the nonmetals (except for phosphorus) are more electronegative than hydrogen
 
12:10 PM
On repl.it APL is known as "an array-oriented language using funny characters"
 
@LegionMammal978 That's generally true, but if I remember correctly from my Chemistry classes electro-negativity decreases with atom size, i.e. atomic number. That's because the outer electrons are farther from the nucleus and are thus less attracted
 
12:30 PM
more classic coding questions :)
does anyone have any experience writing simd code?
I don't understand how you are meant to write code that is fast for sse, avx, avx512 without replicating most of your code
 
Another question: Why wouldn't the compound with formula H₂SO₃ have a +2 charge?
 
Wait how does H2SO3 even work I thought that sulphur only had valency 2
(I don't know chemistry btw :P)
 
I guess it's just adding H₂ to sulfite (SO₃), which has a -2 charge
facepalm wait, that's right, it would have the same charge as sulfate
 
 
1 hour later…
1:46 PM
@Lembik macros probably :P
 
Ven
intrinsics macro :P
 
New quick programming language idea: BrainFlee: BrainFlak has a stack, BrainFlueue has a queue, BrainFlee has a tree :D
5
 
2:03 PM
1
A: Sandbox for Proposed Challenges

Ian H.Randomly select from an array This challenge is rather simple: You are given an array of positive (not including 0) integers, and have to select a random element from this array. But here's the twist: The probability of selecting an element is dependent on the value of the integer, meaning as t...

 
Anonymous
@LegionMammal978 Because SO_3 has a -2 charge. Covalent compounds are largely magic.
 
@ASCII-only That's interesting
I could give a concrete example if that helps
I am always trying to work out how to change it into a PPCG challenge :)
 
@HyperNeutrino BrainFlump has a Dump
 
I mean I am not really sure how macros help
 
2:11 PM
@Mayube What type of memory system would a dump be? :P
 
just all the values thrown into a pile, and pulled out at random
 
@Mayube That would be horrible to code in :P I love it!
 
instead of FIFO, like a queue, or FILO, like a stack
it's FIAO; First in Any Out
should I call it BrainFlump and have it be similar to BF, or should I call it Landfill and have it be more feature-complete?
 
I like the name Landfill better
Wait so you have no way of ordering the memory?
 
@HyperNeutrino Who needs data ordering?
 
Anonymous
2:16 PM
So it would do memory access like a teenager's room: randomly pull things out of a pile, discarding them into another (temporary) pile if they're not what you're looking for, and then merge the piles together when you're done.
 
Anonymous
AKA laundry day
 
@Mego I want to star, but I'm kinda annoyed that that's how I tidy my room :P
 
> tidy :P
 
Anonymous
@cairdcoinheringaahing I used to do that too, back when I was in high school :P
 
2:17 PM
my parents are too orderly to let me do that :P
 
@HyperNeutrino Get a lock for your room :P
 
I have a lock on my door :P
 
(continue the :P chain) :P
 
I have a pile for clothing, a pile for clothing I wear, and a pile for clothing I'm likely to wear in the next week.
 
@Riker /r/thingsforants/
 
2:26 PM
@Mayube is there BrainFleap yet
 
@ASCII-only i uuh.. don't know enough about memory models to know how a heap differs from a stack, queue, or tree
 
CMC: Determine what percentage of @flawr's messages match ^@​Riker /r/[A-Za-z_0-9]+/$
 
@Mayube also BrainFlube (idk what a deque with value popped from random end would be called)
@Mayube heap is just a bunch of items in no particular order
 
Theoretically you could make an extendable BrainFl.+ to work with any datatype with a push and pop function
@ASCII-only well no a heap is arranged like a tree
the order doesn't matter usually tho so yeah
 
Usually used to refer to the space you use when you malloc in C
 
2:29 PM
unless it's a max heap :P
 
@HyperNeutrino internally I guess? Or maybe I just don't know what a heap is
Imagine making a memory model out of a DAG
 
oh yeah a heap is sorted where for all C != root, the parent of C's key value is greater than or equal to the key value of C, which is the "Heap Property"
it's just a fancy tree
 
I mean technically it's been done but not in the way we're talking about
 
wait so how does a heap differ from a tree?
 
2:33 PM
All heaps are trees but not all trees are heaps.
 
so how is a heap more specific than a tree?
 
In a heap, for every node that's not the root, its parent's key value is greater than or equal than its own key value.
 
ooh so... heaps are unidirectional?
 
@HyperNeutrino How about CMC: Follow Riker and flawr's conversation? Whenever I see one of them reply to the other, I always see how far back the message being replied to it :P
 
2:34 PM
:P
 
a child node can only be equal to or less than it's parent, so a heap will always be descending
 
oh yeah
 
so trees can ascend too?
 
if you follow any branch from any node down, it's non-strictly decreasing
 
I'm gunna make Landfill
it'll be a pain to work in, like Lost
 
2:35 PM
yup :P
 
@HyperNeutrino Why did you post that? I've fallen into xkcd's web of jokes D:D (like this :P)
 
But at least the code isn't random
 
ugh gotta turn my PC off in a sec for PAT Testing
 
lol (^^^^)
 
@Mayube Lost is workable, because you create a path that always leads to the proper program. Landfill would be utterly impossible
 
2:36 PM
not necessarily; if there are more features than BrainFL..., then you can use the Teenager Search Algorithm to find a value
 
@HyperNeutrino I think the only way to do anything is to have only 1 value on the heap. In order to have multiple values, you could have a command that creates stacks ([ in ><>)
 
import random

def teenager_search_algorithm(pile, value):
    while True:
        index = random.randint(0, len(pile) - 1)
        if pile[index] == value: return index
        pile = pile[:index] + pile[index + 1:]
^ Teenager Search Algorithm
 
Ven
isn't there an easier way to splice an item
 
yeah del pile[index]
but ease and efficiency don't appear to be the main focus of this algorithm :P
wait
this is actually no less efficient than a standard linear search...
that's weird
both are O(n)
 
@HyperNeutrino you know bogosort? How about bogosearch? :P
 
2:43 PM
> return array.index(value)
come on seriously
:P
 
Rod
@HyperNeutrino the changes in your question means that my answer is valid?
 
@cairdcoinheringaahing that... Is not a correct implementation
 
@Rod Yeah; the intention differs a bit now from my original challenge idea but yours is now valid
 
Ven
@HyperNeutrino mh, it is
deleting an item from an array is pretty slow
 
2:45 PM
oh
nvm then :P
 
why do people like doing while 1
 
But I guess python's recursion limit is good enough for bogosearch
 
@ASCII-only -1 only half golfed. Either go all the way, or none of the way
 
@cairdcoinheringaahing ok
Funny thing is it's the exact same algorithm as the one here: svn.red-bean.com/repos/kfogel/trunk/algorithms/bogorithms
 
2:56 PM
CMC: Using an algorithm based off randomness, check whether x is in the array y
 
@cairdcoinheringaahing Python, 85 bytes, output with error code: tio.run/##FYm7CsMwDAD3foW6SUUenLQUCvqSkEElcWqIHxgTyNe7znAc3OWz/…
 

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