« first day (2071 days earlier)      last day (2889 days later) » 

11:00 AM
MobX is pretty similar to a talk I gave at Facebook a few months ago only well thought out. We're bringing the author to a local conference in September so I guess I'll have a much better understanding of the philosophy then.
 
@cswl haha, I recover really quick ;)
 
@techie_28 jQuery check whether an element is empty: stackoverflow.com/a/6813294/893578
@techie_28 The non-jQuery check is if ( ! element.firstChild ) { /* empty */ }. If it is empty it is null (false). Otherwise it is a node (true).
 
11:22 AM
@Sheepy comment and text nodes are considered as children?
looks like it... jsfiddle.net/ckoe3jhy
 
@tereško my question was only to find an efficient alternative of .html()
 
This room disappoints me sometimes...
room topic changed to JavaScript: ECMAScript 2016 Released: Topic: JavaScript, ECMAScript. Read this: javascriptroom.github.io/rules. Before asking inform yourself on the XY problem goo.gl/taIqf | devdocs.io Documentation™ Helps. Room meta discussions: github.com/JavaScriptRoom/culture [ecmascript] [es6] [fetch] [htm-is-basic-for-java] [javascript] [nodejs] [promises]
 
       guys a silly q

        <script type="text/javascript" src="js/jquery.min.js"></script>
        <script type="text/javascript">
        $("#fb").click(function(){
            var iframe = $("#fbiframe");
            iframe.attr("src", iframe.data("src"));
        });

        </script>

    and

    <div id='fb''>
    <form id ='fbform'>
    <input type="image" src="images/facebook.png" style="padding:15px" \>
    </form>
    </div>

<iframe id="fbiframe" data-src="http://www.facebook.com" height="100%" width="100%" frameBorder="0" scrolling="yes" src="about:blank">
iframe doesnt load when form is clicked
 
@cswl Yes, I consider text nodes non empty. Comments and directives are also counted, but I have probably never see a lone comment (without other stuffs) when I need to check an element's emptiness.
 
@BenjaminGruenbaum Can you change the tag in the topic to , please?
 
11:32 AM
so a few guys mentioned bringing out conditionals into vars for readability, but does it not hinder performance?
 
@Bergi I'll just clean the tags
 
as in example 2 would not fire the costly calculation if the 1st or 2nd check failed: pastebin.com/GcFFp42B
does that happen in javascript?
as in, would example 2 would have better performance?
 
room topic changed to JavaScript: ECMAScript 2016 Released: Topic: JavaScript, ECMAScript. Read this: javascriptroom.github.io/rules. Before asking inform yourself on the XY problem goo.gl/taIqf | devdocs.io Documentation™ Helps. Room meta discussions: github.com/JavaScriptRoom/culture [ecmascript] [ecmascript-next] [javascript] [node.js] [rlemon]
Fetch is just a function, I don't think it should be on the very top
@Lynob you're adding the event handler too early, all your scripts should typically be at the bottom of your body section.
@bitten no, JITs are not retards, they inline.
 
Ok. ES2016. Hmm. I don't understand why it is ES7 instead of ES 6.1...
 
@bitten oh wait, no, in that case you should write it differently, with &&s on every conditional, otherwise it evaluates much more
 
11:35 AM
@BenjaminGruenbaum so #2 is better for performance, but suffers in readability?
 
You can have the best of both worlds by creating functions the last part is a function already so you can just use it. Also, you can do ""&&="".
Like var cond2 = cond1 && someCheck and it will short circuit as much
 
@BenjaminGruenbaum yeah true, i guess when it starts to get costly then functions make sense
what's &&= ?
i'm not familiar
 
Readability is typically much more important
There is no &&=, that's why I put it in ""s. I mean x = x && y. With other operators you actually can do operator= like x += 1 for x = x + 1
 
i imagine there's a npm package for this kind of thing, heh
 
@BenjaminGruenbaum already tried putting it before </body> still same issue
 
11:39 AM
@BenjaminGruenbaum yeah i think so too, i like the idea of putting costly checks into functions so they only run if necessary.. so thanks for highlighting it
 
@Lynob no, I don't believe you, make a jsfiddle and prove it.
 
@BenjaminGruenbaum oh okay, i'm familiar with += and so on, although to clear my example up, var is just a placeholder, it's not a declaration
i should have called it exampleVariable or num so it's clearer
 
I have a angular view which loads from the init method in the controller. After that I use a form which is in another view to add data and those data should reflect in the first view. But that does not refresh automatically. How is it possible to make it refresh automatically?
 
@BenjaminGruenbaum whatever u say boss
2
 
@techie_28 innerHTML is always the less efficient variant. No matter what do you do with it.
though, keep in mind that "less efficient" does not always mean "less pragmatic"
 
11:51 AM
"...I don't believe you, make a jsfiddle and prove it..." ooooh dem's fightin' words!
 
Who's Dem?
 
@JanDvorak lel
 
Who's Lel?
 
@JanDvorak who has a lel?
 
42
 
12:01 PM
the meaning of life is undefined
 
@FlorianMargaine Woo! \o/ @Loktar Friday!
!!clean install or upgrade from current state
 
@rlemon upgrade from current state
 
EMCAScript 2016 released? What does that even mean?
 
Guys how do i get the element before this in a list ?
 
Whoa, that's a big upgrade
 
12:10 PM
i tried this but to no avail
$("#stool option[value='13']").before()
it returns the element itself
<option value="81">*-OST-OPS</option>
<option value="82">*-WEB-OPS</option>
<option value="13">/</option>
this is my list , i want to get the 82
starting from 13
 
!!jquery before
 
should work
 
come on , it didn't :s
it returns the same element
it returns the 13 element
 
get the parent, then get the nth child?
 
12:16 PM
before adds an element
api.jquery.com/prev you want prev
 
i cannot get the parent then get the nth, because i do not know what the nth will be
 
Is there any list of changes between ES2015 and ES2016?
 
i only know that i want the one before a certain element
 
@Joseph you do, because you can get the element with the value 13, get it's index, and access it that way
but you can also use .prev()
 
prev does the trick
thank you @rlemon
 
12:19 PM
.before and .after are for dom manip, .prev and .next are tree traversal
 
Hello guys
 
@Despirithium 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.
 
@rlemon I made a shuttle in KSP last night, and the first test flight was a complete success :O
Only one or two minor tweaks needed
 
nice.
I made a lander to land a science probe on duna
 
I should try making a SSTO spaceplane again
 
12:29 PM
but fell asleep waiting for a 15 minute burn :/ stupid small rockets.
 
but those never worked well for me
 
 
ES2016 was released in June 14.
 
looks like there is some work being done on it
I really want to start a new space station on another planet
and be able to recruit from it
 
true * 3 = 3
lmao
 
@Despirithium +true === 1
 
@rlemon can't divide by false
 
@Despirithium now you've gone and done it
You've divided by zero
 
!!giphy divided by zero
 
12:45 PM
@cswl Thanks, that's what I was looking for!
 
something weird, i have an iframe, and some element with some id inside, when i try to get the element $("#element_id"), all i have is undefined
any thing specific when getting elements from i frames ?
 
Reminds me of this video I saw where someone while podcasting decided to see if they could view it during with hilarious results
 
yea but the thing is i am selecting from inside the iframe not from the parent
 
How can I know the height or width in pixels of a HTML element when the height/width is set as a relative size (%)? I see that with element.getBoudingVlientRect() doesn''t work, because I get the height/width in %...
 
1:00 PM
 
@rlemon you removed the scraper?
 
has bugs
 
were you using some scraper, or hand rolled one?
 
hand rolled
ofc.
 
you'd hit automatic detection and trigger the captcha, unless you were managing multiple ip ..
 
ako
1:10 PM
hi there...how to find a div tag that it's parent is a Form tag with a specific id using css??
 
so @ssube, what do you usually use for your models? Do you just use plain knex without any ORM?
 
@ako do you mean #id > div ?
 
ako
<form id="formId"><div></div></form>....how to find div tag??
 
@ako Have you tried what I suggested?
 
1:15 PM
Looks like early liquid oxygen depletion caused engine shutdown just above the deck https://t.co/Sa6uCkpknY
@VeronicaDeane ^
video ends too soon
@DJSnM @elonmusk I'm not trying to start anything... just saying, it feels weird that Elon follows Weird Al but not Scott Manley.
he's got a point
 
@rlemon did it died?
 
it ded
 
@elonmusk so the solution is to land faster.
 
ako
it works but what if a want to find a div with a specific class?
<form id="formId"><div class="divClass'></div></form>....how to find div tag??
 
but something I think was wrong before landing
 
1:17 PM
Was that the one from a few days ago?
 
they were wondering if it would make it back in one piece
@VeronicaDeane yea
 
I saw that landing this morning
 
is there a longer video? did it explode? I know it "crashed"
but ... fire!
 
I was just watching the webcast vod
 
> The first-stage's experimental landing on a droneship experienced a Rapid Unscheduled Disassembly 😃
 
1:19 PM
It cut out just after it touched deck
 
I love that they added a smiley face at the end of that sentence
 
> Turns out the landing was not as fast we thought, but still hard enough to destroy the primary airframe and accordion the engines
"accordion the engines" sounds bad
 
lol ik
 
these are the mods we need in KSP
 
I guess that refers to the nozzles?
 
1:21 PM
real damage mods
 
Well, failure just means more variable data, which means higher chance for success in the future.
 
@ndugger he's calling 2016 "a year of experiments"
 
@rlemon There is one that (randomly?) bends parts when they experience high forces
it's not very realistic, but still
 
@VeronicaDeane taxing on the system?
 
Not too bad, but probably a bit
 
1:23 PM
I've failed at so many things, and I always learn enough to do better the next time. I don't know why people are so afraid of failure. I wonder if it's an American thing, or just a western thinking thing... or is it human, and everyone ever hates failing?
 
I'm probably going to get that population mod tonight, possibly get my feet wet with KSP modding trying to bug fix / improve that mod
 
I might get back into KSP once I get my new rig
 
@ndugger I don't mind failing, I hate falling
 
You hate falling down your stairs and bruising your tailbone?
 
@rlemon nice, there's a small chance I may be able to answer some questions, I messed around with part mods a bit
 
1:24 PM
@ndugger ah man, that happened to me when I was 7
 
That happened to bob a few months ago
 
I don't mind failing if it doesn't get me laid off.
 
@ndugger all of my recent injuries are results of falling
 
Maybe you should get better legs
 
1:26 PM
@rlemon Same with SpaceX
too soon
 
;)
 
I'd get robot legs
Actually, no
but I'd get a robot arm
but only one
 
Cause that's all you needed, huh?
 
ES 2016 what?
 
1:28 PM
I'd make it so I can swap out the hand
get some... attachments
if you know what I mean
 
@littlepootis huh, weren't they supposed to stop with all the years?
 
ES8 is the spec under dev? wtf?
 
@SterlingArcher bro, new watch
 
@rlemon SterlingArcher is afk: oh dear
 
must have been a violent shart
 
1:35 PM
!!weather Kitchener
 
@rlemon [object Event]
 
> We noticed that you're using an ad blocker, which may adversely affect the performance and content on Bloomberg.com. For the best experience, please whitelist the site.
 
Nice out today ;)
 
Bullshitberg.com
 
According to google, it's nice here too
 
1:36 PM
Gonna be 29 and sunny
Allldayerrrday
 
@Cerbrus lol, you were blocked from accessing that site?
 
Popup with a countdown and a "continue" button
I'll keep adblock enabled, thank you very much
 
my "tease" talk on fake 3d is up :D youtube.com/watch?v=dCLEyZw5GL4
 
@towc so far 1/5th of your talk is you on stage failing :D
 
1:42 PM
@rlemon yeah, but oh well :P
 
@rlemon We need to get Zirak to do another talk
 
guys
 
was supposed to be a quick thing, a time filler and they asked me to do it at the last min so... I'm still happy :P
 
how can i modify this to allow upto 720 hours in the first part please ?
 
@Joseph I prefer girls
 
1:43 PM
value.match(/^(([0-1]?[0-9])|([2][0-3])):([0-5]?[0-9])(:([0-5]?[0-9]))?$/)
me too @VeronicaDeane
 
well yea, you got up there. good job :) I'm just teasing
 
@Joseph Why do you need this?
 
@rlemon dw thanks :)
 
@towc if you're ever in a bind and need to fill time. just show this video
 
@Joseph What exactly is that supposed to match?
 
1:44 PM
its a time validation reg , as is , it will only allow me 2' hours
24
 
@rlemon I'll make sure to do that :P
 
its makes sure i have this format hh:mm:ss
 
seems like a generated regex
 
How about dd:hh:mm:ss?
 
no i dont need days
it is going into a time mysql field
 
1:47 PM
ew
 
@towc "Why don't you use Three.js? The point is, I don't know." I like this guy.
experiment for days
 
@VeronicaDeane I do give other points later
and I should have said that it's all part of learning, but meh...
completely forgot
 
come on help me out, basically this ([0-1]?[0-9])|([2][0-3]) means i can have numbers from 0 to 19 or from 20 to 23
i need to be able to go up to 720
 
It's friday, I'm not going to do math with regex
 
1:50 PM
frey day
my day
 
should i be doing this ([0-7]?[0-2]?[0]) instead ?
 
@rlemon oh may I click that? what is it? :o
 
Maybe you should split out the hours part, parse it as number, then compare it with actual numbers.
 
@Joseph That's incorrect, it doesn't allow 699
^^ that
 
The office here is going to do gokarts at noon today. I have awesome perks.
 
user2620028
1:51 PM
Gokarts would be fun on ice :D
 
parseInt(timeString.split(':')[0]) <-- There's your number.
 
pfff, we went skiing abroad
 
const n = Number(hours);
if( Number.isNaN(n) || n > 720 || n < 0 ) throw new Error('fuck');
return n;
 
@HatterisMad Nobody likes a 16-minute laptime
 
user2620028
But everyone likes crashing
 
1:53 PM
@VeronicaDeane ask the FIA , they know all about 16 minutes lap times ...
 
@HatterisMad I'd like to get away from my starting spot in the first place...
 
what? why?
 
@VeronicaDeane hint (1.6 liters v6 turbo ...)
 
1:53 PM
800hp doesn't give you 16-minute laptimes
 
another hint baku ...
 
Yes yes I know
 
it's actually more like 950
 
really wow
 
user2620028
@Veronica idle away from the start and slowly get your speed up, it wouldnt be the worst thing in the world. But it would be tons of fun haha
 
1:55 PM
Karts are fun
 
@towc you look elder than me
 
user2620028
so much better than hold gas pedal to floor until they shut the go karts off
 
@HatterisMad nah fam. nothing like all the grip in the world tearing around a corner
 
user2620028
@Veronica sounds incredibly boring to me :(
 
@AwalGarg take it as a compliment :P It's very useful for drinks
 
1:56 PM
That's because you drive a glorified go-kart
 
user2620028
Anyone can drive a car that has infinite grip
 
not true actually
you'd die of g-force
 
user2620028
sure, but you can drive it. No skill required
 
if grip were infinite, I doubt it would move
 
what if the car didn't move, but you ended up spinning the earth.
 
user2620028
1:57 PM
unless you count the skill of trying to keep the speed low enough that you didnt flip the car
 
user2620028
@rlemon i would be questioning the mass of that car
 
@rlemon this is what happens now. relativity.
 
@rlemon conservation of angular momentum
 
Probably a dumb question... if you have an object and you are checking a given key where the value could be undefined, wouldn't both undefined and false be falsey? Would that cause problems?
 
1:58 PM
lol you guys can't give serious answers when we're talking about infinite grip :P this is now /r/shittyaskscience
 
@towc but congrats - you are a public speaker now! :D
 
@corvid yes, both are falsey. Yes, there are cases when that matters
 
user2620028
true haha
 
@rlemon I thought this was /r/whatif/. Sorry.
 
@AwalGarg Ikr! I can add it to my weird list of seemingly grandious things and my CV for later "I started giving public conferences on advanced programming concepts at the age of 16"
 
1:59 PM
what if humanity actually cared about humanity?
 
and employer's be like daaaaaamn
 

« first day (2071 days earlier)      last day (2889 days later) »