« first day (1985 days earlier)      last day (2966 days later) » 

12:01 AM
crappy production value
but still kinda worth it
 
12:35 AM
Do you think you can use Analystics as subsidiary database?
for your application?
 
12:47 AM
hey guys, I'm trying to wrap my head around the concept of JWT (JSON web tokens) vs. sessions
can someone explain it to me at a conceptual level
 
JWT is meant to be stateless on the server
If that makes sense
For example, when you log in, the server generates a token that has authenticated: true in it
Then the client sends that token to the server every time it has to access a protected page
 
1:27 AM
is it bad for performance to leave an element in that DOM that isn't on the page? If so how would I go about deleting it? jsfiddle example
 
it isn't in the DOM (if you're talking about the canvas) e
and a smart browser will GC it once the ref is unused
 
oh I clearly misunderstand what the DOM is then.
what does GC stand for?
 
you are creating the element with the DOM api, but it is existing in memory
 
garbage collector
 
GC = Garbage Collection
 
1:30 AM
right, so theoretically if I did that many times on a page wouldn't it fill up the memory?
 
if you keep a ref to the canvas outside of the function, I think.
in your case I'm pretty sure you are fine (assuming the function returns the string for the image)
but you can profile the memory and make sure it doesn't grow
 
ok thanks, I'll do some tests and report back.
 
@joshhunt Not exactly
 
can you explain?
 
@joshhunt jsfiddle.net/36fy1jfL/1 should be fine
 
1:36 AM
Yeah I'm just trying to put it in simpler terms
Basically you have 2 bins
Young memory and old memory
The idea is that like 99.99% of your app's data is young
But in your situation, the GC would notice that it hasn't been used in a while, so it'd move it to old memory
Ergo not exactly costing your application memory
 
ah ok, that makes sense.
 
Eventually you'd fill up the old memory
 
btw the only reason .remove() isn't used is because of browser support right? (I only just found that such a thing existed, I thought it had to be done via removeChild)
 
And I think that the GC would eventually delete the object, even if it's still referenced
If memory is an issue
 
is GC a browser or OS thing?
 
1:40 AM
Browser
 
well, kinda both
 
Garbage collection is implemented by the javascript engine
Not sure if there are OS-level garbage collectors
 
I also thought that, but somehow magically the same version of chrome handles memory better on win10 than win7 :/
 
thanks, just reading the wikipedia page on it now
 
annoying as it is
 
1:42 AM
Yeah read up on generational garbage collectors
 
2:02 AM
@Meredith ok I've had a play around with some stuff but I don't really know what I am doing :/ which test should I be using?
 
That article I linked basically talks about exactly what you're dealing with
Basically, if you have a reference to a node, its entire tree doesn't get colelcted
In your case, you'd do imageObj = null when you're done with it
 
this is my test, memory is still going up at about the same rate (viewing via Chrome's task manager)
function killMemory() {
    var test = document.createElement('div');
    test = null;
    setTimeout(killMemory, 100);
}
I should say I really have no idea what I am doing, so my test is probably wrong.
 
do you really need an endless amount of objects/elements?
or can you use a pool
 
no not really, I am just researching
 
well, then maybe lookup object pool pattern as well?
 
2:16 AM
seems like a good idea, probably a little overkill for what I need at the moment though
@Meredith what is the difference between = null and .remove()?
 
Setting it to null frees the reference
x = someNode
Here, someNode can't get collected
If you set x to null, nothing points to the node, so it can get collected
.remove just removes a node from the tree
It can still be referenced somewhere else
 
right, thanks. So much to learn
 
var el = document.getElementById('div-01');
var el2 = el.nextElementSibling;
el.nextElementSibling.remove(); // Removes the div with the 'div-02' id
el2 = null; // Now the node can get collected
 
that's a good example, thanks
 
Have you ever used C++?
 
2:33 AM
nope, I pretty much started as a web designer with a little knowledge in html / css.
 
2:49 AM
Slim framework for PHP is... pretty nifty
 
What do you like about it
 
Well, it's a bitch to setup with Composer but that's just me. But I like how it maps the routing and this is the first I've used anon functions in PHP
 
node like behaviour?
 
$_api->map('/inventory/(:view)', function ($view='') use ($db, $_api) {
    //stuff
}).via("GET");
Behavior like async?
 
Eww I don't like that
 
2:58 AM
porque?
 
copy cats everywhere
 
I don't like the use part or the via part
 
Well, you can do $_api->get if you wanted to. map is like nodes router
 
I like that more
 
@Meredith Can you elaborate on "JWT is meant to be stateless on the server"
 
3:08 AM
The server doesn't store any state
Instead, it checks the JWT, which is stored on the client
 
For Node.js, can you give an example of when I login and what the server actually does in terms of "authenticated: true"
oh so the server doesn't store any state
But in SOAP they did right?
In restful they don't
 
Anything that uses sessions is stateful on the server
REST is supposed to be stateless, but it rarely is
 
 
2 hours later…
4:44 AM
@rlemon Sounds like an interesting person!
 
5:39 AM
Hello Guys
 
@hemanjosko Welcome to the JavaScript chat! Please review the room rules. Pleasedon'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.
 
[Pleasedon't ask if you can ask or if anyone's around;] - what is it
 
sounds like a tricky riddle
anyway, what brings you by?
 
@hemanjosko welcome!
 
6:08 AM
@SomeGuy Its happening!
 
@Abhishrek What is?
 
@SomeGuy heard whats going on in Latur ?
 
Nope
Oh, a water crisis?
 
I copied some code which got invoked when items inside an ul element got changed . So I tried this
 
@SomeGuy Curfew because of water :P
 
6:11 AM
But it fails to work.
 
Uhoh
 
@SomeGuy Mad Max in ETA 10 - 20 years
 
Haha
That's sad, man
 
:-/
 
6:19 AM
morning
 
Morning
 
@SomeGuy how is your draft going?
 
Just finished a rough draft
Check Hangouts
How about you?
 
@SomeGuy nice job :-)
 
oh
 
6:28 AM
which draft? what draft?
 
Draft of declaration of Independence of Maharashtra
xD
 
Why does Maharashtra need independence? xD
being another Kanhaiya kumar? xD
 
https://github.com/kensterz/interview-questions-in-javascript
GIthub repo for algo questions written in JS. Contribute, Share, Like (:
 
6:40 AM
> "So what you're saying is, your computers cannot possibly not continue damaging the plaintiff's interests."
> "That's correct."
> "You're being honest with me."
> "Yes, your Honor."
> "Will the computers continue harming the plaintiff's interests if shut off?"
> "... That would be dreadfully inconvenient, your Honor."
> "Do you have a more convenient solution?"
> "No, your Honor."
> "You are hereby ordered to turn off your computers in 48 hours."
> "... You can't do that."
> "I can do a lot of things, including jailing you if you disobey my lawful authority. 48 hours."
 
@AwalGarg where's that from?
 
6:56 AM
@CSáµ  news.ycombinator.com/item?id=11342147 from the thread @SomeGuy linked
 
oh yea
omg, he said it's not a knee-jerk
 
@AwalGarg lol, all the comments like "You just totally broke my build, but good for you!"
 
Which angular directive helps to invoke the controller when element html or content (like li added to ul tag)changes?
 
why did the html change?
where did the new li come from?
 
@phenomnomnominal it's from the library choosen. If I choose an element from the drop down, it automatically added to ul tag.
 
7:09 AM
ied
 
I want the same elements to be appended to another div.
 
you will need to write a directive to wrap that behaviour then
or find one someone has written that does a similar thing
 
Just now I realized that it should not be possible through jquery..
 
@AvinashRaj how does it feel to get enlightenment?
 
7:49 AM
@SomeGuy ping
 
8:07 AM
@AvinashRaj just use regex
 
@MadaraUchiha the real shitstorm is on twitter though :P
 
@AwalGarg Link?
 
Hey npm users: left-pad 0.0.3 was unpublished, breaking LOTS of builds. To fix, we are un-un-publishing it at the request of the new owner.
 
Yeah, it's a big shitstorm
 
I'm glad I'm not on twitter.
 
8:14 AM
NPM has always been a shame for node community. I'd be very glad if it faces an iojs level fork soon. </knee-jerk>
 
dungeon
 
npm, Inc. is dedicated to the long term success of the JavaScript community, which includes the success of the open-source Node.js and npm projects. npm's mission is to take Open Source development to entirely new places. When everyone else is adding force, we work to reduce friction.
 
@AwalGarg not gonna happen, it's the same people except they have a vested interest.
NodeJS, for people who do it full time, is like linux: it's not an altruistic project.
These people all have vested monetary interest in node - either they're consultants, or they're selling your their "enterprise" software, or they're selling your their package manager or they're selling you their cloud hosting.
Not a single person works full time on NodeJS just for the kick, they all need to eat. That's the consequence. In order for NPM (which is a funded for-profit company) to be replaced you need some tremendous effort first.
You need someone to first clone npm and then get community adoption and so on.
!!afk work/shit to do
 
8:34 AM
@AwalGarg Why do people include a dependency for something like that?
 
Everyone works because no one can survive without eating, and no one can survive without eating because our bodies consistently need energy to stay alive and we need energy because the universe is a system of increasing entropy
 
Which brings up my favorite module as of late: github.com/IonicaBizau/split-by-comma-regex
 
@AwalGarg Holy shit
What a shitty situation.
 
@OliverSalzburg Oh my god, I found the module I've been looking for. Thank you I owe you my life. wtf
 
@OliverSalzburg Hahaha
 
8:36 AM
ionica used to be a regular here, btw
 
@OliverSalzburg Because people are lazy, and silly.
 
In the HTML room too
 
Yeah, I talked to him in here
 
npmjs.com/package/number-is-nan 6 million monthly downloads
6
 
He has quite a few ridiculous modules
 
8:36 AM
'use strict';
module.exports = Number.isNaN || function (x) {
	return x !== x;
};
6 million downloads a month
 
@BenjaminGruenbaum sindresorhus... that explains
 
@BenjaminGruenbaum lol
 
@BenjaminGruenbaum God damn
 
I should package a module "safe-eval": module.exports = eval;
 
@AwalGarg Neat, I was waiting for a safe way to eval!
Needs a comment like // I'll fix this later though
 
8:39 AM
We need something like pear
 
@BenjaminGruenbaum that's like an entire city of programmers
 
And all they're doing is isNaN checks
 
I need to know what city that is and avoid it at all costs
 
> According to Koçulu, Kik's briefs told him to take down the module, he refused, so the lawyers went to NPM's admins claiming brand infringement. When NPM took Kik away from the developer, he was furious and unpublished all of his NPM-managed modules.
great
 
Hey, I'm working with Backbone and Marionette, do you think it's better to filter a photo gallery by adding css classes or directly filter my collection in backbone and re-render it
 
8:43 AM
@littlepootis it would be pretty great if some of kik's stuff breaks because of this unpublishing :D
 
I don't understand the purpose of the module when we have plain isNaN.
 
@AllanRaquin in terms of performance?
 
@Neil Yes
 
Or the comma regexp. It takes more effort to include and understand it than to type the few characters.
 
@AllanRaquin better to use classes imho
 
8:45 AM
@Neil Ok thanks :)
 
Also because it will be easier to understand/change later
 
@Sheepy isNaN coerces the value to a number pre-check, whereas Number.isNaN doesn't.
 
!!> isNaN("hello")
 
@MadaraUchiha true
 
!!> Number.isNaN("hello")
 
8:48 AM
@MadaraUchiha false
 
Ah. Thanks for the explanation. I usually do my own type cast.
 
As does anyone sane
 
Hey, guys, sorry for asking an off topic question but where do I go to suggest a change in procedure? Mainly I think a downvote should require a comment.
 
@GregBorbonus Welcome to the JavaScript chat! Please review the room rules. Pleasedon'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.
 
isNaN asks whether what was supplied isn't a number, whereas Number.isNaN asks whether the supplied value is the constant NaN.
 
8:49 AM
@GregBorbonus Suggestion downvoted. No comment.
 
@GregBorbonus Before I answer that
This was suggested at least a hundred times before
And declined every time, as it breaks the concept of "votes are anonymous"
If you still wish to go through with it, Meta Stack Overflow is where you go.
But be ready for getting downvoted a lot there.
 
It will likely be closed, fair warning
 
@MadaraUchiha without any comment.
 
fuck you florian
 
@FlorianMargaine I know someone would say that
@AwalGarg lel
 
8:51 AM
@AwalGarg 2.9
 
lol
But I also don't think npm is making a good precedence by bowing to the request. They are making themselves responsible for user content.
 
@Sheepy That's absolutely correct.
 
Thanks, but if its been said before, then no need to. Ice just been seeing people downvote legit and good answers. In what appears to be an attempt to raise their answer vidibility, but I shall suffer in silenc.
 
I've got a colleague on the opposite side of the desk coughing his lungs out and he calls me for help. My boss has a runny faucet for a nose. .. yeah, I am getting sick
 
After that, their only option is to make it impossible to redact versions (even for them)
Which is very bad.
(For the cases of "this package with N millions downloads has a major security hole in version x.y.z, we need to redact it")
 
8:54 AM
@GregBorbonus sometimes, if you ask nicely in the comment section, they will provide the reason behind the downvote
 
@GregBorbonus Link?
 
Hmm. We'll see how it turns out. I'm sure npm inc is thinking it over.
 
But you may not most definitely will not agree with the decision
 
@Sheepy Yeah, people should really settle down and wait for the post mortem after the initial heat dissipates.
 
Ha! My cell is making typo hell, but I will try that, count to 50 and ask politely ... Yeah politely.
 
8:57 AM
@GregBorbonus Link to such a post?
 
@GregBorbonus remember that it can happen ;) it is normal
 
No. I don't agree with Firefox removing options after options, either. Still using Firefox. Happens all the time.
 
I am on my cell with the new app, don't
 
i'm an intern. and that's probably the reaction my co workers would get
 
8:59 AM
@swess hehe :)
 

« first day (1985 days earlier)      last day (2966 days later) »