« first day (1866 days earlier)      last day (3083 days later) » 

1:01 PM
@Cerbrus Nobody cares if you don't have three commas.
 
@AwalGarg
want to call venkatesh ?
 
!!google venkatesh
 
venkatesh is the south indian god of luck and charm
 
1:05 PM
Hi chaps
 
@BartekBanachewicz o/
 
is there a better impl of removeEventListener without WeakMaps?
 
got a quick question because I'm feeling dumb. If I've item.push({name:'something', value:'a value'});
how do i get the value back out? Can I just use item['something'] ?
I can't think of the term I need to search.. D:
 
thats not legal syntax
 
1:06 PM
interesting
 
@BartekBanachewicz no. And WeakMaps could be polyfilled to ES5, just in case you don't know
 
ahhh seems I can't even copy paste today
 
@AwalGarg not entirely, but yeah kinda
 
@JaredSmith I think I fixed the syntax now :D
 
@AwalGarg if they are polyfilled like in that example then lol kthx nope
 
1:08 PM
I'm a php guy, so trying to wrap my head around javascript objects vs arrays etc
 
basically don't
otherwise, 2 years forward, you end up like me
I understand what's going on, but there's no learning left. There's just despair :D
 
dat prediction
 
@BartekBanachewicz I asked the similar reverse question in php room the other day. I was told to run.. anyway how is eventListener implemented with weakmap o.O
 
@djsmiley2k PHP conflates the idea of an array and a hashtable, you aren't the first and won't be the last to be confused by this when moving to another language. You'll need to know the index to get the object back out. Something like
var index = arr.length; arr.push(obj);
and now you know where in the array it is.
 
Ooo I already know the index
as I used the index when inserting the items \o/
 
1:11 PM
not if you used .push
 
@JaredSmith whoops, Nope, no I don't
I knew in the old array :D
 
@shortCircuit instead of those idiotic arrays you can just do listeners[fn]
 
@BartekBanachewicz listeners.get(fn) </pedant>
 
I didn't know the javascript event table is a collection of weakmap .. such shame .. :(
 
it's not
 
1:12 PM
^
 
@JaredSmith so get the length of the array before pushing the object onto it?
 
@shortCircuit it's a half-ass broken mockup of one
 
@AwalGarg books.google.co.in/… near the end highlighted
 
hey let's keep this room occupied too?

AngularJS

angular.module("ng-chat", ['stackoverflow'])
 
^ people have tried and failed
 
1:13 PM
@shortCircuit lol, no
 
@shortCircuit thanks for that link
it helps me
 
and also painfully shows why I'm annoyed at that
@shortCircuit it's clearer than MDN implementation
 
right. since array indexes start at zero, the length is one more than the index of the last element. So once you .push another item on to it, the index of that item is the length of the array prior to the push. But if you want an easier way to retrieve specific dynamically added items you may want to use an object instead of an array.
 
1:15 PM
Why can't I use myData.push({name'inputRequired', value:'on'});


if (myData.inputRequired == 'on')
I'm presuming it's an array and not an object, I'm not clear on the difference yet :/
 
because your array has no property with that name
dude you need to surf on over to MDN and do some reading
 
yup
errr name:'inputRequired'
So a push doesn't generate a property.
 
that is correct
 
Ok :)
 
what does it mean keys are weakly referenced .. in Weakmap
 
1:19 PM
Ahhh, I could loop over the array, find the item in it which is named inputRequired and call the value of that item?
 
@shortCircuit it means once theyre garbage collected the entry theyre a key for gets gc'd too
if it has no other reference, that is
 
> this is why i dont play lucian, or else ill get locked up in elo hell, gg
a comment on the last youtube video
cc @rlemon
nice vid anyway, it should be shocking
 
hmmm just working this out in my head now
 
@djsmiley2k you could, although that's massively inefficient. Just use an object. var obj = {}; obj.someProp = whatever;
 
Can you do a push onto an object?
 
1:22 PM
no
 
obj[key] = value;
 
what he said
 
k
looking at my code now
 
@djsmiley2k In real life, or wut?
 
@JaredSmith meaning lets say o = { a: 1} .. now when a is gc'ed o is gc'ed too ?
 
1:23 PM
@Neil :D
 
Object.prototype.push = function(k,v) {
  this[k] = v;
};
:D
 
@rlemon Brilliant.. must be added to jQuery immediately
 
ikr
 
@shortCircuit so if we have a weakMap foo with a object key bar and do foo.set(bar, someObj); then when bar gets gc'd if someObj has no other reference it will be gc'd too, the entry in the weakmap won't keep it around
 
@rlemon lol :D
I'm not doing that.
 
1:25 PM
ok
 
remember the keys have to be objects
 
myData.push({name:'prop', prop:'value'})
becomes....
myData[prop] = 'value';
?
 
yes
 
obj['poop'] = {name:'prop', prop:'value'};
 
Sweet :)
 
1:26 PM
or that
minus the poo
 
ty, that made sense :))))
 
poop makes the best key
 
it's nice when someone explains something, and I actually understand :D
 
lol
yup. to be fair to php, js arrays have their own weirdness
 
:)
I'm not 'trained' in php btw
I started this job as sysadmin, it rapidly become 'oh you'll learn to program tools to fix everything'
 
1:27 PM
!!> [1,2,3,4,5,6,7] + [,8,9,10]
 
@rlemon "1,2,3,4,5,6,7,8,9,10"
 
Prior to this, while I have a CS degree, the ledgnd says I've never written any code that worked ;)
 
how did you pass then :p
 
Perl has the best kind of lists
 
seduced the professors ?
 
1:28 PM
@AwalGarg there is a sex joke in here
 
I knew one of them via Local LUG, but never actually met her until the course
but she knew I knew all the theory
 
@rlemon reveal
 
!!undo
 
Partially lazyness, partly just not 'getting it' at the time
 
hello i made 4 relative positioned div [see the picture] .now i want to show a text in left .however when i add a text boxex resize .to avoid that i gave float value.but float:left doesn't show text nicely.right do but i want text to align left
 
1:29 PM
lol
 
ty for hiding that XD
 
crl
can't read that fast duh
 
no but you know what to search now
 
For all that's holy, people need to stop using floats.
 
1:31 PM
oh wait
I'm submitting this array in an ajax request
 
JSON.stringify
 
does it matter if its an object vs an array? D:
 
JSON.stringify will tell you if the data is wrong
or to be extra sure, JSON.parse it
:D
 
Is that for me?
 
JSON.parse = function(str) { return eval( '(' + str + ')' ); }; // this is the correct function
 
1:32 PM
They decided to keep peerDependencies in npm, right?
 
@AmericanSlime hmm but i want div to ignore text .see when i avoid float boxes realine
 
also, do not listen to me
if you haven't noticed :P
 
@AmericanSlime No, they just need to learn how to use floats correctly.
 
if you're ajaxing it just do a simple object var obj = {key: value, otherKey: otherValue}
 
floats still have a valid usecase, the usecase it was created for.
 
1:33 PM
text and pix
 
I like to use floats with my tables. really pulls the layout together.
 
So before submitting I should stringify it?
 
lol
 
@djsmiley2k depends.
 
I like to... oh wait, I don't like front-end... nvm
 
1:34 PM
are you using jquery or a raw xhr request?
 
jquery
 
then passing an object is fine
 
no. jquery will do that for you
 
any other suggestions instead of float?
 
ok cool
 
1:35 PM
FormData is cool tho
read up on it
 
method: 'POST',
dataType: 'json',
data: myData,
 
@shortCircuit I have read that paragraph. The author is talking about MooTools ... (Maybe it's worth to mention @BartekBanachewicz too )
> Like the class system, MooTools adds powerful new features to the native event system ... The first feature that MooTools adds is an internal event table ... The event table is actually a collection of weakmaps ...
 
@FastSnail flex, inline-block, etc
 
yeah I've used formData when i've got an actual form
Wasn't sure if I should convert this 'into' a form as such
 
@KarelG also, wouldn't it be implementation specific?
 
1:35 PM
> MooTools is a collection of JavaScript utilities designed for the intermediate to advanced JavaScript developer.
 
@djsmiley2k Forms are just a visual component
 
as long as it comes through in the $_POST['prop'] thhen I'm happy
 
On the AJAX or HTTP level, there are no forms.
 
yes, but he said that the js event table is a weakmap
 
@djsmiley2k that's right
 
1:36 PM
@JaredSmith doesn't work.same
 
@JaredSmith brill ty :)
 
@KarelG in which engine ?? ;)
 
Now I have some idea wtf arrays are, vs objects :)
Learning++ :D
 
meh
 
so now I can use if (myData.inputRequired == 'on')
?
 
1:37 PM
no, use ===
 
@djsmiley2k Yeah, it's a bit confusing for people who come from PHP especially.
 
if it's an object yes
 
but it's an object.... isn't it?~!?!?
 
USE === !!!
 
Oh, we use === in js too?
 
1:37 PM
@FastSnail they can do the same kinda things, but you have to use them the way theyre used, they aren't a drop-in replacement for floats
 
yes
 
what other language uses triple = ??
 
I've not seen anything so far when googing about javascript/jquery to suggest ===
php!
 
crl
!!> false === !!! true
 
ugh, php is the worst
 
1:38 PM
@crl "true"
 
@djsmiley2k yes, use === unless you have a really, really good reason not to
 
afaik, '==' is so called as equal operator. === is called as identical operator
 
and even it doesn't work entirely right
 
who invented that ...
 
1:39 PM
is it same value vs same type thing?
 
here is fiddle of my code
https://jsfiddle.net/9kL3zoxe/

@JaredSmith
 
@copy ^
 
crl
!!> true ======== false
 
1:39 PM
string '1234' === !!! int '1234'
 
its type coercive vs not type coercive
 
@crl "SyntaxError: missing ; before statement"
@crl "false"
 
!!> true == ( false === ( '1234' == 1234 ));
 
@KarelG "false"
 
crl
don't need ()
 
1:41 PM
!!> true == false === '1234' == 1234;
 
@rlemon that is both fantastic, and truely horrifying
 
@KarelG "false"
 
yarr, habit is difficult to prevent
 
!!> true == (a = b = c = 4) === !a;
 
@rlemon "ReferenceError: assignment to undeclared variable c"
 
1:42 PM
ugh
I hate your env Cap
 
@FastSnail you're trying to recreate the native box model...why?
 
declaration !
 
!!> '1234' === 1234;
 
@djsmiley2k "true"
 
native box model is super bad
border-box ftw
 
1:42 PM
@djsmiley2k "false"
 
K, got it, thanks :)
Same as PHP handling
 
!!> [] === [];
 
@rlemon "false"
 
enjoy
 
@SterlingArcher : what's the backstory about the trend on imgur with Linda and IS or something
 
1:43 PM
@KarelG SterlingArcher is afk: home
 
now to figure out exactly how I want to display this attach button for these tickets.
 
@JaredSmith i'm making div maker
 
@djsmiley2k not entirely, for instance '0' coerces to true in js but false in php
 
crl
@Kar sorry I said shit
 
@FastSnail again, why? Just for the hell of it? Or is this some sadistic homework assignment?
 
crl
1:44 PM
!!> [true == 2 == 2, true == (2 == 2), (true == 2) == 2]
 
@crl "false,true,false"
 
!!> /[A-z]/.test("^")
 
@rlemon "false"
 
crl
it's left-first evaluated right?
 
this proves the problem with ==
 
1:45 PM
@JaredSmith no it's not a homework
 
sometimes i stare for minutes to others code because the unit test fails ... apparently changing == to === solves most of the times
 
@rlemon "true"
 
hehe
 
@crl yes
what else ?
 
crl
@CapricaSix logic it tests if the string has a beginning right?
 
1:47 PM
[A-z] checks everything between charCode A and charCode z which includes []^_ and `
 
crl
@rlemon ah I thought of that
nice
 
@rlemon i'm impresed
 
ohh and \
 
crl
that's why people do A-Za-z
 
I that read wrong.
 
crl
1:48 PM
@MadaraUchiha me too :)
 
@crl Or [a-z]/i
 
crl
good way too
 
For you
 
crl
!!> /^/.test("")
 
1:48 PM
@crl ""
 
@Cereal :P
 
@crl "SyntaxError: unterminated string literal"
@crl "true"
@crl "true"
 
I didn't scroll down -_-;
 
it's SFW
unless man nipples get you fired
 
1:53 PM
meh
;)
 
Ancient Chinese Curse, loosely translated as "May you become a viral internet celebrity"
 
I'm going to write a chrome extension that replaces window.alert() everywhere to a nicer DOM based modal window
 
@djsmiley2k you mentioned you were a sysadmin...how much AD do you know? Any chance you could help with this : stackoverflow.com/questions/33899383/…
 
No more blocking all of the tabs on all of the windows for "You have an appointment in 10 minutes". God dammit Google Calendar.
 
@MadaraUchiha hells yeah
I hate that, although I'd be the first to admit google calendar saved my marriage
 
1:59 PM
why don't you use the calendar on your mobile phone and let the desktop version not notify you ?
 

« first day (1866 days earlier)      last day (3083 days later) »