« first day (2065 days earlier)      last day (2782 days later) » 

4:00 PM
I know vim and perl have very similar regex engines
 
does vim regex have define blocks?
 
s/regex// makes regex go
How to make everything but regex go
 
o_O A(3, 10) take 0.2sec with memoization and stack overflow without
v
 
forget what I said
@betseg s/(regex)|./$1/
 
4:07 PM
@MartinEnder What's $1?
 
I think something is wrong ^^
 
@El'endiaStarman first capturing group
 
Then what's \1?
 
the same (in some languages)
 
first capturing group
 
4:08 PM
Are they the same thing, just different flavors?
 
@Downgoat what do you mean?
 
Yes
 
some flavours support both
 
Oooh, okay.
 
just \1 can also be used in the regex to match a group
 
4:08 PM
but usually you'd use \1 as a backreference inside the regex and $1 inside the substitution
 
ninja'd
 
sed.tryitonline.net/… <-- what is wrong halp
 
@DJMcMayhem In PCRE you can define named capturing groups in a name capturing group names DEFINE. Which will not be executed until a named capturing group is called upon
 
@betseg I don't know sed but it works in Retina: retina.tryitonline.net/…
 
it allows for recursion letting you match any grammar
 
4:09 PM
(i.e. .NET)
@Downgoat it doesn't actually need to be used inside a DEFINE, that's just a useful convention
 
Wait wat
then wont the capturing groups be executed?
 
([ab])(?1) match aa, ab, ba, bb
 
@MartinEnder echo "wine retina.exe" > /bin/sed
 
@Downgoat ah yes
 
@Downgoat that's why you put inside a falsy conditional (whose conventional name is DEFINE)
 
4:12 PM
@betseg inb4 /bin/sed is owned by some evil system user that you cannot use.
 
you could also do (?=|...) for example where ... is your definitions
 
Permission denied: `/bin/sed` write permission denied Owner: apt Group: apt
 
@zyabin101 Arch doesn't have apt
 
Then what does it have?
yum?
 
Permission denied: `/bin/sed` write permission denied Owner: access Group: denied
 
4:16 PM
zyabin101@zyabin101 /
# ls -l bin
<...> pacman pacman <...> bin

zyabin101@zyabin101 /
# # ...
 
@zyabin101 sorry my mum called me
It has Pacman
 
Okay :/
 
PACkage MANager
 
help
how to put comments in Prolog
 
@zyabin101 %this is not compiled or whatever prolog is
 
4:24 PM
@zyabin101 10 sec googling: %line comment /** block comment*/
 
@miles whoa, that's pretty neat.
 
Thanks :3
Now, how do I print something in Prolog?
I should also unify a variable with a string, how exactly?
 
println function or predicate or whatever it's called
 
Quesiton for cheddar's classes: right now to define a body for the primary constructor you do it in an init {} block but secondary constructors are just init blocks with () in them
problem is now init can't be used as func name
 
Noticed something odd?
 
4:26 PM
use a thing like __init__
@betseg no
 
@TùxCräftîñg theacher
 
@Downgoat Use init as a flag for func names.
 
@zyabin101 can you clarify what you mean by flag?
 
@zyabin101 you should take a prolog tutorial.
 
4:28 PM
class Q { init Q { } }
^^ @Downgoat
 
@zyabin101 ah. I see. So should Q always be equal to the class name? That would be redundant then
 
@Downgoat why would init ever be used as a function?
 
Nope, it may be any func name you wish.
 
do like java, c#, c++, etc...: class Q { Q { /* do weird things */ } }
 
@ConorO'Brien i.e. a method names init
 
4:29 PM
I know, but why
 
Like, class Ches { init Chescloth { } }
works, too.
 
@zyabin101 but what would the initalizer name do? (i.e. i dont what a named constructor does)
 
@betseg Almost no part of this does what it's supposed to do in Basic Regular Expressions. s/\(i\(\s\|\)h\)\|./\1/ works as intended.
 
Uhh...
 
@ConorO'Brien ¯\_(ツ)_/¯ Cheddar has made huge effort to not use any method names
maybe just (args) { body }? i.e. no init
that could be confusing though:
 
4:35 PM
Gah SWI-Prolog, you are ridiculous ~_~
1 ?- X = 123.
X = 123.

2 ?- X
|    .
% ... 1,000,000 ............ 10,000,000 years later
%
%       >> 42 << (last release gives the question)
2 ?- X.
% ... 1,000,000 ............ 10,000,000 years later
%
%       >> 42 << (last release gives the question)
2 ?- Z = 123.
Z = 123.

3 ?- Z.
% ... 1,000,000 ............ 10,000,000 years later
%
%       >> 42 << (last release gives the question)
3 ?-
 
class Animal (private name: string, private age: number) {
    {
        print "Created an animal named %s" % self.name
    }

    (string: name): self(name: name, age: 0) {
         // initializer body
    }
}
pls halp this syntax is weird
at least the { ... }
perhaps I could make just that the init { ... }
 
@Dennis it prints a single i?
And doesnt select multiple whitespaces ;_; sed.tryitonline.net/…
 
@Downgoat i think it's good
 
@TùxCräftîñg how is it compared to:
class Animal (private name: string, private age: number) {
    init {
        print "Created an animal named %s" % self.name
    }

    (name: string): self(name: name, age: 0) {
         // initializer body
    }
}
 
what is the thing starting with (string: name):
 
4:41 PM
I ultimately broke SWI-Prolog.
 
@TùxCräftîñg shit that should be reveresed
it is a secondary constructor
 
SWI-Prolog you are a royal nightmare
 
no, it's just different of normal languages
 
I tried to exit(). But that ended in an exception.
?e
 
4:47 PM
Did I mention that my calculator can be taken down in just three keys? :3
 
._.
@zyabin101 yes
 
wat. how does java not have multiple inheritance
pls halp how to multiple inheritance cheddar
 
becuz multiple inheritance is evil
 
ON/C + 2 + 3
 
it's a name clash paradise
 
4:49 PM
@TùxCräftîñg so ches should hav no multipl inheritanc
 
no it shouldnt have
 
"Cats, bats, rodents." -- Lost in Translation
 
u wot m8 => the friend
 
@Downgoat I thought java was OOP
 
This website is truly weird => This place is very strange
 
4:51 PM
"Hats, caps, pens and chicken." -- Lost in Translation
 
@TùxCräftîñg :D :D :D :D that makes things so mcuh easier
 
Ok, stop destroying my sentences => Well, stop destroying my beliefs
 
Programming Puzzles and Code Golf => will be reviewed
@TùxCräftîñg star my original message pls
Translation is stupid => Translation elses unwanted goods
 
@betseg I just ported .NET syntax to sed syntax. With a g flag to make replacements global, sed and Retina do the same.
 
This is why the Bible is so weird
 
4:53 PM
XD "dangr noodl" becomes "bad luck Noodle"
 
What the fuck => Piracy
 
"I am a man, a plan, a channel to see Panama." -- Lost in Translation
 
Translation is stupid => This new product needed
@TùxCräftîñg set it to 35 for real funniness
starz, pls
 
"Goats are better than sheep and danger noodle is evil" => "Animals are willing to take risks"
 
@Downgoat Now try something in English. :P
 
4:55 PM
"Goats are better than sheep and danger noodle is evil" => "Goats and sheep are the most serious crisis the best pasta"
 
Yeah, translation hell => In addition, cholera
 
"Java is quite a verbose language." => "Java is the most widely spoken language."
 
"So this is how the bible was written" => "Many missionaries."
 
I'm gonna make a chrome extension that does this to text for you.
 
4:56 PM
@Dennis Ah, i didn't notice retina didn't do what i wanted too.
 
France is a weird country => France is a fantastic country
kk
and now it's France is a wonderful country
 
@betseg Well, what are you trying to do?
 
> France is a wonderful place.
k
 
"Yummy meats!" => "The food was fantastic!"
 
Match inh, where n is any non-negative number of whitespaces
 
4:58 PM
@uoɥʇʎPʎzɐɹC Do you think the Bible is translated by machine?
 
@El'endiaStarman humans are no better...?
 
@betseg Generic regex syntax: /i +h/.
 
i don't know
 
@El'endiaStarman deus ex machina?
 
@uoɥʇʎPʎzɐɹC I don't see how you can plausibly think that human translation and machine translation are about the same quality.
 
5:00 PM
"I am a chicken wearing thirty hats." => "Thirty of my face."
 
@betseg You have a substitution, not a match.
 
@El'endiaStarman lost in translation website shows that the machine only rarely messes up. A rare mess up is chaos
 
Microsoft is an evil company => Microsoft is a bad crowd
 
Virgin woman thing in Bible? it was a mistranslation
 
"Jelly is better than jam." -> "The sun is much better than prison."
 
5:01 PM
@El'endiaStarman yes it is translated by machine
I have photos
 
@uoɥʇʎPʎzɐɹC "the machine only rarely messes up".....yeah right. It's incredibly rare to have a perfect translation by machine.
 
@Dennis it seems that sed does suppoer ?: sed.tryitonline.net/…
 
@El'endiaStarman try the site and see the intermediary translations
Sometimes 10 in the row of the same thing
 
@Dennis i forgot that yeah. i wanted to remove everything except /i\s*h/
 
@seshoumara addressed it @PeterTaylor fixed
 
5:03 PM
@El'endiaStarman oh I realize why you are arguing fiercely... you are an active christian.. but all religious texts are like that
 
@uoɥʇʎPʎzɐɹC You can't really know that since you don't know the languages they've been translated into.
 
I am writing a very long sentence to see how Lost in Translation will mess up => My pain threshold is lost in translation
 
@uoɥʇʎPʎzɐɹC No, I'm arguing because I believe I have a much better grasp of what's involved in translation than you do.
 
Lel
 
5:04 PM
@El'endiaStarman but the machine translates it back into english in the intermediary steps, good enough right? So twice as much oppurtunity for messups. 70%, no messups
@El'endiaStarman you seem like a CS dude
 
@wizzwizz4 you're back! :D
 
"GitHub is perfect for open-source" > "Art is a good start"
 
@MartinEnder Ugh, \? works, yeah. BRE is the worst...
@betseg s/\(i\s*h\)\|./\1/g
 
Gaot => will
 
@uoɥʇʎPʎzɐɹC Not necessarily. I'm almost certain that Google Translate is being used, and that works by statistical inference. Prior human translations are used to get some data on what words and phrases in language A correspond to what words and phrases in language B.
 
My pain threshold is lost in translation = Do not miss the pain threshold changes.
OK
 
@Dennis thanks
 
@El'endiaStarman I mean try out the service to see what I mean
 
Puzzles Golf zip software is a high-quality site, where you can do any programming.
xD
 
5:07 PM
@uoɥʇʎPʎzɐɹC I did. It sorta seems to be a reskinning of a similar website I played with a few years ago.
 
> Welcome to ridiculous programming language with unifications and predicates.
to:
> Specifications of programming and fusion and ignorance are welcome.
 
@El'endiaStarman ah it seems you are right and know more than me
 
@betseg With the -r flag, you can use Extended Regular Expressions, which aren't subject to BRE's escaping madness. s/(i\s*h)|./\1/g
 
@uoɥʇʎPʎzɐɹC I'm not sure why you're being so aggressive?
 
5:08 PM
@Dennis TIL
 
Enter any English phrase here and press Enter => Type the British press
 
if this is about machine translation vs human translation there is no contest. Machine translation is not good yet.
 
^^ proof
-22
Q: Reverse a 1-dimensional array

Erik the GolferNote: This challenge is not the same. Challenge Believe it or not, we haven't got ONE challenge for reversing one-dimensional arrays (although we've got one for n-dimensional ones)! This should operate only on the 1st dimension, not on all dimensions of an array. Rules Standard loopholes are...

-22 xD
 
I speak as someone whose hobby is spotting labels and packaging in other languages that were clearly machine translated while shopping
 
"It's not too little time that we have, but too much that we waste." --> "Not so long ago, but we use a lot."
I like that for a very long series of languages it actually was "We have little time, but we spend a lot."
 
5:12 PM
Huh
 
@TùxCräftîñg This isn't worth any of its downvotes, not even in wood.
 
I mean it was close....
 
Too bad the original and final phrase have to be in English...
 
I take it this thing just iteratively feeds it through Google Translate?
 
I know I feel so bad when I see that question. It seems like a reasonable challenge.
That being said I am not one of the three upvotes
 
5:21 PM
What do you call "An argument made from personal experience"? It's right on the tip of my tongue
 
I got "I am alive" -> "death" ._.
@DJMcMayhem anecdotal?
 
nvmd, I got it. anecdotal
 
as in, the fallacy
 
Haha, ninja
 
5:24 PM
yup, that's what I was looking for
 
@quartata wat? I just admitting starman was probably right
New rendition of an old popular challenge:
0
A: Sandbox for Proposed Challenges

Agent CrazyPythonOpen the browser, polyglot edition. polyglotcode-challenge Your job is to open a browser window of the default browser to https://codegolf.stackexchange.com in as many languages as possible. Your code must open the browser itself, and cannot rely on an open one. Rules Versions of the same la...

 
@wizzwizz4 waaaaaves :3
 
-1
A: Sandbox for Proposed Challenges

Agent CrazyPythonOpen the browser, polyglot edition. polyglotcode-challenge Your job is to open a browser window of the default browser to https://codegolf.stackexchange.com in as many languages as possible. Your code must open the browser itself, and cannot rely on an open one. Rules Versions of the same la...

 
Je parle en français lol => Buy hard to France g-
 
@zyabin101 ?
@zyabin101 That was just my browser starting up. I heard the ping, but I wasn't at the PC.
 
5:34 PM
oh, you are there, wizz!
 
I am now.
 
Play some Space Trader, now? :3
 
@wizzwizz4 did you change your avatar?
 
@ConorO'Brien Unfortunately. I sort-of liked the old one.
 
ah, the avatar changer strikes again
 
5:39 PM
It still displays in some places, but not others.
 
I suppose you're green with envy at whoever got your avatar ;)
 
Woah. V is no longer my most starred GH project. That's kinda weird
 
what is?
 
Brain-flak. Almost 20!
 
CMC: Brainflak interpreter in Brainflak
 
brainflack self interpreter ?
 
@betseg That sounds horrifying
How about a brainfuck interpreter in brainflak?
the [] sounds painful, but other than that not too bad
 
@betseg What's eval in Brainflak?
 
@wizzwizz4 wat
 
5:53 PM
eval in Brainflak.
 
There is none
The only valid characters are (){}[]<>
 
@DJMcMayhem reading readme, (()()())()(){} is 5?
 
@DJMcMayhem So, is eval something like ({>?
 
@wizzwizz4 No, there is no eval whatsoever
 
@Downgoat Cheddar feature-request: a "remove" characters from string and "remove" characters from matching a string
 
5:56 PM
@betseg Well, the ()(){} part of that evaluates to 5, but the program does nothing.
Actually, I think the entire thing evals to 8
 
@DJMcMayhem :-)
Any easter eggs?
 
getch a
print a
copy -2 0 1
 
> (()()()) Will push 3
 
^^ near cat in my new language
 
 ( () [] {} )
(  () [] {}  )
 ( () [] {} )
 
6:00 PM
(it dont stop on eof or C-c or anything)
 
> if we had a '3' ()(){} would evaluate to ... which would evaluate to 5.
@DJMcMayhem ^ and ^^^^^
 
@betseg Yes. But just evaluating so something doesn't do anything. If you did (()()())(()(){}) that would push a 5. What are you trying to do?
 
Oh true right
I'm not trying to do anything im just looking
 
You should try multiplying.
 
@ConorO'Brien example pls?
str.sub(Regex { "abc", "cg" }, "");
 
6:03 PM
what's /c?
 
@ConorO'Brien matches literally
 
@DJMcMayhem no thanks
 
wait did you remove regex literals
 
e.g. /./c matches a literal .
@ConorO'Brien no
 
@Downgoat yeah, that's it. Also another one without /c
 
6:05 PM
@betseg Subtracting two numbers? That's a little easier
 
@ConorO'Brien actually since I'm working on classes I'll be making extend blocks soon
e.g.:
extend String {
    removeChar(chars: string) {
        ...
    }
}
that way I can write cheddar stdlib in cheddar :D
I'll do that though before so i can stop writing stdlib in JS
 
I thoguht you started on it in C++?
 
Cheddar C++ will be finished like never :P
 
@DJMcMayhem you wrote ([{}]{}) but shouldn't it be ({}[{}])
 
@Downgoat oh
 
6:10 PM
Either one. Depends on if you want a-b or b-a
 
print 72
print 101
print 108
print 108
print 111
print 44
print 32
print 87
print 111
print 114
print 108
print 100
print 33
hello world in Copy
 
:/
 
are there not variables in copy?
 
yes there are variable
 
set a variable to 108?
 
6:13 PM
add a 108
the only arithmetic operations are addition and negation
 
Why is there a russian title on TNB when you search it on google?
> The Nineteenth Byte - Stack Overflow на русском - Stack Exchange
 
:-/ ^^^
 
to set a variable to zero:
add tmp a
negate tmp
add a tmp
 
:/ :/ :/
 
infinite loop:
copy 0 1 1
 
6:17 PM
is it a self modifying language?
 
not really
you can copy and remove code, but not modify it
 
> u wot m8
 
+1 for ruby
 
6:25 PM
though technically you should put the Copy class outside of the main file, so that people could actually use the class
 
yeah
i gtg for now but i will push a fix later
 
6:50 PM
back
pushed
 
whoa, nice idea
 
23
A: Is there a "main" method in Ruby like in C?

dantswain@Hauleth's answer is correct: there is no main method or structure in Ruby. I just want to provide a slightly different view here along with some explanation. When you execute ruby somefile.rb, Ruby executes all of the code in somefile.rb. So if you have a very small project and want it to be ...

irb(main):007:0> Object.ancestors[0]
=> Object
u wot m8
a wait nvm a class automatically inerith itself
 
7:17 PM
@Downgoat I would not recommend using /c for that
 
@quartata ?
 
/c means something else in Perl (and I think Ruby too)
also /l makes more sense character wise
 
Those forward slashes should probably be back slashes.
 
Talking about regex flags
or at least I thought
 
7:22 PM
Oh, I see.
 
quality
 
10/10
 
huh
CMC: Primality checker in Copy
 
@ConorO'Brien you little....
:P
 
Hello
 
dont say olleH dont say olleH
 
What's the polite to say "my last six answers have no votes (up or down), please have a look at them?"
 
7:42 PM
gimme upvoets
2
 
Thank you Tux. What he said :D
 
Please note that tux's perscribed method will likely come with complimentary downvotes...
 
give him lifetime warmth
 
I wont downvote though
 
@Sherlock9 your last six answers were all posted within the last 24 hours... don't expect a lot of attention on weekends.
2
 
7:46 PM
Thank you kindly
Ah right. Thanks for the heads up Martin
 
2 stars on my message o_O
 
CMC: Reject this CMC
 
No you're not going to reject this CMC?
Thank you for doing the CMC
 
@TùxCräftîñg Well, I thought your message was amusing and someone else starred that message before me, so I starred it, as well
 
7:50 PM
............. ._. — Maltysen Sep 18 at 18:20
this comment
 
Oh that
No idea what's up with that
 
@MartinEnder Isn't the weekend the best time for writing weird, unreadable golfed code?
 
Hm, my last 7 answers have been posted in the last 24 hours. 1 upvote total.
Writing, yes
Reading, perhaps not
 
@DJMcMayhem sure, but there is still a lot less activity on PPCG
 
At work may be a better more common time
Nuts, I've forgotten the Markdown again
 
7:51 PM
@Sherlock9 Dashes
 
@RohanJhunjhunwala Python: f=lambda x:f(x)?False:True
 
Tree of em
---Foo--- bar
 
@Sherlock9 rip markdown
 
@Sherlock9 ^^
 
Halle-freaking-lujah
Thanks DJ
 
7:52 PM
Hahaha
 
@wizzwizz4 how does that reject the CMC?
 
by not doing it
 
@RohanJhunjhunwala True is "Do the CMC", False is "Reject the CMC".
 

« first day (2065 days earlier)      last day (2782 days later) »