« first day (2233 days earlier)      last day (2612 days later) » 

12:00 AM
Could I get someone to answer this so I can go again:
11
Q: Answer-Chaining - Positive divisors of a number

Mr. XcoderThis an open answer-chaining challenge, so your answer depends on the one before yours. Task: Print all the positive divisors of a number x taken as input. Input: A single number x which is the number (in base 10) whose positive divisors should be computed. Output: All the positive divi...

 
I need halp with regex
 
I don't have any halp at hend right now, sorry
 
How do I match args in Clojure fns and defns?
In Atom's text editor, I want to match a and b in this defn:
(defn test [a b]
  (* a b))
 
O_o
 
12:06 AM
For clarification, I only want to match the a and b inside the square brackets separately.
 
[ab](?=.*\])
 
But the args can be any name though
(defn test [arg-name other-arg-name]
  (* arg-name other-arg-name))
 
@WheatWizard I'd love to but I'm not sure which language to use
 
I'm a little confused what you're trying to match. Can you give an example?
 
12:08 AM
(?<=\[.*)\w+(?=.*\])
 
@DJMcMayhem You should do wsf
or glypho
glypho is a bit harder
 
@ГригорийПерельман In Clojure, functions are written like so:
(defn function-name [{list of arguments}]
  {code})
 
You're trying to match a function definition?
 
The list of arguments is separated by spaces, so it could be [a b c d]
I want to match the arguments
So a, b, c, d
 
any collection of word chars after a [ and before a ]?
 
12:12 AM
@JanDvorak Only if it's wrapped around brackets with defn
 
@WheatWizard wow, you're only 39 characters away!
 
I want to match arguments in (defn test [a b] (* a b)), but not [a b] on its own (because those aren't arguments)
 
Good. Now we're getting somewhere. Knowing what you want is the first step to getting it.
 
@JanDvorak Apparently lookbehinds can't have variable length wildcards (so no *, + or ?)
 
12:14 AM
notes this bit of trivia for the purposes of guessing Qwerp's environment.
 
This is Clojure rejex?
 
I think he said Atom, so ... Javascript flavor?
 
@JanDvorak (?<=.*) doesn't work rubular or regex101
So I'm assuming they don't work in general
@ГригорийПерельман I want to extend the Atom's Clojure highlighter, this isn't Clojure regex
How confusing is my problem right now?
I can clarify some things if you guys are still confused
 
it's becoming less unclear but it's still too broad.
 
@JanDvorak What's unclear?
I think I should just rephrase my problem entirely
I want to extend Atom's highlighting for Clojure to include function arguments in defn (Atom probably uses Ruby-flavoured regex, because it supports lookbehinds).
An example of a defn looks like this:
(defn multiply [a b]
  (* a b))
The function name is multiply, and the arguments are a and b.
I want to match the function arguments (a and b), but only in the context of a defn - so the match must only go through if it follows the format of a defn.
 
12:23 AM
@JanDvorak Problem: JS doesn't have lookbehinds
 
The reason behind this is because vectors (basically lists in Clojure) is denoted using square brackets as well, and I don't want to match that.
Did I clarify everything?
@JanDvorak?
 
Don't ask me. I'm no longer here.
 
???
 
12:39 AM
Wow, how long has this existed?
That is incredibly similar to my avatar
 
@Qwerp-Derp But nearly every regex flavor has look behinds.
Even Java has lookbehinds
 
Not JS :-(
But there's a proposal that's making its way up the ranks
 
How should I start cracking this problem?
 
12:44 AM
Well, I don't think you can do that without lookbehinds.
 
If you can handle capturing groups though, it should be fairly easy.
 
You need to match something based on what's around it, without actually including what's around it in the match.
 
@ГригорийПерельман Atom's syntax highlighter has lookbehinds
 
But it uses JS regexes?
 
It's more like Ruby's syntax I'm guessing
 
12:47 AM
/\(defn \w+ \[((?:\w*)(?:\s+\w+)*)\]/ should capture all of the variable names in the one and only capturing group
 
I looked it up, the Atom devs confirmed somewhere that JS regexes are being used internally.
 
@Downgoat looks like an "open in browser" link to me
the little square with arrow in it right
 
What's ?:?
 
?: is modifier iirc
 
?: is a noncapturing group.
 
12:49 AM
Doesn't it mark a non-capturing group?
You don't need the first one though, actually
 
If you put a modifier after it, the modifier applies to the group and only the group, without being able to be matched by a backreference.
 
Hmm, the proposal to standardize global in JS is nearly complete
 
I modified your regex a little:
\(defn\s+\w+\s*\[(\s*\w+)((?:\s+)\w+)*\]
I want to ignore the \s in the capturing groups inside the square brackets
Is that possible?
 
No, the entire point of a capturing group is to exactly match everything in it.
 
do we/should we have a challenge to implement a tee? (take STDIN and output it and write it to a file)
 
1:01 AM
I don't actually think so.
I haven't seen one, at least.
cat>a
 
@Downgoat what it looks like in your app right now
what it looks like on github
the first img, your current one, looks like "open in browser"
 
@ГригорийПерельман you also have to output it
 
@Riker err that is share button
fork button is one that says ... forks
 
... it crashes also >>_>
 
>_> oh
Well if it worked it would bring up one of share boxes :P
 
1:04 AM
@ConorO'Brien cat>a&cat a? I don't know if that works, I'm new to Bash.
 
@ГригорийПерельман I can try it
 
@Downgoat no tha'ts ok
 
Oh, wait, tee is a thing.
Dur
 
no builtins
 
@Riker you know those buttons that when you click shows you stargazers and all
 
1:06 AM
?
 
@Riker the colorful ones
 
oh yeah
ok, of those:
the top three all work
the bottom three do nothing, can't click on them
 
@ConorO'Brien Doesn't work, remembered TIO is a thing.
I need to do &&
 
Ok good those are ones implemented
 
1:07 AM
but I need a way to star and to watch a repo
 
@ETHproductions Is it possible for it to not match the stuff at the start, or is that not possible?
 
should I add buttons to the top bar (navigation bar)?
 
@ГригорийПерельман also filename is from argv
 
@Downgoat they work for me, running ipad air 2 sim
 
@Riker do you think it would be a good idea to show part of the readme in the empty space at the bottom, and when you click on it it shows full?
 
^
 
^^
 
@Downgoat might get cluttered, maybe only a couple of lines
and at the very bottom ofc
 
1:10 AM
@Riker ok. Just that I dunno what to put on bottom because very empty atm
 
yah
 
If you do that, you can remove the link to the README that's also there
@ГригорийПерельман silly me, a newline is shorter than &&
 
also, just a note: the starboard has many things with 2-digit star counts
more than normal
 
I think we all know about the HTTPS thing, we don't really need it pinned anymore.
 
let it unpin itself naturally
 
1:16 AM
How does that work?
 
things unpin themselves after a while
 
@ГригорийПерельман usually in around 3-4 weeks
 
I did not know that.
I don't think it should be pinned for 3-4 weeks tho
 
it kinda should
because it's not done yet
 
Do we really need to follow it's progress though.
Just make another announcement when it's done.
 
1:21 AM
there's nothing gained by unpinning it
 
But if we unpin it we can fit more memes on the starboard
 
that's a horrible incentive
 
Feb 11 at 7:03, by Dennis
@Pavel Excellent reason to unpin something...
 
1:35 AM
@Qwerp-Derp I don't think so
 
2:11 AM
Test
 
2:41 AM
@Riker can you test if logout work
 
3:00 AM
@wat Dammit how many accounts do you have
 
@Qwerp-Derp Just one
He changes his username
 
@Mendeleev Dammit how often do you change your name
 
Not very
 
VAAP: Most "elegant" challenge ever (or at least recently)?
(VAAP = Vote to Assign an Adjective to a Post)
 
3:15 AM
yes
 
@HelkaHomba i don't think there is once, AFAIK Nathan Merrill hasn't started on an Elegance interpreter yet
 
0
Q: Simplify numbers while maintaining order

Helka HombaWhen comparing two numbers it can sometimes be tricky to tell at instant glance which one is bigger. For example, it probably takes you longer to tell which one of these is bigger 6478093 6745021 than it does for these 6000000 6040000 Let's write some code to fix this pedantic issue! Chal...

 
Waj just thinking about how some of my challenges like this have a forced "elegance" if you can even call it that but others like Stackylogic are really elegant and satisfying.
 
3:30 AM
@HelkaHomba elegance?
 
4:20 AM
@Riker So I was looking at other apps for inspiration and I was thinking about putting commits into their own tab, you know how like at the top there is the bar that says like Code | Commits | Issues | PRs.
Though I'm not sure since commits are connected to code
anyway, I will probably be redesigning a large part of app
 
4:43 AM
Jelly in a nutshell:inputs,links to inputs, and functions to links to inputs
 
That sounds like a lot of languages.
 
4:54 AM
@NewMainPosts deleted this since I wasn't really satisfied with it. If it gets undeleted that's ok
 
@HelkaHomba I think if you specify that if a digit is changed to 0 in a number it must also be changed in the other number, the challenge is more interesting. Still not rocket science, but I think it would be worth having in that state.
 
Is this a good syntax?
loop(n) ->
  {n = 0: 0
  {n = 1:
  |out(1)
  |loop(1)
For CMQ
 
@Qwerp-Derp is it an esolang?
 
Yup
It's the sequency esolang that I'm possibly working on
 
I can't really tell what it does but the syntax looks neat
 
5:01 AM
It's a truth machine function
 
@Qwerp-Derp Ah. Looks like you got inspired from switch.
 
ack(m n) ->
  {m = 0: n + 1
  {n = 0: ack (m-1) 1
  {ack (m-1) (ack m (n-1))
I'm thinking of making functions comma-less
 
'Ack' looks like a painful sound :P
 
I think there's too many brackets though
 
Is it a golfing lang?
It doesn't look like so
 
5:05 AM
I think that syntax looks nice
 
Since its too verbose
 
It's probably not going to be golfy
It might be IDK
a(m n)->{m=0:n+1;n=0:a(m-1)1;a(m-1)(a m(n-1))
I'm thinking of making a recursive function syntax as well:
(m n)->{m=0:n+1;n=0:@(m-1)1;@(m-1)(@ m(n-1))
Compare the three versions
 
Speaking of not golfy, I'm planning on a longest hello world challenge
 
@MatthewRoh Python, infinite bytes: print("Hello, World!")#{insert infinite bytes here}
 
does anyone else here use materialize?
 
5:11 AM
@Qwerp-Derp nah, I'm planning to disallow unnecessary comments and spaces, also semicolons
 
@MatthewRoh Infinite base64 encodes and decodes
 
You can seperate each letters into each functions tho
@Qwerp-Derp seriously?
 
@MatthewRoh That's one way to get around the limit though
Whoa your profile pic is transparent?
 
@MatthewRoh Duplicate, iirc
gimmeasec
 
None
@Qwerp-Derp Yes
@Qwerp-Derp also, classes and struct
 
5:28 AM
I will give 100 points to Gryffindor if anyone can figure out what this function does: (n)->{n=1:1;n*@(n-1)
 
looks like factorial?
 
@PhiNotPi 100 points to Gryffindor!
A bigger prize this time: 200 points for Gryffindor up for grabs! (n)->[{n in[0 1]:1;(@(n-1))+@(n-2)][to n]
 
5:47 AM
Looks like it... returns the first n Fibonacci numbers?
 
Wait actually ignore the above one
@PhiNotPi Uhhh... I have a question - does this look neat?
 
The syntax?
 
sumFib(n) ->
  {sum[(n) ->
         {n in [0 1]: 1
         {@(n - 1) + @(n - 2)
   ][to n]
@PhinotPi Yeah, it's for a language I'm going to be designing (hopefully soon)
 
Where's the }s?
 
@PhiNotPi No }'s
Cause it's meant to simulate these types of functions:
In computability theory, the Ackermann function, named after Wilhelm Ackermann, is one of the simplest and earliest-discovered examples of a total computable function that is not primitive recursive. All primitive recursive functions are total and computable, but the Ackermann function illustrates that not all total computable functions are primitive recursive. After Ackermann's publication of his function (which had three nonnegative integer arguments), many authors modified it to suit various purposes, so that today "the Ackermann function" may refer to any of numerous variants of the original...
See the curly brace thing
 
5:53 AM
How would you be able to nest it?
 
Actually no I don't think that would work, unless I nest the square bracket thing all in one line
fib(n) ->
  {n in [0 1]: 1
  {(fib (n - 1)) + fib (n - 2)

sumFib(m n) ->
  {sum [fib][to n]
The reason for the spaces between fib (n - 1) is because for multiple args I want to do something like this: a b (c + d), where b and (c + d) are args
@ASCII-only What do you think of my syntax for CMQ
@ASCII-only :( Y u ignore me
 
@Qwerp-Derp because i was afk sorry
@Qwerp-Derp cmq?
 
@ASCII-only Charles Montgomery Quince
Geddit? C. Quince?
@ASCII-only?
@HelkaHomba Stackylogic is really cool :)
 
6:14 AM
@Qwerp-Derp seems nice but what does [fib][to n] do
 
[fib] makes a sequence of all the numbers (1 to infinity) of the fib function, and [to n] get all the elements of that sequence to n
So [(n)->2*n][to 5] becomes [0 2 4 6 8]
 
@Qwerp-Derp why square brackets for [fib] though
 
[function] denotes a sequence
Should I use #[]?
 
@Qwerp-Derp oh ok so it's [sequence][subscript]?
 
@ASCII-only Yup
 
6:18 AM
@Qwerp-Derp ok why the parens around fib (n - 1)
 
Easier to parse
I'm trying to make the syntax comma-less as well btw
 
@Qwerp-Derp how is it easier to parse
 
IDK, it should parse (n - 1) as an entire expression
 
why (fib (n - 1)) not fib (n - 1)
 
(fib (n - 1)) + fib (n - 2)
You can omit brackets only at the end of a line
I'm not sure if I should make it a thing
 
6:23 AM
@Qwerp-Derp probably not but recursive seems like it would be useful as this e.g. #(n - 1) + #(n - 2)
@Qwerp-Derp why though
 
@ASCII-only I can get rid of that rule if you want
@ASCII-only But what about functions with multiple variables?
 
@Qwerp-Derp yeah i think it looks better without parens
 
@ASCII-only That's done with @
 
@Qwerp-Derp functionName (x - 1 x - 2)
 
functionName (x - 1) (x - 2) would look better IMO
 
6:25 AM
so basically it's a bit like lisp?
then hmm i think you shouldn't be able to omit brackets at all
@Qwerp-Derp D: sumfib doesn't use m
 
@ASCII-only Whoops added an m in
@ASCII-only Yeah
 
@MatthewRoh Use lenguage
@Qwerp-Derp i think you should use Python slice syntax: [to n] becomes [:n]
 
@ASCII-only Readability...
 
Umm..
I like trains.
insanely loud train sound
 
dies
 
6:35 AM
Wait
Train
Esolang
Train + Esolang
TrainLang inbound
 
What is TrainLang? Is it train-based instead of stack-based?
 
Someone should make a lisp dialect and call it "rhotacism"
 
@Qwerp-Derp rhotacism?
 
An r-based lisp
 
@ASCII-only A person with a lisp can't pronounce s's, a person with rhotacism can't pronounce rs
Dammit ninja'd
 
6:40 AM
And both types of people can't pronounce the name of their condition correctly
 
Yup
lithp and wotacism
 
7:40 AM
@Sherlock9 like a version of Lisp for statistical analysis?
 
... That would definitely be interesting
 
Someone should make a library and call it rhotacism.
 
@Sherlock9 write it in R?
 
Well, this was Qwerp Derp's idea first. See "rhotacism" two posts above mine
 
@Sherlock9 yeah, I know, it would just be interesting to see that
 
7:55 AM
I'm just wondering why you're all pinging me
I don't know enough about Lisp, statistical analysis, or R to try to write this
 
I know about statistical analysis, but not R or Lisp
 
@Sherlock9 I'm just replying to your messages
 
@fergusq How do you force the program to take input in Röda? pull var_name works, but when I'm inside a stream, like a seq for-loop, pull doesn't take user input
 
@KritixiLithos Currently the only way is to create a named stream like this: main { stream x; x.push | seq 1, 10 | for i do line := x.pull(); push i, ": ", line; done }
But that is an eager operation, so it will consume all input. I should really create a function that will read from stdin.
 
That is probably important, yes.
 
8:14 AM
True, as of now, when I do stream stdin; stdin.pull(a) the program doesn't end, it keeps wanting more input
 
@KritixiLithos The problem is that stdin.push() reads all input it can, in an infinite loop. It could probably be possible to create a custom stream implementation in Röda that was lazy, but it's easier to just add a builtin that reads from stdin. I'll create one when I have time to continue coding later today.
If you know how many items you are going to read, you can limit the number of pushed items with head, like this: stream stdin; head(3) | stdin.push() | ...
 
What exactly does push do to the stream?
 
The push method (without arguments) reads all values from its input stream and pushes them to the stream object. stream x creates a queue and x.push adds items and x.pull pops.
In main { stream stdin; stdin.push() | seq(1, 5) | for i do ... done } the values in the input stream of main are consumed by stdin.push() in parallel with the seq for loop.
 
8:31 AM
How does for i do ... work? Don't you need to specify what to iterate over?
 
It iterates over the seq(1, 5)
 
Oh. Does for i in seq(1, 5) work?
 
The for i do ... done loop iterates over the stream. In detail: stdin.push() consumes all values in the stream and pushes nothing back. seq(1, 5) reads nothing from the stream and pushes values 1..5. for i do .. done consumes all values of the stream.
 
So the if the for loop operates on the stream, what was the point of the seq(1, 5)?
 
Apparently @KritixiLithos wants to iterate over two streams at once: the stdin stream (the default) and the seq(1, 5) stream.
The seq for loop is like this in Bourne shell: seq 1 5 | while read num; do ...; done
 
8:38 AM
I don't really know how Bourne shell work, to be honest.
 
@KritixiLithos You can try to use the for in construct also: for i in [seq(1, 5)] do .. done. Now the stream is connected to stdin, not seq.
 
Ah, thanks
Do you guys think there should be a chatroom for discussing Röda?
 
Eh, if it disrupts anyone else's conversation, yeah.
 
Btw, how do you specify regex flags?
 
Do you mean like (?i)[a-z] for both lower and upper case letters?
 
8:48 AM
Yeah, that works. What regex engine does it use, or is it a custom one?
 
I'd say Java's
I don't think a custom one is very easy to do
 
It uses Java Matcher and Pattern classes: docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html
 
TIL you could do (?i) in Java regex
 
9:08 AM
I am now trying to crack your cop's submission @fergusq. All's good, but the only problem is with the |s. I only have 2 of them
 
I think I made the regex too easy. It's always possible to add unnecessary pipelines inside if false etc.
 
0
Q: Help me reduce my perl code

Tarun TalrejaI am new in Perl and I tried perl for the first time and reduced my code to 56 charcters of length.Can someone help me to reduce my perl code to least possible. This is my reduced perl code: @j=split$",<>;map$%+=2*$a[$_%@j[1]]++,split$",<>;print$% For the question Visit https://www.hackerearth...

 
I just did a exec("mkdir","||||||")
Meh, just changed it to a a="||||||"
And btw, cracked :)
Oh wait, I'm stupid
I didn't crack it
I am such an idiot
I didn't snake it
 
9:40 AM
Okay, cracked for real now
 
Well done!
 
Why do you need parenthesis around the _ after the {seq} block?
 
10:00 AM
Because they are part of the function call syntax. They can be left out at the statement level, but not at the expression level. (Except after pipe characters. This is valid: print(seq(1,5)|pull)
If the parentheses could be omitted, they could cause difficulties with parsing. Eg. is f-3 function call f(-3) or a calculation f minus 3.
 
I still didn't decide if I should make my language completely usable with function and stuff and put real work on it, or just a simple list of built-in commands.
 
Oh, so _ is sorta like an argument to the function block
 
The first part of the sentence: "[...] and put real work on it, [...]"
 
_ can be used as an argument or inside an argument. Eg push(1,2,3) | seq(1, _+1) pushes values 1,2,1,2,3,1,2,3,4 to the stream.
 
both(gender n) ->
  {n = 0: 0
  {gender = 0: n - @ 1 (@ 0 (n - 1))
  {n - @ 0 (@ 1 (n - 1))

male(n) -> both 0 n

female(n) -> both 1 n
 
10:14 AM
@Qwerp-Derp 3k rep? woo!
 
@betseg But I already had 3k rep and you cheered for it
 
oh
 
b(g n)->{n=0:0;g=0:n-@1(@0(n-1));n-@0(@1(n-1))
m(n)->b 0 n
f(n)->b 1 n
 
@fergusq Now I'm confused. What exactly does _ do?
 
@betseg Let's cheer anyway! Woot!
 
10:15 AM
then you didnt get upvoted in a long time
 
@betseg Yeah
Haven't really posted in a long time
What about a challenge where you have to output a sound within a certain decibel range?
 
10:47 AM
@KritixiLithos _ is syntax sugar for for loops. f(_) = f(x) for x = for x do f(x) done. The for loop is placed around the nearest function call.
 
So push(1,2,3) | seq(1, _+1) is equal to push(1,2,3) | seq(1, x+1) for x, right?
 
Yes
 
11:02 AM
Actually it's not always the nearest function call, but the nearest piped function call ie. a function call that is either a statement or a member of the pipeline (not first call). So main { f(_, g(_) | h(_))) } would translate to main { f(x, g(y) | g(z) for z) for x, y }
 
11:37 AM
0
Q: The Bounding Box

noumenalAn endless number of squares are added to a random location on the screen: Main goal: Each square may not overlap with a previous square and must be separated by at least half a square All squares are of equal sizes Each square has a border that defines the bounding box The bounding box (center...

0
Q: CSV cleanup: remove all in col after (

A TProblem Given a file with: 56 (65%), 33(75%), , 44, hello world, goodbye 89 (25%), 33(75%), , 44, hello world, goodbye 92 (97%), 33(75%), , 44, hello world, goodbye Goal Write back to that file with: 56, 33, , 44, hello world, goodbye 89, 33, , 44, hello world, goodbye 92, 33, , 44, hello w...

 
12:08 PM
TIO needs an api so we can make a js code snippet to run every language
 
12:33 PM
@MatthewRoh It doesn't need an API, you can create the query yourself like DataBot does, and ajax it like PPCG-Design does
 
 
2 hours later…
2:35 PM
Ah. I'm not so familiar to ajax.
btw a radiation-hardening quine would be awesome
It prints itself, but it hardens itself too
(it may be impossible)
 
Does it have to work even if it's not struck by radiation?
Otherwise qq in HQ9+ will do the trick.
 
No, but it has to work if it's struck by radiation of arbitrarily low energy.
 
Any idea why this is segfaulting when I run the Ruby method? github.com/MiningPotatoes/Ohm/blob/master/ext/smaz_ohm/…
 
@NickClifford Well, you used an uninitialized value.
What C compiler are you using? It should really tell you that.
 
2:52 PM
0
A: Sandbox for Proposed Challenges

busukxuanThis is just a placeholder for now. I couldn't find any similar question in the search, but I feel someone must have asked this before, so I am putting it here to see if someone could find a question like this. Shortest answer of Kolmogorov complexity questions Challenge: write a program that...

 

« first day (2233 days earlier)      last day (2612 days later) »