« first day (2062 days earlier)      last day (2904 days later) » 

user3119231
1:00 PM
a little hint for the new programmer: if you do a @ please type your message in the same line right behind the @. ok? ok.
 
@Paran0a I've learnt all my coding myself through tutorials. It's hard to know everything without taking a few courses
 
@Paran0a let's not bash the newcomer on account of the fact that he is new and asking questions. There is nothing wrong with this
 
@GNi33 laughed very hard so that co-workers stared at me
 
He seems to actively participate in that repo.. opening issues and PRs.. he's sad that the project seems to be abandoned... I mean.. RowanHarley
 
@RowanHarley don't forget to add to your list github.com/enaqx/awesome-react
 
1:08 PM
@KarelG even though it's really nothing to laugh about... it's just so weird
 
knowing that people has drunk from toilet water?
 
@FilipDupanović you probably meant that for elsololobo
 
that he needed to actually flee the country
 
@RowanHarley Not true; A lot of us in this room are self taught. Schooling isn't some magical place that has exclusive knowledge.
 
religion is stupid
 
1:10 PM
it influences your reasoning
 
Euphporia intensifies
 
Holy shit water
 
How can you know when a HTML element (for example a div) is moved?
 
does anyone know a workflow to be able to use a git gui on a remote server? over ssh or something
 
@ErroreFatale Moved in what way? moved to a new parent? Moved a few pixels?
 
1:12 PM
ndugger moved a few pixels... you know, when you applay $(elt).draggagle() with jQuery you can freely move the element where you want
 
He said $!!!
 
@ErroreFatale If you're using a library, they usually have a move event
 
ew jquery... Anyways, you're going to have to store the previous coordinates in memory, and then after you've moved it, compare the new coordinates against the old
 
I'm using jQuery, but from what I'm reading in jQuery there is not such event
someone suggests to create a Custom Event but I don't know how they work
 
@ErroreFatale It's the drag event
 
1:13 PM
@bitten release the gitkraken.com
 
.draggargle() oh yeah. I use that event all the time ;)
 
@FilipDupanović can it view a remote repo?
 
@OliverSalzburg I have tried with the simple drag event... but it's not fired
 
@ErroreFatale Then there's something wrong with your code probably
 
Which library? draggable isn't native to jQuery.
 
1:14 PM
jQuery UI
 
@bitten yes and it automagically does a periodic fetch so you're always up to date with the remotes and their branches
 
Because jqueryui.com/draggable/#events is working fine for me
 
I have a proposal; don't use jquery... you don't need it
 
@FilipDupanović interesting.. downloading now :3
thanks man
 
1:15 PM
myElement.draggable = true;
myElement.ondrag = e => { ... }
 
appreciate it
 
@BenFortune thanks
 
@ndugger That's a thing?
 
@BenFortune Yes
 
@ndugger what do you use?
 
1:15 PM
@ErroreFatale There are already DOM APIs for this; you don't need a library
 
@ndugger as of this morning I weigh 206lbs, down from 212 :)
 
@SterlingArcher I weight the same as I did yesterday :(
 
Speak in normal units alien
 
@ndugger are that cross-borwser?
 
@SterlingArcher congrats :)
 
1:16 PM
@ErroreFatale Google it and find out
 
@bitten np, there goes the rest of your day
 
@ndugger I have just searched but I don't see an event which is good for my case...
 
@ErroreFatale then you're bad at searching. I already put a link in chat
 
How can I add the [add] method to the class in TypeScript ?
import {add} from './add'
import {sub} from './sub'
export class Calc {

value:number = 0;

dump(){
add(2,3);
}
}
 
@ErroreFatale developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API please actually try next time
 
1:18 PM
(currently i did it under the [dump] function)
 
@RoyiNamir your spacing is weird and gross
 
Not if you ignore the empty lines
 
I always bash 3 enters before new line
 
@RoyiNamir 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
 
1:20 PM
@JanDvorak that's like saying poop doesn't smell bad as long as you ignore the poop.
 
(sorry can't edit , time elapsed )
 
OK, it's much worse if you remove all formatting
 
@ndugger I have already tried with the drag event... it's not fired when an element is moved. I know that it works with the native drag functionality of HTML, but it doesn't work with draggable() of jQuery
 
Is it possible to add an imported method to a class in TS ?
 
@ErroreFatale Then don't use jquery. It's bad, especially for newbies like you that don't understand what it's doing.
 
1:21 PM
jQuery isn't bad
 
@RoyiNamir You can accomplish this a few ways; I have a link for you, one sec
 
Thank you
 
@JanDvorak Agree to disagree.
 
I agree to not argue
 
Ironic coming from you
 
1:23 PM
I'm not entirely sure why you say that
 
Would it be mandatory to store my sessions server-side with NodeJS for a browser game?
 
You don't need a session if you don't want to remember anything
 
If they've checked out "Remember me", there has to be a session
 
@ndugger but weight aside -- how do you feel?
 
If you have a login, then yes, you need a session of sorts
 
1:26 PM
I feel 10x healthier already, just by drinking water alone
 
@SterlingArcher Mentally, today is a bad day. I feel great physically, but I just feel mad today for no reason.
 
Break something!
 
@SterlingArcher I wanted to try out some new decks, ended up going from 1600 trophies to 1300 :D
 
Sure, let me just break the company's property
 
decks?
 
1:27 PM
@FlorianMargaine lmao I'm up about 150 more than average, thanks to Sparky.
I think I can hit legendary this month
 
My heart rate is a bit low right now...
 
@ndugger resting low?
Maybe you need some sugar or something
 
I mean, my resting is at 62, but my actual heart rate right now is only 68...
that's not right...
 
That's good though
Mines at 73
 
1:29 PM
I'm just trying to figure out why I'm pissed off today
It's not my time of the month
 
I have those days where I'm upset or mad for no reason, and it almost always turns out to be for no reason
 
Maybe that's just God's way of letting you know that he doesn't like you
 
Amen
 
@ndugger Works like charm. :-) thanks
 
My knee was hurting a bit from my run yesterday... I'm gonan talk to my PT about it; I might have to stop running for a while and do something else cardio
 
user986408
1:30 PM
has anyone worked with ace (editor) and knows if it can be used with websockets to collaborate?
 
Not really. But you might want to put more trust in Him
 
Lets pray for him
Dear father
 
that, or you dialed in something wrong on your Penfield Mood Organ 3000
 
@ndugger elliptical maybe? It's a great workout considering the minimal impact on your knee
 
@RoyiNamir You're more than welcome to upvote that answer... nudge nudge
 
1:31 PM
@BadgerCat summoning!
 
@jAndy do you run?
 
Hello in advance
 
@SterlingArcher Yeah, maybe. I was gonna do leg day with my PT today, but after I tell him about my knee pain, he might say we do upper/push instead
 
@BadgerCat If you say "Sie schreiben einen Brief", typically in spanish you go like "ellos escriben una carta", I'm wondering if you could also say it like "Vosotros escribimos una carta"?
is that legit or wrong in any way
 
@codepushr mmm, your best bet is to run a search on NPM; sounds like something someone might have already implemented
 
1:36 PM
Can you calculate the "force" behind a scroll while still preventing the default action?
 
user986408
@FilipDupanović it seems i'm using the wrong terms, can't find anything useful
 
@BadgerCat I guess no because "vosotros" is "Ihr" and not "Sie" right.. but then again, can you do the same line using "Usted"?
 
@corvid Probably
 
@corvid nothing readily available on the scroll event w3.org/TR/DOM-Level-3-Events/#event-type-scroll
 
Does someone have an idea on how to handle empty (or null) ajax/json response within a promise? It always throws an error and doesn´t proceed, before i can actually handle it
function fecthItem(){
    return dispatch => {
        dispatch(requestPost())
        return fetch('http://localhost:444/localWebServices/getCounter.php')
            .then(response => response.json())
            .then(json => dispatch(receivePosts(json)))
    }
}
 
1:40 PM
man I'm so used to simple coerced concatenation that this sat script threw me off
For the life of me, I couldn't figure out why String + Number was throwing an exception, until I realized I needed to Number.ToString() anything not a string for report concats
 
@elsololobo localhost:444? How does that work? I think that 444 is a reserved port by the OS, no?
 
Yeah I thought ports under... 1000? were OS reserved too
 
I thought it was 1024 usually
 
someone is obviously running their server with elevated privileges :)
 
@corvid i´m a magician... no ^^ I don´t know why it works, but if my database table ins´t empty my app works perfect
it´s simply xampp
 
1:44 PM
Can you add a catch handler and see what the error message is?
 
"Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0"
 
@SterlingArcher java?
 
@elsololobo oh, you're not getting a JSON response
 
!!magic
 
(∩ ͡° ͜ʖ ͡°)⊃━☆゚. * ・ 。 ᵀᴴᴱ ᴳᴬᴹᴱ
 
1:44 PM
@ndugger nah, it's a custom scripting language used for satellites
 
Ah
 
It's like a mix of python and C# almost
 
how to I have to modify the else part then to respond valid json ?
 if($stmt->rowCount() > 0){          //Wenn abfrage ein ergebnis hat
                while($row=$stmt->fetch(PDO::FETCH_ASSOC)){
                    $response[] = $row;
                }
            }else{
                $response;
            }

header("Content-type: application/json");

echo json_encode($response);
 
Set your headers to { 'Content-Type': 'application/json', Accept: 'application/json' }? (see this github polyfill)
 
sorry it´s php^^ donßt kill me
 
1:45 PM
@elsololobo .then((response) => { debugger; return response.json(); })
 
@elsololobo Go ask the php room, then
 
okay. Imagine in my else if would say response = null.... That´s the state how to handle this in JS in a promise
 
586
A: Returning JSON from a PHP Script

timdevWhile you're usually fine without it, you can and should set the Content-Type header: <?PHP $data = /** whatever you're serializing **/; header('Content-Type: application/json'); echo json_encode($data); If I'm not using a particular framework, I usually allow some request params to modify the...

 
Hello!
 
@XkiD 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.
 
1:48 PM
I know how to do that... and obviously i do... but if I return null and then try on runtime to update the redux state with a new item. it throws an error "bundle.js:30066 Uncaught TypeError: Cannot convert undefined or null to object"
 
if the problem is the PHP side though, this might not be the best place to ask
 
IT IS NOT THE PHP
PHP IS FINE
its about update a redux state that conaints a null/ undefined object
 
Are you... PHP_CEO?
@PHP_CEO, PHPCEO@OUTLOOK.COM
CEO OF A PHP COMPANY. DISAPPOINTING HUSBAND. DISAPPOINTED FATHER.
425 tweets, 27.9k followers, following 1 users
 
What is the json supposed to return, though?
 
(∩ ͡° ͜ʖ ͡°)⊃━☆゚. * ・ 。 ᵀᴴᴱ ᴳᴬᴹᴱ
 
1:50 PM
@KarelG lol if that is real I would call the police on her
 
[{"id":"1","counter":"1"},{"id":"2","counter":"2"},{"id":"3","counter":"3"}]
 
I love that account
 
if my table is not empty
 
Okay, so then what is your initial state, and what does your reducer look like for that action?
 
export default (state = {items: []}, action) => {
    switch (action.type){
        case 'RECEIVE_POSTS':
            console.log("in reducer")
            console.log(action.items)
            return Object.assign({}, state, {
                items: action.items
            });
        case 'ADD_ITEM':
            console.log("IN add reducer");
            console.log(action.item)
            return Object.assign({}, state, {
                items: [
                    ...state.items,
                    action.items
the initial state is fetched from the DB. But if the user was never there, then the initial state from the DB is the response we talked about === null
 
1:53 PM
Please forgive my lack of knowledge, I want to make dynamic functions and place them in an array for example
 
1 message moved to Trash can
@XkiD 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
 
and if that is the case, I´m not able to update the state of my App
cause of the error i posted before
 
[
	{
		"name": "test",
		"version": "1.5"
	},
	{
		"name": "test2",
		"version": "1.2"
	}
]

projects.forEach(function (project) {

	project.functions['function1'] = function(){
		return project.name;
	}

	project.functions['function2'] = function(){
		return project.version;
	}

}

console.log(projects[1].function1());
 
So then just set items to [] if the response is null? I am not sure I understand the problem. usually I set an error response if there was an error during fetch.
 
function arrow() {}
 
1:56 PM
export function getPosts() {
  dispatch({ type: REQUEST_POSTS });
  fetch('someurl')
    .then(res => res.json())
    .then(items => dispatch({ type: RECEIVE_POSTS, items }))
    .catch(error => dispatch({ type: POSTS_ERROR, error }))
}
 
okay. but and empty response does not throw an error. or should it?
:D
 
Then just set the items to [] if it's null? I would think the response should return json regardless, shouldn't it? eg: { items: [] } returned from the back end
 
ahhh, okay i will try..
 
import * as ScrollActions from 'utils/scroll';

export default class HomePage extends Component {
  constructor() {
    super(...arguments);
    this.onScroll = ScrollActions.onScroll.bind(this);
  }
  componentDidMount() {
    window.addEventListener('scroll', this.onScroll);
  }
  componentWillUnmount() {
    window.removeEventListener('scroll', this.onScroll);
  }
}
Scroll event never fires... anyone see any reason why that would happen?
 
2:02 PM
okay the solution was on server side... ^^ i just send $response = [] and it works without any clientside handling... anyway thank you!
 
projects = [{name: "test",version: "1.5"	},{	name: "test2",version: "1.2"}];

projects.forEach(function (project) {
	project.functions.hello = function (){
  	return project.name;
  }
});

console.log(projects[0].functions.hello); how can I make something like this ? jsfiddle.net/4f45ndyc
 
@AwalGarg I still can't decide if I believe this story
 
Hey guys quick question this event called event.stopPropagation(); does not work in firefox it fires an error "ReferenceError: event is not defined" This function works in every other browser including ie lol but not firefox. any ideas? jsfiddle.net/f4od3yL6
 
You haven't passed in the event parameter from a listener..?
Where do you think event comes from here
 
@SterlingArcher the universe just kind of makes sure there's an event when you need one, maaan
 
2:10 PM
Whoaaaa
 
Similar to this, just IE-only
 
lol.... okay so I forgot to pass in the event but i still get an error which is event is undefined jsfiddle.net/f4od3yL6/1
 
Wait is event implicitly bound in some browsers?
 
@SterlingArcher also, I got a bottle of this yesterday and it's super tasty.
 
Ooooooh
 
2:13 PM
@SterlingArcher Yes. The chrome does it to be nice to IE code
 
@sterlingArcher Sorry buddy I'm still learning js
Don't know what you mean
 
the dragon fruit tastes like it could be banana or could be strawberry or maybe mango, there's no way to tell
and then tons of cream to back it up
 
@RajaSharma you called event.stopPropagation(). where you called it, what exactly is event?
where is it coming from.
 
@KevinB Originally I didn't have this whole stopPropagation thing somebody told me to add it b/c of xyz reason which i don't remever
When I remove it everything is fine :) just wanted to know why this would cause an issue in firefox
 
2:18 PM
!!afk walkies
 
since you didn't pass the event handler's event, you're using the global event which is a non-standard property of window that doesn't exist in all browsers.
 
@kevinB oh okay I think i'm understanding
@KevinB Il do more reading, thanks for the help..
 
Guys just wondering, what are the different formatting options for text on the chat
if any
 
@RowanHarley Same as SO markup.
 
Does someone know what is causing the error here. trying to render a button foreach li item i render.

  {this.props.items.map(function(items, i) {return <li key={i}>{items.id} {items.text} <button onClick={this.handleClick.bind(this)}>clickMe</button></li>})}

  Throws: bundle.js:29678 Uncaught (in promise) TypeError: Cannot read property 'handleClick' of undefined´

  I´m pretty sure I´ve seen such implementation in one example
 
2:25 PM
:31035662 no bbcode...
 
oops got mixed up
 
click "help" in the bottom right
 
apparently this is undefined
 
but it shouldn´t
 
2:28 PM
but it is
 
good point :D
 
have you tryed taking out this?
 
why?
 
because you're in a different function
you're inside of the .map's function. you'll have to bind this into it or do the var that = this dance.
 
or using an arrow
 
2:31 PM
or just use a lambda
 
does that work in jsx? i had issues with that in the past
 
ah okay. But why does the implementing via constructor also don´t work?
 
the lambda would work, but it wouldn't properly bind this.
 
!!afk Row row row your boat, gently down the stream. The stupid's too much so now I have to go run, kick, and scream.
 
@KevinB JSX can't even being to mess with that. The VM handles all lexical bindings.
 
2:33 PM
Maybe we could do the kicking for you?
 
grr... meteor allows you to use async/await, but every package for meteor can't handle it. Super lame.
 
Babel could if it was wrapping stuff in weird ways, but that's about it
 
how would the"this" dance implemention look like? You mean that I should bind "this" into a var, right? Tried var myRef = this; but this throws the same error
for me it doesn´t make sense that the bind doesn´t work within my class constructor
cause it´s outside of .map()
 
if that threw the exact same error, then either you continued using this instead of switching to myRef, or this.props.items.map(fu would be throwing an error.
 
hm, it´s the exact error
 
2:35 PM
post the updated code
 
 render() {
        console.log("todos");
        console.log(this.props)
        var myRef = this;
        var isEmpty = true;

        if(this.props.items !== null){
            var todoItems = this.props.items.map(function(items, i) {return <li key={i}>{items.id} {items.text} </li>});
            isEmpty = false;
        }
        return (

            <div>
                <h3>Meine Aufgaben</h3>

                <ul>
                    {isEmpty
                        ? <h3>Sie haben noch keinen Todo´s angelegt</h3>
 
yeah, you're still using this.
this.handleClick.bind(myRef)
 
omg -.-
it works... i´m an idiot ^^
thanks
 
Guys I'm having problems with my code (again!). This time I can actually connect but instead of being able to play, the console says that my connection was closed. Any ideas why this is happening
 
@RowanHarley you need to post the code, the errors, and something we can use to actually debug that.
 
2:45 PM
give me a minute. I'll update my github code and give you that
 
Sure, let's just debug an entire application for you
 
Good point. I'll stick up the main file on pastebin
 
how to sethigher priority to run data annotation based validations first over validations defined in script function on submit button click
 
@AbhishekJadhav 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.
 
2:47 PM
 
Here's the main code: pastebin.com/rEMETTsi
 
@RowanHarley we're not just gonna stare at code and magically fix it. Do what ssube just linked you
 
If I gave enough code to reproduce the problem, I'd have to give you the github link
 
ln#126: ... clients[i] != null || clients[i] != undefined
 
2:49 PM
This may be my favorite amazon review
 
lol
 
what should I change that to?
 
&&
 
Actually, != checks for null and undefined at the same time. Don't use loose equals!
 
@ssube && doesn't work
 
2:50 PM
Loose equals is a good way to make bugs
 
@RowanHarley then your shit is null or undefined and that will break everything else
 
Also, you've made me even more mad now because of your stupid loose equals. I need drugs.
 
@SterlingArcher lmao
 
@RowanHarley on top of that, you're still doing the stupid this shit from yesterday that we told you to fix.
 
2:52 PM
@SterlingArcher Have you seen this old gem from Steam? steamcommunity.com/id/DRLgaming/recommended/293500
 
@ssube I got rid of all that
 
@KendallFrey classic
 
@RowanHarley I need you to respond to tell me you understand... x != null is checking if x is not null and is not undefined at the same time. DO NOT USE LOOSE EQUALS.
 
@KendallFrey oh my god that was amazing
 
yes I understand. Just changed it
 
2:53 PM
So savage LOL i love it
 
@RowanHarley ln#27, ln#43, ln#100, ln#105 are all using this when it won't be set
try actually making changes before you ask us to debug your code again
 
Well sorry @ssube, maybe I didnt notice them. I didn't want to waste a load of time looking through every line to check for this's
 
conn.on('error', close.bind(conn.id)) are you doing any other tracking on error?
most editors have a ctrl+f search
 
@RowanHarley if you're not going to waste time reading your code, neither are we.
 
user3119231
!!urban immersive
 
2:55 PM
@Maurice immersive Immersive is an improper word that is sometimes incorrectly used in place of immersing.
 
@RowanHarley if you continue to waste our time because you're being lazy, we won't allow you to ask any more questions in here. Please take some time to evaluate your code.
 
user3119231
now I'm more stupid than before, caprica.
 
@ssube #27 and #43 are used to bind the functions to the client. #100 and #105 were useless bits of code which I didn't notice
 
@RowanHarley #27 can't possibly be binding to a client, it's at the top scope of the module
and 27 not doing anything makes 43 invalid as well
 

« first day (2062 days earlier)      last day (2904 days later) »