« first day (3292 days earlier)      last day (1639 days later) » 

12:00 PM
he's trying to map an office layout and determine fastest route
I think the end objective is to map out his entire building
 
Can't seem to figure out.
lol
I thouht I found the problem
 
@HassanAlthaf think about it. What is it about [1, 2, 1] that is indesireable and [1, 2] is fine?
 
@HassanAlthaf you're also jumping ahead two nodes
 
12:03 PM
you only want to work with one jump ahead
 
is it the if condition
 
nextPoint represents the adjacent node to current
you don't need to be looking at which connections it has
you need to look at each adjacent node to current and ask yourself if its id has already been visited in your path
and in that case, you ignore it
 
pls tell me
i want to work with this kinda problem
 
@HassanAlthaf Fill him in :)
it'll also help you understand it if you can explain it to him
 
@Nobody Sure man, go through our chat logs for the past 2-3 hours
@Neil I suck so hard at this recursion LOL
 
12:11 PM
it helps to think of each run of a recursive method like a single loop pass
 
yes, i think that way.
i have written many simple recursions, not such crazy ones tho LOL
linear recursions
 
@KarelG are you here?
 
path[path.length - 2].id === nextPoint.id
@HassanAlthaf Why this?
 
[1,2,1]
 
This will work for the example of [1, 2, 1] but not the example of [1, 2, 3, 4, 1]
 
12:12 PM
oh, must be entirely
 
you don't want it to be anywhere in the path.. not just -2
basically you're asking if by going to this node, you're making a loop
you're not interested in loops, only trees
 
@KarelG You know how I was trying to update my list without refreshing the page? I tried adding some code that loads up the list of cards on but button onClick which is like so onClick={() => this.loadAdminHelpCard()} but the page still doesn't update the list until I refresh the page
 
Woah.
Got it working man.
WOOOO
You're a beast.
But, it literally went through the entire thing
And the final point came last.
So, how I'd I simplify that long process
(6) [{…}, {…}, {…}, {…}, {…}, {…}]
0: {id: 5, x: 10, y: 110, connected: Array(2)}
1: {id: 1, x: 0, y: 110, connected: Array(1)}
2: {id: 2, x: 110, y: 110, connected: Array(3)}
3: {id: 7, x: 250, y: 110, connected: Array(2)}
4: {id: 3, x: 320, y: 110, connected: Array(1)}
5: {id: 6, x: 110, y: 20, connected: Array(2)}
The path is from Meeting Room (id 5) to Pantry (id 6)
 
you should be returning an array though
remember there may be multiple paths
but definitely a good start :)
 
yes, its returning an array
 
12:23 PM
that's a path
 
an array of objects of points
im so confused lol, it goes through everything LOL
 
you many have several paths
you're probably grabbing the first path you find
 
you're so pro dude.
 
you need to return all paths
 
how would I do that
let me share the code.
 
12:24 PM
you should always return an array of paths
so an array of array of objects
whatever gets returned, you concatenate them together and return that
so by the end you should have an array of several legit paths to your destination
 
so
path would basically be an array of paths?
 
path = array of js objects.. an array of path = array of array of js objects
 
oh, where'd i define the array of path
 
rather than return path; you'd do return [path];
also, I think "let newPath = path;" isn't copying the array
so that could be problematic
you'd need to make an actual copy of it
otherwise you're modifying the original
 
12:28 PM
you could also modify the original, but you'd need to remove the added node before each successive call
you'll get there I promise :P
you're already like 90% there
 
wow
lol
man u're so pro
 
nah, just experience
it becomes second nature to think about these things
 
i dont understand anything in the recursion
 
first, you should address the problem with returning an array of paths
if you've found the end node, it should still be an array of paths (because you can't know what you'll receive otherwise)
in the second part where you're making each call, what gets returned is now an array of paths. So turn these arrays of paths into a single array
 
my internet
is terrible rigt now. thanks to rain
 
12:33 PM
it's not raining here, but it looks like it may
 
FINAL[[{"id":5,"x":10,"y":110,"connected":[1,2]}]]
After making the changes, I only get this.
which is basically the starting point. let me share the code.
 
path.some((ele) => ele.id == nextPoint.id);
 
Can one of you guys please check out my question here? stackoverflow.com/questions/58484613/…
been trying to figure it out for days now
 
@HassanAlthaf good on you that you're slicing
@HassanAlthaf return [path];
 
I didn't get what u told me to do with that path.some(...)
 
12:40 PM
You're doing this at the end. Of course this way you're only getting the first node :P
 
so i gotta remove that?
 
@HassanAlthaf path.some(...) can replace:
let found = false;

                path.forEach( function (point, index) {
                    if (point.id === nextPoint.id) {
                        found = true;
                    }
                });
@HassanAlthaf what you return from the recursion is what you get when you make each recursive call in your loop
 
removing the return [path] at the end gives me a undefined
 
yes, because nothing is getting returned
you need to return this, no more no less: an array holding all paths leading to your end point from the passed path given
In the case in which your path already includes the end node, you're there. Simply return [path]
otherwise, you're making multiple calls, and each call returns an array of paths
You need to group them together into a single array and return that, understand?
 
i'm confused :/
 
12:43 PM
suppose you can get from 1 to 3 by doing [1, 2, 3], but you can also get there by doing [1, 4, 3]
 
at the end of your call, you should receive an array like: [[1, 2, 3], [1, 4, 3]]
 
oh!
into the path, instead of re-writing
so we need to
into the path, instead of re-writing
push the return values
im sorry if i keep disappeaaring, terrible internet
 
suppose after a single recursive call you receive [[1, 2, 3]], and after another, you get [[1, 4, 3]]
you must combine them to return [[1, 2, 3], [1, 4, 3]], understand?
or similarly, if a single recursive call returns [[1, 2, 3], [1, 4, 3]], and another returns [], you need to combine them to return [[1, 2, 3], [1, 4, 3]]
 
12:47 PM
you're trying to collect all valid paths to destination
 
Hello. This is a generic question. Not strictly related to JS. I just want to know the kind of APIs we have for consuming a video stream...in any platform/programming language...
 
you may also be returning an empty array, keep that in mind
 
have you been following this shitstorm?
 
@deostroll pretty much any language which can access a URL and download content can manage a stream
 
12:49 PM
shouldn't that be right
 
when accessed as a stream...what do we deal with...bytes of data at a time...or a byte of data..., something in the byte data - like a stop mark? What is the standard here...?
 
but throws an error on me
 
@BartekBanachewicz what tf is wrong with these guys?
it's like they've honest to goodness flipped
 
if its video data, my goal is to take some sort of a screenshot...what do I do to achieve that?
 
@Neil they've been rolling in midair for years now
only follows that a full flip has been commenced
 
12:52 PM
@deostroll there's a protocol for html where base64 data is sent, and a newline is used to indicate a full stop
 
but yeah, kicking out moderators for no reason is gotta be a new low
 
beyond that, whatever language interprets this may automatically convert to bytes or not
@BartekBanachewicz I mean I suppose we don't hear the other side of things, but nothing about that made me think he was lying or being dishonest
 
@BartekBanachewicz the storm has been hailing for weeks
a lot /resigns after that.
it just just the drip
 
@deostroll hmm, well you'd call the server using http and headers that would suggest you're expecting a certain kind of data in reply
 
@Neil she. (ironically it was all about pronouns)
@KarelG oh yeah, two big SO mods got out as well IIRC
that's a really sucky outcome there
 
12:54 PM
the server would ideally reply with the base64 data or status code other than 200 in case of problems or redirection
 
vlc does this to some extent...if only i knew what it is that i have to search the internet for...
 
wait fuck Robert Harvey as well?
 
for e.g
 
ow.
okay it's even shittier than I though
 
oops
 
12:55 PM
@BartekBanachewicz yeah
there is a list on meta if you want to see it all
 
when attaching a usb cam, vlc is able to detect it and play...
 
@HassanAlthaf path.push(path);
i don't think you've thought this through :P
 
@KarelG fucking hell
 
12:57 PM
@deostroll a lot of magic under the table is going on to make that work
 
many (chat) regulars left as well
 
Drivers register to windows as an optical device, and windows can make it work using a very simple interface
 
i don't imagine every chunk of data is going to have meta info here...
 
I did not have seen some high rep users that used to frequent new questions lately
 
@deostroll no, it is one request to the server you'd have to make
 
12:58 PM
@Neil wdym by that. I still don't get what you mean
 
@HassanAlthaf path.push(path) is adding a copy of itself to itself
 
you said there must be an array of multiple paths right?
 
I don't know if that's possible, but it is certainly not what you want
 
whats is the "server" in case of a usb cam here?
 
@HassanAlthaf yes, but this doesn't do that :P
 
12:59 PM
lol
 
if you've found the destination node, then you only have to return a single path (which is path itself in an array, so [path])
 
im hella confused man
 
every other call could have zero, one, or many paths being returned by calling recursively
 
        if (current.id === end.id) {
            return [path];
        }
this is before the for loop right?
my output is still the same
 
@HassanAlthaf you tell me. When that condition is true, would you want to recursively call for adjacent nodes?
 
1:02 PM
the only node in the path is the startignPoint
 
@HassanAlthaf yes, because at the end of your function, you shouldn't be returning [path]
 
oh
removed it
 
If I call a function which always returns [path], then if I pass [22] it returns [[22]]. If I pass [1000], you return [[1000]]
 
now my thing is undefined
 
yes, because you're not returning anything..
Follow me for a second. suppose the only path is [1, 2, 3], you follow?
you pass [1], and you say, is 1 my destination node 3? No..
with me so far?
So then you say, give me all your connected nodes and call myself for each..
One connected node is 4, so you call itself with [1, 4], right?
 
1:05 PM
yes
 
is 4 equal to 3? No? Then continue with [1, 4, whatever].
 
yes right
 
Suppose after these series of calls, you don't find anything. The result should be [] (not undefined or [[1]])
 
then?
 
you want that after a call with path [1, 4], you get [] because nothing was found
However you then call with [1, 2], and you should get [[1, 2, 3]]
Do you see why?
what you're doing is returning [path] or undefined
you need to return an array holding all the returned results during your loop
what you return on line 35 is what you receive on line 26
 
1:10 PM
for some reason
path is getting smaller
on line 26
 
debug your code, using a simpler example
using my scenario
the only right way to get to node 3 from node 1 is through node 2
so [[1, 2, 3]]
Walk through your function, starting off with [1] as the path and 3 as the destination node
it's a good exercise, and it helps, I promise
you'll hit a point and go "ohh wow I totally didn't see that before"
 
Yeah niel the kid is a complete creep
Today in class, he actually bothered coming to class after all that drama this weekend
he got all pissed off at me lol
"Whyd you call the cops on me for ringing your doorbell!?" Kid forgets breaking illegally into my back yard and almost getting bit by my dog
 
oh god i still dont get it
LOL
 
@TaylorS if the dog wasn't a clue that you weren't supposed to be there..
sheesh, stay away from the guy
 
lol ikr
I went out there with my steel bat and a flashlight
 
1:24 PM
you make sure he hears you say, "I don't care who you are. If I find you, you're getting your face smashed in by a steel bat. I recommend you leave if you don't want that."
 
I remember he drove off and his little brother said "I told ya you shouldnt have done that!"
I guess he doesnt remember me coming out because he says he just saw the dog
 
@HassanAlthaf just debug the whole thing from start to finish, did you do that?
 
I did
I see that
newPath suddenly becomes [[1,2,3]]
when a valid path is found
 
ok, that's half of it
the more important part is the next part
you have to have that information make it to your first call
 
Just a quick design question, should I include the Website name on the topbar like it is here: skylerspark.github.io or should I put some kind of replacement, like a logo or something else
I already have my own logo, havent bothered putting it in yet
 
1:31 PM
I think a logo might be nicer tbh
 
@Neil Could you rephrase the last sentence?
 
@HassanAlthaf when you get to the point where you return [[1, 2, 3]], you're three calls into your function
debug it entirely back to when you called it the first time with path [1]
 
I know how to prevent firefox/chrome pwd-manager saving credentials by unchecking the 'remember pwd' in the browser's settings - but how the heck can I prevent that programmatically from my app even if turned on in the browser's settings and when using input type=password in the markup? any workarounds?
 
recursiveIterationOfPoints: function(path, end) {
            let current = path[path.length - 1];

            if (current.id === end.id) {
                return path;
            }
It keeps making me feel, that this first return must be path and not [path]
 
Ill probably use a logo then, as I feel the large website name is a little bit impending
 
1:33 PM
But that doesn't seem to make a difference
 
@HassanAlthaf what gets returned on line 26 after you've returned [[1, 2, 3]]?
@TaylorS generally you'd have both
some people are more visually keen than others
so they'll see the logo first, while others will read the text first
 
@TaylorS yeah, especially when people can see the URL at the top anyway,
it'd just feel a bit repetetive
 
@neil while a lot of bigger companies use a sombination of both in a text-graphic (coca cola, ibm, amazon etc..)
 
@Neil think you'd be able to help me out with my JS problem?
 
I found out
 
1:39 PM
@HassanAlthaf bravo
 
as soon as I do newPath
before I do the recursive call
I checked for the path to be found or not
It does work.
But for some reason, it doesn't ignore my return
it goes to
the recursion
I don't know hwo to fi
This is my code so far, would you be able to give me a hint
 
it is supposed to recursively call for every adjacent node that isn't already in your path
that's correct
 
@Neil any clue regarding my question, or any workaround (input type of pwd triggers the browser's pwd-mgr via the interpreter)?
 
if you can get to three by doing [1, 2, 3] or [1, 4, 3], then in one call you'll get [[1, 2, 3]] and in the other you'll get [[1, 4, 3]]
@HassanAlthaf so my question to you is what do you want to return in that case?
 
1:41 PM
I still don't get it.
 
@iLuvLogix I think that's a browser thing. You can't really prevent it from memorizing your password anymore than you can prevent a user from visiting a website
 
i only get one valid path
look at my debugging output
pastebin.com/mAaTa8ia
When it says BOOM, it means tis valid
but when i hit return
 
@HassanAlthaf ok, so per my example, if you can get to three by doing [1, 2, 3] or [1, 4, 3], then you would simply return [1, 2, 3] and not even call for [1, 4]..
 
you've found one.. there may be many (arrays, hint hint..)
 
1:44 PM
make a global variable
and push to that?
 
you don't need to check what gets returned
well no, local variable, but yeah
have a local variable accumulate the results of all your recursive calls, then return that
 
local variable as in
 
if there are no viable adjacent nodes, then you should still be returning an empty array
 
inside the function
 
yes
 
1:45 PM
@Neil i'm aware of that but any known & solid workaround for input type pwd? I'm working on a admin app for access-control where details such as mqtt-broker connection and ldap-credentials can be set & changed, but I hate it when i see those 'remember me?'-popups come up..
 
broke my
function entirely
LOL
Probably the hardest code I've ever written.... lol can't figure out..
 
@iLuvLogix You can usually just say "don't remember" on most browsers though
 
Would you be able to tell me what exaclty I need to do, so I could then understand this code.
 
@HassanAlthaf why'd you change back line 6?
you need to always return an array of paths
return [path];
 
indoormaps.js:251 Uncaught TypeError: Cannot read property 'id' of undefined
at IndoorMaps.init.recursiveIterationOfPoints (indoormaps.js:251)
at IndoorMaps.init.findPath (indoormaps.js:167)
at new IndoorMaps.init (indoormaps.js:26)
at IndoorMaps (indoormaps.js:3)
at app.js:1
Gives me an error on line #31
41**
When I got rid of the console.log on 41, it returns me an empty set []
Let me give you the latest code again and wait for you to see what I did wrong
 
1:56 PM
ok, a lot wrong here :)
newPath[newPath.length - 1].id this would fail if newPath were undefined or of size 0
You check if it is undefined, but after
You should never return undefined.. ever
if anything you should return an empty array
 
I dont returna anyting tere
 
hmm, it's becoming increasingly difficult to debug this
do yourself a favor, and scrap the whole middle part of your loop
 
which part exactly
 
I want you to implement this: For every adjacent node to current which isn't already in path, call itself with path with adjacent node added. Concatenate all returned arrays into a single array. Return said array.
 

« first day (3292 days earlier)      last day (1639 days later) »