« first day (2174 days earlier)      last day (2769 days later) » 

4:00 PM
And why A*?
Also - I'm pretty sure the actual problem is not the traversal itself - it's the tracking of what's connected and what not
That's where i'm actually struggling
 
Just gave a mini presentation on WASM to my coworkers, and the other front end dev here didn't like it because multiple languages compile to WASM, which he things will create fragmentation in talent and the ability to write code for the browser... Valid argument, but I completely disagree.
 
I don't have a implementation in JS, and mentionned A* since it is easy to get the algorithm, it may not be the fastest or more efficient, but it s not hard to do or understand.
 
I could, albeit with much difficulty port some traversal code from Wikipedia in JS - but that's not the hard part
WASM is that web assembly stuff right>
?
 
And if you do the traversal right (you want all linked nodes, whatever the link may be, so try all link), you almost naturally get the list with A*
You may have to build a transitionnal model thought, since A* is node based, and your data is link based
 
hehe that's where I stumble
Perhaps i should start by reading on graphs first
 
4:04 PM
@NicholasKyriakides i have a code sample of a* in js
it's using easystar
 
@bitten I'm not sure A* is the right stuf
BFS looks much easier
but then again i'm talking out of my backside
so take it with a pinch of salt
easier meaning simpler
 
But other algorithm may work with links.

Start with 1, get all nodes that are target from 1, or have 1 as target.
With recursion, do the same with all nodes found on the first step.
When you find no more node, you should have all the graph you want, and should not have computed on a non linked node at all
 
hey guys
 
@jagdish 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.
 
okay
can someone tell me how to find height of text which is inside a <div> tag ?
 
4:06 PM
@jagdish that's gonna be tricky
@DrakaSAN I think I now get what you're saying
 
@Shmiddty nice win
 
@jagdish wrap a span around your text
 
<div>
 
no padding no margins no nothing
and measure the spans height
span needs to fit snuggly on your text
@DrakaSAN why do I need A* then?
 
<div>some text <br> some text <br> some text </div> suppose height of text is 20px then total height of text becomes 60px. how do i achieve using javascript ?
 
4:09 PM
measure the containers height?
 
@SterlingArcher danke
I'm playing a derpy deck right now
 
but my content is also dynamic
 
@NicholasKyriakides: Was refining the idea, and thought of A* before realizing we only need to traverse the graph, I m trying to implement it right now
 
@jagdish getBoundingClientRect?
 
I think we need to revive youtube poop
 
4:11 PM
your container is also dynamic
it stretches to fit your text if it's display:inline;
 
hrm, so I don't want to take up all my PWM pins and I want to get a few leds on different colours... my idea is that they all share a set of PWM and their grounds run to digital io and I just quickly swap them on and off .
doesn't seem to be working
 
Hia
 
@Loktar relevant to your situation? ^
 
4:15 PM
LOL yeah I saw that on FB
I need a pic of him in my wallet as well
 
@ndugger @KendallFrey fuck that's dank
 
but what if harambe is not kill?
 
'use strict';

//Dependencies
const candidate = 1,
data = [
{ source: 1, target: 2 }, // is connected with 1
{ source: 2, target: 3 }, // is connected with 1
{ source: 6, target: 9 }, // no connection
{ source: 12, target: 15 }, // no connection
{ source: 3, target: 2 }, // is connected with 1
{ source: 5, target: 3 }, // is connected with 1
];

let toTest = [candidate],
connected = [];

function addToTest(node) {
//If the node is not already set to be tested, and have not been tested
if(connected.indexOf(node) < 0 && toTest.indexOf(node) < 0) {
 
@SterlingArcher daaaaaank
 
@NicholasKyriakides can you have a look at here ? jsfiddle.net/mv9c0v2z
 
4:18 PM
i.imgur.com/3NSBbaW.mp4 OH MY GOD @KendallFrey
 
@NicholasKyriakides: Here it is, had the right result on your test array from earlier :)
 
@SterlingArcher amazing
 
I'm so glad the harambe jokes haven't stopped yet
 
i don't know why but javascript is not running on jsfiddle..:(
 
4:19 PM
you mean that your broken-ass code isn't working on jsfiddle
 
omg, js fiddle is on fire!
 
that's gonna get flagged
 
Yeah probably
 
@DrakaSAN Crapsticks
@DrakaSAN I think I wasn't very clear
I'd like to keep the pairs - the objects themselves as a whole
not just the nodes
 
js code is not running @ndugger
 
4:21 PM
But it looks on the right track
 
You just need to find the links containing thoses nodes, not a big deal
 
lol oh yeah
filter to the rescue
Can I test and get back to you???
That's brute force right??
 
console.log(data.filter((d) => {
return (connected.indexOf(d.source) >= 0 || connected.indexOf(d.target) >=0);
}));
Sure, but I leave in less than 10minutes
 
@DrakaSAN please format your code
!!format
 
Format your code - hit Ctrl+K before sending and see the faq
 
4:24 PM
@SterlingArcher: Did Ctrl+K, didn't worked out as expected
 
@KendallFrey. youtu.be/zh05k99kkms
Omg yes
 
It's super easy man
 
@DrakaSAN I think you NAILED IT
 
4 spaces = 1 tab. 1 initial tab on each line makes format
 
if ctrl-k doesn't work, then it thinks you are already indented. probably some of your lines were indented, some not, from the paste
 
4:26 PM
Yup, had tab character in it, must have been what threw ctrl+k
 
Irish make the best coffee
 
too late to edit again tho
 
@NicholasKyriakides jsfiddle.net/DukeBaird/aft0xzxv I think it works, but its not super efficient, and my lunch is over
 
@rlemon potato
 
@rlemon wtf?
 
4:27 PM
@NicholasKyriakides: You re welcome, was fun to code :)
 
@BenCraig That's BFS??
 
BFFs
 
@KendallFrey when he got to the atomic mass of gold I died.
 
@NicholasKyriakides BFS/DFS is irrelevant when you only have one child
 
4:28 PM
gotcha
so it's brute force in a sense
 
BFS = brute force search
the best kind
 
Breaddth first search is what I meant
 
I know
 
Ohkay
Thanks a lot
 
I dont have time to write something nicer, thats up to you
 
4:29 PM
Big Fuckin' Slip-n-slide
 
Up to this far everything is cool
Thanks a milli
 
@NicholasKyriakides: What I did is BreadFS
If that was what you needed
 
toTest.shift()
that's what indicated it to me
Other than that I wouldn't now
Guys thanks
I need to smoke & get some coffee - my evening just got fun with the solutions you gave me
 
4:32 PM
wooo
 
not knowing graphs makes Impostor syndrome real all over again
lol
time to read up
 
you have access to stimulants and depressants and some JS is the reason you have fun?
 
@SterlingArcher implying there's another kind of math?
 
no more stimulants for me
just caffeine
 
which is...
 
4:33 PM
a very weak stimulant
 
caffeine is a stimulant...
 
lol, it's not weak at all
 
compared to what??
 
caffeine is strong and highly addictive
 
4:34 PM
@KendallFrey I mean... wrong math?
 
do a gram of caffeine. I dare you. :)
 
again... compared to what
;p
i'll blow out my nose
 
also die.
 
@NicholasKyriakides: The code is simple, and does exactly what I indicated earlier as algorithm. Could have used .shift, but that would have been ugly to print out which node was tested
 
If I dont get my caffiene in the morning I get headaches all day
 
4:34 PM
compared to a lot; as @Luggage said, do the same amount of caffeine as you would take in a pill of aderall, and you'd lose your shit
 
definitely addictive
 
So I ran my arduino program with the ardunio serial monitor
no extra bytes
:(
 
@DrakaSAN gotcha
 
coca leave tea should be legal.
 
4:35 PM
nah to who?
 
to you
cocaine is addictive af
 
Why not?
So.
so is tobacco.
 
I think heroin should be legal
 
yeah true that
not for the heroin
i dunno
had some adventures with blow
 
the rules for what is legal and not have no correlation to addictiveness or danger.
 
4:36 PM
not so good
agree
that's justified as a Class A
except heroin
 
and, while I could accept some harder drugs staying illegal, i also think that being illegal has it's own dangers.
 
I think alcohol should be legal for kids age 5+
 
corn syrup should be illegal
 
corn should be illegal
 
porn should be illegal
 
4:38 PM
gasp
 
~ said no one ever
 
trolling people
 
gasping should be illegal
 
bye people
again
thanks @DrakaSAN and @BenCraig
happy blow and smoke day
 
yum
you're welcome
 
4:40 PM
These fancy British conferences sure are swell
 
val2=document.getElementById('txtsize').value;
val2 = val2+'px';
alert(val2);
document.getElementById('demo').style.fontSize='val2';
why is it not working ?
 
tried removing that still not worlking
 
Tom
you need t remove the 2 ' at 'val12'
 
@Tom 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.
 
4:44 PM
@jagdish because you put the variable in a string... jesus, dude
 
Tom
@jagdish ohh.. mhh.. ill have a look
 
Can we please use our brains? I don't have much patience for lack of thinking these days
 
/me sprays @ndugger with a hose.
down
 
v1=document.getElementById('txtsize').value;
v1 = v1+'px';
alert(val2);
document.getElementById('demo').style.fontSize=v1;
 
good god damn jesus piss
 
4:46 PM
the inconsistent spacing is making my eye twitch
 
everything in that is making my brain twitch
 
what ?
 
creating global variables, using alert to debug a non existent variable, the inconsistent white space, the weird concatenation
You need to go learn javascript basics
 
v1=document.getElementById('txtsize').value;
v2 = v1+'px';
document.getElementById('demo').style.fontSize=v2;
is that okay now ?
 
now stop creating global variables
 
4:47 PM
it is inside a function
 
so?
 
use var. Always.
 
why font size is not changing ??
 
ALWAYS
 
because your code is bad
 
4:48 PM
once you use vars, then you can decide if you should change them to let or const
 
@Luggage *never
 
I wasn't getting to es6, as that'll just confuse.
 
Agree
He's too new to understand the difference
 
holy shit. ndugger can agree with people?
 
i am learning dont demotivate
 
4:51 PM
don't talk back about how your code is inside of a function, then. I don't care where it is; stop creating global variables
 
Tom
woow.. i'm kinda new to javascript and did not know the global variable thing...
 
Now you do. Always use var (or let or const).
 
jsfiddle.net/mv9c0v2z here is what i am trying to do
 
There are exactly 0 legitimate uses for skipping it.
 
not that
 
4:53 PM
You also should never use alert for debugging code; the console exists for a reason
 
okay well removed it
 
You also should not put event listeners inline in your HTML
you're just begging for bugs
 
open your console and you'll see: Uncaught ReferenceError: f4 is not defined
 
Tom
luckily ive used var all the time..
 
@Tom then we shall let you live.
 
4:54 PM
i am not bagging for bugs
 
you'll be bagging if you don't get this right.
j/k :)
 
just want to change font size which is not channging
 
You are begging* for bugs if you put event listeners inline in your HTML
 
yea, open your console.
see the error
 
Don't talk back to me, whipper snapper
 
Tom
4:55 PM
@Luggage thank god! i was worried for a second
 
i am using dreamweaver and there is no error you are talking about
 
Jesus
 
in the fiddle. open you browser console
 
First of all, don't use dreamweaver. Second of all, we're talking about the console in your browser.
 
also document.getElementById('demo') returns null
 
4:57 PM
All of this is so wrong
 
oh god
 
Tom
@jagdish press f12 to open youre browser console
 
@ndugger i don't disagree with you but can you dial it down to 9?
 
@Tom that only applies to windows
@Luggage No, people need to learn. I learned while people said much worse things to me--not everyone needs to be babied. It's not personal.
 
okay i got your point
 
4:58 PM
9.5?
 
No
If he learns and knows not to do bad shit anymore, we all win
 
Tom
@ndugger Oohh... Okay.. Well.. there is quite a chance that he's using windows.. so.. :D
 

« first day (2174 days earlier)      last day (2769 days later) »