« first day (1068 days earlier)      last day (3883 days later) » 

6:00 AM
What do you want as output?
 
@Zirak 4,5 should be output
 
If you use array.map to create a deltas array, then you have an array[i] -> deltas[i] mapping
Why 4,5 and not something else?
 
I'm lost, but I'll just leave this here
 
@v.ArunKumar 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.
 
i want the smallest difference array as output. in array [[1,20],[2,10],[4,5]] first element has 1,20 which means 20-1 =19, second 2,10 which means 10-2 = 8 and lastly 4,5 that means 5-4=1 .out of 19,8,1 . 1 is small . which is resultant of 4,5
@Zirak @Shea
 
6:05 AM
Then build the deltas array, find the index of the smallest element (we'll call that i), and originArray[i] is your answer.
(where originArray is your input, your array of arrays)
 
@Zirak let me try
 
@Zirak I don't even understand that sensei
 
Which part isn't clear?
 
Oh nvm, just new terminology with me. /englishfail
 
@Shea yes it is returning the smallest value 1 as output. but i have to know which elements are returning 1? the output should be 4,5
 
@RyanKinal happy birthday :D
 
I had an awful dream where my boss confronted me about my use of too many resources from the office.
In my dream (where everything seems logical), I recalled my use of recharging my cell phone and using toilet paper and I felt awful.
 
@Telic 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.
 
@Neil You are a horrible person.
 
@Zirak *cries*
 
6:16 AM
You're probably one of those people who drink water or makes coffee in the office.
 
It's true! I'm so ashamed!
Funny how dreams like that always seem logical at the time
 
heh, well, we deal with illogical things (mostly social things) all the time.
 
If a purple dragon walked out and asked you how your day was, you'd probably react nonchalantly about it
Most people act logical, even if they're not rational
 
It's fun to establish this sandbox, where your rules are relaxed.
 
Perhaps they're stressed and they've been turned down too many times, and so they crack.. at least that's a logical reaction
What's really scary is when no logical explanation exists
 
6:19 AM
@Zirak perfecto
 
Ever have a dream where you're falling and you never hit the ground, so you immediately realize you're dreaming?
 
Thanx man @Shea @Zirak
 
I had a professor at my university who is generally friendly to everyone. He invited me to his office and I had absolutely no reason why.
 
Growing up, my mom told me that I can't wear sweat pants (trainings) to formal things, like weddings. I asked "why". The answer sums up to "because".
She still tells me that. I'm 93.
@Gajini Enjoy
 
He talked through clenched teeth and told me he wanted me to drop out of his course.
I tried to understand why he was upset and why he wanted me to drop out, but he acted like he was at the end of his patience and wouldn't let me speak
 
6:20 AM
Oh this'll be good. Why?
 
@Gajini You're welcome bud
 
He threw me out of his office and threatened to punch me said another word
 
His wife cheated on him with you?
 
To this day, I have no explanation for that behavior.. it was quite frightening really
You'd think so by the way he was acting
I wasn't doing anything immoral. Only thing I can imagine is that one of the students that were closer to him didn't like me and said something very very bad about me to him
 
Wait, that really happened? o.o
 
6:22 AM
What's his name? Can I email him?
 
But even that theory doesn't hold much water. I didn't have any archenemies or anything
 
No no no, don't tell us, we can figure it out. lol
 
@Zirak If you promise to spam his e-mail box, sure
 
I wanna ask him why
How long ago was it?
 
So, um, I am basically going to try to recreate crocodoc in short to allow for markups on documents by teachers
 
6:23 AM
But even if it was over a decade, he'd surely remember something like that.
 
Hmm, it was during my graduate studies, so about 8 years ago I suppose
 
I hav no idea how the heck I can convert a PDF file to HTML5
 
I understood that his daughter was really sick during that time
That surely didn't help
 
Does anyone know where I can find a script to markup PDF's or a script to convert PDF's to HTML5, preferably client side?
 
@BrandonGelfand Have you googled?
 
6:25 AM
Yes
For hours
I only found one, and it screws up the PDF a bit
 
PDF is a BIN file?
 
It's a famous project by mozilla
 
@Zirak well aware of it, but isn't HTML5
its just a viewer
 
Anyway, if anyone wants to put his e-mail address on a porn spam list, be my guest: people.cs.clemson.edu/~malloy
 
The goal is to make comments and highlights and markups on a pdf document
Its for teachers to grade papers
 
6:27 AM
Well, that's going to be quite horrible. pdf is a bitch.
 
I squeaked through the rest of that semester trying to avoid the man hoping he wouldn't forcibly kick me out of his class
 
@Neil I'm gonna ask him
 
@Zirak I know...
 
@Zirak You'll have to let me know what he says then
 
...I have no idea what to ask him
 
6:28 AM
Do you think a word doc or ppt or excel file can be marked up some how?
 
Well, how to ask him
@BrandonGelfand oh, I'm sure that'll be worse.
 
@Zirak Yes, I know :/
 
@BrandonGelfand Surely you can use the viewer to capture the markup that it produces?
 
I am sort of stumped...
 
You had a student you invited into your office and almost punched him in the face for not dropping the class.. care to explain why?
 
6:29 AM
@Shea I was thinking of canvas as a possibility...
 
@Neil What's your full name, if I may ask?
 
I don't know how I could merge the two
(I am still learning, only been working with JS a little under a month)
I know I am biting off more then I can chew here, but I still am determined to figure it out
 
@BrandonGelfand And it work by generating html
It wouldn't work otherwise
 
Yes, so we are still at turning the pdf into HTML5
 
You are, I'm at "you're screwed"
 
6:31 AM
From what I can tell, pdf.js produces HTML/JS, to use as it's viewer. So if you go here, inspect an element, you'll see that it's all HTML like you wanted.
Hey, that demo file looks like a pretty good read :D
 
Yeah, it does...
Alright, now how the heck can I do markups..
Canvas came to mind, but how will it be converted back to a PDF that is still readable on adobe or something
 
Okay, what exactly do you mean by markups?
 
Like highlight, strikethrough, add comments, freewrite
thats about it
 
hmm
@rlemon , @Loktar colorbay.me does it lag for you ?
 
@AbhishekHingnikar Hey
 
6:37 AM
@AbhishekHingnikar U do this? Looks nice. Yes lags a bit, its just the photos loading though, shows the menu fairly quick
 
its supposed to be the footer :$
xD
i am doing it with angular maybe i need to do inline templating
 
Well it loads in the middle at first
then when the photos come in it works
 
Its actually blurring in b/g
for the bokeh at the bottom which causes a fair performance hog in beginning
 
@Shea Any ideas as to my project?
 
Sorry, but no. I don't have any experience reading/rendering PDF files, however I do know that it is not very easy. Not knowing much about your situation, I would suggest having them either use a PDF editor, or switching formats completely.
 
6:44 AM
Ok :/
 
I do know that PHP offers some PDF editing functionality
^But again, I don't have any experience with that
 
6:59 AM
This question appears to be off-topic because it is best answered by the official documentation — Jan Dvorak 10 secs ago
 
7:48 AM
o/
 
congratulations, us-americans, you own the internet
http://www.washingtonpost.com/blogs/the-switch/wp/2013/09/15/former-nsa-and-cia-director-says-terrorists-love-using-gmail/
 
@GNi33 LMFAO
 
i don't know if one should laugh or cry if a dumbnut like that was director of the CIA and the NSA
 
hello everyone, im kind of stuck with a regex, how can i make it so it HAS to have website.com, currently everything matches fine but it continues to match even if website.com isn't there /((?:website.com)|(?:photo%5fid=|photo_id=))(\d+)/
 
7:54 AM
"At one point, Hayden expressed a distaste for online anonymity, saying 'The problem I have with the Internet is that it's anonymous.'"
Funny, I would have said that was one of its greatest features
 
yeaaaah, just that it's not
and "the internet"... well... forget it...
 
Yes and no. Depends on how badly you want to track someone down
Though it's been becoming easier these past few years
 
@user2204158 hm... remove the second branch of the alteration?
 
@user2204158 You're "or"ing the two expressions
That means one or the other must be there.
If website.com has to be there, don't put it in an OR expression
 
@neil but it stops working when the 'or' isn't there, sorry but im relatively new to writing regex
 
7:58 AM
@user2204158 If the or isn't there, you're saying that the 2nd expression must follow the first
 
@neil problem is that it isn't exactly after it, it can be anywhere after the domain name
 
If before it was catching it without website.com in it, and now it isn't matching, it is because now website.com must be there
@user2204158 There is a way to handle wildcards in regex, and that is .*
 
i've gotten some different answers on stackoverflow but none of the worked when the position of the photo_id is different
 
So something like /((?:website\.com).*(?:photo%5fid=|photo_id=))(\d+)/
That means "website.com" <something or empty string> photo_id=<number>
 
it doesn't match at all but it's on the right track
 
8:02 AM
@user2204158 Regex is complicated to test, but what I've found that helps is testing individual components. Test just /((?:website\.com)/ then just test /(?:photo%5fid=|photo_id=)/
when you see that the pieces work, assemble them together. You can rule out the possibility that the pieces don't work if they worked prior to assembling them
assuming you didn't modify it in the meantime that is
 
that's how i got to this point actually, (?:photo%5fid=|photo_id=))(\d+) works ok on it's own but i cant get it to require the website.com
 
@user2204158 Well did you try "/((?:website\.com).*(?:photo%5fid=|photo_id=))(\d+)/"?
 
@user2204158 OK... just removing the pipe character will turn it into a sequence. Is that what you're looking for?
 
Also, you shouldn't surround the match with parentheses unless you wanted to extract a piece of the matched string
 
bingo! thank you so much, i've been scratching my head at this for a couple of hrs
 
8:08 AM
s/shouldn't/don't have to/
note the ?: part @Neil
 
@JanDvorak I should clarify:
You shouldn't surround the regex expression with capturing parentheses if you don't want to extract that information later
 
@user2204158 just check with an indexOf that the string contains website.com and then use the rest in the regex, or better, use a URL parser that's way easier.. regex is pretty low level for well structured strings.
 
Is there anyway in javascript to get the html content of another page on click of a anchor tag?
<a href="linktoAnotherpage.html"></a>
 
@Mr_Green if it's cross-origin, no
 
@mr_green only if it's on the same domain
 
8:15 AM
yes it is on same domain
 
then it's easy. Are you using jQuery?
 
nope
just javascript
 
!!tell mr_green mdn xmlhttprequest
 
ok thanks
 
8:18 AM
create new XHR -> open it -> attach an onload handler -> send it
or onreadystatechange handler, if you want to support IE
 
user1125394
!!> [1,2] == [1,2]
 
@cc false
 
user1125394
expected
 
@cc it's true in Ruby
 
can you get a specific element using this method?
 
8:20 AM
@user2204158 using XHR? Parse the response and select
 
@JanDvorak Then matching a 10,000-sized array with itself would match each element one by one in Ruby?
 
@Neil I think there's a ref-equality quick pre-test
 
user1125394
yea ruby.. it's true with _.subtract(a, b) also
 
@janDvorak i guess that's the way jquery does it aswell?
 
@Neil it's more fun with recursive arrays
 
8:22 AM
Not sure if I like the idea of matching each element in an array
I suppose the difference lies in how a language treats an array.. as an object or as a built-in value type
 
user1125394
@Neil well that the diff between foo == bar and foo.equals(bar) for strings in java, c# ..
 
user1125394
either you match ref, either you match each char
 
a = []
a << a
b = [[]]
b[0] << b
a == b # true
 
@cc Yeah, that's my point. Java treats it like an object, and the object determines what to do on .equals
otherwise it's a reference check with ==
Though if I had my way, in Java "==" would always call .equals for two non-null objects and if you want a reference check in that case, you would not override .equals
 
@Neil what if you wanted reference identity for strings?
 
8:26 AM
@Ankur 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.
 
hello everyone
i need help for javascript...can anybody help me out for that...
 
@JanDvorak They're immutable. When would you ever want to check to see if they were the same instance?
 
@Neil symbol-like functionality, perhaps?
 
@JanDvorak Then String can make a reference check by calling super.equals prior to performing character by character equality checks :P
In any case, it is not possible to have separate strings but share the same instance, so that should work in any scenario
 
i wana the code for poping up the pictures....in my asp.net webpage
can anybody help
please
 
8:30 AM
@Ankur you mean, something like the jQuery lightbox or featherbox plugin?
 
hi@jan
ya like jquery
 
I do
 
Anyone here heard about this? developers.google.com/chart/interactive/docs/reference A friend of mine worked on it, and I told him I didn't even know google offered a library that does charts and plotting, and people use highcharts and stuff. Did you ever heard about it or use it?
 
please help then
 
A friend of mine worked on it, and I told him I didn't even know google offered a library that does charts and plotting, and people use highcharts and stuff
 
8:31 AM
@Ankur asp.net is the server constructing the web page that you view, but it doesn't handle client-side code
 
actuly i m new to this javascript...
okay...what we do
nw
 
what kind of javascript are you not new to?
 
actuly i need the pictures or button to be poped up...when i put my cursore on that...
 
Iv never held a hamr b4. How do I bild a house?
 
8:34 AM
@Ankur developer.mozilla.org/en-US/docs/Web/JavaScript/Getting_Started there you go! Good luck! Glad to help.
 
thanx...ben
@jan there always a start.....
@Neil somthing like that.....
 
@Ankur He kids you because we've seen many like you before
 
@Ankur noted. I'll be pointing at said start from now on. Sorry
 
@neil no probleum bro...
@jan
 
8:37 AM
Learn vanilla javascript, become an expert, stay away from jQuery, then come back and be the one to help out those who don't know javascript, deal?
 
its ok bro
 
jQuery makes things too easy
 
can anybody help me to provide suc documents....for javascript...
 
what do you mean by "suc"?
 
such...
 
@JanDvorak he meant suck.
 
What do you think the first things someone starting with JS should learn? Context: So - I just found out that this article: developer.mozilla.org/en-US/docs/Web/JavaScript/Getting_Started is pretty badly written... anyone interested in helping me edit it?
 
@OctavianDamiean whom does he want to provide such sucky documents to, then?
@BenjaminGruenbaum if you're willing to invest the time to read it, I'm willing to help you with formulating stuff
 
Thanks :) It goes on about how good JavaScript is compared to other languages and how it's a superior language to others in some aspects rather than teaching it, and then it deosn't teach it at all, but just give examples
 
What do you reckon should be taught on that page?
 
8:44 AM
@OctavianDamiean a tutorial to javascript
basic syntax, threading model, scoping model, arrays v. objects, advanced syntax, DOM, AJAX
 
message = 'OHAI WORLD'
alert(message)
Best JS ever ^
 
@OctavianDamiean Pretty much, basic JavaScript, what a variable is, how scoping works, how iteration works, arrays, objects etc. With plenty of references and plenty of links.
 
@OctavianDamiean Stop polluting global scope.
 
I'm not sure if SO links are cool in MDN, probably not, but it's perfectly fine to steal from answers in SO as they're CC
 
@phenomnomnominal Pollution my ass ... yo deh grenpace?
 
8:47 AM
@BenjaminGruenbaum err... SO is CC-BY
 
@JanDvorak is that a problem? Attribution is good anyway
I'm not a lawyer
 
@OctavianDamiean pollution is one thing. Accidentally overwriting someone's (accidentally global) message is other.
 
Note: I'm fully aware what an ugly construct that was, I knew it because every fiber in my body was fighting me while writing it.
 
@OctavianDamiean you also missed semi-colons. You're a bad person.
 
wrap it into some super-cool !function(){}() then
 
8:50 AM
Because ASI biatch we know that ASI is perfect.
 
fits your "i hate semicolons" - way of writing
 
@BenjaminGruenbaum You should just link to JavaScript Garden.
And Eloquent JS.
And this room.
Maybe not this room.
 
@wanmohdpayed 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.
 
Hi guys
 
hello
 
9:00 AM
I need some help.
 
I'd post a you don't say rage face but I already have a dick flag. It's made of @Shmiddty's foreskin.
 
@wanmohdpayed are you going to tell us your issue?
 
@OctavianDamiean Haha, I wonder who I can talk to about MDN, I've done plenty of small edits but nothing that substantial
 
@JanDvorak yes.. What does this mean "You will need to check JavaScript source files to see what javascript:checkDownload() does to get the actual file location."?
 
@BenjaminGruenbaum Just do it and let them react. I mean it's a wiki, they have to expect edits. :)
 
9:03 AM
@wanmohdpayed they want you to find the checkDownload function
 
@OctavianDamiean It's not an edit, it's a rewrite - I started editing it and I noticed I have more changes than keeps
 
I'd still say that you should do it.
 
@JanDvorak what is that function? It is inside download button in "http://www.downloadcrew.com/article/27337-makemkv"
 
Oy vey.
 
@wanmohdpayed you'll need to find out where it's defined. Searching the function name across source files should help you finnd it.
 
9:07 AM
@JanDvorak I really have no idea what it is. When I filter the page, I still cant get the download link. I just the download link.
 
@wanmohdpayed page source != page
@wanmohdpayed press CTRL+SHIFT+K in Chrome -> sources tab -> CTRL+SHIFT+F
 
@CharliePrynn just replace the id and url rite?
@JanDvorak nothing happened when I pressed.
 
@wanmohdpayed I'm not sure what you're tring to do. You asked what the checkDownload function did.
 
Then you have to enter the search term.
 
9:12 AM
CTRL+SHIFT+I, sorry
 
@JanDvorak I get this "href="javascript:checkDownload( '30272', '?act=software.download&id=30272&t=1379471277&c=e25f30b536f6aa09f5edb340dd82c29c‌​10b3e03e', false )""
 
@wanmohdpayed that's not where the function is defined
 
@wanmohdpayed goo.gl/t94na8 that is the file where the function is defined.
 
@ArpanDas 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.
 
@JanDvorak how can I get the link?
 
9:18 AM
15 mins ago, by wan mohd payed
@JanDvorak yes.. What does this mean "You will need to check JavaScript source files to see what javascript:checkDownload() does to get the actual file location."?
 
@CharliePrynn How can you tell? I mean, are you, like, his coworker or what?
 
@OctavianDamiean In one of his messages he provided a link to the page.
 
@CharliePrynn Oh my, you're right.
 
ecmadate 2013091811.20, captains log. "Just arrived at the bridge where I just found a bunch of trolls and vampires, like every day. Trying to pretend kindness, which gets harder."
Hello friends !
 
9:33 AM
@ThomasLang 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.
 
hey
can someone explain me why in this:
http://jsfiddle.net/Turxm/
the this variable is the element i give to the function? there is no function parameter "this"
or to say it in another way: I would expect the first line to be like: (function( this, $ ) {
 
this is an implicit argument
 
@Praveen 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.
 
if you call a function as a property of some object, that object is given to that function as this
 
@nbar Yea, JS is not Python. :)
 
9:45 AM
think "object oriented"
 
the first parameter is this?
when I just give jQuery as parameter this will not work:
http://jsfiddle.net/Turxm/2/
but this will:
http://jsfiddle.net/Turxm/3/
 
the first parameter from .call() and .apply() and .bind() is the object to which this will refere within the function context
 
oke, thx.
 
you would need to pass .call( null, jQuery ); in your second example to achieve the same
 
ok
hmm any reason why this is like that?
 
9:51 AM
think object-oriented
 
you mean, why that is like this or this is like that ?
 
@nbar God hates you, that's why.
 
@Neil inb4 flag
 
@Neil nothing new :p
 
@nbar Oh, good, you took that well. Congratulations, you are a person of average intelligence or above. :)
 
9:55 AM
hmm http://jsfiddle.net/Turxm/4/

it looks thats way. I cant use this as a parameter. so when I wanna set this in the functionscope I have to use call. thats why. right?
 
yes. Why would you want to name an argument this?
 
to set this in the functionscope ? :)
na, i got it
and btw, god hate us all
 
@nbar this is clearly not true
 

« first day (1068 days earlier)      last day (3883 days later) »