« first day (2319 days earlier)      last day (2854 days later) » 

18:00
@FlorianMargaine damn grats
my highest on an SE site is just under 200 :(
You're 7 votes away from the gold badge though in JS
I think I have 4
6 votes
Hey thanks for at least explaining your down vote @Imray , Also note, I said fixed width and height, not variable. So resizing isn't a factor. "Basically" I set the width to 100px, not 100%, and margin to -50px which is half. This has been a pretty standard method for centering. I look forward to your answer though :) — Loktar Mar 19 '14 at 14:32
oh my god that italics snark
@SterlingArcher oh?
i may have done a vote
oh sorry i was talking about @Loktar
he's at 993 (soon 994 JS points)
.... it was hard to find one of his JS answer I hadn't upvoted yet.
18:10
hi guys. I was searching on Google on how to write your own javascript charts to render but I can't seem to find a good tutorial for it. Does anyone know a good place to learn this?
@StuiterSlurf 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.
@StuiterSlurf how dirty do you want to get your hands?
@Lugg
@Luggage I want to learn to write it xD I use some libraries but I have no idea how they build it up.
@Luggage I am just someone who wants more knowlage about those topics
charts like graphs and models and stuff?
d3 is the defacto standard for making charts. It's a low-ish level set of tools with lots of exmaples
It's not a single-line of code type of library, you make your own
But lots and lots of examples are around
d3 runs with svg elements mostly. WebGL is also an option
and the cool kids (me) use react w/ some d3 helpers.
but d3 is all you need if you aren't a react person
and the cooler kids (me) use angular w/ some d3 helpers
18:14
gasp
but why still use helperfiles?
real' cool kids use canvas with no library/framework
also, slow kids
I want to write it al xD
plotly is pretty nice plot.ly
well, d3 provides lots of helpers to help you calculate parts of a chart/graph, even if you don't use it to do the drawing
18:15
because nobody wants to manage a self-built graphics library unless that's the goal
hahahah maybe I am slow but I see a lot of rendering that I can't follow
and therefore I was googleing but I couldn't find it
but thanks a lot!
I will read in to d3.js and react
I will never not love this
we're all experts here
ok @towc god please help me
18:28
what do you need help with?
the above question
if you want us to help you, make some effort so we don't have to click a link
i thought clicking a link would be easier than reading text here
sure will do it
not all of the text
tell us what kind of is the problem
Data gets printed here
18:29
then in a separate message, paste the link, so we can see it oneboxed
1 message moved to Trash can
@user2280016 Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
but not inside here dbHelper.distinct(mongoose.model('_listing'), {}, {}, { 'ticket.seating.category': '1' }, 'ticket.seating.category').then(function(data){ console.log(data); })
Hey guys, can somebody help me out with promises?
When defining a function f1, which calls a function f2, can I define the return of f1 inside f2().then()? I always get a `undefined`.
post an example
18:32
@towc you gone?
f1 = persistAnswer(dto)
f2 = answer.save()
@user2280016 no
What's undefined?
if you want my full attention, give me some money, otherwise wait until someone who is in a good enough mood to help you will
I see a lot of things in there that would be undefined
18:33
when calling
var shouldBeTrue = persistAnswer(obj)
it's undefined
Yeah
@SterlingArcher haha nice
@Meredith sry I forgot to mention, I ommited some things, like the declaration of anwer, to limit the example
you've been more concerned with that than me
Because you're not returning anything
18:34
I keep forgetting
so it's esier to grasp
return answer.save
lol soon!
any one who is voulnteer to help me?
Or remove the brackets in the first lambda function
You don't actually need them in this case
18:35
distinct: function (model, conditons, projection, options, distinctKey) {
            return new Promise(function (resolve, reject) {
                options = options || {};
                projection = projection || {};
                model.find(conditons, projection, options).distinct(distinctKey, function (error, data) {
                    if (error)
                        console.log("error is" + err);
                        reject(error);
                    console.log("data is " + data);
this time i formatted
great, now if you look for towc on twitter porn things come up -_-
answerDto => answer
  .save(...)
Is perfectly valid
@towc i will give you 25 rep points, answer please
Am i retarded or should a span click event trigger even if it's inside a tr with a click event?
Are you sure you're clicking it
18:37
@Meredith when returning the promise, I'd get the promise itself back (I also tried .resolve(), didn't work)
@user2280016 did I ever say I knew the answer? I quickly clicked the link in the end because you were being fairly annoying, then saw it was for databases, of which I know few about, and that's that
@Ronin Yeah isn't that the point
you could have at least asked "any experts with mongoose?"
ok any experts with mongoose and node ?
@Meredith yesm
18:38
@Meredith I'd like to know if the promise was fullfilled (i.e. if it was resolved correctly)
shouldbetrue.then(checkforwhatever)
(sry I'm still new to the world of promises)
@Meredith this works for the case that the promise was correctly fullfilled, yes. but what if it wasn't, how can I handle this case?
.catch
any mongoose and node experts here?
18:43
oh wait dat not mosho?
@user2280016 have a look around freenode, otherwise just hire someone
@Meredith turns out I am indeed retarded
or just wait a few more hours (and not just 40mins or so)
I was registering the click event inside the wrong Template helper
will i be kicked out if i keep saying same thing here?
yes
user2620028
18:45
yes
@SterlingArcher Yeah I know
whats this chat for then? no one is helping :( and if i ask i will be kicked
I mean we're not obligated to help you
there's currently noone with enough experience / freetime for you
there's no problem in asking once
or asking if there's another way to get that piece of information
If chat can't help, ask on the main site
18:47
trigger activated
i have asked in main site and came here
Then please be patient, most of us are currently at work right now
ok sorry i will be patient
user2620028
@towc neat feature, how did you set that up
@HatterisMad complex algorithms and rng manipulation
user2620028
18:48
figures... you would add rng to porn
I'm not sure if the fact is pissing me off or just funny
@Meredith yes that works, thanks a lot
LMAO
19:00
finally a javascript expert
loktar will you be interested to help me
he's the expertest
user2620028
yep. he is the only one in this room qualified to answer any questions
  wow
so expert javascript ecma promise
whoops, forgot commas
user2620028
19:02
@SterlingArcher man he got hit hard
user2620028
thank god labs are virtually indestructible
loktar ! god are you here?
2
room topic changed to JavaScript :: Loktar, Our God: 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-6] [javascript] [nodejs] [typescript]
user2620028
seriously though @user2280016 your time is better spent learning about your problem than waiting for someone to join the room who entertains your question.
i dont know where to learn from, because i dont know what the problem is
all seems ok with the code
19:05
Knocked off 2 tickets for my sprint in 1 morning. <3 Im on a roll today
suck it monday
user2620028
if you don't know what the problem is then how are you going to describe it to anyone else who would be willing to help you?
i found out what a mad matter is yesterday
@PauloHDSousa 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.
paul is that hi for me?
19:07
Not sure
@SterlingArcher Lol
He got some air
you could almost call him an... air bud
@PauloHDSousa if you are not sure please read this question stackoverflow.com/questions/42350065/…
user2620028
i also hate those cookies
19:10
me, too
theyre the best
you cant deny it
just eat a spoonful of sugar. It'll have more depth and nuance.
sugar doesnt vaguely taste like cardboard though
OK to paste link to an article on building a web app with Vue, Go and SlashDB?
I love those cookies
gtfo you heathens
19:13
Right
!!tell Meredith ^5
@Meredith ⁵
am going to get fired tomorrow
Like I recognize that they're not actually good but that's the point
user2620028
@user2280016 if you can't do your job and refuse to self teach then that is likely your own fault
19:14
@user2280016 final warning, please stop spamming your question to everybody you "think" is talking to you.
Ok quick question
why did you get hired for a mongo job if you dont know mongo
ok guys
@Meredith quesiton is nothing to do with the mongo, the same query works fine on mongo
user2620028
@Meredith ehh i have been hired for java before when i claimed many times i knew javascript and hadn't touched java in a really long time. I get that part, I just took the time to learn java so i could do my job at that place.
19:27
Maybe this is an idiot question... But are Pixel Coordinates actually Screen coordinates or Wheres the difference ?
hey shiny folk!
Hello :-)
Last week I gave up on Javascript because there is no way you could make your site 100% SEO friendly with just javascript
@FahadMullaji 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.
gosh that sounds a task @FahadMullaji 0_o
19:32
@FahadMullaji Sure there is.
19:48
My life right now -_______-
@KendallFrey ^
But moooOOOOOMMMUHHHH
I found a meteor +1able. Meteor does what I wish angular did when it comes to event handling. Abstracting them into template handlers. THAT I like. Not much else.. but if angular did that it would make the templating so much cleaner looking
How does meteor do it?
user2620028
20:08
@SterlingArcher i think for this one to be accurate the ctrl, c, and v keys would likely also be dead
What was the Amazon(? maybe) website, named something like Human Torque, where you could post or do odd miniature tasks, like filling captchas or extract text from images or whatever?
monad
user2620028
would that be it?
@Meredith sorry was busy -- i'll give you an example
20:13
@HatterisMad holy shit I just spelled "turk" as "torque", because "turk" isn't a word
user2620028
Mechanical Turk
Thanks
<angular-directive>
    <div ng-click="some(); function(); here();"></div>
</angular-directive>
I don't like that ^ it's inline event handling
user2620028
yeah i just googled amazon mechanical torque and thats what came up :P
meh, my google fu failed me
20:15
<template name="meteorTemplate">
    <div id="clickMe"></div>
</template>
Template.meteorTemplate.events({
    'click #clickMe' (event, template) {
        //shit post here
    }
})
That's how meteor handles template events
Each template has it's own helpers, autorun, and events declaration
Hey, everyone! I have a quick question about testing a React app
Some of my tests cause React to issue console warnings. I expect this; I'm deliberately doing things in some of my tests that would normally be problematic, so the warnings are appropriate.
I want to supress the warnings, but only on the specific tests that I expect to issue warnings
So I want to mock/stub out console.warn() on those tests
I know how to do that, but I was wondering if there's a commonly accepted idiomatic way to do so?
20:42
I'm trying to update what is inside of a div using innerHTML, but when I refresh the page, the div does not display the new content. I've tried doing it from the dev tools console even, but no dice. Am I missing something, am I doing it wrong?
the code is attached to window.onload
@Tiffany can you show the code?
sure, sec
function display_total(total)
{
  var output = document.getElementByClassName("output");
  output.innerHTML = total;
}

window.onload = function() {
  display_total("2");
}
I'm trying to make floaty things tilt, but they're not—can anyone tell what's going wrong in lines 78 - 85 of my js here? codepen.io/Flobin/pen/qRzRJO
@Tiffany I think the error is in window.onload = function() { }
HTML has <div class="output"></div>. I'm trying to build a calculator in javascript.
I tried doing window.onload = display_total("2"); but that didn't work either
Actually, I'm not sure, but you could try this: thechamplord.wordpress.com/2014/07/04/…
20:45
but even aside from window.onload, I running the code from the browser console
when I run var output = document.getElementByClassName("output"); it even gets the right element, and if I expand its details, the innerHTML value is correct, but I can't update it
let me do it again and I'll show what I mean
Have you tried using output.textContent = total; ?
It's safer anyway
I just tried, div didn't change
would the console be able to update the DOM?
@Flobin good info, will probably help me after I overcome this issue
I have a component that displays depending on if an action has updated a bool value it's listening to in componentDidMount.

But now I need to hide that component when the user clicks close in the component. Can I dispatch an action for that bool in the same component that listens for that bool result?
If that makes any sense to you
20:55
I did realize one problem with my code, I'm using getElementByClassName instead of getElement*s*ByClassName
blah, meant to emphasize the s
oh well
Scratch the above..my question can you update props value and listen for the same props in a component? Because when I tried listening for props value it's fine but if I try to update the same props value by calling it's reducer the value doesn't reset
ahh, of course
but still doesn't give me the intended outcome. I'm going to mess with it later, not a priority right now.
21:24
@Zirak saw that, wasn't very impressed
21:37
Skip-Gram works!
user image
4
um
Baedger i don't think I wanna know
user2620028
what in the hell
Those are two of my three favourite things!
22:23
@SterlingArcher lol
dank
"I have no idea what kush means"
hi
If a component A decides when component B displays..How do I handle closing component B as it shouldn't modify it's props right?
You just stop displaying it.
//component A
render() {
    return <div>
        { this.state.showComponentB && <ComponentB /> }
    </div>;
}
yes but in my case the props from compA are still true when I dismiss compB..so when I ask compA to display again it doesn't as it's showB props are still true
once showComponentB is false and componentA re-renders, then any instance of componentB that was there will get cleaned up (i.e. componentWillUnmount is fired, etc)
22:35
in essence dismissing compB from within itself doesn't reset the props set by compA
ohh, then componentB should not dismiss itself if component A is controlling, just fire an event like onHide()
then componentA can update it's state and propogate the change back down
Exactly like a controlled form input takes it's value from the outside and just fires onChange
ok digesting that
//component A
handleHide() {
    this.setState{ showComponentB: false });
}
render() {
    return <div>
        { this.state.showComponentB && <ComponentB onHide={this.handleHide} /> }
    </div>;
}
In this case ComponentB is a 'dumb' component and component A is a 'smart' component (i.e. it has internal state)
at least in regard to the show/logic
I use this for things like Modals. They just "request to be hidden" and the parent destroys them.
22:42
so compB is sending a update to compA to tell it to update the props that compB is listening to, for it's display logic
or am I picking that up wrong?
or wait
What do you mean "listening to"?
well at the moment compB is listening to the prop bool value isTableDisplayed, which is set from compA
ohh, i see.
brb, I need pants
ok, soo, if this component is getting isTableDisplayed from it's parent, then normally, it would only take changes to it from the parent, not internal state
you COULD treat isTableDisplayed like just the "initial value" and then track the state inside compoentnB, but.. one or the other, not both.
And the general trend in react is to push state to just a few smart parent components and keep lots of smaller components dumb.
again, think about a controlled <input />
22:48
hrmm
value/onChange lets it externalize that state. In your case it might be isTableDisplayed / onTableToggle or some shit.
But this is without seeing your code.. i could be leading you astray.
I'm assume that componentB is a rather dumb component
no it's sounding right, trying to put it together in my head
<Modal onHide={app.hideModal} show={app.shouldShowModal} >
    <... />
</Modal>
show / onHide is a sample from my own code. This is a modal.
finished my bench and coat rack today

« first day (2319 days earlier)      last day (2854 days later) »