« first day (1443 days earlier)      last day (3491 days later) » 

user1804599
1:00 PM
If I meant "horrendously ugly" I would've said "horrendously ugly," not "beautiful."
 
I simply implicitly corrected you in my head
 
I'm confused what does that mean...
couldn't it simply write 0 instead of 0^T
I'm so going to fail my exam tomorrow
 
user1804599
@LoïcFaure-Lacroix Maybe it was generated by a computer program that doesn't know about transposing scalars!
 
user1804599
@LoïcFaure-Lacroix I agree with the CoffeeScript, C# and Ruby parts.
 
user1804599
Scala, Clojure, Lua and Perl are MY PRECIOUS.
 
1:08 PM
hi
 
user1804599
Guten Tag!
 
user1646075
1:29 PM
Authoring a library doesn't make you an expert. It probably makes it easier to embarrass yourself though. Just ask David Heinemeier Hansson
 
Bunning Thornleigh is charging more for some same items than bunnings chatswood ... the sad part is that I have only found out this after I purchased the items from Thornleigh store :(
 
user1646075
don't they have a 'if you find it cheaper elsewhere....' policy?
 
their own stores? what, that they did not know?
 
Any regex experts in here? I want to remove //... and /*...*/ style comments from a string.
private val comments = "//.*?\n|(?s)/\\*.*?\\*/".r
Anybody see a problem with this? Apart from being unmaintainable, of course, being a regex and all? :)
 
user1646075
@chmod711telkitty if it was more than a few bucks I'd be having a major spit.
 
1:34 PM
altogether maybe some $20 dollars difference
 
user1646075
@FredOverflow almost deserves a link to that 'can't parse XML with regex' page
 
not enough to have a rort
 
user1646075
@FredOverflow what exact regex engine?
 
@aclarke Since comments to not nest in C, there should be a working regex solution, right?
@aclarke Scala, which uses the Java engine, I assume.
 
I am amazed though ... thought they had a flat price for all stores, all stores in Sydney at least. But they don't ...
 
user1646075
1:35 PM
@FredOverflow eek - is that POSIX compat? that engine gets rude
 
user1646075
What does (?s) do in Java
 
user1646075
oh - allows . to match newlines?
 
user3010322
Hey, guys.
 
user3010322
I have 2 template structs
 
user3010322
I want to use them with each other
 
user3010322
1:37 PM
Is there anyway way to do that without moving the implementation of the function down below both structs?
 
@aclarke yes
 
user1646075
looks good all round then. the big Q: does it work?
 
user1804599
@FredOverflow //.*?\r|/\*.*?\*/
 
user1646075
is that java?
 
user1804599
Does Java use PCRE? If yes, then yes. If no, then I don't know.
 
user1646075
1:43 PM
@rightfold also, misses multiline /* .... */
 
user1804599
. matches newlines.
 
user1646075
@rightfold only if told to - and in this case, the one before | does NOT want to multiline
 
user1804599
Depending on the options you use, perhaps.
 
@ThePhD No, I think.
 
@rightfold In Java and Scala, you specify with (?s) that . should also match newlines. It doesn't otherwise. I've tried.
 
user1646075
1:53 PM
you must have the entire file in one big string, rather than doing a line-by-line read?
 
user1804599
@FredOverflow ok
 
@aclarke The parser combinator library already gives it to me as one large string.
@rightfold What is \r?
 
user1804599
Newline.
 
user1804599
No idea why they use \r and not \n. vOv
 
And what is \n then?
 
user1804599
1:54 PM
No idea!
 
According to the Javadoc, \n is newline.
 
user1646075
\n is newline. \r for carriage return - should be using $ or \Z if supported
 
user1804599
I don't know about Java's regex dialect.
 
@FredOverflow I'm pretty sure it can't be done with any hope of correct behavior. Just for example, if your code contains a string literal that happens to itself contain //, that should be ignored, but I'm reasonably certain an RE can't maintain the state necessary to make that determination (correctly).
 
user1646075
@FredOverflow groovy.
 
user1804599
Regex dialects that aren't Perl's or PCRE's must DIAF.
 
user1646075
@JerryCoffin that's a fine point actually
 
@JerryCoffin The language I am using does not have strings. But that's a nice observation :)
 
user1804599
@JerryCoffin IIRC Java's regexen are Turing-complete, and such a thing should be possible.
 
But my gut still says it should be possible even with string literals.
 
user1646075
1:57 PM
no NOT \Z forget i said that
 
user1646075
yeah, if you're free from false positives you're just about there. Test!
 
user1804599
Here is how you check whether a string is a palindrome in Perl: if ($str =~ /^((.)(?1)\2|.?)$/) { … }. :)
 
user1646075
ignoring escaping and quoting:
//(?m).*$|(?s)/\*.*?\*/
 
user1646075
java looks like it will support the m so you can use $ in the pattern which is generally preferable. it hides all crimes of line termination
 
@FredOverflow Given all the crap they've stuffed into "regular expressions", I suppose it may be--but if so, they really shouldn't be called regular expressions any more.
 
user1646075
2:00 PM
and will leave your \n or \r\n intact as per the dos/unix nature of the file
 
@rightfold And how do you do it in a non-shitty way?
 
user1646075
@Puppy ummm, a simple for loop might work
 
@JerryCoffin Strictly, a regular language certainly can, but IDK if REs can match all regular languages.
 
user1804599
@Puppy if ($str eq reverse $str) { … }
 
user1804599
@aclarke lol a for loop
 
user1646075
2:01 PM
@rightfold look, it's past midnight where I am ;-/
 
user1646075
anyway, a for loop would be FASTER!
 
user1646075
early exit!
 
user1804599
Isn't making calls to POST, PUT, DELETE, GET and request or tracing status of request will be easier whit that ? .. i am completely ok with not using OOP, but if you have some examples that will help a lot .. it's just i want to write something re-useable .. — user4088059 1 min ago
 
user1804599
lol what a moron
 
@MartinJames ugh
 
user1646075
2:03 PM
@rightfold I like it when people ask the right question cough cough cough
 
@FredOverflow I would suggest using something like //[^\n]*\n for the first part.
 
user1646075
@CatPlusPlus Hey cat, how's the head?
 
user1646075
@VáclavZeman A regex pro would laugh at using [^\n]
 
user1646075
because dot
 
@VáclavZeman What difference would that make?
 
2:07 PM
@aclarke Floaty
 
user1646075
still swimming in ethanol?
 
user1804599
@FredOverflow None.
 
user1804599
//[^\n]*\n is equivalent to //.*?\n.
 
Depends on the mode
 
user1646075
not quite
 
user1646075
2:09 PM
[\n]* is equiv of . not .*?
 
user1646075
greedy, non-greedy. I like how java calls that 'reluctant' - never heard that word used in Perl or PCRE.
 
@rightfold It is not equivalent. There is backtracking involved if the regex does not match in case of .*?\n but there is AFAIK no backtracking possibility for [^\n]*\n
 
user1804599
@aclarke Did you ever hear of backticks?
 
user1646075
@rightfold if that's advice for my horror here - THANKS!
 
user1646075
@VáclavZeman EVERYTHING backtracks in regex
 
user1646075
2:11 PM
unless you use the magical operators in PCRE (and maybe other engines) that short-circuit backtracking on command
 
@aclarke I do not think that is true...
 
user1646075
@VáclavZeman I do. I've used re for more years than I care to admit. My first editor was driven by regex - none of that fancy-pants arrow keys and wysiwyg
 
user1646075
and the worst thing we're doing here, is not discussing using a mini-parser with a tokeniser - but that depends on the complexity of Fred's language.
 
user1646075
I've made a lot of top-down parsers with re for tokeniser and then a simple state machine
 
user1646075
the thing that makes the "now you've got two problems" thing so true about regex is because so many people try to do an entire parse with one pattern
 
user1646075
2:21 PM
so, as i was trying to say above: [^\n]*\n is the equiv of .*\n not .*?\n
 
user1646075
YAY! i got it. Thanks, @righty
 
user1804599
The rules clearly state that you can do that, by the way.
 
user1646075
@rightfold rules? what rules?
 
user1646075
heh
 
user1646075
2:24 PM
but i have a short attention span
 
user1646075
actually, it's the help hth
 
user1646075
oooo - the rules have words. My apologies.
 
no.
 
user1646075
no?
 
user1804599
@aclarke You were not fast enough.
 
user1646075
2:28 PM
 
user1646075
@rightfold trying to get drunk on 1/2 bottle of white wine here. please make allowances.
 
52
Q: Reference - What does this regex mean?

HamZaWhat is this? This is a collection of common Q&A. This is also a Community Wiki, so everyone is invited to participate in maintaining it. Why is this? regex is suffering from give me ze code type of questions and poor answers with no explanation. This reference is meant to provide links to qua...

Wow. I would not have guessed that regex was such a complicated topic! 369 questions linked to/from that question.
 
@aclarke Unless your weight is like 20 kg, that is not going to happen.
 
user1646075
@FredOverflow what rock are you hiding under?
 
user1646075
@VáclavZeman ;-( - I know. One gulp, it's almost gone.
 
2:32 PM
@aclarke The rock is labelled "Regex is no more complicated than [a-zA-Z_0-9]+" ;)
 
user3010322
WTB T&&& for universal references.
 
user3010322
Would have been so fucking clear and made so much sense.
 
user3010322
Plus, the idea fo REFERENCE COLLAPSING would actually be visibly clear
 
user1804599
It's so stupid Python's batteries included standard library still doesn't have recursive globbing.
 
user1646075
regex - the final frontier
 
2:32 PM
@Puppy I'd have to do a fair amount of work before I was sure a regular language could do that. From what I can recall, the formal definition of a regular language only allows a single character, union, concatenation and Kleene *. You can do a surprising amount with those, but the limitations can also be somewhat surprising.
 
@ThePhD What does TWB mean?
 
user3010322
"Depending on what T is, you can lose 1 or two of the & symbols"
 
user3010322
@FredOverflow Want to Buy
 
Oh yeah, &&& would have been nice.
 
user1804599
@ThePhD But it's already an lvalue reference to an rvalue reference!
 
2:33 PM
Probably too late to introduce it now :(
 
user3010322
Too late indeed.
 
@rightfold no such thing as a reference to a reference
 
user3010322
@FredOverflow Exactly, which is what would have made it perfect.
 
user3010322
Plus, ti would mean you could provide template specializations for r-value types
 
user1804599
@FredOverflow When I use exclamation marks I'm totally not joking!
 
user1646075
2:33 PM
@JerryCoffin modern regex is acknowledged to NOT be regular expressions. Much like SQL is known to NOT be relational.
 
@JerryCoffin I thought that regular languages encompassed everything that requires only a constant number of previous states to resolve.
 
user3010322
Now, you have to do some ridiculous unqualified-T-in-struct or tag-dispatching on is_rvalue_reference.
 
@aclarke Where exactly is your relationship with regex on the love/hate scale?
 
user1804599
@FredOverflow You wish: ideone.com/GJi4cu
 
user1646075
mostly love. I've committed some big crimes with it. Occasional lapses into caution help a lot
 
2:35 PM
@rightfold That is not C++.
 
user1646075
might be entertaining to track down some of my wildest patterns...
 
user1804599
Caption Obvious saves the day once again!
 
@aclarke I find regexes to be unreadable. Is that just a matter of familiarity and expertise?
 
user1804599
@FredOverflow Yes.
 
@Puppy So #!/usr/bin/perl does not mean "What follows is a C++ program"? Strange world we live in.
 
user1646075
2:37 PM
@FredOverflow mostly. Onc you're fluent enough you can start to break down a big mess ritualistically.
 
@FredOverflow inorite
 
@aclarke I miss the ability to define my own "functions" in regex to split big problems into smaller problems.
 
@Puppy I'd have to look things up to be sure, but I believe that's the whole list of allowed operations. But yes, I believe those are enough to specify any stateless FSM.
 
user1646075
the thing is, a shit-load of activity is squeezed into a few operators.
 
user1646075
@FredOverflow In Perl you can do that, effectively.
 
2:38 PM
@JerryCoffin Stateless isn't quite the same thing, because you can make new states to encompass any constant amount of context.
 
user1804599
@FredOverflow loljava
 
@Puppy You can create a new RE, yes. That's not really a new state (but I think we're at the point that we're mostly disagreeing over words, not underlying concepts).
 
well, I don't know if REs strictly include all possible FSMs, or if they can do so relatively easily.
 
@FredOverflow You are now ready for SNOBOL (or possibly Icon/Unicon).
 
user1804599
@aclarke REBEL
 
2:41 PM
but for a general FSM, you can just have one state for "Seen quote, found quote" and another state for "Didn't see quote, found quote".
 
user1646075
@JerryCoffin Heh - and bypass RE altogether
 
user1646075
@rightfold REBOL you mean?
 
so you can encode a fairly arbitrary (constant) amount of context into each state.
I think that since lexers for C and such have flex grammars, then they should be able to match such constructs.
 
user1646075
@rightfold eek
 
@Puppy REs, FSM and regular language are all equal/convertible.
 
user1804599
2:43 PM
Generating SQL and Python code is fun.
 
user1804599
I also have to generate HTML code. :v
 
user1646075
@FredOverflow this is a sample of building re's on top of other re's in perl
 
user1646075
$ident = qr/\b[a-zA-z_]\w*\b/;
$integer = qr/\b\d+\b/;
$token = qr/$ident|$integer/;
 
dont perl
My throat is destroyed I yelled too much
 
user1646075
@CatPlusPlus Puppy, adjucation please. Is it in the rules?
 
user1804599
2:46 PM
Perl is awesome.
 
@aclarke nice
 
user1646075
@FredOverflow a good way to avoid foul hellishness.
 
@CatPlusPlus It sounds like you had loads of fun yesterday night. :)
 
catnip?
 
2:47 PM
Slightly less fun now
 
Katzenjammer?
 
@CatPlusPlus Will that make you less or more grumpy now?
 
I need orange juice but I'm still drunk
A bit
 
user1804599
Yum, OJ.
 
user1646075
@CatPlusPlus you need a hair of the dog (that bit you). Or should that be, a tongue-wash of the cat that scratched you.
 
user1804599
2:49 PM
O.J. Simpson.
 
@CatPlusPlus Good morning sunshine.
Did you dance enough yesterday?
 
It's neither good nor morning
 
user1804599
nor sunshine.
 
user1804599
What is the ternary equivalent of "both?" "Troth?"
 
He is a sunshine, because he is cute when he enjoys himself.
 
user1646075
2:50 PM
all?
 
@rightfold "all three"
 
@CatPlusPlus You can have a little vodka with that orange juice.
 
Shutup
 
user1646075
SORRY ARE WE TOO LOUD?
 
So cute.
 
2:52 PM
Maybe milk will help
 
user1804599
I have some milk for you. :3
 
Anyway, I'm going for some Bourbon. Let's see how this library is.
Need to jerk off first.
 
user1804599
@CatPlusPlus How long is your tail?
 
user1646075
@Sofffia need a hand?
 
user1646075
2:55 PM
did I really write that or did I just think it?
 
Did you really just write that?
 
user1804599
@EtiennedeMartel No. Pinky Pie is terrible.
 
Seriously Rightfold.
 
user1646075
Righteously seriousfold.
4
 
Wow. float X1 = 44.15.55;. One more dot and we can stuff a whole IP address into a float I guess.
 
3:00 PM
Feb 19 at 19:36, by Cat Plus Plus
I regret everything
its me i told them to post ponies
Stupid fuckin WMP stealing file associations nobody asked it to
 
Thats weird... I got an upvote on an old question that barely got any attention (IIRC its the on that got me the tumbleweed achiev, EDIT: it is)
 
@JerryCoffin I don't understand the question. Is it just me?
 
user1646075
@FredOverflow well, clearly he wants to extract numbers. Duhhhh
 
@FredOverflow No, I don't think so. In particular, I'm pretty sure the OP has nearly no clue of what he wants nor how to express whatever question he may have.
 
@aclarke Maybe he should have the number part of his brain extracted. numb, number, numbest, get it?
 
user1804599
3:09 PM
Pretty sure there are languages where 44.15.55 accesses the member named 55 on the object 44.15.
 
user1804599
lol, OP accepted a wrong answer.
 
user1646075
hah. Since we've been perling, and cat is probably off in the bathroom groaning so he can't complain again, looks almost like a version number token v44.15.55
 
user1804599
This method still returns Unit. — rightfold 12 mins ago
 
user1804599
:<
 
@rightfold Unfortunately, you'll need to narrow that down a lot before any of us has a clue of what you're referring to.
 
3:12 PM
@JerryCoffin There's a = missing. Functions without the = always return Unit.
 
user1646075
@JerryCoffin since bartek is still off in a huff, someone has to keep up the supply of non sequiturs
 
user1646075
@FredOverflow ohhhhhhhhhhhhhhhhhh
 
user1804599
@FredOverflow Such a misfeature. :(
 
@rightfold Yeah, Martin regrets it as well IIRC.
 
user1804599
IntelliJ offered a correction from def f(…) = { somethingReturningUnit } to def f(…) { somethingReturningUnit } in the past. Now it does it the other way around. :)
 
3:15 PM
...How best practices evolve :)
 
user1804599
flatMap(…) instead of map(…).mkString doesn't work :( It returns a list of chars instead of a string. :(
 
.toString
 
user1804599
You mean mkString.
 
You can turn a list of chars into a string with .toString
 
user1646075
you mean "#{x}"
 
user1804599
3:17 PM
s"$x" :P But that's silly.
 
user1804599
@FredOverflow Yes, but that returns "List(…)".
 
Really? Wow.
 
user1804599
scala> List('a', 'b', 'c').toString
res0: String = List(a, b, c)
 
user1804599
scala> List('a', 'b', 'c').mkString
res1: String = abc
 
mkString it is, then.
 
user1804599
3:18 PM
I wish Java had repr and str distinction like Python does.
 
user1804599
And hell, even Ruby.
 
user1646075
@rightfold or "@{[expr]}" for the most general case
 
what is the distinction, exactly?
 
user1646075
repr is a faithful re-interpretable version, str is a nice warm fuzzy stringy viewable
 
user1646075
or vice-versa
 
user1804599
3:19 PM
No, not vice versa.
 
user1646075
phew
 
user1804599
str is like boost::lexical_cast. repr is unambiguous.
 
user1804599
E.g. str(1) and str('1') return the same string, but repr(1) and repr('a') don't.
 
user1804599
repr is for debugging and REPLs.
 
@aclarke Well, repr produces something reasonably unambiguous, anyway. You can often give it to eval to get something like the original, but not always.
 
user1646075
3:24 PM
@JerryCoffin ok - maybe people don't always follow intentions. Then again, it ain't JSON, so probably fair enough. Haven't done a lot of Python, not since I got rid of my Symbian phone
 
user1646075
can I get erlang for Android? Somehow it would just seem so .... right!
 
@aclarke At work we use a fairly hacked-up version of scons for (nearly) all our building, so I get to read Python all too regularly.
 
user1646075
@JerryCoffin looks interesting. Build tools are such a fertile field!
 
user1646075
at least Rake is ritten in rails for real running of relevant ranguage-referent .... ummm ... runnables.
 
user1646075
@JerryCoffin is your software also pythonic?
 
3:29 PM
@aclarke Some is, but most is C++.
 
user1646075
I've noticed a lot of python-love amongst C++ programmers. Is it the Serious Technical look of it?
 
user1646075
written in all innocence ^ ^
 
@aclarke s/C++//
 
@JerryCoffin whouldn't it be simpler to write plugins for scons or use a more modular build tool?
 
@aclarke Although different in many respects, I think Python is a lot like C++ in terms of overall character. The primary guiding principle in both cases is pragmatism, rather than purity or adherence to some high principle. Likewise, both are quite explicitly oriented toward specific (though large) niches.
 
user1646075
3:36 PM
@JerryCoffin and also, avoidance of wild-ass flights of fancy! It's interpretation of generators scares the crap out of me, however
 
@LoïcFaure-Lacroix It might be, but that's not how things have been done. By the time I started working here there was a pretty long history (not to mention some strongly-opinionated people).
 
I think hacking up something is pretty bad unless you'd want to merge it back into master
 
user1646075
@LoïcFaure-Lacroix which, coincidentally, is probably what cat is doing right now.
 
years ago I was pretty fan of WAF build tool
 
user1804599
3:52 PM
@aclarke the C++ guys sometimes need something that isn't utter shit, in order to keep sane.
 
@LoïcFaure-Lacroix How very strange. I thought you were a programmer, not a pretty fan.
 
user1804599
That fan isn't very pretty.
 
@rightfold I'll take your word for it. I just picked one of the first pics Google turned up for "pretty fan".
 
lol, wrong window
 
@TonyTheLion What does e mean? Were you playing a game? :)
 
3:55 PM
@TonyTheLion Damn. I thought we were doing free association again.
 
Someone go here. It's a webGL experiment, set it at 4000 fish and tell me your FPS
 
@FredOverflow You've programmed this long and you don't know that e means "exponent", as in 1.23e4? Shame on you!
 
user1804599
@FredOverflow the pi*i-th root of -1.
 
@Nooble 18 on average
 
@Nooble 60
 
3:57 PM
@Loopunroller at 4000 fish?
 
No, actually about 55 on average
@Nooble Yes
 
Nice
I get 54 on average
 
Well I feel like a failure xD
 
@FredOverflow I was about to write else, because I thought my code window had focus
which it didn't
 
And then you panicked and pressed Enter?
 
3:58 PM
@OMGtechy Yeah it's tough on your browser, especially if you don't use chrome.
 
@Nooble I do use chrome :(
 
@OMGtechy Do you have an actual dedicated GPU?
 
Yep, R9 270X
 
Huh. My laptop runs this at 34 fps, with a GTX860m
 
I can run sleeping dogs without a problem, but not this haha
 
3:59 PM
It's the 4000 fish man, fish are real hard.
 
such swim
 
very water
 
@Nooble want full specs?
 
It depends on a browser more than GPU
 
user1804599
@TonyTheLion And the moral is that one should not use else.
 

« first day (1443 days earlier)      last day (3491 days later) »