« first day (597 days earlier)      last day (3195 days later) » 

5:35 AM
Wow @xxx You've given 1300 rep away as bounties!
 
 
3 hours later…
8:27 AM
!important
63
Q: Javascript + Unicode regexes

AmitDoes anyone know of any JavaScript libraries that support Unicode-aware regular expressions? For example, there should be something akin to \w that can match any code-point in Letters or Marks category (not just the ASCII ones), and hopefully have filters like [[P*]] for punctuation etc.

 
user652649
morning @CSᵠ
 
user652649
yesterday, by Wesley Crushed
guys how do i write, for example [\p{S}] except the "+" character?
 
morning
 
user652649
i have two preg_match that i want to merge if possible:
 
user652649
if(!preg_match('/^[' . $allowUnicodeGroups . ']+$/', $filename) || preg_match('/[' . $disallowedChars . ']/', $filename))
 
8:30 AM
(?![+])[\pS]
that's a way
 
user652649
"@^(?![$disallowedChars])[$allowUnicodeGroups]$@i"
 
user652649
?
 
yup
nailed it
 
user652649
cool :D
 
preg_match('((?![' . $disallowedChars . '])[' . $allowedChars . '])i', $filename)) @WesleyCrushed
bettr
 
user652649
8:33 AM
yea
 
notice the parens, you generate this with php, and a @ would screw you up[
 
user652649
preg_quote() :P
 
user652649
what do i search for understanding what (?!) does?
 
@WesleyCrushed negative lookahead
 
user652649
thanks
 
8:54 AM
@HamZa it should be more efficient using a neg lookbehind in this case i think...
 
@CSᵠ well I didn't even check the situation :P
 
neither did i
but looks like that
 
hehehe
 
if you exclude a few only, it would backtrack more with a lookahead
and it's a fixed length 1 char
lookahead:
lookbehind:
yup
it is indeed
cc: @WesleyCrushed ^^
 
user652649
performances?
 
9:03 AM
yup, #2 is bettr
first match what you need, then discard what you're not interested in
vs. match anything that is not what you want to discard (a lot in a general usecase), then see if it's also what you need
~2-3x improvement on those testcases...
 
user652649
updated :P
 
user652649
thanks
 
user652649
there's a profiler on regex101? can't see it
 
debugger
 
user652649
i mean to see which ones faster
 
9:08 AM
@WesleyCrushed click 'regex debugger' link on the left menu
 
user652649
ah cool, so less steps = better :D
 
user652649
good to know
 
ofc
 
user652649
php will never stop impress me (negatively) php.net/password_hash
 
user652649
> Returns the hashed password, or FALSE on failure.
 
9:11 AM
yeah, we should revolt really
 
user652649
how is possible that a function like that can fail? and more importantly
 
on failure there are only 2 valid/sane(as some like to call this) options: ERROR and Exception
nothing else
 
user652649
why doesn't it trow a notice
 
no null, no false, no 0
 
user652649
9:12 AM
instead of returning false
 
but... php is Weak
and that might be desired functionality
 
user652649
i can live with weak
 
user652649
but i can't understand the "failure" of a function like that
 
eg. 'my.... code... will... live... on... past... any... shit...'
fuck
 
user652649
without explicitly saying what can fail
 
9:14 AM
try { pass_hash() } catch Exception $shit
instead (pass_hash!==false)
 
user652649
exactly. it should trigger an error, not return false
 
@HamZa THAT is the trick :) cool
knew it, but was much simpler to do it the ol' fashion way
but that's the way
bit counter intuitive to double negate, but it's awesome sauce
fwd
 
9:30 AM
@CSᵠ What about it?
 
@Unihedron js sux :))
 
@WesleyCrushed Less steps does not always mean it takes less time to match. Depending on the implementation or engine. For example, \d is faster than [0-9] in Java, the debugger fails to reflect this.
inb4:
2
A: Atomic groups clarity

Unihedron Author note:     This answer targets question 1 as delivered by the bounty text "I am looking forward to the exact reason why more steps are being needed by the debugger.I dont need answers explaining how atomic groups work.";     Jerry's answer addresses the other concerns very well, while...

 
@Unihedron ;)
 
:)
 
and that gives me a thought... answer in 140 characters or less, because TL;DR!
 
9:42 AM
@CSᵠ And use useful formatting.
 
user652649
@Unihedron there's an italian way of saying that asserts "only the actual necessity to do something makes people genius"... -> i'm wondering what you guys had to solve with regex to get this level knowledge :D
 
user652649
ahah
 
10:43 AM
@WesleyCrushed curiosity? :)
btw, nice saying you guys have
 
user652649
:D comes actually from latin i think, it's really old
 
user652649
ah... also english, slightly different tho
 
user652649
necessity is the mother of all inventions
 
user652649
latin: mater artium necessitas
 
@Unihedron too much awesomeness !
 
10:47 AM
@CSᵠ :)
 
@Unihedron now... is this possible in PCRE ?
 
@CSᵠ Does PCRE come with balancing groups?
 
didn't read the solution, spoilers
 
 
7 hours later…
5:28 PM
@Unihedron no, PCRE doesn't have balancing groups
 
@HamZa Thanks.
Then as a deeper thought, is it possible to use some of PCRE's advanced recursion features to achieve mid-dynamic balancing tasks, like detecting if a string contains more uppercase characters than lowercase with PCRE syntax?
 
@Unihedron it would suprise me if that's possible...
 
I got somewhere last time messing around with Jan.

Typical day writing regexes

Oct 16 at 14:01, 38 minutes total – 79 messages, 7 users, 0 stars

Bookmarked Oct 16 at 14:49 by Unihedron

@HamZa Maybe you can improve this: regex101.com/r/wW9tL2/5
 
@Unihedron haha sorry man. I'm not in the mood right now. When I saw that big/long regex I thought I need to sleep :P
 
@HamZa :P
 
5:36 PM
one small tip:
If you can use the x modifier, then try to use newlines/spaces to make the regex a bit more readable. Adding comments would be a nice extra bonus
 
Thanks for protip
 
@Unihedron I think with a callback would be possible but that's cheating :P
 
@Unihedron that's some ugly sonofa :)
 
xP
I'm 100 rep away from 5k! :)
I'll get to unlock... Reviewing tag edits, really? :(
 
i'm 19points away
since 2 days ago:)
lol
 
5:41 PM
Edit 10 approved tag wiki / excerpt edits, and you'll get 20 rep.
 
yeah, lol
 
Public service advertising:
in Java, 40 mins ago, by Unihedron
How much net score and views does each character in your answers among various tags bring you? Find out with this query! ;)
 
what is that good for? why? what's better?
 
@HamZa That's... Not matching with PCRE syntax, but ok :D
 
5:45 PM
@HamZa nice...
but.. no cigar
 
hahaha
 
:D
I want 10k!
 
Maybe we should make a DFA and then transform it to a regex...
 
i would have done it without regex,, but that is very nice allowing unicode
 
@HamZa What's a DFA? sorry imma nub
 
5:48 PM
@HamZa mb_count_chars() comes to mind
 
@Unihedron I don't even know what it is exactly. I know how the chart looks like and it's awesome...
 
...
 
@Unihedron so i have 388 cps for php
 
Anyways, I don't think it's possible
 
Deterministic Finite Automata?
i may have misspelled
 
5:50 PM
@CSᵠ 554 here
 
No, I mean to check if lowercase_c > uppercase_c with pure regex
 
CpS is Characters per Score (HTML body), CpV being Characters per View (HTML body, rough anti-popularity; If this is high it means you've put too much effort into what people don't read)
 
@Unihedron or... or... you may need to explain it better, and simpler
make it so you gran`ma understands it and everything's awesome
 
.net -> 1332 CpS lolwut
 
.net 1020 cps
lol
 
5:52 PM
@CSᵠ That's kind of funny since my grandma has passed away quite a long while ago.
 
Also sort by CpS :P
 
asset-pipeline 1407 CpS
 
@Unihedron figuratively speaking
sorry for your loss
 
enums 2416 CpS (?!?!?!)
 
both of mine too
 
5:53 PM
@CSᵠ No worries, I'm not upset by it :) )
 
@Unihedron hmmm I think it's a general saying which means "make it as simple as possible"
 
@HamZa I know, the idiom just happened to be word-able. :P
 
wow, i have an answerr in R
:D
 
CpS 1457 wow
 
validation 71 CpS :)
inb4:
 
5:55 PM
1
A: Remove US zip codes from a string: R regex

CSᵠRegEx with LookArounds: (?<![0-9-])([0-9]{5}(?:[ -][0-9]{4})?)(?![0-9-])` Live demo: http://regex101.com/r/hU9oK4/1 The stuff we're after: [0-9]{5} is the most important part, looking for exactly 5 digits (?:[ -][0-9]{4})?) optionally followed by 4 more BUT only if joined by a space...

@Unihedron lower == bettr?
 
@CSᵠ Yep, it means you write more critical posts and people upvote you more than from other fields, it's theoretically proportional
@CSᵠ Aww, out of upvotes.
 
@Unihedron lol, what?!
dude
you are way too active
if that's even a thing
 
I told you, I'm almost first on the league of participation stackoverflow.com/users?tab=participation
 
There was a time when I was out of up and close votes :P
 
@HamZa Happens to me 6 days out of 7, and I never have a day with close votes remaining :)
Aaand I'm out of comment flags.
 
5:58 PM
lolwut
 
lol, what?
how many are those?
 
100/day
 
10 or so?
funk!
what do you hunt with to flag comments>?
 
Obsolete and rude comments
 
ok I don't want to be mean but you might invest better in your time. Really, it's not worth it. I know it's difficult. Try to find something interesting to work on or workout or even get out outside and do something else.
 
have a tool?
 
in Tavern on the Meta on Meta Stack Exchange Chat, Oct 18 at 13:40, by Infinite Recursion
@Uni, how do you manage to balance everything? Talk in all SE/SO chat rooms, 112 SE accounts, so many area51 commitments, Smokey and Pham on git...play chess...omg!!
Don't worry about me. :)
 
@Unihedron Just saying. At least I tried to convince you. Later on please don't blame me :P
 
@HamZa interestingly enough... I got a job offer bc SO (turned it down :D) and rep here kinda paid off in a sense
 
@CSᵠ Some comments are programmatically not constructive, (too short and include boring keywords like "accepting"), they get nuked, otherwise just flag them normally and a mod will handle
 
6:01 PM
@CSᵠ seriously? The rep did help you?
 
@CSᵠ I want a proper job. Jobs are hard to get. :(
 
not sure if really rep, but having it in the K's surely helped
maybe it was the answers
some of them at least
not sure, but really cool stuff
 
Yeah, some of them are really deep
 
the job offer was when i was in the top 0.something% active users
turned it down because.. jobs mostly suck, it's hard to find a great interesting one that also pays
 
in The SO Tavern (Free Snacks), Sep 10 at 9:40, by Stijn
@Unihedron doubt it. I found most colleagues are aware of SO as a resource but don't participate, and managers/recruiters don't know it exists.
in The SO Tavern (Free Snacks), Sep 10 at 9:32, by Unihedron
37
Q: Would you consider SO 'reputation' valuable at interview?

SobriqueFollowing on from: Is it legitimate to "buy" Stack Overflow reputation? Prompted the question - would you consider Stack Overflow reputation something relevant to the job application/interview process? (And similar assumption elsewhere on Stack Exchange where professionally relevant) It hadn't ...

Oops, wrong order.
 
6:04 PM
huh?
 
@CSᵠ at least you don't work in a DIY shop or in your local supermarket :P
 
and.. SO also helped me learn... like fast... faster
@HamZa i have tons of hobbies also
 
@CSᵠ Stack Overflow is a kindergarten. A well-designed one.
 
i like DIY
 
@CSᵠ Lately I'm really dedicated to training (calisthenics)
 
6:06 PM
@Unihedron that reminds me... there's a user who feeds vamps @Bahmar or something
 
@CSᵠ hahaha Barmar
 
has 120k+ rep
and still feeds them
awful
 
Barmar, Arlington, MA
142k 12 54 103
 
Please censor vamp feeders' names, it disgusts me to see. :)
 
Oh he went to 140 lolz
 
6:07 PM
be careful invoking his name 3 times
lol
 
i got sick on some answers he wrote on stupidest questions ever
 
@CSᵠ well one of the reasons I stopped moderating :)
 
and he left a mark somewhere on me brain
 
@CSᵠ Don't look at those disgusting posts! Close your eyes! Terrible!
 
6:08 PM
INB4 We need some top help vampire list
 
i mean.. i don't mind if a new user does this, eventually he/she will get on the right track, there are plenty of tools to help users, no need to feed the fish stupid
 
@HamZa pls censor, my eyes will bleed!
 
but a user after some K doing it, it's just plain WRONG
 
Lately I've been doing some Java and C. Which is great! I'm finally releasing myself from a weak language like PHP :P
 
Reminds me of that other comic. :)
 
6:10 PM
fuck, and you picked Jabba because if that?
lol
 
@CSᵠ HamZa can be seen in our room sometimes. :D

Java

Dedicated to the discussion of the Java programming language a...
As seen from the graph, it's a quiet hour.
 
i wanna pick it to write some android stuff
i'd like to do it in JS+html(5)+css if possible
but seems like a pain so far
 
@CSᵠ Because school is obsessed with Jabba! I'm now working on a simple android app, sockets -> C -> robot
 
still juggling
 
I'm a junior at web dev :)
 
6:11 PM
@Unihedron get out!
 
in The SO Tavern (Free Snacks), 3 hours ago, by Unihedron
We need our own http://cv-pls.com/, @ProgramFOX @Sam :)
^ What I want to do
 
just a tip
 
@CSᵠ those app are so terribly slow. I've worked with phonegap (cordova) and linked it to a webshop (prestashop)
 
What I have:
 
@HamZa how's phonegap?
 
6:12 PM
<!DOCTYPE html>
<head>
  <title> hi </title>
</head>
<body>
  <p>hi</p>
  <p>hello world</p>
</body>
 
web dev'ing is going to hell soon
 
@CSᵠ it's easy but again slow.
 
in a short while it will be a jungle out there
 
also setting it up was a pain
 
I gotta go to sleep, it's 2 am and I have school tommorrow / later today. Bye!
 
6:13 PM
there will be some time till people seeking good web dev are going to understand this
 
@Unihedron Really nice if you typed it out from your head :)
@Unihedron cyaa
 
@HamZa No, that took me half an hour.
 
programming is harder, do harder! bc it's harder to fake
 
I was trying to use a title="hi" all the time.
 
@HamZa it's still a pain for me (ubuntu, won't move to win* unless i'm dead)
@Unihedron ROFL
 
6:14 PM
@Unihedron haha Java logic :P
 
:)
 
and now it's on the wall of shame :P
 
unset()
:)
 
@HamZa This room has to be one of the most on-topic rooms, sucks to see something like that getting starred. :)
 
@CSᵠ Even on windows it was a pain. I can't imagine what you're feeling!
 
6:16 PM
PAIN
ohh the PAIN
 
OH PAIN
 
yeah... PAIN :(
 
PAIN PAIN PAIN
owww PAIN
why are we doing this?
 
but anyway, i need to learn Jabba anyway
lol @uni
 
@Unihedron haha I know :)
 
6:19 PM
@Unihedron btw, i've put it on my CV, and it was asked about at some interviews, it did amaze i can tell you, everybody uses SO, nobody contributes (and this is a great point to see what company you're trying to get to work)
if some of the devs are contributing at least a bit, there's hope
 
@CSᵠ so you python?
 
otherwise... little red flag
neah
tried it a few yrs ago, can't say i do it at all
 
@CSᵠ Everyone copies from the Internet. The people who writes code are wizardary to others. That's why this room exists.
I mean, who even bothers getting the 20 reputation to ask here instead of dumping another question? :D
(Anonymous users, I'm looking at you)
 
yeah..
we've been getting a lot of kibitz around here..
 
Oh he dropped off the shelf as I said that.
 
6:21 PM
strange
 
ah ok. The "so" was a typo. I meant "Do".
Anyways, this seems interesting kivy.org
 
maybe some of us are followed
 
Maybe it's hunting season
 
@CSᵠ we really need to let @Unihedron go and sleep. Good bye :)
 
^^
Bye!
 
6:23 PM
@Unihedron goto sleep;
invoke exit()
BYE
@HamZa interesting... would want to see how much overhead it uses
i just hate strapping unknown shit to my spaceships
re @Unihedron
welcome back
coffee?
 
The velociraptor is innocent.
 
what?
lolwhat???
 
Your goto showed up as I put my computer into hibernate, had to make that xkcd reference. :)
 
lol
 
6:27 PM
have a great night sleep and rest @Unihedron
 
Thanks! Enjoy your day!
 
lolraptor
 
roflcopter
 
@Unihedron yees, there
hmm, i have only 20 flags
and, when i flag the comment, it also disappears
strange ^ ?
 
7:04 PM
Your number of flags = min( 10 + round( rep / 2000 ) + ( helpful flags - declined flags ) / 10, 100)
Comments that are programmatically not constructive (cuss words, begging for accepting, etc) is nuked on one flag, otherwise your flag is in queue for mod to review
@CSᵠ
 
wow, nice
how much rep you need to activate that?
btw, weren't you going to sleep()
 
Activate what? I just have lots of helpful flags
Like over 5000
 
wow, such power
i meant after how much rep?
this wasn't before, and i'm at almost 5k
 
Yeah well your ping became an inbox notification which made my phone rang and woke meh
 
@Unihedron dude, wtf
lol
tech
 
7:08 PM
You don't nume comments by having high rep. It's the programmatical criteria of comments.
like "What have you tried for this?"
 
hmm...
going 4 marshal then
:D
 
I deserve 10 marshal badges.
 
you don't !
you deserver 10 fanatic badges
and a mega-fanatic one
 
7:27 PM
helpful flags 128
 
helpful flags 5042
 
try { /*to*/ } catch SleepException @Unihedron { sleep(300); }
 
7:57 PM
in SO Close Vote Reviewers, 2 days ago, by Unihedron
I'm out of d/uvs, comment flags, close votes and enthusiasm, so good night!
 
8:54 PM
!!nono
 
@CSᵠ That didn't make much sense. Use the !!/help command to learn more.
 
@CSᵠ Command nono learned
@CSᵠ Command nono learned
@CSᵠ Input not matching /http:\/\/www.youtube.com\/watch?v=8mKIuZ4tIzk'/. Help: User-taught command: '<>
 

« first day (597 days earlier)      last day (3195 days later) »