« first day (2367 days earlier)      last day (2469 days later) » 

4:07 PM
Does anyone here know regex?
 
@cairdcoinheringaahing ?
 
sorta
 
@cairdcoinheringaahing don't ask to ask, just ask
 
If I want to match a string so that it separates every character, except ones preceded by a question mark, how would I do that? e.g abc?efg => [a, b, c, ?e, f, g]
 
4:19 PM
yay i posted my first answer in 15 days \o/
 
@cairdcoinheringaahing Find all matches of /\??./
 
@cairdcoinheringaahing [?]?. will mach each case separately
regex does not do separations
It just matches things
 
@WheatWizard yeah I know, I have a function that separates things on matches, it was just the regex to get matches that I was looking for
@Doorknob what is the emoticon at the end of your PPCG profile? :wq?
 
Not an emoticon, a vim command. Combination of :w (write) and :q (quit).
 
@cairdcoinheringaahing not an emote
ninja'd
 
4:24 PM
@Doorknob ok, that makes sense. I was trying to figure out how that could be a face q:
 
You can use :x, just saying
 
@WheatWizard but don't accidentally use :X
 
Good point
 
what does it do
 
:x is the same as :wq
:X will encrypt your file
 
4:27 PM
o no
 
@WheatWizard The point is that it's recognizable, not what I actually use. :P
@musicman523 Not quite. It won't write to the file if no changes have been made.
 
@Doorknob good. As a mod of code golf, all your code should be as golfy as possible :P
 
0
Q: On type restrictions

Wheat WizardRecently I had an interesting interaction on one of my questions. A user posted this answer in C++. My question requires a function on the positive numbers that has some properties, the user's answer essentially implemented the function add 1, which does not satisfy these properties on the posi...

 
@Doorknob Gotcha, I suppose this could make sense in some cases but I don't think it would usually matter (probably only if you open a brand new file in Vim or if like your hard drive dies or something)
 
4:31 PM
There was a moment when I thought n>=q would be golfier than n=n>q
 
lul
 
@HyperNeutrino I was reading through this when I noticed the comments below the question ಠ_ಠ
 
@cairdcoinheringaahing hehe
 
@HyperNeutrino the other user though
 
ikr
whoever it was even ಠ_ಠ
 
4:41 PM
@HyperNeutrino long gone now i think.
 
yup.
hey I can chain onto OEIS challenge now
 
@musicman523 Well, if you don't want make to recompile a file for no reason then it's useful, for example.
 
@HyperNeutrino have you got an answer?
 
not yet
neither do I have a language to use >.<
MORE PARTITIONS
 
@Doorknob my "emoticon" is better :P
 
4:41 PM
@HyperNeutrino F#?
 
@DJMcMayhem checking I agree
@DJMcMayhem also, your profile picture is much better. Everyone likes cats!
 
@DJMcMayhem The capitalization of "The [Aa]lgorithm" (hehe I detected it with regex) is inconsistent ಠ_ಠ
 
@HyperNeutrino it means that it can't be detected by regex
 
llama@llama:~$ cat > Makefile
a: test
	echo hello
llama@llama:~$ touch test
llama@llama:~$ make
echo hello
hello
llama@llama:~$ touch test
llama@llama:~$ make
echo hello
hello
llama@llama:~$ make --version | head -1
GNU Make 4.2.1
(@musicman523)
 
4:44 PM
@cairdcoinheringaahing no I mean the A is not capitalized consistently lol
 
@Doorknob I just did the same thing, that's why I deleted :P
 
@Doorknob again, WHY are you a llama??? :P
 
@HyperNeutrino its deliberate so that Jon Skeet can't find it back :P
 
@HyperNeutrino /\cthe algorithm/ is golfier
 
@musicman523 Oh, didn't see that. :P
 
4:44 PM
@DJMcMayhem Pity you couldn't work on the answer. It's currently leading :-) BTW are you planning on doing the change suggested here? Otherwise I may have to remove the link to that answer as the third example here
 
Yay me, I decided to break the mold and not do ... 5 - 3 - 1 - 2 - 4 ... for the infinite chain question
 
@DJMcMayhem Sure :P Still, make your capitalization consistent >.<
 
I found a random regex! ([^0-9a-f?][0-9a-f]+)|([?][^0-9a-f])
I don't know what it does!
 
Well it selects something that contains two parts I think, ...|...
unless you forgot the brackets around the very outside.
The left part takes anything that isn't 0123456789abcdef? and then any number of hexadecimal digits
 
I copied it into regex101, still no idea
 
4:50 PM
-3
Q: Sort an array with multiple objects from a file into a new file

Debbie LevyI have done Option 1 & 2 but it is not compiling... any ideas on how to fix this? You are going to create a switch loop with different options. Option 1: Ask users to input Person Name, Ticket Type and Fine. You will keep asking users until they press q key. Once user types Q, you will store all...

 
The right side takes a question mark and then anything that isn't a hex digit, unless [?] is different
 
what do I do with this? +3/-2 :|
 
@dzaima personally I like that challenge so I upvoted it
 
@WheatWizard hm, that's very interesting, I didn't consider that. Is that a function you made yourself or that you found?
 
4:58 PM
Also, before seeing that proposed challenge, I had been thinking for some time about a "golf the [numerical] sequence" challenge where people first have to figure out the sequence and then golf it
 
@StepHen I made it myself. (explanation incoming)
 
@ETHproductions that thing you added is genius, I think this might be one of the stack snippets that people will save and reuse :P
 
If you take any current answer you can shift it left or right on the number line pretty easily. That is instead of integers > 0 you can change the domain to >n for any n (I won't explain this hopefully this is evident). So take your function and shift it up to Int_max+1 so that Int_max+1 is the smallest number in the chain, now have int_max+1 map to 1 instead of whatever it mapped to and int_max map to whatever int_max+1 used to map to. This essentially takes the int range and inserts it into an existing chain function, However on the range 1-Int_max it behaves exactly like +1.
If thats confusing I can answer questions.
 
Ugh. My CnR is at 9.8k views, but it's slowing down. I want that gold badge!
 
@DJMcMayhem Holds F5 on a different account, you won't get caught I promise
@WheatWizard I understand that part, I was wondering about the function :P
 
5:04 PM
@DJMcMayhem :-)
 
@StepHen I'm not sure if that technically works
 
@StepHen That is the function.
 
@WheatWizard oh, I thought you already had a function implemented that was just +1 on that range and complicated every where else, I was wondering what the everywhere else part was
sorry for the miscommunication
 
Now I'm confused
I don't even know what the miscommunication was
 
@WheatWizard I thought you actually had implemented a function that did that and you said if you want to know this function ping me and I wanted to know what that function looked like :P
 
5:08 PM
I did, Its defined right up there
did you want code?
 
wait, now I'm confused again, I'm assuming this function is +1 from say 1 to 2^31-1, but after that it jumps back down to one again and does some weird stuff, is that assumption incorrect?
 
> jumps back down
What do you mean by that?
 
I dunno how I would implement this but my assumption from what you said was that there is a function that fulfills the requirements such that inside the range is just n+1
say the range cap is 1000
 
This part is correct "I'm assuming this function is +1 from say 1 to 2^31-1"
 
My assumption was that once you get above 1000, say, 1001 maps to 1 and then the algorithm does some fancy stuff to get 1001 covered
 
5:11 PM
Yes thats what happens
You take an existing infinite chain, you break it somewhere and you insert all the other values in order into the hole
 
@WheatWizard Sorry that took so long :P thanks
 
No problem
 
CMC: Write a function that is bijective for all positive integers. In other words, for all positive N, f(N) is unique and != N && f(f(N)) == N
(if I understand what bijective means)
 
@DJMcMayhem I believe f(f(N)) == N should become f(f-1(N)) == N where f-1 is the inverse function of f
or is it f-1(f(N)) == N, might be that instead
or they might mean the same thing
 
@DJMcMayhem The identity is bijective
 
5:21 PM
@StepHen Oh. Does that mean f(N) == N + 1 is bijective?
 
@DJMcMayhem Yes.
 
@DJMcMayhem Yes, I believe so
 
@DJMcMayhem Not on the positive integers
 
Why not?
 
Nothing maps to 1
 
5:22 PM
Bijective means that it has a different result for any different parameter
 
Bijective means injective and surjective
@Mr.Xcoder No that is surjective
 
What is injective then?
 
@WheatWizard That's mainly injective
 
Every value in the range is mapped to by a value in the domain
 
Is there a term that means f == f-1?
 
5:23 PM
Oh yeah I got them mixed up
 
@DJMcMayhem the following (as I understand it) is bijective, but does not follow @WheatWizard's challenge because it doesn't allow transversing the integers: x=>x%2?x-1:x+1
@DJMcMayhem It should look like f to the power of -1 but I dunno formatting
 
@DJMcMayhem That is not true.
 
Injective means that f: a -> B, f(x) ≠ f(y), forall x ≠ y
 
@WheatWizard I'm just asking if that term exists
 
In mathematics, an (anti-)involution, or an involutory function, is a function f that is its own inverse, f(f(x)) = x for all x in the domain of f. == General properties == Any involution is a bijection. The identity map is a trivial example of an involution. Common examples in mathematics of nontrivial involutions include multiplication by −1 in arithmetic, the taking of reciprocals, complementation in set theory and complex conjugation. Other examples include circle inversion, rotation by a half-turn, and reciprocal ciphers such as the ROT13 transformation and the Beaufort polyalphabetic cipher...
 
5:25 PM
@DJMcMayhem No it does not, bijective functions must not be their own inverses, as stephen linked that is called an involution.
 
A bijective function f: X → Y is a one-to-one (injective) and onto (surjective) mapping of a set X to a set Y.
 
/must not/can be not/
 
Ok I get it
 
@DJMcMayhem Anyway, JavaScript, 14 bytes: x=>x%2?x-1:x+1
 
This one works for all integers higher than 1:
def f(N):
 if int(N**.5)<N**.5:return N**2
 return N**.5
 
5:26 PM
So x%2?x+1:x-1 is an involution, therefore not bijective
 
Maps 1 -> 2, 2 -> 1, 3 -> 4, 4 -> 3, ...
@DJMcMayhem uh it's supposed to be bijective, dunno if it is or not
but as far as I understand it is
 
@DJMcMayhem JavaScript, 10 bytes: x=>--a^1+1
 
2 mins ago, by Wheat Wizard
@DJMcMayhem No it does not, bijective functions must not be their own inverses, as stephen linked that is called an involution.
 
2 mins ago, by Wheat Wizard
/must not/can be not/
 
CMC: Given two positive integers, determine whether they are coprime.
 
5:29 PM
Bijections can be involutions, but they don't have to be
 
So an involution is a special case of bijectivity?
 
@WheatWizard And no involution is valid on your challenge, correct?
 
@StepHen No
 
@DJMcMayhem I don't think so, f(x) = x is it's own involution
 
@DJMcMayhem No functions can be involutions and not be bijective
@StepHen f(x) = x is bijective.
 
5:31 PM
oh right I'm dumb
 
0
A: Sandbox for Proposed Challenges

xyz123Challenge: Calculate the largest factorial of integers (!). A factorial (!) of an integer number (n) is defined as the following, all the integers from 1 to "n" multiplied together, so 6! = 1 * 2 * 3 * 4 * 5 * 6 = 720. Factorials quickly balloon in size such that asking a computer program to cal...

 
an example would be f (x) = x from the positive integers to the integers.
Its is an involution but there is no way to get a negative number out of it.
 
Anyone here good at Chemistry (or Physics)?
 
@Mr.Xcoder define good
 
I was a physics major for 2 years.
 
5:33 PM
@StepHen Being confident with their knowledge in the field
 
So I'm ok at physics, no good at chemistry though
 
@Mr.Xcoder I did ok in high school chem but I've forgotten it all, so count me out
 
I'm looking for a Chemist this time though
 
I've only taken high school chemistry so I don't know If I can be of help
 
5:34 PM
TIL SE sites themselves can onebox
 
@StepHen Too dumb for an SE Site, I'm 14
@WheatWizard High school is what I need
 
@Mr.Xcoder Trust me, they'll be OK with it
Chemistry Stack Exchange is a question and answer site for scientists, academics, teachers and students
 
Whats the question? Instead of speculating we can know.
If its not about ppcg you should probably ask there though
 
^^ boring onebox 0.o
 
Ours looks disgusting
 
5:36 PM
NVM
 
its really blurry on my monitor
 
@Mr.Xcoder now we're really curious :P
 
@StepHen Lemme write it
 
when will we get a design
 
@betseg soon TM
 
5:37 PM
we'll get our design in November 1st
I thought you knew :P
 
@Cowsquack source?
 
My Q was: What are the coordinative bounds between Nitrobenzene and Ammonium Hydroxide?
 
@Cowsquack oh it wasnt last year's nov 1? ohhh
 
I don't need the answer anymore, Nvm ^^
 
5:41 PM
Anyone – Jelly Hypertraining?
Or Pyth?
At least, Is someone willing to write an easy CMC, then?
 
CMC: increase inputted integer by 1
 
@betseg Pyth, 1 byte: h
@betseg I didn't mean that easy
 
Print current time
 
@betseg JS: x=>x+1
 
@BlackCap Pyth, 3 bytes: .d0
 
5:44 PM
@betseg guess the lang, 1+⊢
 
Is this ready to post? It's at +2/-0 and all issues pointed out in comments have been fixed.
3
A: Sandbox for Proposed Challenges

programmer5000code-golf cops-and-robbers Will it halt? Cops: This is the cops' thread. The robbers' thread is here. Your challenge is to make a program that runs forever without halting1, unless it gets a particular input or inputs2. If it receives that input, it must terminate in a finite amount of time3....

 
@Cowsquack dyalog apl
 
Another one?
 
@betseg Java, class A{public static void main(String[]a){System.out.print(Integer.parseInt(a[0])+1);}}
 
5:46 PM
@betseg Jelly, 1 byte:
 
untested
behold the verbosity
 
@Cowsquack that adds two arguments, not increases one
 
@Cowsquack x=>x+1 ?
 
main=readLn>>=print.succ
 
I messed up
 
5:47 PM
3 mins ago, by programmer5000
@betseg JS: x=>x+1
 
also java too
 
@betseg Java lambdas use -> arrows
 
oh
 
Print every other letter from the input
 
@BlackCap every other?
What is other here?
 
5:49 PM
where do we start?
 
print letters at even indecies
 
@BlackCap Ok
 
befunge, 4 bytes ~~$,
 
@BlackCap 0-indexed or 1-indexed even?
 
zero indexed
 
5:51 PM
@BlackCap Pyth, 2 bytes: %2
I gtg, will be back shortly
 
@BlackCap SOGL, 4 bytes: 2nHk
 
omg. I just went over to Movies & Tv and saw that one user (not saying who) got suspended for a year. That is too long.
 
um ok?
 
Did he share an entire movie?
 
5:54 PM
@BlackCap no but he's had a string of long suspensions there
 
@BlackCap will the input string always be of even length?
 
You may assume that
or that the input is infinite, if you wish
 
sed, 11+1 bytes, s/(.)./\1/g
 
lambda is longer
 
lambda s:s[::2]
if it's the wrong indices: lambda s:s[1::2]
 
5:58 PM
Remove even lines
 
@BlackCap you went from one horrible sequence to another ಠ_ಠ
 
Is it that bad?
 
sed, 19+1 bytes, Try it online!
 
If the OEIS page doesn't give a(n), its bad
 
6:00 PM
I should learn sed.
 
Yay, even indexes in a String? Pyth wins by far (if jelly doesn't outgolf it)
@cairdcoinheringaahing Want to join Hypertraining?
 
i've just noticed that i passed 6k
 
@betseg Congrats! I just passed 5k :D
 
nice emoticons
 
6:06 PM
2
Q: Verify Topology

flawrChallenge Given a set T of subsets of a finite set S={1,2,3,...,n}, determine whether T is a topology or not. Explanation The powerset P(S) of some set S is the set of all subsets of S. Some examples: S = {}, P(S) = {{}} S = {1}, P(S) = {{}, {1}} S = {1,2}, P(S) = {{}, {1}, {2}, {1,2} S = {1,...

 
@betseg Couldn't really decide
 
@Mr.Xcoder he's already in
 
@EriktheOutgolfer I asked him if he wants to train with me now.
@EriktheOutgolfer Do you want to teach me a bit?
 
yurt
 
@Mr.Xcoder come over
 
6:08 PM
@EriktheOutgolfer Already there
 
6:22 PM
@StepHen The available/not-available thing, you mean? Yeah, I liked how it was fairly easy to tell in the old version whether a byte count was used, so I wanted to have something similar in the new version
 
0
A: Sandbox for Proposed Challenges

Erik the OutgolferWhat's the check? code-golfset-theory Quick! You need to give some check, but you don't have time, as customers are waiting in a queue. Fortunately, you can make a program that can do the job for you, but, since you don't have much time to write it, it must be as short as possible. Also, due to...

 
@NewSandboxedPosts wow 14 minutes that's quick as hell!
 
6:54 PM
about how braid is undecidable, TC, and a couple other things
 
Woah
 
@HyperNeutrino i found the problem with the handler. Your bots don't work
 
@Riker BRB, making braid esolang :P
 
braid-flak
4
 
Yeaaaaah
 
7:00 PM
No-Flak
 
@Christopher well rip I will try to fix them
 
@HyperNeutrino Yeah make it a real function
 
Is the issue that I'm using lambdas rather than real functions?
 
Yeah
You do nothing at all and the entire thing breaks
 
7:08 PM
Ty man
 
Going to get current standings
 
Lol CautionBot vs agressor. Agressor lost 20-0
 
lol xD
hey I got sportsmanship xD
 
7:14 PM
Actually aren't they only supposed to play 10 rounds?
 
well the way I have it, they play 10 rounds with the left bot starting and 10 with the right bot starting
change 10 to 5 if you want just 10 rounds
 
ohh
That makes sense
huh
 
Yurt
Hi
 
I am half way into the new Red vs blue episode. IMMA BOUT TO KILL ONE OF THEM WRITERS
 
I'm two answers to 150
 
7:37 PM
@HyperNeutrino random bot is annoying
like super annoying
every other bot it is simple
but random bot SCREWS SCORING UP
 
D: D: D:
hey i can't find the text 1337ify challenge
there's gotta be one right?
 
Programming question: I had the brilliant idea of a data type that could represent multiple values at once (e.g. so a function can return multiple values in an easier way than an array), but before I get all excited about my new invention... isn't this the basic idea behind tuples?
 
CMC: 1337ify text
 
English 1 byte: ^
 
no what?
 
7:42 PM
@totallyhuman What?
 
What's the 1337 alphabet again? 1 is l, 3 is e, 7 is t...
 
a = @
 
0
Q: Secret Message Part 1, Elements

GryphonYou and your friend want to send each other secret messages. However, because you are conspiracy theorists and think that the government has a quantum computer that can crack any standard encryption. Therefore, you are inventing one of your own. The first step of this is as follows: taking an ...

 
@ETHproductions I believe so
29
Q: Return multiple values from a Java method: why no n-tuple objects?

SaketWhy isn't there a (standard, Java certified) solution, as part of the Java language itself, to return multiple values from a Java method, rather than developers having to use their own means, such as Maps, Lists, Pairs, etc.? Why does Java not support n-tuple objects? Especially thinking for tri...

 
This webpage I found seems to think that in Python tuples are basically supposed to be dicts, but using indexes instead of keys
 
7:47 PM
@ETHproductions No, that sounds like non-determinish. Curry does that
 
@ETHproductions o, I thought tuples were for heterogeneous data
754
A: What's the difference between lists and tuples?

nikowApart from tuples being immutable there is also a semantic distinction that should guide their usage. Tuples are heterogeneous data structures (i.e., their entries have different meanings), while lists are homogeneous sequences. Tuples have structure, lists have order. Using this distinction ma...

 
abcdefghijklmnopqrstuvwxyz -> 48cd3f6h1jk1mn0pqr57uvwxyz
 
@ETHproductions Touples can contain different types of data in a typed language
 
@StepHen Ah, that makes sense
 
@ETHproductions (of course that's all just semantics and you can do whatever you want)
since if you're never going to change it a tuple is better than a list even if the tuple is homegenous
Biggest thing is tuples are immutable, at least in Python
 
7:50 PM
y tho
 
@ETHproductions Why immutable? or why better
 
right
 
I dunno
 
Is it just to reinforce their intended purpose I guess?
So you can't just append items to the tuple ad infinitum
 
More efficient
and you can use them as keys in dicts then
 
7:52 PM
Yeah
Anyway, I should get going. Thanks for the discussion :)
 
No prob, see you around
 
@BlackCap If you didn't notice, I added another OEIS answer so it's open to you again
 
An easy one too
nobody take it please, I'm gonna find some really obscure esolanguage
 
@BlackCap easy? how would you implement it? seems kinda complicated to me
@BlackCap You see it has no 14, 30, etc. right?
 
right.
curry: s = x^2+y^2+2*z^2 where x,y,z free
 

« first day (2367 days earlier)      last day (2469 days later) »