« first day (1725 days earlier)      last day (3224 days later) » 

user3119231
12:00 PM
@adeneo this is pastie.org corrected 2 times!
 
the child divs will start getting add from the first parent div, when the height of the first parent div gets full then the rest child divs will start added into the 2nd parent div.
 
@Amit that's what the fiddle I gave you does.
and you need to define "full". how much is "full"?
 
@AwalGarg, the height the parent divs. 100%;
 
@Amit so you know the height of the divs in advance?
 
Anybody here using zurb-foundation-apps?
 
12:03 PM
@ShankarRegmi 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 have an issue
 
@AwalGarg, i have given the height by myself .100%
 
And how does it get "full" when it's height is always 100% of it's content ?
 
@Amit 100% is not a definite height. 100% of what? The screen, or viewport, the eiffel tower, your physical height, Mt. everest? What?
 
@AwalGarg, <div style="height:100%; width:50%"> this is how i have created the div
 
12:11 PM
@Amit does this div has any minimum height?
 
no
 
How to get the value of an attributes inside the <option> tag ? I tried gist.github.com/aruprakshit/17c14a523dcd4c38d001 not working
 
anybody here
@Arup
@ArupRakshit ??
 
Hi @ShankarRegmi
 
@Amit Then you aren't giving us enough information to help.
 
12:12 PM
i have some issue with zurb-foundation , have you ever used?
 
No dude!
 
i have shared my pastie whatever i have written.. :(
@AwalGarg, if u want i can again share u the pastie
 
@ArupRakshit
 
@Amit ok, put it another way: at what point does the div get "full"?
 
$('select').change(function() {
    console.log(this.value);
    // or $(this).data('state');
});
 
@rlemon Morning
 
@Amit I think by 100% you mean 100% vertical screen space?
 
@AwalGarg, the height. like one div under another div. ek k niche ek.
 
@BenFortune I tried
  $( "#user_state" ).change(function() {
    $( '#user_county option' ).each (function( index, value ) {
      console.log( value.data('state') );
    });
  });
but same error
Uncaught TypeError: value.data is not a function
 
value is not a jQuery object, inside the each function it's a regular DOM node
$( "#user_state" ).change(function() {
    $( '#user_county option' ).each (function( index, value ) {
      console.log( $(value).data('state') );
    });
  });
 
12:17 PM
ok..
thanks
In Js/Jquery how you guys check the class name of an object ?
it is good for debugging
 
.className or .classList in vanilla DOM.
 
@ArupRakshit elem.className
 
ok..
 
class name?
I thought JS didn't have that?
 
@Gemtastic It refers to HTML classes, not OO classes.
 
12:20 PM
@AwalGarg, want to align 20 divs vertically . after one parent div's height gets full with the child divs, then the rest of the child divs will started getting added in the next parent div.
 
@ArupRakshit
 
@MadaraUchiha Aaah
 
Also, newest version of JS does have classes
 
goes back to my book
@MadaraUchiha Real classes or just syntax sugar?
 
@Gemtastic syntax sugar.
But helpful syntax sugar.
 
12:21 PM
@MadaraUchiha Thought so :P
 
@ShankarRegmi yes.. pls
 
Well it'll help me feel more at home if it works like I'm used to
 
console.log( $(value).data('state') ); doesn't print anything
 
@Gemtastic Sorta. Learning the underlying prototypical system is important too
Helps you understand the limitations of the class syntax and why they're there.
 
12:23 PM
@MadaraUchiha ... Did you miss what I told you earlier? :P
 
Why should I attach an event on the document in case I have the ready handler in jquery?
 
5 hours ago, by Gemtastic
I'm trying to get a deep understanding of how the language works. Syntax is just syntax, you can look it up. The logic and structure of the language is what's interesting and important to me.
 
@Amit I do understand that. Since you are not telling me how much is 100%, I'll assume 100% of vertical screen space. In that case, here is how to do it: jsfiddle.net/wyLcxe1w/1
If you are not ready to read that code and understand how it works, it is likely no one here will be helping you.
 
I think that's one of the biggest differences between me and my classmates; I don't just want to copy code that shows me how it's done, I need to know why it's done the way it's done. How does it work under the hood? What am I doing when I'm writing things this or that way?
The kinds of answers I like the most are like the answer I posted earlier today.
 
> The JVM is smart but also very, very autistic.
haha
 
12:29 PM
Yup. It doesn't understand your social nuances, it only understands "make it more efficient"
;P
 
So glad I went the C# route.
 
The JVM saves you a lot of work, and it's not as important to optimize everything since Java will do that for you. However, that comes at the price of constantly needing to remember that the functions needs to work independently of one another because the execution sequence may be re-arranged by Java.
 
@AwalGarg, parent1 is undefined its showing
 
Which is why Java is more heavy on the importance of "pure functions"
 
user3119231
lol dump map v2 bm-designs.de/test
 
12:33 PM
Java code stinks when it has a lot of side-effects.
 
@Amit set parent1 to document.getElementById('parent1') and same with parent2. that code works in sloppy mode, and was intended as way to show you the logic of how to do what you want. don't just copy paste it.
 
user3119231
now works with multiple blips but shit still gets moved into left top corner
 
Question fellas: I have an object implementing event emitter. I emit an event "foo", and a corresponding listener "f1" does some work asynchronously. Another event "bar" is fired at the same time and a corresponding listener "b1" does some work. How can I defer b1 until f1 has completed?
 
Can't you emit bar after f1 has finished?
 
Well it implements node's event emitter and AFAIK there is no way to detect when a listener completes it's work :/
 
12:37 PM
I mean have it emit from inside f1?
 
A few steps later that will become a callback hell :/
 
Hi friends
 
Add another event emitter that fires when f1 has completed ?
 
hmm, sounds like a clean-ish way. thanks.
 
TIL that was the first proof created for the sole purpose of an entertainment TV show
 
user3119231
12:47 PM
so anyone able to give me a hint where to continue or to fix the bug? pastebin.com/45NaeCKj
 
Don't use for..in to iterate an array.
 
user3119231
while?
 
Yeah, you should really use int i=0; int limit = 10; while (true) { if (i > limit) break; /** ... */ i++; }, like all the pros do
 
for..of
unless you need to use ES5
 
or [].forEach if you need to use ES5
 
user3119231
12:51 PM
ok thanks. Now only fix blip shit :D
 
@corvid so the pro's throw syntax errors?
 
yes, only pros write broken code.
 
@AwalGarg you a Crockford fan?
 
no
 
@KendallFrey no, he's a fan of php
 
12:58 PM
^ true story
 
@rlemon the pros write C like in assembler
 
and inline assembly in C
 
I write inline C in assembly
 
just like your mom, you have no idea what is going in
 
I get all the ladies
 
1:01 PM
you don't
 
my milkshake brings all the boys to the yard, they're like, "put some damn clothes on".
I'm not very good at this...
 
@AwalGarg, thanks
 
Is there any way to detect if an object is a Proxy object?
 
obj instanceof Proxy
 
Pros use assembly code to write HTML
 
1:03 PM
I use HTML to write assembly
All the ladies.
 
@FlorianMargaine : did some quick tests: fiddle The tool is quite handy but still not user friendly.
 
plebs, I write binary in XSLT
 
I write my code out of transistors
 
retards
 
pfft
I write with a pen
 
1:04 PM
!!xkcd real programmers
 
weirdoes
 
never used nano :p
 
@rlemon well...
 
nano is okay
 
1:05 PM
@KarelG did you know you could have syntax highlighting in nano?
 
I prefer vim
 
I love nano.
 
anyone here knows Kyle Simpson ?
 
@FlorianMargaine automatic detection of language, as well.
 
nano is my current to-go-to
 
1:06 PM
 
is he a big person in Javascript / getify.me
 
i know that nano has syntax highlighting but i'm still using vim ... became so familiar with its commands
 
@Learner why do you ask?
 
I was going to watch this - http://www.pluralsight.com/courses/advanced-javascript

so wanted to know if he is authentic trainer
 
if he's on pluralsight he's at least somewhat credible.
they don't just let any asshole make content
 
1:08 PM
My asshole makes content
 
@rlemon I see, thanks
 
Your asshole makes only shit.
 
@AwalGarg don't be so limiting.
it also makes methane
 
yeah, getify is good
 
@rlemon and quite a few other gases
 
1:09 PM
@rlemon And plays the trombone
 
which are all shit
 
@Learner not necessarily
 
@ivarni rusty?
 
@FlorianMargaine no, he is. didn't you see the pic
#mild-fat-joke
 
@AwalGarg in that case, you're breathing shit right now
enjoy
 
1:10 PM
does anyone has an idea about dataLayer.push();
 
pushing nothing to an array?
 
It's a function!
 
@KendallFrey thankfully my nostrils filter shit out.
 
@KendallFrey lol let's not urban that
 
1:11 PM
@AwalGarg How do you survive without air?
 
Real programmers don't need air to survive ;)
 
Just coffee
 
real programmers get paid for their work and don't just fuck around on SO all day
:P
 
I'm not a real programmer. I'm a complex programmer.
 
Imaginary
 
1:12 PM
In a mental plane above you nubs
 
@FlorianMargaine yes
 
@rlemon That is impressive
 
dataLayer.push({'event': 'GAevent', 'eventCategory': 'hotels', 'eventAction': 'find-hotel-button', 'eventLabel': find-hotel});
@FlorianMargaine my array is like this
 
1:13 PM
Would have been better if it was real money.
 
@rlemon what a moron. plastic doesn't absorb liquid
 
@rlemon WHAT THE FUCK MAN
 
Mandatory "my currency is more real" comment.
 
Book club poll for month #2! Vote here - goodreads.com/poll/show/…
6
 
Mandatory "my currency is complex" comment
 
1:14 PM
@Luggage my fake house and fake car were purchasable with my monopoly money. so meh, I really don't care :P
 
@FlorianMargaine I had witten this on onclick function
 
@SomeGuy ^
 
@FlorianMargaine lol did you miss this day?
 
@rlemon I totally did
 
1:15 PM
I'm too lazy getting a pic of a plastic monopoly house and metal car
 
@rlemon Your money is so pretty
 
@FlorianMargaine There are a few people who do :P
 
@FlorianMargaine ^
 
@FlorianMargaine but daa is not pushing
 
1:16 PM
@rlemon LOL
 
@Luggage a metal car? hot damn
 
guys can u please help me out
 
dataLayer.push({'event': 'GAevent', 'eventCategory': 'hotels', 'eventAction': 'find-hotel-button', 'eventLabel': find-hotel});
doesn't explain a problem
 
@SomeGuy I know, just kidding :)
 
it is random code posted in the chat.
formulate a real question before we can help
'eventLabel': find-hotel});
 
1:17 PM
and I have no idea why you are wrapping keys with quotes
 
looks like a syntax error
 
@rlemon I am scaring for downvotes
 
@AwalGarg because keys are strings. in the end that doesn't matter
some people prefer it
 
weird preference but ok
my opinion is always betterâ„¢.
 
@rl
 
1:18 PM
@AwalGarg you like php, how can you say that?
 
@FlorianMargaine you write code for php-src, how can you say that?
 
@rlemon i am notgetting data when am clikcing on button. means data is not pusing into datalayer
this is my problm
 
@Aparna that code has a syntax error
I already pointed it out
read above.
 
ok
 
also, when debugging OPEN THE CONSOLE
 
1:19 PM
@AwalGarg I don't judge other people
 
you will see "Uncaught SyntaxError: Unexpected token -"
 
@rlemon nah, reference error
 
@rlemon even i put wid quotes and check it
though its not wrking
 
do you have errors in your console?
 
@rl
 
1:20 PM
@AwalGarg no, syntax error
 
@rlemon exatly
the same i go
o
ok
 
!!> ({'foo': bar-baz})
 
@AwalGarg "ReferenceError: bar is not defined"
 
WTF DO YOU SEE?!
 
@rlemon can you plase correct it
 
1:21 PM
question does maintainAspectRatio true / false attached to a canvas element decide whether or not the canvas is resized
 
@AwalGarg oh, nice
 
@Aparna no
 
@AwalGarg my bad. You were right.
 
dataLayer.push({'event': 'GAevent', 'eventCategory': 'hotels', 'eventAction': 'find-hotel-button', 'eventLabel': 'find-hotel'});​
 
Awal Garg is always rightâ„¢©®.
 
1:22 PM
except when he's wrong
 
@rlemon is this the correct sytax
 
@Aparna this doesn't explain anything
you need to make a demo of it failing for me to help
otherwise, good luck have fun
 
the latter clause sounds more fun
 
@rlemon ok. now I am explaining
 
what does maintain aspect ratio do exactly?
 
1:23 PM
@CS_STEM no clue
never heard of it for canvas.
what are you trying to do?
 
one sec and I can pull up the question
0
Q: chart resizes everytime it is rendered

Pallavi PrasadI have a chart which is rendered in the same canvas repeatedly. The canvas is not recreated. I am using Chart.js for the rendering? I find that the chart resizes everytime it is rendered. I have 2 questions. Can the chart be stopped from resizing? Can the canvas be cleared before the next chart...

 
ayy rlemon
 
btw, sublime text users: I started using the Predawn theme a while ago and it has been a very good experience. Very much worth checking out.
 
@CS_STEM more than likely there is an option to disable it within the chat library you are using
so you need to link to the applicable library from within your question
 
1:28 PM
@CS_STEM can't you just call a canvas.clear?
 
that isn't a thing
 
the idea is he does not want the canvas to resize
 
It's been a while since I've worked with canvas, but you can clear the canvas.
 
I know what you want.
but my point still stands.
link the lib in question
because...
> responsive : true
SCREAMS "hey! look at me in the docs!"
 
No need to be so scathing about it
 
1:30 PM
I dont fully understand.
 
@Polyducks no one is scathing.
 
what does a library have to do with this
 
@CS_STEM he's saying to look it up in the documentation because the responsive:true indicates it might be your problem
 
@CS_STEM because 'Chart' is not a native thing
 
so refer to the docs for chart.js
 
1:31 PM
At the pace we are going, it will be native in ES10.
 
this is proly a stupid question but what docs exactly?
 
!!afk stupid hardware testing is stupid.
 
He is on SO as well if you do get curious -

http://stackoverflow.com/users/228852/kyle-simpson
 
thanks
 
1:33 PM
Spooky! Nice research @Learner
 
@Polyducks it's on his website....
 
@CS_STEM most plugins or scripts have documentation which explain how to use them. It was one of the last things I learned about javascript, which is annoying
There's always reference material to work from.
 
nothing
 
@Awal That's not what I said. I said it's annoying that it was so late that I found out about docs
One of the things that makes programming so inaccessible to the uninitiated is this unfamiliarity with things programmers take for granted.
 
I like how the EJS book keeps using double quotes.
 
1:35 PM
so he is literally trying to put chart.js into a canvas.
does it need to be in a canvas or could it be put in an iframe?
 
Er... I'd advise using a canvas
iframes come with all kinds of issues
gtg back to work
 
how do you figure that?
 
iframes cause loading issues, communications between the interior and exterior of the frame...
styling issues, scope
 
Pretty sure chart.js requires a canvas.
 
^ and that
I've never worked with chart.js, but I can tell you iframes are a pain in the arse
 
1:38 PM
people is just abusing iframes for something else than displaying external HTML pages ...
 
ah okay and speaking of iframe loading issues can it slow the loading time of a web page
 
@KarelG Yeah.
@CS_STEM yes. What happens is that the page loads, and then it loads the iframe
and any iframes within that ad infinitum
 
that explains why a simple page takes so long, Thanks
 
Very welcome :)
 
Ah iframes...
I remember the horrible old days when it was supposed to be a stepup from frames...
 
1:43 PM
thats better
so what can a canvas be used for?
 
Graphics.
 
so like charts that are hard coded?
 
Pretty much
Also lookup webgl
 
@CS_STEM GAMES
 
so it is of many uses for web pages but is it able to run like adobe software and or cmd games?
 
1:47 PM
@CS_STEM fun
 
No.
It's simply web graphics.
 
oh okay thanks
 
Think flash, but not shit.
 
@BenFortune @adeneo if only node's event emitter did this: bit.ly/1H7dmh2 (had to shorten link because it is to babel repl and chat won't allow me to post that long url)
 
@AwalGarg You can just extend eventemitter
 
1:50 PM
@BenFortune how? It is not subclassable AFAIK
 
I used it for one of my bots
 
@CS_STEM here is a simple example of using a canvas to display a clock ( that project was my first experience with canvas)
 
@BenFortune got a link to code handy?
from what I understand, the super() call will just fail (atleast according to the spec)
 
import {EventEmitter} from 'events';

class MyClass extends EventEmitter {
  constructor() {
    super(EventEmitter);
  }
  method() {
    this.emit('event');
  }
}
 
@SomeGuy : does SO have its own book club ? :p
 
1:52 PM
@KarelG Yes!
Not SO, but this room
Anyone on SO is welcome to join, though
 
maybe you can allow members from other rooms to have more members
but are you reading one book per month ?
 
Roughly, yeah
 
or just to collect nice titles ?
 
We've read Ready Player One
We're voting on the book for month #2 right now
 
@KarelG that is really spify
 
1:54 PM
not bad. i read books too, mainly fantasy genre. But to read one book in a month is possible if you have time :)
 
@AwalGarg Excuse the terrible code, was just starting with ES6, but this worked for me.
 
@KarelG Feel free to join! You don't have to read the books if you're busy / aren't interested in the book
Be back later. Got to go eat something
 
I hate testing hardware, 4 devices take 5 minutes each to test. And I can only test the 4 at once. :(
 
@BenFortune hmm, lemme try that out. thanks.
 
I think I am getting some kind of weird async error.
 
1:56 PM
Never really done hardware stuff other than random shit with my PI2
 
@BenFortune well, that worked. I don't believe this. brb.
 
@AwalGarg Have fun :p
Afaik, you should be able to override the methods
 
@BenFortune well all I have to do is flash the HDD with the base firmware then allow it to update itself to verify it is working. However all of that takes five minutes for flashing and five minutes for updating.
 

« first day (1725 days earlier)      last day (3224 days later) »