« first day (1653 days earlier)      last day (3296 days later) » 

11:00 AM
@Qantas94Heavy Oops, got confused, Promise.decline doesn't exist, Promise.reject was meant sorry
Ok thanks
 
@jemz ajax and sockets are two different things
Do you mean WebSockets?
 
infoq.com/research/javascript-frameworks-2015 this provides exactly 0 amount of useful information.
 
@jemz Ever heard about Socket.io?
 
@MadaraUchiha, I am using Node.js
@GabrielTomitsuka, I heard that socket.io uses only http
 
@jemz No, socket.io uses ws:// and wss://
It can also use JSONP long polling, that will need HTTP, but this option can be disabled
 
11:05 AM
@jemz Ajax and WebSockets use two entirely different protocols. The problem you described doesn't really make sense.
 
@GabrielTomitsuka, how to use socket.io in net module ?
 
@jemz where are you from?
 
@AwalGarg, why ?
 
just curious. You talk like a person I know.
 
11:07 AM
<- Born in Brazil, lives in Germany
 
@AwalGarg, where you from ?
 
Inphpia.
 
@AwalGarg, is that a country ?
 
@AwalGarg Is that meant to be some sort of "India uses PHP" joke? :P
 
It is the place where I live. Near Nojsia.
@GabrielTomitsuka ??
 
11:10 AM
In PHP ia
 
@GabrielTomitsuka, what PHP you mean ?
 
I dunno what you are talking about :/
PHP is a programming language. How can it be associated with a place?
@jemz now where are you from?
 
@AwalGarg google.de/search?q=Inphpia gives no city as result - I assumed that was some sort of mix between India and PHP
 
yup I search too
I'm from Taipei
:)
 
@GabrielTomitsuka It is a small place.
Our government said we will soon get strict types security
 
11:22 AM
 
@OliverSalzburg Now I'm wondering what domain you have.
 
@OliverSalzburg And what you keep in that page
 
@MadaraUchiha dirty-motherfucker.org
An old blog of mine
Great for IRC vhosts though
 
@OliverSalzburg I used to know how to do that
Now I don't anymore :(
 
11:25 AM
@MadaraUchiha Run an IRC proxy that is bound to an IP address that resolves to a certain hostname
 
the aurelia thingy only looks good. at it's core, it is a perfect example of how to screw all knowledge and wisdom of a programmer.
 
@OliverSalzburg I used to know how to do that
 
Heheh
The only part about that process that I really hate is IPv6 PTR records :P
 
@SomeKittens Answer looks good question needs a bit of work
 
11:39 AM
// foobar is a promise that returns an array of entry ID's
foobar.map(function(entryId) {
    var url = 'http://example.com/' + entryId + '/comments';
    return rp({ method: 'GET', url: url });
}).map(function(body) {
    return JSON.parse(body).comments;
}).map(function(comment) {
    // Only want individual comments here but
    // instead get arrays of comments per entry
    console.log(comment);
});
Trying my hand at fully utilizing promises; can someone assist with this since I just can't figure out the correct way?
 
@MarttiLaine what promise library?
 
In a nutshell, I simply want to process all the comments in a callback function, while retaining the chained promise structure (hopefully I'm making any sense).
Bluebird
rp is request-promise
 
@AwalGarg The first comment to that comment is priceless
@MarttiLaine you need to use Promise.map since you want to wiat for all of them
Oh wait, foobar is already a promise, disregard that
You're looking for a flatMap, we don't ship that in bluebird I'm afraid, but you can do the same thing with .reduce using [].concat, lemme make a quick fiddle @MarttiLaine
 
It works fine but the issue is that I get an array of the comments (per entry) instead of just handling them individually.
 
Yes, I understand, lemme make a quick fiddle
 
11:44 AM
Thank you. So far I've usually went with nested promises but this time I want to go full-on with simple chained syntax :P
 
Just to make sure, you're on 2.x and not 3.0 right? (This is the case if you npm install'd)
 
Yeah, 2.9
 
@MarttiLaine so basically, this is what you currently have: jsfiddle.net/dbzpxz4x
 
What you want is something like: jsfiddle.net/oqa24fqh
This is basically a flatMap we don't have that, it's shimmable though
 
11:48 AM
Yeah that's exactly what I was after, thanks!
 
Aka concatMap
@MarttiLaine Glad I could help, happy coding - lots of interesting stuff coming in 3.0 :)
btw did you randomly come here and ask a bluebird question :D?
 
12:11 PM
@AwalGarg your city(I'm assuming) is NoiJSia instead of nojsia
 
user2620028
question about ternary. This is a valid java statement using ternary and i am curious how it is rewritten without the ternary so i can understand what it is doing
return sum==0?count:0;
 
@HatterisMad surely you meant JavaScript, not Java?
 
user2620028
@Qantas94Heavy you are asking because this is the javascript room or because it is likely the same syntax ?
 
JS room :P
 
@HatterisMad Ternaries are relatively simple statements
 
12:21 PM
Hi JS
 
(condition ? value if true : value if false)
 
user2620028
@Madara yes i am just making sure that i am understanding it correctly
 
I'd like to make an informal announcement.
 
In your example, if sum == 0 is true, the statement will resolve to count. If not, it will resolve to 0.
 
user2620028
@Qantas it was indeed from a Java source but i am sure is the same sytax for JS
 
user2620028
12:22 PM
@madara thank you, this is my first time actually encountering the ternary operator and it was really important that i read it correctly. That is what i thought it was.
 
@HatterisMad don't read jquery source code
 
user2620028
@Florian It's not lol. Didn't you read this is Java source
 
Javascript has cond ? a : b but Haskell lets me define cond ?: (a, b) :-)
 
I'm proposing a sister site to Stack Overflow so that we can re-route beginner-styled questions in a more tutorial-based format. If you want to support resources for programming, you might want to take a look: area51.stackexchange.com/proposals/86662/…
2
 
user2620028
12:25 PM
@Jan same evaluation different syntax?
 
@HatterisMad Yes. Fully lazy even
 
@Cinch I doubt this will take off
You aren't the first to try the concept.
 
@MadaraUchiha I'm just letting you guys know.
If there is interest, I am definitely dedicated to supporting this 100%
 
user2620028
@Jan seems like a more readable syntax
 
@Cinch And I'm just letting you know. The concept has been tried before in Area51
 
12:26 PM
@MadaraUchiha I saw the other failed ones.
 
And it never got past definition, mostly because Stack Exchange closes them early.
 
> Stack Overflow is not meant to be a library of reference manuals.
 
@Qantas94Heavy But that's Stack Overflow
 
@HatterisMad until you start doing stuff like cond ?: somethingThatReturnsAPair
 
I understand it's a new site, but I think it equally applies to all SE sites as well.
 
12:28 PM
@Qantas94Heavy I think SO deserves a tutorial sister site catered towards novices
 
@Cinch does dedication include actually doing people's homework?
 
@Cinch the problem with that is that it doesn't sit well with the SE format.
 
@MadaraUchiha Try reading the guide:
 
@Cinch I have
And I've also read Philip's response to it.
 
@MadaraUchiha Still?
I thought that a simple Topic -> split -> individual questions could be a good thing
It would be a FAQ site, I suppose, for more trivial questions
SO often focuses on the why or semantic how
 
12:30 PM
@Cinch isn't it what tag wikis are?
 
@FlorianMargaine It could be, but PT would also provide common use cases and references for people
 
@Cinch also, I think the base assumption is wrong
 
SSCCE
 
@Cinch look at some of the canonical duplicates on SO
 
Solid resources are not lacking. All of the example questions you've posted can pretty easily be found on Google today.
 
12:31 PM
@MadaraUchiha Sure, but the focus is on a condensed format.
 
What's lacking is the willingness to actually learn and improve, over the "I need to solve the problem now because my boss is angry with me"
 
It would be a secondary tiered site to aggregate resources into a condensed format
 
@Cinch Well, I'm in favor regardless.
I'm just not that optimistic, that's all. Sorry :P
 
@MadaraUchiha Oh okay.
Is that an upvote? lol
I'm expecting it to die today, really.
 
I'm not sure whether you'll be able to condense something like an "Introduction to JIT Compilers" into something short enough that will be read by most newbies. The ones who will be able to are typically those who are also able to find information themselves easily.
 
12:34 PM
@Qantas94Heavy True that. But other topics are perfect for this format
 
tys
hullo
 
such as?
 
@tys 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.e. "What's the use of even having different shared_ptrs? How do I even use them?"
"How is a closure important? How should I use them?"
"What's a lambda? How should I use it? Do I need to? Should I?"
 
@Cinch you're describing Programmers
 
12:36 PM
@MadaraUchiha Actually, it doesn't seem so: programmers.stackexchange.com/help/on-topic
Their list is:

    software requirements
    software architecture and design
    algorithm and data structure concepts
    quality assurance and testing
    development methodologies and processes
    software configuration management
    software engineering management
    software licensing
 
@Cinch #1 might be valid on SO. #2 is too broad, but it could get a histolock if a good answer pops up. #3 is four questtions in one. #3.1 is answered by documentation, #3.2 is kinda broad, #3.3 is boring with the answer "no, the language is turing-complete even without them", #3.4 is POB
 
@Cinch these are all in StackOverflow
 
@BenjaminGruenbaum Of course they are
But the point is to make it friendly and digestible in a format where we can use it as basically beginner-level reference.
 
@Cinch so why duplicate?
@Cinch Write a better answer to an existing question
 
@JanDvorak SO is also very picky about its format and style
 
12:38 PM
@Cinch guess why?
 
@JanDvorak Because it's meant to facilitate high quality answers
 
@Cinch That. Do you not want high quality answers on your site?
 
The idea here is to have the second stage of doing so, with a focus on condensation and reference.
 
AKA "don't throw pearls to swine"?
 
@JanDvorak I want digestible. It doesn't need to be extensive, but it should be small and atomic.
 
12:39 PM
Haven't numerous blogs tried this sort of thing already?
I wonder why they haven't taken over the internet.
 
@Cinch this should be a meta stackoverflow question
 
@Qantas94Heavy tutsplus is fairly famous
 
@Qantas94Heavy Perhaps.
 
So you want to produce milk for toddlers? How many lactating females do you already have?
 
Okay, let's be a bit more serious here @JanDvorak.
 
12:40 PM
@JanDvorak The point is that if developers need to keep teaching the same concepts, we might as well have a common material to work on to show them.
 
by which I mean people willing to answer
@Cinch SO can handle easy questions just fine. What it can't handle are people lazy to search. And I doubt your site will be able to cope any better
 
@JanDvorak SO is a very good system. I'm just proposing a sister site to help it's weaker side.
I myself joined a year ago as a newbie and even though I searched, I still couldn't do things that easy in C++
 
Easy questions aren't SO's weak side
 
I spent 2 weeks compiling and linking wxWidgets even with SO's help.
Atomic guides for linking and compiling would've helped
 
tutorials.stackexchange.com?
 
12:43 PM
SO isn't for tutorials
 
@JanDvorak that's exactly what I'm proposing
@KarelG Which is why I'm proposing a sister site.
 
I think as a community we have a problem where we close too broad questions even if someone is willing to cover them
 
0
Q: Why Programming Tutorials Are Unique: A Guide

CinchProposal: Programming Tutorials/Guides There is no question that Stack Overflow gets many "questions" that are some variation on "here, do my homework" or "debug my code" when the problem could be greatly alleviated by having solid programming resources to pre-emptively eliminate many "gotchas" ...

 
i'm not sure that a tutorial site would be good. Ya know if its reputation goes bad, it can reflect on the Stackoverflow itself
 
12:44 PM
@KarelG It would have a very specific and strict style guide.
 
@Cinch elaborate?
 
tutorials are opinion based.
 
I'm also willing to write it if the idea garners more support
@KarelG Wrong, even in C++, there are right ways of doing things and wrong ways
For example, using printf(). Printf is a C function, and although we can use it in C++, it's pretty much recommended to never use it.
 
@KarelG why?
 
@JanDvorak It would be extremely beginner friendly.
Wording would be picky, and the vocabulary must be very simple
Synonyms or analogies must be given for complex ideas or foreign concepts such as "mutex" or "monad"
SSCCE would be a must
 
12:46 PM
No, find five tutorials about a particular subject (problem) and you will see five different strategies of implementing a solution to that problem, with pro's and cons.

it is about how the author sees the strategy to the solution.
 
@KarelG We're focusing on small and atomic
 
So this would be something like Simple English Wikipedia vs English Wikipedia?
 
We can find different use cases for, say, a unique_ptr but there are a few major ones we can use
 
Example questions?
 
@Cinch too broad, POB which one is better...
 
12:47 PM
@Qantas94Heavy Yes, except we would also "show-and-tell" instead of "explain-and-elaborate"
 
it may not be too small or atomic. Or people can have more questions after reading such tutorial while it's about explaining, not confusing
 
@JanDvorak POB?
 
@KarelG that's true for every problem ever.
The "newbies" issue has been raised a hundred times on meta
 
@BenjaminGruenbaum Agreed.
 
You can't draw a line between newbie and pro
 
12:48 PM
@Cinch a site like that is likely to attract a lot of questions, and very few (relatively) answers.
 
@MadaraUchiha That's why I already have a system in place
 
You're practically asking for a site that's filled with only canonicals
canonicals are very easy to ask, very hard to answer.
 
that's why i'm not certain that tutorials, even a small one would fit well in a sister site of SO.
 
@MadaraUchiha Also I'm not from JS so what's canonicals?
@KarelG At the very least, I'd ask that you monitor the situation and continue to give input
 
@Cinch canonicals is not a JS concept
 
12:49 PM
I believe in this and so can you.
 
A canonical is an extensive Q&A that serves as a good information source/reference
 
@MadaraUchiha PT wouldn't be extensive. It would be flat and easily readable
If SO is the steak dinner, PT is the multivitamin
Anyways, I'm here to ask that you follow it.
I would appreciate your support!
 
you've posted your question on Area51
not sure that it attracts enough visitors
(i'm rarely visiting that catacomb)
 
@KarelG Exactly.
 
@KarelG he also posted the link to the propsal itself, it's starred.
 
12:54 PM
@MadaraUchiha Thank you if you're the one who did that.
Once again, I would appreciate activity and discussion over the subject on the site.
If it gets shutdown, then we can look to somewhere else
I really want to push for this, though!
 
1:09 PM
Avengers 2 : 0/10
 
@darkyen00 QQ
 
the whole movie was like "jokes + jokes + jokes" + "blast some stuff" + "squeeze 10 comics in one 2 hour escalation"
 
@darkyen00 Meh.
 
that age of ultron ?
was going to watch that, even if it's a typical popcorn movie.
@darkyen00 is it really so bad ?
 
@KarelG i want a refund.
but then again i gave 7 / 10 to memento and 8/10 to dark knight rises
 
1:25 PM
hi
 
@sami 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.
 
When is it available for download purchase as DVD?
 
i have seen FF7
pretty decent
 
i need see and read this javascript code : m.uploadedit.com/ba3c/142989642734.txt
 
but they are destroying a lot things again. But yeah, it became a popcorn movie
 
1:26 PM
how???
8->
 
@sami why?
 
why
 
to analize it
 
why?
 
:|
 
1:26 PM
It might be illegal
 
no its work correctly but encoded
 
talk to the person who encoded it
 
Guess why it's "encoded" [sic]?
 
@rlemon : i cant.
 
We are not here to help you bypass some site's security however feeble it might be
 
1:29 PM
@JanDvorak : 2 unable see source :)
 
@MadaraUchiha not worth space
 
:(
 
the only good scene about the movie was when thanos says "I will do it myself"
thats in post credits
 
a encoded js script means that the author wants to keep his code secure. it is not open for public use, to prevent copycats/piracy
 
@darkyen00 Wow, thanks for the spoiler man :P
 
1:32 PM
if you want to analyze it, ask the author for permission. (s)he will give you the keys if (s)he allows that
 
@BenjaminGruenbaum ikr :P (also, you bloody racist!! <3)
 
@MadaraUchiha lol .... it ain't no spoiler technically its not in the movie
and you should off googled it already.
 
ok how it encoded (algorithm???)
 
Why should we be telling you?
 
@vamsiampolu no. I live in Inphpia, near Nojsia. Noconfusionia.
 
1:33 PM
to increase my knowledge...
 
find a different way to increase your knowledge
 
try doing knowledge++
 
hello guys just a quick question my ajax response looks like this <span id='src'>1</span><span id='loc'>1</span> how can i get html value from its id src and loc
 
@softgenic DOMParser.prototype.parseFromString
 
store these values in variables like srcval , locval
 
1:36 PM
Element.prototype.getAttribute
 
var src = $(responseText).readAttribute('span.src'); this gives error
 
Because there's no span.src attribute
Also, jQuery doesn't provide a readAttribute method
 
this doesn't return anything either
var src = $(responseText).find( "span.src" ).html();
 
!!tell softgenic mdn DOMParser, getAttribute, javascript
 
1:40 PM
since when does a <span> have a src attribute ?
 
Perhaps because there's no span with the src class?
 
src is class of span
 
check for className then
 
@softgenic No it's not.
Not according to your example anyway
 
ninja'd
 
1:41 PM
var src = $(responseText).find( "span#src" ).html();
var src = $(responseText).find( "#src" ).html();

What;'s wrong with above?
 
<span class="src">...</span>  allowed
<span src="foo">...</span>  not allowed (convention)
# = checking for ID, . (dot) = checking for class names
 
you have var src twice
 
@softgenic Aside for that ^ Nothing.
 
Also, an ID+anything selector is redundant
 
they both alert undefined
full testing code is follwoing:

var responseText = "<span class='src'>1</span><span id='loc'>1</span>";

var src = $(responseText).find( "#src" ).html();
alert(src);
 
1:43 PM
Also you should be inspecting response and not responseText
 
@softgenic src is a class
not an id
 
@softgenic you're looking for the ID, not classname
 
!!mdn selectors
 
use the dot . instead of #
 
1:44 PM
read this ^
 
it doesn't work for class either
 
are you sure?
 
let's stop
 
HAMMERTIME!
 
1:45 PM
one faulty example at a time
always match up your error descriptions with which version of code they refer to
 
or better, create a fiddle.
 
also, that
howgh. Time in
 
well I can tell you the real problem, but I won't tell you how to solve it. fair?
 
Why people repeatedly ignore the help and links given to them? :(
 
.find acts on the returned elements children -- $(response) returns [span,span] -- you can figure out how to solve this I hope.
@AwalGarg tl;dr
 
1:50 PM
@AwalGarg They want a solution, not a help
 
Which means they are not here to learn, and didn't we agree not to work for free?
 
I didn't do any work for them
 
I did, but in fairness I just led the horse to water. it is his job to drink.
 
This is such a problem, there has to be a solution.
 
Anyone who could point me to the right system to use when creating several pages where only the main content is different, while the header and/or footer remain the same? I've used JS for this before (jsfiddle.net/rhptztzm/3) but I remember getting critiqued pretty badly about that.
 
1:52 PM
@Yorrick 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.
 
@AwalGarg You can't help someone not willing to accept help
 
@Yorrick any decent server-side templating system
 
If someone wants to learn but is just very new or not very good, the problem can be solved with time and effort.
If they don't, all the time in the world won't solve the problem. Money, however, probably will.
 
@JanDvorak so PHP/ASP? At least someone answered
 
@Yorrick
@Yorrick not that one
 
1:54 PM
Yeh sorry hit enter too fast, been writing too many HTML tags so got used to the "hit enter after a word" thing :P
 
@Yorrick While it's something that can be done client-side, it's a thing better done server-side.
 
@MadaraUchiha But that way, we won't be able to help half of the people who come here :(
 
@AwalGarg That's right
 
@AwalGarg and that's fine
 
Unless you're willing to work for free of course,
In that case, by all means "help".
 
1:55 PM
but not here
 
Please ^
 
No way to tell them that they need to learn and not Ctrl+C Ctrl+V?
 
Throw them some links and then throw them out
#1 is optional, #2 will follow from their interactions
 
While I agree with you guys on that, @MadaraUchiha & @AwalGarg, there's a difference between "being unwilling to learn" & "not understanding the subject even though it's been thoroughly explained"
 
@JanDvorak IIRC, you did the opposite with me :P And that helped me ^_^
 
1:57 PM
@Yorrick Many fall into the first category, though
 
True
 
@Yorrick Definitely. And most people here who know me will tell you that if I sense someone is willing to learn, I'm willing to spend my time helping them learn.
 
@AwalGarg only if they are willing to learn
 
I'm not saying you don't see the difference, but a lot of people certainly do seem to fail at seeing that difference, on SO and on other websites like this one
 
1:59 PM
@JanDvorak TBF, I didn't came here with the pure intention to learn. I also just wanted to copy paste. But I realized I can learn and it would be for the greater good. And I think the same could help other people too. Profit.
 
@Yorrick SO is not a "gimme a tutorial" site
 
I never said it is @JanDvorak
 
@Yorrick for your specific question
There are several ways of doing it
 

« first day (1653 days earlier)      last day (3296 days later) »