« first day (2956 days earlier)      last day (1999 days later) » 

12:00 PM
Right, late lunch time. @BenjaminGruenbaum you already ate? You're closer to me now, aren't you?
 
I need to have a lunch as well
 
We are, but I already ate
We can set up a lunch date sometime though :) Ping me on fb?
 
@AlexH Hmm, are you eventually removing the items? It doesn't seem that you are
 
sure, after I satiate my unfathomable hunger.
 
yes i am, Neil, when opacity reaches certain point
Line 109, @neil
 
12:02 PM
@AlexH hmm, fair enough.
I don't see anything obviously wrong with it. Neat animation by the way :)
 
i got 1500 objects(circles) on screen, at any one time, maybe I am being to generous there :-) @Neil
 
Could just be sheer number of objects being animated
 
Then the question, how and where to hit it on the head to speed things up. You said 1. Object numbers. What else? @Neil & thanks
 
@AlexH when you have so many objects like that, it takes obviously longer and longer to update them all
You need to base yourself on a new metric: delay
After every frame, take a timestamp.
 
you mean, not to update every fps, but skip a few frames?
 
12:06 PM
Sorry, rather at the beginning of every frame
No, not exactly
I mean you determine the delay since your last frame
If very little time passes, your rockets should move very little
If lots of time passes, your rockets should move more..
 
How can I display modal in react native when user clicks on icon ?
 
It means the rockets move constantly based on time (despite slower frames per second)
 
In above screenshot you can see the icon in top right corner
 
@AlexH It's called "delta timing". That should give you something to google.
 
I see, @ Neil. No idea thought... What can I google/youtube Neil, for this respect?
 
12:08 PM
See @KendallFrey's comment :)
 
Reading your mind @KendallFrey & @Neil Thanks for your time, Guys.
 
When user clicks on it. It should open box modal how can I do it ? This is very complicated and couldn't understand how to proceed
 
my suggestion is make it move based on the delay, then afterwards adjust the velocity to make it look the way you want
 
If only JS had dimensional numbers
 
what do you mean?
 
12:10 PM
Make it invalid to do x += velocity, since they have different dimensions
x is L, velocity is L/T
 
well like any language, there are no checks like this
 
Not "like any language"
F# has this
There are probably more I don't know
 
Well that would probably explain why I'm not familiar with the concept
I don't program in F#
 
Neither do I
 
In C++, you would just create a class and overload operators on it
 
12:13 PM
To implement dimensional numbers?
 
So you could allow a velocity to be multiplied by time, but not by something else
yeah
 
I don't think that would really work
 
Not exactly what you're describing but similar
 
Unless you mean a restricted set of dimensions, which is much less useful
 
You'd have to implement it yourself of course, but you could
 
12:15 PM
Without language support it's almost guaranteed to be quite messy
 
probably
But it's also the only way to do properly in C++
 
Is it possible to do it generically at compile-time?
i.e. supporting arbitrary dimensionalities without relying on runtime checking?
 
It wouldn't compile if you tried to multiply two classes which had no overloading for it
At least if I recall correctly.. it's been some time since I programmed in C++
 
You can't have one class for every possibility, that's just not tractable
 
if you declare it as a friend class, they can be defined outside the class
 
12:18 PM
What can?
 
the operator overloading
 
That doesn't solve the problem
 
...Maybe I should use some animated sprite, say, 2-3 per rocket rather than creating and updating 1500 plus object onscreen
 
If you use delta timing, the rockets leave the screen and don't have to be animated anymore
 
data timing is firmly in my diary for studying
delta even
 
12:21 PM
It will be faster this way, I promise:P
 
i prefer it this way - simple objects than some png's etc
 
@Neil What does that have to do with delta timing?
 
@KendallFrey he's incrementing the rockets one at a time until they leave the screen, and as more get added, it takes increasingly more and more time to update them all
If it was based on time, they'd leave regardless of slowdown
 
I fail to see the connection to delta timing
 
jsfiddle.net/alexhermanuk/enbp73o4/1 This is what i am doing, @KendallFrey
 
12:23 PM
@KendallFrey Well I just explained the connection, so I don't know what more to do about it, bud
 
the more rockets i have, the slower the overall animation of everything... @KendallFrey
 
^
 
fwiw, I'm not seeing any slowdown
 
give it a few moments =_:-)
 
@KendallFrey keep it open for a while :)
 
12:25 PM
Nope, might work to have it in the background though
 
maybe it won't slowdown on your super mega-fast computer
 
I suppose that's what we're supposed to take from this
 
i was going to say, like i100 and 1TB graphics card
 
work laptop here.. 'nuff said
 
12:26 PM
hello
 
@objectiveME \o
 
I am having a hard time warpping my head around next js and express js
how can i integrate all for instance have express routes call next js pages
@Neil Hii old friend.
 
has anyone created search bar using filter pipe in angular ?
 
1:05 PM
@AlexH kinda logical right?
you are doing your calculation at each frame request. More objects = more time required
 
I will explore the delta timing issue. @karel
 
just limit your # of rockets
it started to lag when my screen got covered with all rocket plumes
 
i hope your laptop didn't start to smoke LOL
 
user8729657
1:27 PM
Is cheerio and request good for scraping dynamic pages?
 
puppeteer ftw
 
Hmm is it normal to have site/path and site/path/ go to different views?
 
user8729657
@BenjaminGruenbaum so puppeteer takes a screen shot of a webpage. Say the website returned a list of results would I have to similate some scroll effect to get more results?
 
@paul23 Nope
You can, but it's probably a bad idea overall
 
Since react-router considers them different, so I'm now just removing the last slash if it's there. (Currently one would go to a 404 and the other would work, since only the one without the final slash is used by the frontend api anyways).
 
1:40 PM
@paul23 I think they give you that possibility, but it would just lead to endless confusion if you did it that way
 
What way?
It's more like: if the user forcibly types in an url with a final slash, should I "correct" this mistake for him and redirect to an url without? You know "if you fail, fail hard" would be violated that way.
 
@paul23 because A) is it really incorrect if user puts a final slash? and B) what are the chances that user would realize their mistake even if it were?
It's not really fixing an error so much as making one an alias of the other
 
@Neil ending slash usually means "show index"
but I just strip it away in the filters / routes
 
1:57 PM
@KarelG if you allow mydomainlol.com/users and mydomainlol.com/users to be different pages, you're just asking for trouble
of course that would have been turned into links..
 
both urls are same :P
 
the second does have a slash in front actually
 
Show directory listing would be the appropiate action. So it is an action that makes no sense on a leaf, and should display something like "hey you open a leaf node, you can't have sub-nodes under this leaf", and in a case where you do have sub-nodes the one without the slash should show you generic information and the one with the slash should show you a list of possible sub-nodes.
 
the chat is filtering it out
 
@KarelG They are not, one has a trailing slash, it's just not visible thanks to formatting
 
1:58 PM
> but I just strip it away in the filters / routes
 
That would be following the http standard.
 
@KarelG that was a "you" general
not you specifically
 
So, a new building is build in front of my appartment: now my 4g/5g connection has just become terrible and I can't call from the center of my appartment building anymore on "bad days".
This is annoying
My home server also runs over 5G mobile network since it's way more stable in the past than cable.
 
just switch back to DSL
 
first time I have heard someone saying that 5G is more stable than using cable
are you from India? <-- serious question
 
2:08 PM
@Neil I'm living in a relative new appartment block (4 years ago it didn't exist yet) so I don't even have copper inside my building. Fibreglass all the way..
 
hard to believe there is no copper
surely your electricity comes in copper wires
 
-.- ok touche.
 
^_^
well optical fibers works good too
 
But it's just my isp seems to have random outages ever few weeks for like 5-10 minutes and each time I have to reset the router to get back online then.
mobile network (so far) has never ever failed, so long as I have a connection.
 
I'm about to move to a new apartment
I hope I don't get problems like these
At least I won't have problems with ghosts. It's a new building
 
2:10 PM
Problems like these?
 
$(document).ready(() => {
    $('button').on('click', () => {
        $('#name').text(fetchName());
     });

     function fetchName() {
        $.get('scripts/ajax.php')
        .done((data) => {
            return data;
        });
     }
});
 
@Beefo Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
Can someone help me find out what's wrong with this code?
 
@Beefo what does your call to scripts/ajax.php return?
 
A random name
 
2:11 PM
Well I know the isp isn't good, it's part of the rent and choosen to be "el-cheapo" (Iiterary pay only 7 euros a month for 100Mbit up/down + ziggo television)
 
@Beefo have you checked? Does it work?
 
<?php

$names = array(
    'Allison', 'Arthur', 'Ana');

echo $names[array_rand($names)];
Yes it works
 
4536
Q: How do I return the response from an asynchronous call?

Felix KlingI have a function foo which makes an Ajax request. How can I return the response from foo? I tried returning the value from the success callback as well as assigning the response to a local variable inside the function and returning that one, but none of those ways actually return the response....

 
That was fast.
 
So tldr, you have to return it outside of the .done?
 
2:12 PM
no, don't tl;dr, read it
 
When there's a question with 4.5k stars and multiple answers with many stars you really should read it :P.
Those are the questions that are good to read even if you don't have a problem yet.
 
Those upvotes are the number of people that question has helped
Plus or minus 100
 
So the solution is to use a callback?
 
@Beefo Or promises (with or without await/async structure)
 
Now I need to research the difference between ajax and promises.
Thanks for the advice.
 
2:24 PM
Uh they kind of have nothing in common.
 
@Beefo a Promise is a way to represent the result of an asynchronous operation. AJAX is a way to make HTTP calls without refreshing.
While there's a loose connection between the two, they are completely orthogonal.
 
AJAX == Asynchronous JavaScript and XML. Currently the XML portion that relevant .
 
@HelloWorldPeace Funny enough, AJAX is neither necessarily asynchronous, nor is it necessarily XML.
 
Okay I looked it up and yeah prmises have nothing in common, except they both work around async.
Or atleast ajax is advised as working with async, I'm pretty sure ajax can be sync too.
 
@Beefo
"Ajax is not a programming language or a tool, but a concept. Ajax is a client-side script that communicates to and from a server/database without the need for a postback or a complete page refresh. "
 
2:29 PM
I understand what ajax is, its a technique.
 
That's a lot of words to say basically nothing.
 
@MadaraUchiha how is it not necessarily asynchronous?
 
@HelloWorldPeace You can pass async: false and it would be sync (block the entire browser tab until the request completes)
 
xmlhttprequest allows for the async argument to be false.
 
I once insta-disqualified an interviewee that pulled that off in an interview without a good reason.
Needless to say: Don't do that. Like, ever.
 
2:33 PM
Hmm isn't there something to be said for it if you are actually deferring page loading, like first load a small script that only checks a simple thing. And that script loads the actual interface.
Not sure what you would gain by using synchronous calls, but if the page is blank anyways there's also little drawback.
 
@paul23 You should pretty much never ever intentionally block the tab. This also prevent scrolling, clicking, typing, etc.
Especially not for I/O, which is notoriously slow.
 
Yeah, but if the page is literary blank?
 
@paul23 When is it exactly, that you have a completely blank page, with no spinners, no header, no footer, no nothing, and you're waiting for an API call?
 
ajax requests takes time. Doing nothing during that (= doing it synchronous) is waste of the visitor's time.
 
And even if you do, it's literally free to not use sync calls, seeing how easy it is to use Promises with and even without async functions.
 
2:35 PM
Like I said, if you have an "initialize" script that decided what the actual loading needs to be.
 
There's almost never a reason to want to use a sync call.
We can imagine use-cases, but they won't be real use-cases that you'll find in real production code.
 
<!DOCTYPE html>
<html lang="en">
  <head>
    <script>//somechecking and then loading the content based on localstorage etc</script>
  </head>
  <body />
</html>
 
@paul23 localStorage is sync.
It also doesn't take nearly the amount of time it would take an HTTP call to return.
 
Yeah, but one would sometimes use localstorage, sometimes load from server. - Thus if loading from server there is nothing to be seen yet (first time).
 
@paul23 Then you should show a spinner by default, and still not block the page.
Not giving feedback to the user is a no-no.
 
2:37 PM
But then again, as I said: there is also no drawback to using asynchronous calls.
 
I think the case to be made is that the time wasted would be negligible
 
btw on server side (nodejs) there is a use case I actually experienced. During terminate calls of the nodejs server you can do logging etc. However you can't make asynchronous calls during that event.
Given there exists a async-terminate library for node; it however isn't capable of actually catching all various ways a server would terminate. (And even less than node's event system can).
 
Would I be right in thinking promises are a wrapper around async operations?
 
@HelloWorldPeace I don't think async calls are ever any way slower than synchronous - why would they? The biggest dawback is that you need to get used to write everything in asynchronous way.
@Beefo promises are async operations, a better way is to say promises are wrappers around callback functions.
 
@paul23 No, Promises are not operations.
Promises are a wrapper around the eventual value
If you have a Promise on your hands, then the operation had already begun.
 
2:43 PM
What do most coders actually use atm? I read an article quite recently that I should be using async await over promises.
 
It's an important distinction.
@Beefo async await is a fancy syntax for using Promises in a way that makes your code look like synchronous code.
 
Oh yeah indeed, it's one of those pitfalls that will bite you often early on.
 
an async function is a pausable function, that pauses and waits for any value marked with the await keyword.
An async function itself always returns a Promise, even if you hadn't explicitly returned from it.
 
i was making a case for using synchronous calls. that the time wasted making them may be a lesser problem than dealing with writing async code
 
@HelloWorldPeace What if my internet connection is shitty, and it takes me 10 seconds to download your 1MB payload?
You'll freeze my browser for 10 seconds?
 
2:46 PM
@HelloWorldPeace I know you're playing devil's advocate but I disagree: since writing async code is only hard when you do it for the first time. So the time "wasted" by having to tackle it is just a one time thing.
And thus negligible on the larger scale.
 
Why waste time writing code at all?
Forget computers, let's go back to horses
 
Actually that was a thing my prof in computational analysis told me. And he was correct.
Quite often it's just as good as take your good old calculator and do the calculations by hand a few times instead of having to write a script to solve it.
 
Yea im not defending writing sync code but I'm sure there are rare instances where they might be the right solution even if I can't think of any
 
I'd still love to find a good "graphical calculator app" for my smartphone.
 
@KendallFrey how much horses do you have in your pocket?
 
2:51 PM
0
 
There are ti/casio emulators: but none that actually are build specifically for smartphones. (Like being able to use touch screen to edit cells in a matrix, or zoom on graphs)
 
You counting from 0?
 
I just use TechCalc this one. play.google.com/store/apps/… (weird, it is named as TechCalc as shortcut)
 
the AndyGraph ti emulator for android use to be pretty good but it think TI put a stop to it.
 
@MadaraUchiha I would have thought promises was the fancy syntax, rather than the async await.
 
2:59 PM
@Beefo No, Promises are the low level primitive, and async/await wrap around it.
 
I understand that, what I don't get is why we have ajax when we have promises.
Or why AJAX is still widely sued.
used*
 
It is? But as Madara Uchiha has stated: they are orthogonal, you can (will have to?) use ajax-calls together with promises.
Well I see you use jQuery...
 
yeah I use jquery I guess
Is ajax last years news or something?
 
@Beefo because.. we still need to get the stuff from the server
promises don't solve that
 
doesn't promise have fetch?
 
3:03 PM
fetch returns a promise. but that's not "promises replacing ajax"
 
You can try to play fetch, but I can't promise I'll catch it
 
i did what you see there
 
@Beefo legacy code. IE support. taking over from lots of tutorial that are old (written before fetch API got added). ect
 
@HelloWorldPeace ( ‘-’)人(゚_゚ )
 
I am still bug hunting. I have a SQL query. A direct command with the db leads to one result. But on the page, it gives 1000+
 
3:06 PM
From an outside point of view: are you sure you only call it once?
 
kind of a bug the size of a house
how do you get 1000+ results when the query gives 1?
 
yes. it must be a transaction bug because it includes other results that is not even relevant to this one. Seems a cache leak or transaction server is mixing records
that is painful to troubleshoot
 
Oh and: are you sure you use the same database for both tests? (I once made that mistake of using different test dbs).
 
very serious error for a transactional database to have I would think
@paul23 I did that once too. OH MAN I wanted to laugh and cry when I found out
 
it worked before tho :P
I am now looking at differences from until two weeks ago (my last rememberance) <.<
 
3:08 PM
Hmm what is the framework/library you use to call to the database?
 
SQLAPI
 
you should switch to Mongo
Mongo never has any problems
 
:|
 
@rlemon because it does not know about that.
 
smh
-2
Q: I don't see this often, is this bad practice?

Jack HolmesI usually see the following: if (true) myFunc(); However my colleague uses: true && myFunc(); Is there anything wrong with the second approach?

the amount of people in the comments suggesting short circuits are fine
 
3:24 PM
honestly the question should be opened just to explain to those commenters that if you use short-circuits the parts should be (almost) side-effect free. Otherwise you'd surprise future maintainers.
 
is obsolete as well
 
"What it returns is not even used so does not even matter – epascarello 1 min ago" -- I mean wow, people actually notice that this function is about the side effects;
 
 
user1596138
3:43 PM
I fail to see the significance of this ^
 
user1596138
That title caption tho!
 
@LuckyKleinschmidt Please, shit more on things I enjoy.
 
user1596138
@KendallFrey What
 
user1596138
How's that shitting on anything? I just don't get what it means for X time to pass since space where X = the time between airplanes and space
 
user1596138
I LOVE SPACE :O
 
3:50 PM
look again
first human flight. Then we entered space
and today? no new advancement happens
 
user1596138
Yea I understand the very simple caption
 
user1596138
I don't understand the implication it's making. If you know feel free to share!
 
user1596138
We make new advancement all the time. We launched a car into space
 
@KarelG space is boring, we're too focused on 4K UHD gaming on our phones
 
user1596138
We land rockets vertically.... Over and over and over again
 
3:51 PM
don't you have a phone?
 
user1596138
Oh, and we have the Interstate system.
 
user1596138
For the USA folks anyway lol
 
Car culture
 
@LuckyKleinschmidt That's backwards from launching a person into space
 
user1596138
@KendallFrey Deep space
 
3:54 PM
sup peeps
 
4:23 PM
Having a ?. operator would be so nice in javascript.
 
no
 
To do things like: optionalargument?.value.subvalue without having if statements or exception handling all over the place.
 
make it not optional
 
@paul23 looks like Kotlin
 
4:40 PM
guys can you help me to resolve this?
0
Q: Create a pagination with paginator

Doflamingo19I use this paginator to handle the pagination and the paginator. I use this in bootstrap 3 and work correct but I use in bootstrap 4 and I have this result: The possibile html that creates problem is: <tfoot> <tr> <td colspan="4"> <mfBootstrapPaginator [rowsOnPageSet]=...

 
5:16 PM
@KendallFrey youtube.com/watch?v=AQqYs6O2MPw Electroboom managed to short circuit a high voltage power line again 😃
this is some serious stuff ... i.stack.imgur.com/GmUap.png#.png
 
omg is this a response to boom's video?
 
@KendallFrey yes, he is plenty pissed
 
🍿
 
Why when creating a new Date does day 0 cause the day to be interpreted as 32 instead of 1?
JS Date fuckery is so weird.
 
5:53 PM
because day is 1 index'd
 
What's the logic behind that?
 
probably so people could use the numeric date without converting it
 
anyone browse reddit?
 
everyone does
 
if so is there a way to only show my subscribed sub reddits on the home page
 
6:07 PM
It doesn't do that by default?
 
what are you seeing that you're not subscribed to??
 
no it mixes it with main
 
What's "main"?
 
there is no Main anymore
 
if you go to reddit.com homepage
 
6:08 PM
that went away many years ago
 
that is essentially the default main
 
no those are just the default subs
e.g. AskReddit
just unsub from them if you don't want em
 
this might take a while thanks
yeha there used to be a main I though
 
yeah a very long time ago though
 
6:10 PM
yeah that doesn't work
mildly_interesting displays on my homepage and I am not subscribed to it
 
/r/reddit.com
are you browsing /r/all?
 
/r/reddit.com was the original "Main"
yes I do not understand what's going on for you
 
mildly_interesting or mildlyinteresting?
 
yeah the 2nd
with out undescore
feels better with one for me though
this should be better either way
maybe it was an ad
 
6:13 PM
reddit doesn't care what "feels better", it gives you what you're subbed to
 
you're on the Front Page and you're seeing subs you're not subscribed to..
yeah could've been an ad
 
it may have been an ad
 
there are 'default subbed' subs.
 
Are you sure you didn't unsub from the wrong one?
 
so like, everyone who signs up is subbed to /r/pics by default. you have to opt out of a bunch
 
6:13 PM
@WilliamA show us how to repro the issue lol
 
okay now only 7 are subscibed
I like old reddit interface btter
 
I think you can change it back
 
yeah I did
that's why I said something about it
 
oh
lol oops
 
what is oops about
its funny I have more rep on hacker news then reddit
SO is easier to collect rep because people can vote on psosts quite literally years later
 
6:29 PM
and yet I have more rep on reddit
 
your joking
I have like about 100 rep on reddit
@forresthopkinsa I think the issue was that it was an ad and I wasn't paying attention
I was just clicking the subreddit links to unsubscribe
I hoping that is the case
 
6:50 PM
probably
 
i have 16 rep on reddit
 

« first day (2956 days earlier)      last day (1999 days later) »