« first day (2154 days earlier)      last day (2804 days later) » 

12:02 AM
watching the roast of Ann Coulter (*Rob Lowe)
lol, holy shit
 
12:21 AM
ewww
 
@rlemon what are you watching likn?
 
Roast of Rob Lowe
Comedy Central doesn't like Canada so I'm watching on some sketchy add riddle site i'd rather not link
 
@rlemon here is my emali limeblack7@gmail.com
 
or just use google
"roast of rob lowe full"
 
they better mention his sex tape
 
12:28 AM
ohhhhh they do
and how
it is seriously one of the most brutal roasts I've seen
 
@William thank you for subscribing to the newsletter.
 
@littlepootis what newsletter
I am already subscribed to like 50 email threads
nodejs, javascript, python
also subsribed to flippa nonsense
 
flippa?
flippa-delphia?
 
1:34 AM
Turns out there's something that gets softer in liquid nitrogen
 
var foo = obj.foo || undefined;
var name = foo.metric_name || undefined;
if (name) {
....
is there a better way to do the above ^
 
can youuse es6?
 
I dunno, lol.
 
> var foo = obj.foo || undefined;
why would you do this?
 
what is the goal behind || undefined
 
1:44 AM
I guess so. Most of my small team uses Chrome,Firefox,safari
 
seems useless
 
@rlemon to prevent errors in js console
 
um, what errors?
 
why would there be errors?
 
oh sorry, im trying to access name[0]
 
1:45 AM
if( 'metric_name' in foo ) blah
 
var foo = obj.foo || undefined;
var name = foo.metric_name || undefined;
if (name) {
switch(name[0])
....
 
You can change something like:
var foo = bar || undefined;
to
var foo = bar;
 
o
 
Are you sure it's supposed to be || undefined?
 
but if the property doesn't exist trying to grab an index might fail?
 
1:46 AM
Not || then some default?
 
but the || undefined doesn't solve that
not sure what the point of that is
 
unless of course, if you want to init foo to undefined when bar is a falsy value.
eh
 
Not everything has obj.foo. And fewer have obj.foo.metric_name
 
I suppose, but the later check would satisfy with falsey
@taco so check for the property using in
if( key in obj )
 
He wants to check if metric_name is in obj I think
 
1:50 AM
4 mins ago, by rlemon
if( 'metric_name' in foo ) blah
 
& the answer is no you can't
You gotta check if foo is in obj, then if metric_name is in foo
 
hasOwnProperty
 
No easy way to do that
 
or get a null coalescing library
@ssube wrote one
 
You a lot of &&'s and add a comment.
 
1:51 AM
@rlemon Aha. Thank's rlemon
is that es6 though
 
no
 
but google " null coalescing library + js "
just for fun
nice, ssubes comes up first npmjs.com/package/koalaesce
 
I'm using js. Would I have to browserify that
 
nice
You probably will have to.
 
1:54 AM
You should get browserify or something similar setup anyway
 
I guess I'll do the two if's until I find this to be a deeper problem
 
you can (I'm pretty sure) just compile it once and include that in your front end -- but mer is right get a build system in check
you can use && and one if
 
It's a PHP app :d
 
if( key1 in obj && key2 in obj.key1 )
ofc key1 is a variable that evaluates to 'key1' in that example
;)
 
yeah thanks. That's what I'm doing for now. Might use koalesce if I have to write more noob js
 
1:57 AM
lol "noob js"
 
3 more years in this chatroom and I might be able to pass a lint test
 
obj.hasOwnProperty("key1") && obj.hasOwnProperty("key2") is another way, but doesn't scan up the prototype chain.
 
usually not an issue, but good to note
 
Yeah that method is usually for iterating over arrays and stuff
Something like that
I haven't used it in so long
 
iteration?
oh, for..in and hasOwnProperty
 
1:59 AM
for..in for iteration is ugh
 
Which you should never use
 
but checking for property access is cool
imo better than just checking for falsey, I never actually access the obj
could be issues with shitty code (getters) and crazy huge objects
 
@Meredith why not?
 
Learn how to use map/reduce instead of for loops
 
@littlepootis for..in isn't for arrays and Object.keys is better
iterate arrays, not objects.
 
2:02 AM
Of course, it isn't for arrays.
 
well yea, and for objects if you want to iterate them use object.keys and iterate that array
or for..of
 
Usually you're better off using a keyword list
Than iterating over an object
 
fair enough
 
I'm so happy about for..of
so much love
 
I hate it
 
2:04 AM
me too
map ftw
 
why introduce a function in situations where you don't need it
 
Native maps suck too
 
Is there an Object.keys equivalent that traverses up the prototype chain?
 
@rlemon by that logic everything should just be in one big script
 
@phenomnomnominal no, notice I said "where you don't need it"
 
2:06 AM
 
@rlemon what defines needing it though
 
situations.
 
most functions exist for breaking things up into units of functionality right?
 
You should never use a for of loop
 
move your mapping code out to a function so you can test it, then use it in a map
 
2:06 AM
Just gonna make that a rule
 
look, I'll be honest, I'm a little drunk. but I've had this argument before and there is for sure cases where you don't actually need the function overhead/scope and for..of is cool
 
Then you end up with a for of with like 6 lines in it
 
ask @BenjaminGruenbaum, he's always good for a discussion on js ;)
 
Don't do that to your poor code base
 
2:07 AM
I don't know how else you'd do it.
This probably can't be done without using for..in.. (or maybe we can, but this is better)
 
@littlepootis for ( let p in tel )
 
Of course, it's trivial to write something that lists enumerable properties up the prototype chain, but why?
@Sheepy do it without a for loop.
 
I do agree that for in has it places. I use it when I have to.
 
When do you have to?
 
When you want the potato.
 
2:13 AM
must be latvian
 
I guess maybe if you want to break out of a loop early
but even then, find that shit.
 
That's not hard to do with a reduce
 
This is a subjective design decision, like the use of functions and prototypes, when I design an object that needs to be looped this way. May be I think it is simple. May be other think it is not. Is there point arguing about it when we have decades of experiences combined?
 
^ fair point
 
I just wanted to know what you thought
 
2:16 AM
I usually do that when I manipulate data objects. I need the key to put the processed value back. Somtimes I use a proper Map, but when I control the keys I just use an Object.create( null ).
 
@Meredith labels all the way
;)
 
if only we had a goto.
 
continue label is close enough.
poop:
for( let no = 0; no < 1; no++ )
for (let i = 0; i < 3; i++) {
	console.log(i);
	if( i == 1) continue poop;
}
// 0
// 1
also yes, my use of space is that inconsistent
:(
 
2:36 AM
@rlemon Use space. They work for every editor, everyone, and every site :)
 
for general indentation I hit the tab key, no use in lying to myself.
 
For general indentation I also hit the tab key, which gets converted to space. Don't tell me you are using Notepad?
 
> no use in lying to myself.
Mar 19 '15 at 23:54, by rlemon
you hit the tab key. use a fucking tab :P
 
So I'm on mobile chat and it give mea a stupid list on chat rooms not based on order of activity really... Can someone link me to gamedev chat
how can I search for a chat room in mobile man this mobile version is nebulous
 
you're on the wrong site
chat.stackexchange has gamedev
not chat.so
 
2:39 AM
@rlemon I use Colemak. When I hit Caps it erase the letter to the left. When I hit ASDF it comes out as ARST. My trackball's middle button is not in the middle. But I am making my own life easier.
 
ohhh
Why Are some chats in some but not others?
 

 Wizards Den

Place for all wizards to share spells, words, and having fun w...
 
so is its own chat because of how large it is I suppose
or the fact it was first
all other se sites share the same chat domain
 
It's because it's a separatec site
 
^ Historical reason.
 
2:41 AM
Ah
i have a JavaScript question but John Petrie and techmike and them allready seen more context their
would asked here otherwise
 
paste a link to the context
 
How y'all feel about oop in js and how yal feel about typescript ?
 
Everyone doesn't feel the same way
Some use TS, some uses ES6 class and me prototypal stuff.
 
class is prototypical stuff
well so is ts once it is done
 
Yeah why does js have I be weird and use ptototypical inheritance
 
2:45 AM
Well, all of the are
 
@rlemon I am pretty sure pootis knows that well by heart :)
 
@ChrisOkyen it's not really weird
 
honestly, I'm okay with the fake class keyword
it implies a clear intent
 
It just makes prototypal inheritance confusing
 
@ChrisOkyen That is actually a common question. Have to tried ask google?
 
2:46 AM
much better than just a name casing
 
Why not choose classical inheritance?
 
Unlike languages like Io or Self
 
@ChrisOkyen don't break the web
but probably other reasons
there is got to be enough tcdiscissions on the topic.
 
@rlemon What if there was a language where semantic name casing was enforced via compiler errors? wink wink nudge nudge
 
@KendallFrey notAllLanguagesNeedToBeTheSame (tm)
I'm not all like fanboying js
js is terrible
 
2:48 AM
I'm totally all fanboying Haskell
 
So ur saying all the folks who used prototypical their web programs would break that's why ?
 
lol
 
@ChrisOkyen Prototype can do everything that classical inheritance can, and more. JavaScript is designed to be interpreted so it doesn't need the restrictive class structure for compilers. JavaScript's design is influence by other prototype languages, it isn't the only one.
 
Even though I know that strict casing isn't really good
 
@ChrisOkyen even if they wanted too, because of how wide spread js is today, you can't make such a sweeping change
 
2:49 AM
But JavaScript makes prototypal inheritance so ridiculously confusing that it scares off people.
 
tonnes of things have been left in, admittingly bad, because they would break a lot of pages to be removed.
 
@rlemon This applies to pretty much every mainstream language
 
Lol when you forces to leave shitty practices
Your forced
 
I've said it many times and I'll say it again: we need language version pragmas in mainstream languages.
 
Imagine a developer having to learn about class, new, function prototypes, Object.create, __proto__, [[Prototype]], .prototype to understand wtf is going on.
 
2:51 AM
@KendallFrey how many mainsteam languages are 100% dependent on something as frantic as browsers
we get a spec, and hope to fuck enough vendors listen to them
 
@ChrisOkyen The problem is not with prototype, but in how JavaScript wrap it in constructor and new and class, which really confuse people. I call those "smoke and mirrors" and some of us totally avoid them. OOP does not rely on class (or illusion of class).
 
Have you seen the terrible things that are happening to C#?
 
so if they had a operator named bin laden from the 1990s.... :)
Sorry if it offends you internet is more inportant
 
First we had nullable objects and non-nullable values. Then they added nullable values with the ?. Now they're talking about adding non-nullable objects with the !. oh my god it's so confusing just do it right the first time kill me noooooow
 
@Sheepy but lets be honest, if we're mocking a class why not use the class keyword
it is a clear intent
makes things much easier to read
 
2:53 AM
don't mock classes
 
but I want too
that isn't up for debate :D
 
how dare you not share the same opinion as mine
excluded
 
@rlemon Make things easier to read - once you understand how it works. It's bigger, deeper, fancier, I'll give it that much, but it is still voodoo magic.
 
little pootis has ignored you
@Sheepy I'm like half sure I'm aware how it works
 
Once upon a time I think I know how computer works. Now I just take a CPU die shot and tell people "control, cache, Core, GFX, IO" and hope they don't ask any questions.
 
3:01 AM
lol
I'd recommend CS:APP if you want to understand how a computer works.
Or just PGU (Programming from the Ground Up)
I'm learning X86 on NASM right now.
Well, off to prison, bye.
 
@littlepootis bye~
 
Every time I try to think about how the internet works im surprised the internet works
 
Someone send this to me yesterday.
Sometimes I do feel like IT. From my point of view, if we can't prove to IT how it's their fault - one time involving packet content comparison - I am not doing my job well.
 
3:26 AM
Sorry I almost forget to give you this. Here is a short blog on JavaScript's birth. It then links to all the best sources on the subject:
http://www.2ality.com/2011/03/javascript-how-it-all-began.html
 
3:41 AM
Note the first function I call in HTML after loading the HTML is main() which does:sets a event listener for user to submit all the input forms.
And then calls get state which handles keeps calling. Itself using a timeout and call a function to handle input fm keyboard. Not that when we are check the ever listener we are in state 0 and we stay here untill user submits form data .
The the keyboard handler function is picky on that I had to have a global variable to tell it not we just entered the state 2 ( check for keyboard input and redraw canvas) so that we set a listener only for the first enter
Anyone following so far
 
 
2 hours later…
5:31 AM
d
morning ugys
 
hey
I'm to sleepy or why this function is not working
$('.element').on('mouseenter', function() {
    $(this).css('background', 'lime'  );
});

$('.element').on('mouseleave', function() {
    $(this).css( 'backgroud', 'yellow' );
});
 
@mcmwhfy whats the error message?
 
5:48 AM
yes please tell errormessage @mcmwhfy
 
hey guys. if i have a list of products in a database and each product has a thumbnail image. How can i store the images in AWS S3 and link the images to my mongodb database?
any ideas? The forums say use the file path, but if i have many images, how can I link all of them up to my DB
 
no error messag
*none
is retrieving my elements in console but when I'm on element the mouseenter event is not firing
 
1 message moved to Trash can
@Rush.2707 Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
or you can do this through CSS also
 
nope
 
5:53 AM
$('.element').mouseenter(function() {
$(this).css('background', 'lime' );
});

$('.element').mouseout(function() {
$(this).css( 'backgroud', 'yellow' );
});
 
because I append that elements
 
owk fine ... try this one
may work for you
 
unfortunatley is not working :|
 
@Ming sorry no idea ... :(
@mcmwhfy use background-color
 
yes
already done that
but still not working :|
 
5:57 AM
damn hell ... there must b error in console
$(this).css("background-color", "yellow");
dude dude
ur background's spelling is wrong
 
yes
I saw that and
changed
 
now working ??
 
no
I've tried :
$('.element').on('mouseenter', function() {
    $(this).css("background-color","lime");
});

$('.element').on('mouseleave', function() {
    $(this).css("background-color","yellow");
});



$( '.element' ).mouseover(function() {
    $( this ).css("background-color","blue");
  })
  $('.element').mouseout(function() {
    $( this ).css("background-color","yellow");
  });
 
Check spelling of the class element
must be different
 
what is really strange , is not working only for appended elements
 
6:18 AM
I think the problem is because the selector has returned to many elements
and I need a foreach function
but that this should take only "this element"
hmmm I have no ideeea
 
okay quick grunt watch question: Does it makes sense to watch a gruntfile?
watch: {
  grunt: {
    files: ['Gruntfile.js'],
    tasks: ['copy']
  }
}
 
@mcmwhfy can't be it
 
In the above, if I have updated a copy task, (say, added a new target), will it reflect?
 
@mcmwhfy That second one should work just fine
 
@Cerbrus there is something that is not working with that appended elements
 
6:29 AM
They're dynamically created?
 
yes
 
My GOD !
I know where is the problem
I have a fucking index on css
.element{z-index:-1}
because of that is not working :(
GOD !!!!
 
6:56 AM
Just "Cerbrus" will do.
 
Morning o/
Why when I call 42..toFixed() it works, but when I call 42.toFixed() it fails. Their type is both 'number'
 
42..toFixed() is actually 42.0.toFixed()
 
yeah I know
but why does 42.toFixed() fail
 
In case of 42.toFixed, the interpreter doesn't know if that period is a decimal point, or if it's a property / method access thing
 
it is also a number
Ah, ok I see
 
7:03 AM
Also, it's silly.
 
I know
It's just that there were some people that were arguing with me that you have to understand how JavaScript works and the fact that I don't know the internals makes me a bad programmer.
 
That's silly.
 
7:21 AM
Ok, thanks
 
7:43 AM
Hello everyone, could you recommend me some library for checking email/is date weekend/legal data/phone numbers?
 
@DanielMizerski /^.+@.+$/ then check the user responds to the mail. That is the best practice
There's no universal format for all those things. All the libraries trying to do precise checks are wrong
 
@ziGi I doubt they know how JavaScript works. Have they read the spec? Have they read engine source code?
 
^
exactly
 
You need to define what is a legal email or phone numbers.
Email example: https://en.wikipedia.org/wiki/Email_address#Examples
Phone conventions: https://en.wikipedia.org/wiki/National_conventions_for_writing_telephone_numbers
 
Guys, could u help me, please. Im looking for slang synonym for "jquery-plugin". Is there any IT/frontend-ninja terms for it?
 
7:56 AM
@VladimirGamalian Welcome to the JavaScript chat! Please review the room 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.
 
@VladimirGamalian jquery plugin is the common term. jQuery extensions mean different things and jQuery addon make you sounds like an extinct animal from last millennium.
 
Hi. I got an off-topic question looking for where I can ask it. is it possible to see "top users for a country"? I wonder if it is possible to know how many people in Sweden are top x % on SO? I'm top 6 % and I found some more guys in Sweden, is it possible to see "top users for a country"?
 
can you close this too broad question ?
-1
Q: javascript function Declaration (the diffrence beween this.method and method?)

kimhji make function but cc method is not a function What is diffrence between b.aa() and b.cc()? function A(){ this.aa=function(){ console.log('11111'); }; cc=function(){ console.log('2222'); }; }; var b= new A(); b.aa(); b.cc();

 
Google tells me to start from here. I hope you know SQL.
https://data.stackexchange.com/stackoverflow/query/53058/top-users-by-country
 
@DenysSéguret I haven't access to backend. @Sheepy thanks, I can but I was looking for some library that I can just implement, use some functions and have my day.
 
8:00 AM
@DacSaunders This would be on topic on meta and on data, but search there before asking those sites
 
@Sheepy yeah, I know it, but I need to find some cryptic words to describe it only for IT persons, not for anyone.
 
Thanks :-)
 
@VladimirGamalian "jQuery" is already pretty web design specific. I won't even count it as an IT term. Depends on what you are using you can say jQuery component.
Yup. Just checked. Our lead designer have never heard of jQuery before.
 
@Sheepy What ? Your lead web designer ?
 
@DenysSéguret to be correct... ^.+@.+\..+$
 
8:13 AM
@DenysSéguret Just designer. He doesn't care how the web developer turn his designs into banners and websites.
 
@DanielMizerski doesn't really matter. The goal of a regex here can just be to check the user didn't switch two fields. If there's a @ then it's not his name, city or tel number...
 
@DenysSéguretI see your point, sure
 
@DanielMizerski email@localhost is perfectly valid, and won't pass your validation.
 
good morning all ^^
 
@BenFortune you are right, but it is under ionic and localhost in this case is invalid I think.
 
8:24 AM
(could be another name than localhost)
 
8:51 AM
hey guys. got a quick question
will this try catch cause the for loop to break?
for (let x = 0; x < 10; x++) {
	try {
		someFunction()
	} catch(e) {
		// do nothing. just continue
	}
}
if it gets an error in someFunction()
 
Try it
 
i dont know how to invoke someFunction() to give error
 
A syntax error should do the trick
Or throw an actual error
 
@DanielMizerski There are other dotless email addresses: nobody@[IPv6:2001:DB8::1]
 
alright. thanks.
 
8:58 AM
@Sheepy That's valid? o.O
 
Yes. The domain part can be host, domain name, or ip. Which includes ipv6.
But of course, we can get pass the filter if we create an account so the address becomes "local@part.here"@[IPv6:2001:DB8::1]
That reminds me. When I was beta testing gmail, some sites rejected my email because I had a dot in the local part.
 
9:32 AM
I try to install npm install eslint but it gives me an error of UNMET PEER DEPENDENCY eslint@3.4.0
 
@Zirak That was interesting, thanks!
 
9:48 AM
198
Q: Why does npm install say I have unmet dependencies?

Sean MackeseyI have a node package. When I run npm install from the package root, it installs a bunch of things, but then prints several error messages that look like this: npm WARN unmet dependency /Users/seanmackesey/google_drive/code/explore/generator/node_modules/findup-sync/node_modules/glob requires...

 
@BenFortune thanks.
 
how can I navigate to specific page on ionic (I have that screen added to my state route but how can i go to that directly instead on going through by clicking any ui-sref link ??)...I am farely new to IONIC
 

« first day (2154 days earlier)      last day (2804 days later) »