« first day (1488 days earlier)      last day (3443 days later) » 

12:03 PM
Hello people. Is there a good regex solution for matchin phone numbers of different format?
 
There's a good non-regex solution
remove all non-digits
 
yo whats with this? 100 * (7/100) != 7
 
Look at what 7/100 returns
 
@KendallFrey Hi Kendall. Will that work?
 
please note that using absolute positions and fixed heights can have issues with responsive design
 
12:06 PM
I am doing a page where there are addresses and similar. Regex would be better
 
@macroscripts Yes unless you have unexpected requirements
 
@KendallFrey typo
I get 7.00000000000000000001
 
Well there you go.
 
wait, what type of numbers are you using?
int, double, decimal?
 
@KendallFrey I will have some unexpected stuff.
 
12:06 PM
looks like double
 
!!>7/100
 
@Kippie 0.07
 
@macroscripts such as?
 
address numbers and similar
 
what is double?
 
12:07 PM
@macroscripts what do u mean?
 
vs decimal
 
address numbers?
 
i think I'm using double
 
@grasshopper the type, like string and bool
 
no I know that... nvm let me google it real quick
 
12:08 PM
@shaheer I want to visit pages and get phone numbers. But on those pages there are numbers like addresses etc
 
i think... double
 
@macroscripts addresses are not numbers, can you give me an example
 
javascript doesn't have double but I think you mean 7.00
 
Explain how you can determine what is a phone number and what is not, in human terms
 
you mean you need to extract the strings that match a pattern?
 
12:09 PM
if you have High Hills Street 15
 
phone number has 10 digits
 
@grasshopper You mean, JavaScript doesn't have anything but double
@grasshopper An address can have 10 digits too
 
Ok I will try to strip non digit
 
well they all have an area code so you check if that is valid
 
that will not work, for example, phone: 111-111-111, address: abc street 10 will give you the wrong result
 
12:10 PM
then for 7 additional numbers
oh you're not asking me...
 
If you can tell me in English precisely how to find a phone number, I can write a regex for that.
 
why are we doing this?
 
@grasshopper Ah, shit, all this time I thought this was the C# room
 
grasshopper!!
 
yo?
 
12:13 PM
@KendallFrey Is it not?
 
how many times have I killed one
XD
 
I think I've seen 3 or 4 in my life.
also havent seen snow.
 
We have lots here
 
I haven't seen ground without snow
 
in japan i hear cicadas though
 
12:14 PM
had actually..
 
@KendallFrey A positive number of "1" followed by a "2" for every previously seen "1"
 
their like asian grasshoppers i think
 
@copy Will you accept a non-regular expression?
Because .NET can do that easily
 
No
 
yo copy if i come to this chat everyday will i become a better coder?
 
12:15 PM
No
 
then why are you here everyday?
 
To make fun of @SecondRikudo
 
@copy Ok then, /12/
1 is a positive number
 
Also matches 112
 
no it doesn't
!!> /12/.exec("112")
 
12:18 PM
@KendallFrey ["12"]
 
Ah, shit
 
@KendallFrey good suggestion
 
I made copy say "Ah, shit". My life is now complete.
 
@KendallFrey how can I exclude ( ) and - and then find only those numbers
that are actual phone numbers :)
 
what
I have no idea what that means
 
12:20 PM
Is there even an actual specification on what is a telephone number?
 
if you dial it, and you get an answer, it is a phone number
 
That’s pretty accurate.
Except if you have no reception.
 
@KendallFrey damn lol
can a regex do that?
 
Regex isn't turing complete
 
12:22 PM
Only in PHP
 
:P H :P
There has been a girl in the room. ^_^
 
@argentum47 There are no girls on the internet.
 
Its an illusion. I know.
:(
 
@argentum47 I think there are more women on SO than you would expect. It’s not really that special.
 
yeah i expect the count to be -1 but is is zero :D
 
12:27 PM
XD
The gorls i have generally meet asked me don't you get tired ? and before I couldn't answer "burger off", they went away.
 
@KendallFrey I have no idea what that means
I mean I don't want this 12345678 I want 1-234-5678 or 1-(234)-(5678)
 
@macroscripts It means you haven't explained precisely how I can look at some text and recognize a phone number
 
@KendallFrey well I want to exclude ( ) - from removal process
 
@macroscripts If you come up with a complete list of cases that should and should not be matched, I can write a regex for that too
 
@KendallFrey text= text.replace(/[^0-9\.]+/g, ' ');
 
12:31 PM
@macroscripts /1-(\(\d{3}\)|\d{3})-(\(\d{4}\)|\d{4})/
 
/\d+\-\d+\-\d+/ ??
oh
 
@macroscripts I don't think the "removal process" will work with the requirements as you've described them
 
/1-((\d{3})|\d{3})-((\d{4})|\d{4})/ is almost correct except that first number should not be hard coded
first digit *
 
/\d{1}-((\d{3})|\d{3})-((\d{4})|\d{4})/
maybe this is better :)
 
That is a terrible regex
Simply because it contains {1}
 
12:39 PM
@macroscripts ((\d{3})|\d{3}) doesn’t do what you think it does.
 
also you forgot to escape ()
 
@KendallFrey so how do I do it?
 
do what?
 
8 mins ago, by poke
@macroscripts /1-(\(\d{3}\)|\d{3})-(\(\d{4}\)|\d{4})/
 
The word "it" should be banned
 
12:43 PM
@KendallFrey doing some tests...
 
@JanDvorak back
@SecondRikudo :
Element is a div, containing elements like <input> and one <select>
var children = element.getElementsByTagName("input");
// so children [0][1]and[2] are set as the 3 existing inputs in the div
// i'd like children[3]
(which does not exist yet)
to be the <select> element, in the element div...
 
@KendallFrey Hahahahahah
I try not to say it without context around you :P
try
 
Appreciated
 
.getElementsByTagName("") returns a html Collection... which is not really an array... :/ (hard for me to understand that but....)
 
@poke what does ((\d{3})|\d{3}) do?
 
12:51 PM
@Julo0sS “I’d like children[3] which does not exist yet” – huh?
@shaheer Assuming you mean (\(\d{3}\)|\d{3}), it means that it either matches (123) or 123.
 
@poke yes, children[3] is "undefined", cuz first function only fills 0,1,2 elements
 
then i got it right! thanks ! :D
 
@poke so what i need is to get : element.getElementsByTagName("select")[0] and put it in the "children" html collection as 4th element (children[3])
 
@KendallFrey it's hard to get a phone from this pastebin.com/aKTmWk1X
 
that it is
 
12:53 PM
Is there a way to exclude \ ( ) from removal process. This also failed @macroscripts /1-((\d{3})|\d{3})-((\d{4})|\d{4})/
 
http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript

when I have this url,
portal.herohero20.com/sites/hello/2214/…

Uncaught Error: Syntax error, unrecognized expression: #big=heheeoineteh?bigid=12345
 
Why do you want to remove stuff?
 
@Julo0sS Assuming that this could work; if you added a fourth element to the collection, then where in the DOM would you expect that element to be placed?
 
My suggestion was before you told me what your situation was
 
@KendallFrey works that way better then matching. After I remove I can extract phones from it :)
 
12:54 PM
It's not appropriate anymore
 
@macroscripts Please put your regular expressions within backticks (`) here, so we can actually see what you escape.
 
@poke that element exists in the dom. I just need to get it and put it into this collection
 
So, you want to combine the collection of element.getElementsByTagName("input") and element.getElementsByTagName("select")[0]?
 
:19909562 ok here it goes. I am visiting the pages and want to grab phone numbers. They are different format. With () or - or without it. I want to get those phones. This regex expression didn't work.

text2= text.search(/1-(\(\d{3}\)|\d{3})-(\(\d{4}\)|\d{4})/g);
And removing the non digits also failed. Gives me bunch of numbers that I can't work on.
 
That's why I told you to forget it
 
12:58 PM
ok... well, imagine :
i create this collection :
var collection1 = myDiv.getElementsByTagName("input");
//this returns 3 inputs, so collection[0][1]and[2] exist
var collection2 = myDiv.getElementsByTagName("select")[0];
//collection2 now contains ONE element, which is a select
now i need to combine these 2 collections to get collection2 as 4th element of collection1...
@poke yes
 
[].concat.call( collection1, collection2 );
 
@KendallFrey Nope. Tell me how can I exclude a character ? I want to exclude - ( ) and try it out
 
Array.prototype.slice.call(collection1).concat(Array.prototype.slice.call(collection2))
@jAndy Gives you an 2-element array with two collections instead.
 
I refuse to help you with the approach of removing characters
It's not a solution
 
@poke what i get then is an array and no more a html collection is it?
 
1:00 PM
Yes
 
yeah you might need to splice it up
 
@poke seems to be working like this... thanx :)
 
Can anyone explain why ListCtrlr is called twice? embed.plnkr.co/28eIRFHq7yTLgc6DoBre/preview
(angularjs) ^
 
everyone ignores me here
 
1:33 PM
@BenjaminGruenbaum Do you have a GitHub account? If so, what is it? :-)
 
Why did google not find that... thanks!
 
!!live
 
@SecondRikudo I'm not dead! Honest!
 
!!tell RoelvanUden google Benjamin Gruenbaum
 
Fourth result is his GitHub account :P
 
Yeah, thank you. No idea why it didn't show up here.. or 100% blind.
 
1:42 PM
Pahaha
 
@FlorianMargaine what are you doing?
 
cleaning up
but I can't do it anymore, it seems
 
I thought account hijack
 
ah
good call
 
@copy but... an account hijack would say it was a clean up
 
@JanDvorak They're discussing it in miaou reg if you wanna see.
 
4 messages moved to Trash can
damn :(
I wanted to move the system messages, my bad
 
1:55 PM
Sure you did, Florian
 
I have another question. How can I extract a website name from meta? Example:

<meta property="og:site_name" content="Some Website" />
 
You can select the element and get the attribute?
 
@macroscripts el.getAttribute('content')
el being the meta element of course
 
tnx it did the job
 
2:11 PM
is it possible to force mouse pointer to stay into a div until next click? (user clicks in a div, after first click, the mouse pointer cannot get out of the div's area, if he clicks a 2nd time, then the pointer can get out)
 
@Julo0sS NO WAY! (hopefully)
 
@Julo0sS that would be easy to abuse
 
:)
 
@Julo0sS: Short answer: No. Longer answer: Nope.
 
Longer answer: You fucking don't think of doing that.
 
2:14 PM
You can hide the mouse pointer and then draw a fake pointer wherever you want
 
^ Cheats
 
Requires user confirmation though
 
AFK: Rebooting.
Back.
 
@Cerbrus okayyy :P
 
2:41 PM
What I love about windows is that even though it is an incredibly advanced operating system complete with active user directory, permissions, graphics card memory management.. if I copy a file 10 GB in size in a remote desktop window and paste it in word, it will cause everything to hang until it has moved all 10 GB or it dies trying, even if Word can't use it
Async operation anyone?
 
You rewrite word to handle that case properly
See you in 25 years
 
3:02 PM
@Philae2014, Interplanetary Space
In November 2014 I will land on comet #67P as part of @ESA_Rosetta. I am operated by @DLR_en's Microgravity User Support Centre MUSC in Cologne.
686 tweets, 63.3k followers, following 85 users
 
3:27 PM
Hi!
 
does anyone know why extjs in jsfiddle is down?
does this link show anything to any other users :
 
Sometimes my laptop slows down (for battery saving) or for other reasons (I have a non genuine laptop charger, and I think that when using it, the CPU speed is lower)... even if I have set on Windows : "max performance" (instead of battery saving)

Do you know a light website or tool (freeware) that can test in a few seconds if I'm running my laptop 100% full speed or not ?
 
or just a simple JS loop in the browser to test the CPU speed?
what kind of loop would you use ?
I don't need real benchmark... If I see "3000" for example, and the next day I have "1500" I'll know there is something wrong
 
You could run a benchmark and compare the result with an older result
That's unstable between browser versions though
 
3:32 PM
@copy yes exactly, that's what I'm looking for
because googling CPU speed or CPU benchmarking leads me to big software with 100MB installer, and lots of features...
I just want small stress test
 
There are tools to do that simply
 
I probably don't find the good ones (maybe I search with the wrong query on google), because I mostly find big "Benchmark your computer Software suite" that does lots of things
 
Hi does anyone have any experience in casperjs here? I'm having trouble using evaluate() - its execution seems to arbitrarily get cut short & returns null. pastebin.com/0dDaB9MV
 
@AaronDS Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
room topic changed to JavaScript: Read this: rules.javascriptroom.com. Before asking inform yourself on the XY problem goo.gl/taIqf | Angular is on topic here. stop asking. [ecmascript] [es6] [javascript]
 
3:44 PM
Thanks to the RO change we finally don't have clown titles all the time
 
m59
@argentum47 I was referring to posting answers to questions on SO. People tend to be kinda crazy.
 
room topic changed to JavaScript: Read this: rules.javascriptroom.com. Before asking inform yourself on the XY problem goo.gl/taIqf | Angular is on topic here stop asking. Don't ask to ask just ask. [ecmascript] [es6] [javascript]
 
Whoa, almost every RO was purged?
 
@SecondRikudo @copy What kind of numbers do you get with this simple .js script : gget.it/0neyz1wo/fibonacci.html
(fibonacci stress test during 2 seconds)
 
@SterlingArcher Yeah, according to who @BenjaminGruenbaum thinks has used the mod tools enough
 
3:56 PM
Well, I'll admit I play with the titles a lot but I'll stop that
 
It's pretty random and will probably be undone soon
 
According to who was willing to participate in discussions about the room when we held them and who I've seen use them. Wanting to change some culture in the room after what we've experienced in the last few months and last week in particular. After discussing it with SE.
 
Don't lie, you used !!choose to determine who made the cut. I have logs...
</bot-sarcasm>
 
It's not a cut :S
 
@BenjaminGruenbaum can you link me on Miaou to the conversation you had with SE? I wasn't around to see it
 
3:58 PM
Who's left?
 
It wasn't on miaou, it was on email.
@JanDvorak you, me, florian, lemon and sterling. Cleanup crew.
 
Not many, then
 
@CapricaSix Hahaha
 
I know, you were talking on monday about showing us what went down, but I don't see a ping or anything
 
and cap
 
3:59 PM
@SterlingArcher I pinged everyone on miaou :S We have a room there, I think.
 

« first day (1488 days earlier)      last day (3443 days later) »