« first day (1847 days earlier)      last day (3100 days later) » 

11:10 AM
hello
 
user3119231
is there regexp to return only the money-number from this: <b>600 $ (15 CPRs)</b>
 
@AwalGarg i came out with a solution finally
 
5
A: RegExp for validating PRICE

CSᵠRegExp for validating Price Fields: /^(\d*([.,](?=\d{3}))?\d+)+((?!\2)[.,]\d\d)?$/ Explained demo: http://regex101.com/r/uG5lI0/1 Javascript code to validate: /^(\d*([.,](?=\d{3}))?\d+)+((?!\2)[.,]\d\d)?$/.test(input) Will validate only if in correct format, with dots or commas in their re...

 
crl
I can't get the DnD dataTranfered thing on dragEnter :<, only avail onDrop, need it output.jsbin.com/pujabew/25
for disallowing dropping the element inside itself
will need a nasty global var
 
user3119231
@CSᵠ My problem is that I am trying to parseInt and this returns NaN if there is any other character than numbers
 
11:29 AM
Which is better for collision detection where the object positions won't change (atleast until a major change occurs). Creating a static map in a 2d array and just access the array by y and x coordinate or a tree like structure, which you visit recursively ?
 
@Maurize well, just add a regex replace over the find (eg. /\D//)
 
Personally I like the tree idea more.
 
@CSᵠ You don't want the "D"?
 
@Cerbrus replace non digits with nothing...
@Abhishrek I'd favour the array idea (mem vs cpu)
 
crl
!!> '600 $ (15 CPRs)'.replace(/(\-?\d+)\s+(\S).*/, '$1--'+parseInt('600')+parseInt('$1')+'-- with unit: $2')
 
11:32 AM
@crl "ReferenceError: $1 is not defined"
 
@CSᵠ you are only considering the access time for the array
not the allocation time or the construction time either
(this might be huge ---- about 80 - 90 on x but about a few thousand on y )
 
@crl "600--NaN-- with unit: $"
 
@Abhishrek for your question yes
 
crl
why parseInt isn't working ^
 
@CSᵠ That was a joke.
 
11:34 AM
@crl "600--600NaN-- with unit: $"
 
@Cerbrus mine was not, just stating it out there for clarity :)
 
I am very offended now ;-)
Grrr
 
!!> '600 $ (15 CPRs)'.match(/(\-?\d+)\s+(\S).*/)
 
@Abhishrek ["600 $ (15 CPRs)","600","$"]
 
@crl you cannot parse int like you are trying to do
 
crl
11:36 AM
and why?
 
it will construct the string first and then try to replace the matched thing with your string
 
crl
ok
 
as in it will execute parseInt('600') first then parseInt('$1')
and then join the string
and then pass to the .replace call
 
crl
2 steps
 
yeah fetch them first and then map parseInt on them
 
user3119231
11:41 AM
So not as easy as expected huh? :P
 
tell me what exactly do you want to get
also regexp editor helps
 
user3119231
The cells innerhtml is <b>600 $ (15 CPRs)</b>
 
7 messages moved to Trash can
 
user3119231
Is need just the 600
 
user3119231
RegExp is possible of course
 
user3119231
11:42 AM
e.rows[v].cells[i].innerHTML.split(" $")[0];
 
user3119231
this seems like not valid
 
@Maurize is that consistent?
 
!!s/')/,' 10)/
 
@Cerbrus Could not process input. Error: unmatched ) in regular expression on line 4
 
Fuck it
 
11:42 AM
yup
 
wrong one
 
@Abhishrek Always use a radix with parseInt
 
@Cerbrus Oh i do
 
user3119231
@CSᵠ the "syntax" is same
 
I was just explaining him
 
crl
11:43 AM
@Maurize can it be figures like 600,000 $? or 600 000$
 
parseInt('12313', 10)
 
also using $ after amount is wrong
 
Then explain it with the radix
 
proper price: $600.00 USD
 
user3119231
This is an example of the current values
 
crl
11:44 AM
just (-?\d+) the shit
 
user3119231
I need to sum them all
 
user3119231
Don't blame me I suck at regexp but I'll give my best.
 
Split on $ and parseInt the left side
 
user3119231
				var value = parseInt(e.rows[v].cells[i].innerHTML);
				console.log(e.rows[v].cells[i].innerHTML);
				if (isNaN(value)){ //is string
					value = e.rows[v].cells[i].innerHTML.split(" $")[0];
				}
				if (values[i] !== undefined){
					values[i] += parseInt(value);
				}
				else{
					values.push(parseInt(value));
				}
 
!!>'<b>600 $ (15 CPRs)</b>'.replace(/^\D+|\s+[$].*$/g,'')|0
 
11:45 AM
@CSᵠ "600 $ (15 CPRs)</b>"
 
replace [^-.\d] with the empty string
then parse it
 
@KendallFrey oh you are such a life savor :-)
 
@CSᵠ "600"
 
forgot the g
 
@CSᵠ 600
 
crl
11:47 AM
usually you take the value of a <b> with textContent or innerHTML
 
!!tell Maurize ^
 
meh
 
user3119231
@CSᵠ you da mvp
 
11:48 AM
!!urban mvp
 
@CSᵠ mvp Most Valuable Player
 
@KendallFrey lol
 
game over, lol
 
user3119231
I need to learn this regexp. makes life easy.
 
or so you think

RegEx - Regular Expressions

Discuss about Regular Expressions. Learn at: Regular-Expressio...
 
crl
11:50 AM
!!>'Maurize'.replace(/[aeiou]/g,'')
 
@crl "Mrz"
 
user3119231
You rather should replace my name to hit "Mauzi"
 
user3119231
 
crl
seen it..
 
11:51 AM
Makes me want to go back to Dubai
 
!!> 'Maurize'.replace(/[A-z]/g, 'Mauzi')
 
@Abhishrek "MauziMauziMauziMauziMauziMauziMauzi"
 
crl
fail
 
!!>'0123ABC...XYZ[]^_`abcxyz890'.replace(/[A-z]/g, '#')
 
@CSᵠ "0123###...##############890"
 
11:55 AM
!!^
 
@CSᵠ [A-z] is incorrect
 
my point ^
also \ gets replaced by thart
 
@crl it was intentional
 
crl
:)
!!> 'Sometest is iffenane ef'.replace(/\w(\w{2})(\w{2,})\w/gi, (...a) =>console.log(a))
 
12:02 PM
@crl "TypeError: (intermediate value)[Symbol.iterator] is not a function"
@crl "undefined is undefined ef" Logged: ["Sometest","om","etes",0,"Sometest is iffenane ef"],["iffenane","ff","enan",12,"Sometest is iffenane ef"]
 
crl
(doesn't work in chrome sorry)
 
Chrome sucks ?
 
yes, all browsers sucks
 
crl
*browsucks
 
@CSᵠ suck*
 
12:08 PM
@Abhishrek suckkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
 
@CSᵠ you are weird
 
tell me abut it..
 
I will pass.
Maybe its just the frikin cold that is making me find everything weird.
 
/me perma switched to fedora cc @argentum47 lets see how this goes
@Abhishrek awesome! what is it?
 
@AwalGarg i have mentioned that too
46 mins ago, by Abhishrek
Which is better for collision detection where the object positions won't change (atleast until a major change occurs). Creating a static map in a 2d array and just access the array by y and x coordinate or a tree like structure, which you visit recursively ?
 
12:17 PM
wat
 
@AwalGarg read hangouts
 
hmm, why is all text so small in fedora :( it was good in the vm
 
@Maurize that's meowth
 
user3119231
@Neoares german it's Mauzi
 
oh shit, I forgot to backup my userscripts
UGHH
 
12:24 PM
@Maurize yes I've heard about german pokemon names... they suck actually xD
 
user3119231
But pikachu .. is pikachu
 
I know :D
my favourite one :D
 
crl
@Abhishrek collision between what kind of objects?
 
@crl without giving all the details
if a point is inside a rectangle or not.
 
crl
ok
 
12:27 PM
and thus find the deepest rectangle the point is in :-)
@SomeGuy youtube.com/watch?v=gvDX9uEWdbk /cc @AwalGarg
 
So, using Canvas arc and stroke and such seems to be not exactly pixel perfect. Some kind of anti aliasing is going on. Is there a way to get around that?
 
crl
the -.5 px thing ? I faced that kind of issue some time ago, searching
 
@Abhishrek Neat, thanks!
 
crl
I think I had to Math.floor every positions
mobtowers.com/html5-canvas-crisp-lines-every-time and I still didn't really get it :)
 
fuck dnf
 
12:34 PM
@crl Whoah this is some funky shit
 
crl
pretty hard
canvas implementations should really fix that for us :)
 
Yeah. I'll look into this, thanks :-)
 
Meanwhile in the ruby room
> Also, I want to maximize the use of Artificial Intelligence to make my Website intelligent
 
user3119231
to make my Website intelligent - There are so many mistakes in this sentence
 
good luck
@Cereal in future, you link the actual message
 
12:43 PM
If I linked the message, someone might click it and taint the purity of the ruby room
 
 
stackoverflow.com/a/1777282 what is happening here? I understand absolute inside relative but whats the opposite
@AwalGarg noic
 
@Feeds lol
@SomeGuy I recommend you watch it :-> very strongly its incredible
 
Will do!
Eventually, that is :P
 
1:03 PM
It kinda blew my mind :-)
 
user3119231
First of all -> It is php
 

PHP

Support group for those afflicted with PHP. Don't ask to ask, ...
 
user3119231
We are Javascript Samurais, not PHP Knights.
 
damn
 
!!s/Knights/Peons/
 
1:07 PM
sorry guys
 
@Cerbrus We are Javascript Samurais, not PHP Peons. (source)
 
Im in the wrong room! crap
damn it
Got too used entering here
 
17 > 11
Literally.
Irrefutably.
Undeniably.
 
user3119231
@Cerbrus I think he got it.
 
user3119231
Welcome @abdul-wahab! Please make sure you are here for javascript.
 
1:10 PM
@Loktar @FlorianMargaine Happy Friday!!
 
user3119231
No way.
 
There's someone in the ruby room trying to vamp how to make an entire streaming website
It's something
It's going to be done in 6 months and be bigger than twitter
 
hi all
have, with angularjs a field that has to match a pattern to be valid. With the same field, I have a ng-change function. On change, it has to retrieve data. But, the on-change event should be triggered only when "new value" matches validity pattern...
 
if animals could talk
 
@rlemon boy that was obvious
 
1:26 PM
Speaking of the profane fly
Reddit has a wordpress blog of reddit posts
 
Any good code comment -> documentation generator ? (More like which one do you use)
 
1:42 PM
babel 6.0.1 released fixes nasty fopen security escalation bug
2
 
user3119231
@CSᵠ fuck you :D
 
@CSᵠ 6.0.1 ?
 
short link?
 
@Maurize mandatory upgrade
 
hm... do you smell that? oh!! it's friday!
 
user3119231
1:44 PM
15 minutes until weekend
 
@CSᵠ babel is on .19 or something i think 0.27 now
you might wanna update it
 
shit!
ohh well
 
v6.1.3
actually xD
holy fuck
 
damn
 
@CSᵠ if you feel better, I clicked
just to ensure BTW
though it was obvious
 
1:46 PM
there was nothing announcing the weekend so far, that was a bit strange
 
why is this not working ? :
if((new RegExp("/^[a-zA-Z\séèêëùûúüàáâäôöóòîïíì-]+$/")).test("string")){
	console.log('match');
}else{
	console.log('no match');
}
 
user3119231
W E E K E N D!
 
user3119231
@CSᵠ BETTER?
 
jesus. installed chrome, went to inbox, and got logged in. sigh the wonders of a separate /home mount point
 
is she Penny? :o
 
user3119231
1:50 PM
@Neoares no, better.
 
he
 
bah dum tssh
 
@Maurize don't onebox such stuff...
 
user3119231
Why, its just a picture of a woman :o
 
what does "onebox" mean? :/
 
1:51 PM
@Maurize just like porn
 
Yeah... on the safer side to not post stuff like that (especially so when one-boxed) @Maurize - thanks.
 
you can see how pissed / tensed the guy is
 
user3119231
Okay, okay. No woman allowed here. :D
 
wat
 
@Maurize awal lives with his mum and is damn young
 
1:52 PM
@Abhishrek lel
 
hope you understand :-)
 
user3119231
rofl (no real laughing), yes. Internet security 'n stuff.
 
nothing to laugh about, its common in India, I have been there :P I simply added a door with a loud noise when opened to simply press alt + tab when they are opening it ;-)
 
you need some kind of adjustment, dude.
 
@AwalGarg ^ Tip
 
1:54 PM
ohhh I see
what happens if someone catchs you watching that photo in India? :o
 
Depends on the parent, mine would restrict access to my computer at his age :P
 
@Abhishrek I have godly senses so I don't need that :P
my parents won't believe I was watching shit like that and would say that my laptop is broken :D
 
ouch
 
hahahaha too blonde?
 
so... @Maurize word of advice: Rebecca is always safe (on fridays)
 
1:56 PM
@Neoares Parent bias --- no matter what my child cannot be at fault
 
user3119231
But rebeccas friday song sucks
 
@Abhishrek oh god no... my parents always err on the side of me being at fault. but not about that kinda stuff.
 
ok
 
Should this replace output every time it is written within a Promise.each?
Promise.each(documents, doc => new Promise(/** ... */).then(doc => new Promise(resolve => {
  readline.clearLine(process.stdout, 0);
  readline.cursorTo(process.stdout, 0);
  process.stdout.write(`Inserted ${collection.find().count()} documents into ${collection._name}`, resolve.bind(this, doc))
})).then(process.stdout.write('\n'));
 
@AwalGarg parentBias
@Maurize her saturday song is much better
wonders that a night full of alcohol can do :P
 
1:57 PM
not really. it's just that I have a fluently good track record of not being involved in adult business.
 
@Abhishrek yea, wasn't trying to hide it
 
that should be Sunday
 
dork
 
@rlemon yeah i get it, :D
I can't get a canadian visa in time so bummer :P I won't be able to say hi
 
@AwalGarg but is porn forbidden there?
 
1:58 PM
ofcourse
 
but that photo is not considered porn, right?
 
@Neoares dude you are talking about a country where you are not supposed to fuck until you are married. And to some parents talking to girls can be a sign that you are going to go out of control.
 
or kiss, or touch, or see
 
lel
 
yeah, talking to girls is forbidden for me as well. can confirm.
 
1:59 PM
@Abhishrek and yet your population is still out of control
 
Heck my mom still preaches me NOT TO TALK TO GIRLS, although that advice has been nothing but helpful.
@rlemon Aren't you thankful ?
 
@Abhishrek "supposed" is the point of that sentence
 

« first day (1847 days earlier)      last day (3100 days later) »