« first day (1668 days earlier)      last day (3505 days later) » 

01:40
Why is this utter nonsense getting upvotes? stackoverflow.com/a/30158371
\> sees incorrect answers, put effort into writing a correct answer.
\> people vote up the incorrect answers.
Gotta love Stack Overflow.
01:59
Well, he did answer well the bar=foo part which I skipped over, so that makes sense
02:16
looking back, my "correct" answer wasn't so correct stackoverflow.com/questions/30158304/…
lesson learned: do more research before ranting
+1 for admitting it
thanks for the imaginary vote :D
'morning btw
What happened to the JavaScript room's bot(s)?
02:34
Caprica is still here
Oh nice, I found it weird that it wasn't welcoming the newcomers
02:46
She only pings them on first message
Looks like @MichaelDrayton starting using the chat today, I guess he joined earlier today too then
though, wasn't there a 15 rep or so requirement to join chats?
Oh, they're free to read by anyone chat.stackoverflow.com/faq
03:29
@SomeKittens got any insights into SEO and angular?
Google runs JS, so there's nothing really special to it
03:53
Hey guys, I'm pretty new to posting on SO and have a question. I answered a bounty question that is the correct answer, but the asker hasn't been during the weekend and the grace period ends during the night. Is there any way to get that bounty when he looks at SO tomorrow?
@JohnHarding 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.
And it doesn't have any upvotes so it won't give me the bounty automatically
Hello?
Well, anyways...
Hi! I'm a C++ programmer who was wondering if there were any great and easy-to-use Node.js frameworks to create web apps for maybe the middle school or high school level. I'm completely out of my zone so I wanted your guys' opinions. Any thoughts?
04:24
hi guys anybody knows any url of web service which gives large data set?
04:50
@AwalGarg Haha, ask already!
@FlorianMargaine I've never seen either of them in the Python room, so...
05:33
@AwalGarg I accidentally clicked my JS badge, then was like…"hmm, I wonder how many people have gotten this badge…" Then I saw your name on the recents list.
05:52
@Cinch Express?
@Cinch definitely express
stackoverflow.com/a/30160310/2476755 I almost feel bad commenting since I can imagine me-of-a-year-ago writing code like that
@royhowie the dude learned something
it's good
06:07
@royhowie , i don't see how ur comment is constructive in anyway , and Jaideep , remember that on SO , alot of people prefer to see code , Just to emphasis the point . — Alexander Solonik 4 mins ago
@royhowie Ah okay
Is there anything REALLY graphical in nature? Like "Ho, bang!" and it's up there?
@royhowie , IMHO , u tend to be very very sarcastic and contribute very little to actually answering the question (which is ACTUALLY what your suppose to do on SO , incase u did't know ) , i don't know what toung-in-cheek means , but u surely display very little control of it . on a serious note , if you have nothing constructive to contribute , just don't contribute at all , you could have always said "hey Jaideep , we would appreciate seeing a little more code" ... That statement does the Job . sarcasm only aggravates the situation . BE HUMBLE ! — Alexander Solonik 31 secs ago
@Cinch wordpress?
@royhowie But that's PHP
I already use it too
@Cinch I was hesitant to recommend it (since I really do not like wordpress)
I want it to feel coder-y but graphical in nature as well... Something like a Node.js for SFML or something.
06:16
by graphical, you mean you want the equivalent of a cPanel?
(instead of just having to use the terminal)
@royhowie I don't know what this is.
By graphical, I mean that it can draw pictures at arbitrary positions, load text, etc.
@Cinch en.wikipedia.org/wiki/CPanel go to any free web host and you'll see this
@Cinch a WYSIWYG editor?
@royhowie oh, no no no
It just needs to create graphical stuff
06:18
I'm not quite sure I understand what you mean by "graphical stuff"
Are you thinking of <canvas>?
I know absolutely nothing about JS... What would be the equivalent of SFML or Qt?
You should just focus on learning javascript; you'll be better off in the long term
@royhowie That's not the deal, though.
Apparently I need to come up with a sort of class/dojo-like thing for kids.
@Cinch So you're looking for a GUI interface for code?
06:21
I'll be learning JS later but they want an idea now.
@SomeKittens Code library or module to create an interface.
Dreamweaver?
@Cinch who is "they"?
Morning!
hi is there a way i can access the facebook page views via angular application?
@royhowie Ah, I don't think I am allowed to say since I'm not really allowed to speak for them.
06:23
What's the name of these numbers containing e (e.g. -3.67394039744206e-15)?
@IonicăBizău Scientific notation.
@Cinch ...that's odd
It's a different form of scientific notation.
@IonicăBizău integers (if there are less decimals than the power)
are you bidding on a project?
06:24
@SomeKittens Oh, no. It's just they are open to ideas from me and I want to contribute something.
@royhowie Thanks!
It's just I've been dipping my feet in C++, not JS for the past year.
Then use something like Balsamiq to create mockups
Exponential notation?
@Cinch then why are you offering to write an app in JS for someone?
06:24
@royhowie I'm not. The idea is to teach kids to code in JS.
As I said previously, focus on learning, until you can actually bring a product to market.
It's not a product, it's a light learning service.
@Cinch So shouldn't you extensively learn JS first?
It's just that their current programs all focus around JS.
@Cinch "product" != makes me a multimillionaire
06:25
@royhowie I have a summer internship but I feel like it wouldn't be too hard to learn something light like an SDL binding for Node.js or something.
@Cinch we can't quite help you if we don't know the details of what you're looking for
@SomeKittens Alright, i'll try list some.
* Module that allows for arrangement and presentation of arbitrary items, such as images, text, links, and allows for dynamic behavior (i.e. buttons pressing, signals, the usual I/O stuff we might see in web pages)
* Perhaps another module to make server-client communication easy? I'm hoping to end with maybe a chat client but that's much too ambitious I think. Easy networking would be a plus
* Very light. Doesn't have to be too powerful, I'm just looking for a nice API that is quick and easy to learn. Think Ruby on Rails vs. Java enterprise web backends.
So you're basically building scratch, but for JS (and possibly at a higher level)?
@royhowie Something of the sort.
I want to focus on "networking-lite"
i.e. I press a button, I send a signal, and a server might pick something up.
06:46
@Cinch this is really just too broad; idk how to help in any meaningful way other than "just keep learning"
@royhowie Well.... okay.
someone else might read your message later and help you out, though
@SomeKittens I just realized, the guy who made that comment
is the guy with that horrible question who got really angry (the one @SterlingArcher mentioned in chat)
@royhowie You saw where I needed it. :)
@IonicăBizău huh?
06:57
@IonicăBizău not I have to fix toString() -> toString
@IonicăBizău for that many upvotes, I wish the answer wasn't just a long, run-on sentence
THE
THE
07:14
var iCount = {};
for (var i = 0; i < 4; i += 1) {
    for (var j = 0; j < 4; j += 1) {
        iCount["" + i + j] = 0;
    }
}
$.each(iData, function (index, item) {
    if (item.Weight > -1 && item.Size > -1) {
        iCount["" + item.Weight + item.Size]++;
    }
});
@THE Why iCount["" + i + j] and not just iCount[i][j]?
THE
THE
if I don't put "" then it will take weight and item size as number, so for 0 and 0 it will give me "0" when i expect "00"
What does i in iCount stand for? If you want to do hungarian notation, you should at least do it right.
hi all, In my jsp i have included this tag..
<a href="deleteUser?uid=1" class="icon icon-del" data-confirm="Are you sure?" data-method="delete" rel="nofollow">Delete</a>
THE
THE
what now I want is to add title to the array
07:17
JSP is java, not javascript...
THE
THE
so there may be items with weight and size = 00, then it may have item with several titles
But problem is that it not shows alert
@vishal Why should it?
THE
THE
so I want soemthing like this,

array["00", {title1, title2, title3}] or maybe something smiliar ?
I have included jquery-1.9.1.js
I didn't get it
07:19
@vishal Just adding "data-confirm" will not do anything on its own
@vishal jQuery doesn't care about your data attributes. You should
@JanDvorak or just don't use hungarian notation
There needs to be JavaScript code to read that attribute, and display an alert.
@royhowie "if", "at least"
@THE I don't understand what you're trying to model here. What data do you have, and what do you want to save?
07:20
@JanDvorak I know, I know, but I wanted to make sure @THE doesn't get the wrong message
so what should i have to do
can you give any link or example
THE
THE
:23220096 let say this is what I have,


var countMe = [
    ["00", 0],
    ["01", 0],
    ["02", 0],
    ["03", 0],
    ["10", 0],
    ["11", 0],
    ["12", 0],
    ["13", 0],
    ["20", 0],
    ["21", 0],
    ["22", 0],
    ["23", 0],
    ["30", 0],
    ["31", 0],
    ["32", 0],
    ["33", 0]
];
@vishal hint: .on("submit",
@THE I think you might want to use an object: { "00" : ["title1", "title2", "title3"]}
THE
THE
atm the "0" is just number of items I each array
07:21
@royhowie I think he wants a nested object...
k..got it
Thanks
@MadaraUchiha array["00", {title1, title2, title3}] I mean, I don't get the point of a nested object here
{ "0": { "0": 0, "1": 1 ... }, "1": { "0": 0, ... }, ... }
tl;dr—there must be a better way of storing your data, @THE
@royhowie Have a look at the code generating that array...
07:22
@MadaraUchiha Just use nested arrays at this point
THE
THE
1
Q: Array having issues in JS

THEThis is what I am trying to do, // declare an array with 16 items, each with intial value = 0 var countMe = [ ["00", 0], ["01", 0], ["02", 0], ["03", 0], ["10", 0], ["11", 0], ["12", 0], ["13", 0], ["20", 0], ["21", 0], ["22", 0], ["23", 0], ["...

Now requirements has changed
Now i am adding numbers to this grid
but I need to add titles as well to box if each box have less then 3 items to it as well, so I need items titles as well as array or object
@THE You're having a classic XY problem, which is why you've left yourself with a rather crappy data structure for your goal.
THE
THE
@MadaraUchiha so what should do then ?
@THE Each tile should be an object with information
title, number, color, whatever
The location of the tile is kept either in a nested array, or a nested object.
THE
THE
that's what I am getting in data...

I need to group them based on "00","01"...

but i think your approach makes sense too now, let me think
07:27
grid[0][0] = { title: "top left tile", number: 1, color: "red" };
grid[0][1] = { title: "second top tile", number: 2, color: "blue" };
...
You want your data to look more like this ^
Then you can access any tile using its coordinates on the grid, and access/change any information you want about it, even adding new information is trivial (because objects are not rigid)
THE
THE
think "00" as a box as in the fiddle which can have n numbers of items in it, let me find a more closet fiddle
@THE Stop
HAMMERTIME!
Concatenating strings to form object keys or array keys is almost never the answer
It's a good indication that you're doing something wrong
@MadaraUchiha This avoids the problem of autovivification, though
07:30
@JanDvorak Not familiar with autovivification
@MadaraUchiha autovivification in Perl = when you access an undefined array inside an array, it magically creates a new empty one so you don't have to.
@JanDvorak Oh, yeah it's just an example
Of course you'd need to initialize grid[0]..grid[n] first with empty arrays
morning!
Why does passport.js have such dismal documentation?
I just want to know what the parameters to the callback are passportjs.org/guide/username-password
07:46
@royhowie function(username, password, done) {
@Neoares function (req, email, password, done) is for LocalStrategy
(if you have passReqToCallback : true)
Regardless, is there an easy way to implement redirects?
res.redirect("path/to/your/route")
aka, if a user navigates to /test, but that route requires the user be logged in. So my middleware will redirect to /login?ref=/test
@Neoares I know how to redirect; basically, I want
app.post("/login", passport.authenticate("local-login", {
successRedirect : "/profile",
failureRedirect : "/login",
failureFlash : true
}));
so what's the problem
to be dynamic and redirect, on success, to ?ref=WHATEVERSOURCE
07:50
you meant redirects with passport.js?
passport.use("local-login", new LocalStrategy({
    usernameField : "email",
    passwordField : "password",
    passReqToCallback : true
},
function (req, email, password, done) {
    User.findOne({ "email" :  email.toLowerCase().trim() }, function (err, user) {
        if (err) {
            return done(err);
        } else if (!user) {
            return done(null, false, req.flash("message", "User not found in database."));
        } else if (!user.validPassword(password)) {
            return done(null, false, req.flash("message", "Oops! Wrong password."));
logging in is fine
I'm just trying to figure out how to dynamically redirect based on referrer
5
A: Custom Redirects in Passport

Scott WeinertI would first redirect successful logins to your addemail function inside your twitter route: app.get('/auth/twitter', passport.authenticate('twitter')); app.get('/auth/twitter/callback', passport.authenticate('twitter', { successRedirect: '/addemail', ...

it's very easy to do with just res.redirect("request parameters here"), but I was trying to figure out whether passport has this already built in
the doc is full of custom redirects
@FlorianMargaine I'm already using the successRedirect field; however, I didn't see the section on custom callbacks
07:59
app.get('/login', function(req, res, next) {
  passport.authenticate('local', function(err, user, info) {
    if (err) { return next(err); }
    if (!user) { return res.redirect('/login'); }
    req.logIn(user, function(err) {
      if (err) { return next(err); }
      return res.redirect('/users/' + user.username);
    });
  })(req, res, next);
});
chat Y U NO embed
good ol' days
08:14
@FlorianMargaine is req.logIn something you define?
@MadaraUchiha It gets added when Passport is initialized
Also morning :)
@BenFortune morning
@BenFortune And what does it do?
How does it verify?
As defined by the strategy?
I think it just adds your user to the session object.
The actual authentication is done in the configuration
Which is done when you call passport.authenticate
app.post("/login", function (req, res, next) {
    console.log(req.headers.referer);
    passport.authenticate("local-login", {
        successRedirect: req.headers.referer || "/profile",
        failureRedirect : "/login",
        failureFlash : true
    })(req, res, next);
});
this seems dangerous
is there a safe way to make sure the referrer is from my domain?
I know it's somewhere in req, but too tired to remember and I want to finish this function b5 I got to bed
@royhowie The node application is not aware of where it's being run
In fact, the same machine can be reached by different means (IP, domain, subdomain, localhost, some other alias)
@MadaraUchiha so there's no way to make sure someone doesn't go google.com/something > mywebsite.com/admin > mywebsite.com/login ?
@royhowie Sure there is
Pass the referer as configuration to your app
For example, an environment variable.
actually, it shouldn't matter. Since if they get redirected to login, they will be brought back to the page before that, which must be a page on my website
@royhowie The referer in this case is pointless, because the client can send you any referer
If you want security, read about CSRF
08:23
I know about CSRF
Then that's where your efforts should be focused on.
I'm more concerned about usability
for users
THE
THE
This is what exactly I am doing - jsfiddle.net/nhe613kt/383
but I'm tired and my concern is actually impossible (there is no way for the average "dumb" user to be redirected off the site, unless they're doing something fishy)
THE
THE
at the moment it only shows numbers, I need to change it to show titles if number is less then 3
otherwise numbers
why did i get a down vote ?
care to explain @MadaraUchiha ?
08:35
hey guys
good afternoon !
i have a small question
have a look at this fiddle
now the console.log prints the following :

"WebkitTransition"
"MozTransition"
why just these two results ??
Why not the following ??

WebkitTransition
MozTransition
OTransition
transition
@AlexanderSolonik perhaps because it returns MozTransition?
Hello Guys, need your help, it's angular)
scope applies when I click twice on td, I don't know how to make it right - with one click

var app = angular.module('mainApp', [])

.controller('myCtrl', function($scope, $parse) {

$(".shopcart-table").delegate("td:nth-child(1)", "click", function() {

var angVar = $(this).closest("tr").find('.ng-binding').attr('ng-init').split('=')[0].trim(); // hide().remove();

$parse(angVar).assign($scope, 0);
$scope.$apply();
});
});
@JanDvorak is there some sort of hoisting going on ??
Have jquery event inside angular controller
@AlexanderSolonik I'd say returning is
08:50
@JanDvorak , see my comment in the code now :
There's no hoisting for conditionals. that wouldn't make sense.
remove the consition and all 4 elements in the Object literal are printed
You're returning out of the function.
Console.log can log objects in the state at different point in time than it was called, but that doesn't matter for simple strings.
add the condition and only 2 elements of the object literal are printed !
Why ?>?
08:53
!!tell alex mdn javascript return statement
4
Q: Force React to fire event through injected JavaScript

mstormWhat I am trying to do I am currently writing a little chat bot for Web-Whatsapp. I decided to use a chrome extension because of the easy js-injection. There is a voice-message button which switches to a button for sending text as you start typing something. React deletes the voice-message eleme...

If someone has a second ;)
09:16
@mstorm good question, +1
thanks, the problem is driving me crazy :p
@mstorm I assume you tried facebook.github.io/jest/docs/tutorial-react.html right?
Also, in PhantonJS etc it'd work
Im pretty limited, cant really interact with the react because of the chrome extensions. The injection via chrome extension does not allow access to objects from the site you inject. But i gonna take a look at phantonJS, thanks
THE
THE
0
Q: Did i over complicated this simple grid by using SVG?

THEI developed this grid which displays number of records for X & Y, user can click each number to see a list (I didn't added list's markup to fiddle yet - so lets not worried about it atm) What I believe is that I over complicated this simple project by choosing SVG, and it can be improved massive...

@THE what's wrong with an HTML <table> tag for this?
Also, when you do $(item).attr("id"); a kitten dies.
09:25
Hahahaha :DD
THE
THE
@BenjaminGruenbaum is it for me ?
@THE yes.
fCount["" + i + j] = 0; this is offensive
THE
THE
I applied what I learned
Is there any "best design" for routes? As in /users/delete/1 or /users/1/delete
@THE I'm not actually angry at you, don't worry. I'm just pointing out there are major conceptual gaps in your modeling. You should learn about arrays and how they work to represent data, and you should at least understand the DOM API.
@BenFortune the "better design" would be to access /users/1 with a DELETE HTTP verb.
09:28
@BenFortune I would go for /users/1/delete
@BenFortune I'd prefer the latter
or what Benji said
@mstorm I can talk to the WhatsApp people if you're stuck for much longer, they use bluebird and Petka knows them pretty well - but I'm not sure they'd like the fact people are writing bots :) Wouldn't it be simpler to hook on the messages and how they're sent instead of the DOM?
can somebody explain this line better
Special event hooks for "click" are called if they exist, except the handle hook for "pushy" is called when an event is delivered if one exists.
@AlexanderSolonik heyho
@BenjaminGruenbaum That's what I'm doing now, but I'd like to be able to access it with a GET too.
@BenFortune you don't
@BenjaminGruenbaum I love solving problems on my own as far as possible, but thanks for your help :)
Is having a hundred forms on a page a bad design pattern though?
@mstorm good answer, good luck :)
@BenFortune you really don't, that opens you to a CSRF attack, google up what that means.
09:31
As opposed to 100 links
@BenFortune it's just bad UI. 100 buttons is bad UI too.
Not only to CSRF, but also to plain old page prefetching (which Google might reasonably do in the near future)
... and caching, which it already does
@JanDvorak that's just headers
@THE your code is pretty terrible. Please don't take it as a personal offense. (Not you or your ability, just your code). You really need to go through an arrays tutorial and learn about separation of concerns, you're constantly querying your presentation layer for data.
I mean, the browser won't cache a DELETE request, will it?
@JanDvorak it won't cache a GET one with the appropriate cache control headers either. I think CSRF is strong enough though.
09:34
You can't avoid CSRF with POST
All security concerns aside, DELETE is still the semantically correct approach IMHO
@JanDvorak sure you can, you just need a token
Although I get the point, it's not enough to just change the verb.
@ivarni also that.
I'm going to need a form for each action though aren't I?
form(method='delete', action='/user/#{user.id}')
    button(type='submit') Delete
Maybe, but why do you have 100 forms/actions there on the same page? Split it to different pages logically, you can also put that sort of stuff in a function that takes the table name/connection name an handle it from there
Because it's a list of the users for the backend management
09:37
Does anyone know if blackboxing sourcemapped scripts will be supported in chrome anytime soon ?
@BenFortune JADE?
@Neoares Aye
I'm just picking up browserify and I feel like I'm going backwards if I have to drop blackboxing...
@WillemD'haeseleer Blackboxing?
09:39
Blackboxing is awesome for debugging, I miss it too (I'm a browserify user)
Haven't found any good workarounds, only very very bad ones
@ivarni that's horrible actually
@ivarni It does work absolutely perfectly in Firefox
If I understood you correctly
So it just doesn't work
If I can't blackbox react I don't even think I'm still considering browserify anymore...
back to requirejs
THE
THE
@BenjaminGruenbaum I agree, but i learn by examples reading specific content never helps me as i forget it when developing
I am planning to work on it at some point in future very soon
@Jay Doesn't seem like something you should be doing
09:51
Hello
Are there angular masters?)
ng-click="delete('variable1')"
- - - - -
var app = angular.module('mainApp', [])

.controller('myCtrl', function($scope) {
$scope.delete = function (item) {
$scope[item] = 0;
};
});
@Jay What are you trying to achieve ? do you mean contents of the file, or return value of the file ?
It only removes with 2 clicks, but not one
@dns_project open a question, you'll get better / faster responses
09:53
I don't know why
ok)
@dns_project please format your code
!!tell dns_project format
@dns_project Format your code - hit Ctrl+K before sending and see the faq
$.get('DATA.PHP').then(function(data){ $('.world').replaceWith( data ); });
the function inside the then method will be called when the request to DATA.PHP completes, it's an asynchronous request, read up about ajax and how promises work
@Jay please refrain from starring messages that only help you.
Starring is not a chat upvote.
@MadaraUchiha don't take my star away :(
10:07
@Jay Stars are reserved for interesting/funny messages that people will want to read. They appear to the right of the page --------->
@WillemD'haeseleer that's just $(".world").load("DATA.PHP") ftr
@BenjaminGruenbaum Nice, haven't used that before. But it reminds me of update panels in asp.net webforms...
lol yeah, </3 webforms
what a horrible thing that was
Glad we share that point of view :D
I'm doing some django these days, It's not much better ether
I think it is, but OK :)
It's more like asp.net mvc than asp.net webforms
10:20
Yeah it is a lot more like mvc for sure, all tough I much more enjoyed razor syntax then templatetags
Yeah, definitely.
THE
THE
so should i use table instead of svg then ?
10:42
@royhowie haha nice! And congrats to you too!
@Jay genius might be a bit of an overstatement
THE
THE
completely being ignored
hey guys is there any gentleman to help me little bit with backbone.js ?
i'm struggling with inheritance in backbone.js
11:09
!!welcome hamism
@hamism 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.
@CapricaSix i get it
i have a base backbone view and another view which extends from that base view but when i try to trigger events like click i can't do it unless i go to chrome console and do it there
@Jay yes
> Description: Load data from the server and place the returned HTML into the matched element.
11:33
github.com/darkyen/WomenHelperApp < after that do phonegap serve & gulp
oh my :D
Anyone doing AES256 bit encryption decryption using master and temporary keys (in JS)? I'd love to pick your brain...
such development !
Mmm, react
not just react
it has tons more :D

« first day (1668 days earlier)      last day (3505 days later) »