These are chat archives for FreeCodeCamp/HelpJavaScript

10th
Jan 2019
ReesesLover123
@ReesesLover123
Jan 10 06:11
var red = document.getElementById("input1").value;
var meow = Number('red');
I'm trying to get red to return as a number
Brad
@bradtaniguchi
Jan 10 06:12
@ReesesLover123 How is 'red' a number?
ReesesLover123
@ReesesLover123
Jan 10 06:13
Sorry, new function I learned of today.
Brad
@bradtaniguchi
Jan 10 06:14
Oh, do you want to see if the value inputed is a number? then pass the red variable, not a string
Number(red) not Number('ref')
ReesesLover123
@ReesesLover123
Jan 10 06:15
I'm using an input box and trying to turn the response into a "number".
When I was in testing earlier they were strings. 3 in one box with 3 in the other box returned 33, not 6.
WenxuanZ
@WenxuanZ
Jan 10 08:02
a
alexV
@alexpande
Jan 10 11:19
hello
Marianissimus
@Marianissimus
Jan 10 11:21
hi @alexpande
alexV
@alexpande
Jan 10 11:22
how to add d3.js sankey node click event
Rizwan Syed
@RizwanSyed357
Jan 10 12:35
Hi all, I thought I'd share this quite brilliant article on the Javascript execution stack and how it works under the hood. I've struggled to find a written resource that explains it clearly, and thought it may be of use to others: https://www.valentinog.com/blog/js-execution-context-call-stack/
Christopher McCormack
@cmccormack
Jan 10 15:19
@jk025523 thanks for sharing!
Jason Luboff
@JLuboff
Jan 10 16:08
Morning :wave:
Christopher McCormack
@cmccormack
Jan 10 16:10
@JLuboff heya morning
Jason Luboff
@JLuboff
Jan 10 16:11
How's it going?>
Christopher McCormack
@cmccormack
Jan 10 16:14
busy morning already, been on calls since 07:30
you?
Jason Luboff
@JLuboff
Jan 10 16:14
Fun stuff....did you end up getting that config for the CEO done?
Just got in...going to get to work...eventually :P
Christopher McCormack
@cmccormack
Jan 10 16:21
@JLuboff nope spent about 4 hours on a call last night with Cisco TAC with no results
something buggy in their buggy buggy code
this is why I like web dev, if something is buggy you can normally dig in and find out what. With vendor equipment, it's basically a black box and you're lucky if they want to even support you if it's a few years old
Jason Luboff
@JLuboff
Jan 10 16:23
4 hours? Damn man...that sucks
Christopher McCormack
@cmccormack
Jan 10 16:35
that's why we get paid the small bucks!
Jason Luboff
@JLuboff
Jan 10 16:39
Aint that the truth
Pagnito
@Pagnito
Jan 10 17:05
hey do u guys know if express or koa has http2 support?
Jason Luboff
@JLuboff
Jan 10 17:07
I just googled "Does expressjs support http2" and based on the results...I'd say yes
Christopher McCormack
@cmccormack
Jan 10 17:08
yeah looks like you can pass express to spdy for http2 support
Blauelf
@Blauelf
Jan 10 17:09
spdy protocol is not h/2. h/2 protocol is based on spdy. Or is "spdy" a library that speaks both?
Christopher McCormack
@cmccormack
Jan 10 17:10
I thought h/2 was based on spdy
I imagine spdy has evolved along with the standards
just guessing though :)
Blauelf
@Blauelf
Jan 10 17:11
That's was I said. spdy was very volatile, with Google adding and removing features all the time (using all Chrome users as lab rats). h/2 is a standard, and mostly based on spdy.
Christopher McCormack
@cmccormack
Jan 10 17:12
sorry I mean the spdy library, not spdy in general
Blauelf
@Blauelf
Jan 10 17:13
My favourite feature of h/2 is the cookie references :) Not sure about server push.
Pagnito
@Pagnito
Jan 10 17:14
thnx guys
Blauelf
@Blauelf
Jan 10 17:18
Hmm... reading the h/2 specs, header compression seems to work differently from what I thought. Last time I tested h/2, the browser would transparently hide the details from me, and present them as if it was a regular 1.1 request. Really wish to understand how this "don't send cookies with each request" is meant to work.
Blauelf
@Blauelf
Jan 10 17:50
If that node package does what it says, this looks like something one might want to add to about anything. Not sure you can profit much from the protocol switch. Node might have other limiting factors.
alpox
@alpox
Jan 10 17:56
Throughout the process, the core developers of SPDY have been involved in the development of HTTP/2, including both Mike Belshe and Roberto Peon. In February 2015, Google announced that following the recent final ratification of the HTTP/2 standard, support for SPDY would be deprecated, and that support for SPDY would be withdrawn.[7] Google removed SPDY support in Google Chrome 51. Mozilla removed it in Firefox 50.
Ideas of spdy have made it to h/2 but spdy was deprecated
Christopher McCormack
@cmccormack
Jan 10 17:57
I like the name spdy, I hope they keep it
h2 sounds like an awkward SUV
alpox
@alpox
Jan 10 17:58
@cmccormack They don't keep it :D
Christopher McCormack
@cmccormack
Jan 10 17:58
can keep it as a codename
or just a default name, like how everyone calls TLS SSL still
(I know there is a lot of nuance to what I just said please don't pick it apart)
Blauelf
@Blauelf
Jan 10 19:01
I was a bit surprised the spdy module supports spdy protocol, with compatible software being rare and declining.
Brad
@bradtaniguchi
Jan 10 19:09
Hows everyone doing this fine morning? :)
Jason Luboff
@JLuboff
Jan 10 19:09
Not too bad..yourself?
alpox
@alpox
Jan 10 19:10
Morning? ...
Jason Luboff
@JLuboff
Jan 10 19:11
Technically still is here :)
alpox
@alpox
Jan 10 19:14
Yeaa in your timezone :D
We have pretty much later evening
Brad
@bradtaniguchi
Jan 10 19:14
Its always morning somewhere haha
Brad
@bradtaniguchi
Jan 10 19:32
Just fixed a bug in good old angularjs... so ugly XD
Jason Luboff
@JLuboff
Jan 10 19:32
I thought you loved angular
Aditya
@ezioda004
Jan 10 19:34
Love, stockholm syndrome - same thing
Chris
@crokita
Jan 10 19:35
lmao
Brad
@bradtaniguchi
Jan 10 19:37
angularjs is the old version, I've been using Angular. Let's just say this is like 4 year old legacy code, written in a deprecated framework
So like all the stuff I complain about now applies even more so (no comments, bad naming, no types, no tests 1k+ files)
Jason Luboff
@JLuboff
Jan 10 19:39
Ah....fair enough
Aditya
@ezioda004
Jan 10 19:42
At work I see :any more often than I'd like to admit, might as well just not use type
Brad
@bradtaniguchi
Jan 10 20:08
The old code was written back when the ideas "we don't need types, they just slow us down!"
Christopher McCormack
@cmccormack
Jan 10 20:08
If we didn't have developers we would have far fewer bugs!
Kaz Baig
@kbaig
Jan 10 20:09
If we didn't have humans we'd have no [insert problem here]
Brad
@bradtaniguchi
Jan 10 20:09
Shhh don't tell the machines that :P
Jason Luboff
@JLuboff
Jan 10 20:44
I just discovered that Edge has a dark theme
Blauelf
@Blauelf
Jan 10 20:47
Soon Edge will be like Chrome. Google eventually won the browser war.
Jason Luboff
@JLuboff
Jan 10 20:47
True
Although...I really don't think Edge is a bad browser :shrug:
Blauelf
@Blauelf
Jan 10 20:48
Don't have a compatible operating system. I've read Windows 10 finally has more active computers than Windows 7
Whatever that means.
Jason Luboff
@JLuboff
Jan 10 20:49
As far as I'm aware...Windows 10 is the only OS that supports Edge?
Blauelf
@Blauelf
Jan 10 20:49
Think so.
But with Windows 8, total bullshit began, and hasn't been reverted. One UI for 24" PC with mouse and the 3" smartphone.
Jason Luboff
@JLuboff
Jan 10 20:52
Windows 8 was awful
Windows 10 is pretty good. Little issues here and there but for the most part in my experience, its pretty solid
Blauelf
@Blauelf
Jan 10 20:53
Bit better with 8.1 and 10, but now ordinary customers are beta testers, without a way to opt out.
Jason Luboff
@JLuboff
Jan 10 20:54
My experience is all business side (Windows 10 Pro). Currently supporting bit over 70 machines. But we also use Ivanti to handle our updates so no automatic updates
Blauelf
@Blauelf
Jan 10 21:03
We have something like that, too, but we as individuals have no control. Colleague ran a long database query over night, just to be greeted by a blank client next morning. Windows was so nice to restart the programme (just lost the database connection and therefore could not receive the result). No way to prevent that, as Windows requires a time window where it may restart computer.
Jason Luboff
@JLuboff
Jan 10 21:04
If you're using Windows 10 Pro.. and have a Domain Controller.. setup group policy to block that. We don't have that issue at all
Blauelf
@Blauelf
Jan 10 21:05
I think IT has more problems with computers not updating, so they won't change anything in that direction. I got a "new" computer, was two years behind on updates.
The computer just was not in the right group.
Their inventory system lists a totally different computer for my account, though :P
Jason Luboff
@JLuboff
Jan 10 21:07
How many employees does IT support?
Blauelf
@Blauelf
Jan 10 21:08
Not sure how many have PCs, maybe a few thousand.
Jason Luboff
@JLuboff
Jan 10 21:09
Ah.. I was going to say thats pretty bad but that is a decent number to support. We support around 250 employees and I'd say... 150? computers as not every employee has a computer
Blauelf
@Blauelf
Jan 10 21:11
Somewhat chaotic with so many exceptions (every PC is windows, unless you're in marketing, which is all mac, so we have no way to test the shop on Safari, but marketing will find all the errors we then can't reproduce)
Christopher McCormack
@cmccormack
Jan 10 21:12
@JLuboff you do computer stuff still right? I plan to blow out my windows install soon on some fresh new hardware - do you need much more than the cd key/product ID to get Win10 activated again?
Jason Luboff
@JLuboff
Jan 10 21:13
@Blauelf You can't get them to test stuff before going live?
@cmccormack OEM install or CD/Download install?
Christopher McCormack
@cmccormack
Jan 10 21:14
@JLuboff no OEM, this was an old key for Win7 then upgraded to 10
Blauelf
@Blauelf
Jan 10 21:14
They write the requirements (in a way they can't be implemented or are totally unclear). We have some chaotic process (read: no process) and provide some state, without real test systems. Some developers are never wrong, as is the boss.
Jason Luboff
@JLuboff
Jan 10 21:16
@cmccormack Oh... hmm.. that I'm not positive on. We haven't done any upgrades, just get the computers with Win 10 already on it. When you upgraded, did it provide a key?
@Blauelf You should implement some tests!
Christopher McCormack
@cmccormack
Jan 10 21:17
@JLuboff I pulled the key info I could using EKeyfinder
figured I'd find an installer for Win10 and put on a USB
Jason Luboff
@JLuboff
Jan 10 21:18
Are you pulling the HD from the current computer and putting it in the new one or just doing a fresh install?
Christopher McCormack
@cmccormack
Jan 10 21:19
fresh, going to one of those tiny fast m2 or whatever drives
Blauelf
@Blauelf
Jan 10 21:19
@JLuboff Doing what I can. No infrastructure, test system is not really comparable to production system (also has other jobs). Releases get renamed all the time (different release, same tag). Saying "scrum" and "gitflow" and doing "whatever is easy to implement" and "always force-push to master".
Jason Luboff
@JLuboff
Jan 10 21:20
@cmccormack oh nice. I'm not sure the key will work. I've had mixed results when using key finders. You could potentially clone the old HD to the SSD but.. obiviousily then you're not starting fresh
Blauelf
@Blauelf
Jan 10 21:20
Also, we are adding levels of indirection all the time. A single request might involve like 10 different systems.
Jason Luboff
@JLuboff
Jan 10 21:20
Sounds awful.. lol
Blauelf
@Blauelf
Jan 10 21:22
I had some hope when new boss came. We got bigger, not better. More layers of indirection, and new systems all C# in a Java-only environment.
Jason Luboff
@JLuboff
Jan 10 21:23
Sounds like time to find a new employer :P
Blauelf
@Blauelf
Jan 10 21:24
I'm an external consultant, but I guess my company will soon need to find a new project for me.
Jason Luboff
@JLuboff
Jan 10 21:25
Ah
Blauelf
@Blauelf
Jan 10 21:28
Though I'm surprised the system still hasn't collapsed. It's all politics, people knowing other people, people being kept for loyalty even in complete incompetence, ...
Christopher McCormack
@cmccormack
Jan 10 21:30
@JLuboff thanks man, I'll try to figure it out.
Blauelf
@Blauelf
Jan 10 21:32
Which SSD interfaces does Windows 10 support for a boot device?
Jason Luboff
@JLuboff
Jan 10 21:32
SATA and m.2/pci
Blauelf
@Blauelf
Jan 10 21:34
Wasn't m.2 explicitly not pci-e (just using its connector or something like that)?
Jason Luboff
@JLuboff
Jan 10 21:35
You might be right, I don't have too much knowledge of them except that all of our new laptops and desktops have them lol
Blauelf
@Blauelf
Jan 10 21:39
Doesn't mean it's worse. Just that I read something about different kinds of interfaces, but that was before Windows 10, and old Windows won't boot from some kinds of SSD, but maybe with certain BIOS, but then in reduced performance, and so on. And Apple does its own (requiring an adapter, and at some point a firmware patch to enable trim support in the driver), but that problem has been solved by soldering SSDs to the mainboard in more recent devices.
Christopher McCormack
@cmccormack
Jan 10 21:39
Gotta get two of these bad boys and run them in RAID
that's like 5 years old isn't it @Blauelf ?
Jason Luboff
@JLuboff
Jan 10 21:40
Gotta get three of those and run them in RAID 5 so you got speed and parity!
Christopher McCormack
@cmccormack
Jan 10 21:41
do mb have three ports??
Jason Luboff
@JLuboff
Jan 10 21:42
Dunno. But your basic motherboard probably doesn't support RAID without a RAID card..at which point find a PCI card to plug those bad boys into
Christopher McCormack
@cmccormack
Jan 10 21:42
wow some have 4!
hah who buys basic motherboards
Jason Luboff
@JLuboff
Jan 10 21:43
Losers?
Jerry Smith?
Brad
@bradtaniguchi
Jan 10 21:44
Man I feel outa my depth here XD
Christopher McCormack
@cmccormack
Jan 10 21:44
@bradtaniguchi I pretty much feel that way every time I want to do a hardware upgrade
Blauelf
@Blauelf
Jan 10 21:44
@cmccormack I am on a Windows 7 system bought just over 5 years ago. One of the last. Windows 8 never got much ground (I know a guy who bought a Windows 8 phone... He never got any updates, Windows 8 phones got abandoned)
Christopher McCormack
@cmccormack
Jan 10 21:44
I built this system with high end components in 2010, time for new stuff
Brad
@bradtaniguchi
Jan 10 21:46
I build a middle of the road system in 2010, already upgraded the memory, and ram.
Starting to fall behind in terms of CPU and graphics tho, but I don't use that computer much anymore haha
Christopher McCormack
@cmccormack
Jan 10 21:47
I really don't much either, maybe I'd be happier just replacing the whole thing with a docking station for my mac
Jason Luboff
@JLuboff
Jan 10 21:48
I built my desktop around 2011? Still runs like a champ but...slow by todays standards. Probably be decent with SSD
Christopher McCormack
@cmccormack
Jan 10 21:50
@JLuboff you don't have an SSD??
Jason Luboff
@JLuboff
Jan 10 21:50
Nah.. got a couple of drives in a RAID 0 config (it was getting backed up so didn't care that much)
Christopher McCormack
@cmccormack
Jan 10 21:50
but what about boot speed
Jason Luboff
@JLuboff
Jan 10 21:50
When I thought about getting an SSD... they were still pretty pricey
and at this point.. I don't even really use it
Christopher McCormack
@cmccormack
Jan 10 21:51
ah
Blauelf
@Blauelf
Jan 10 21:52
I never want to go back to spinning drives. It adds so much to the responsiveness of the system (though not necessarily to the "speed").
Brad
@bradtaniguchi
Jan 10 21:52
I use my SSD for 1 multiplayer game... and GTA
I was thinking a few months ago of creating a new system, and stripping down the old one. But I bought more laptop ram instead. Much more useful, I'm never home to use my desktop anyways haha
Christopher McCormack
@cmccormack
Jan 10 21:53
I just keep adding smaller cheap SSDs when I kind of need more space and I see them on sale
plenty of SATA ports on modern MB
Blauelf
@Blauelf
Jan 10 21:54
It's so confusing. Every time I read "GTA", I think of GTA. But most people never played the original game, and mean any other game of the franchise.
Christopher McCormack
@cmccormack
Jan 10 21:54
I sure as hell did, top down was the best GTA
Blauelf
@Blauelf
Jan 10 21:56
Bonus points for hitting the whole group of joggers, that's mostly what I remember. And stealing a tank.
Christopher McCormack
@cmccormack
Jan 10 21:56
haha I remember it was pretty tough going against the cops
Blauelf
@Blauelf
Jan 10 22:02
Wish notebooks had the capacity for supporting more drives. But those notebooks that do are more "portable workstations" or "portable gaming PCs". Reminds me of the notebooks of the early 90s, small b/w screen within the lid with sliders to adjust contrast and brightness, built-in trackball, ... (and next to no battery capacity)
I like the form factor of my T430s (but it slowly disintegrates, so I need a new one at some point this year, next year Windows 7 will go out of support).
Christopher McCormack
@cmccormack
Jan 10 22:05
I wouldn't mind trying that matebook x pro from Huawei but for now I'm still enjoying MacOS
Blauelf
@Blauelf
Jan 10 22:23
@cmccormack I guess that SSD you linked is not made for notebooks? At least their description of "heat dissipipation" confuses me. My notebook has no air flow next to the (m.2 SATA?) SSD/3g-modem port. My RAM, two bars behind the same lid as the WLAN card and that SSD slot, runs pretty hot. That card looks like it would not fit into the device at all. Is it like 2.5" drives, where the same small connector is used for different sizes in desktop and notebook?
Christopher McCormack
@cmccormack
Jan 10 22:25
@Blauelf the rest of the description leads me to believe it does something to maintain temp instead of requiring additional cooling, not sure
but I don't see why it couldn't be used in a notebook, I don't think the SSD use nearly as much power
Blauelf
@Blauelf
Jan 10 22:25
Sounds like throttling if it gets hot.
Christopher McCormack
@cmccormack
Jan 10 22:25
probably :)
Blauelf
@Blauelf
Jan 10 22:27
The area where I am supposed to add a card SSD in my current notebook (a slot that could also be used for a 3g modem) is pretty densely packed, and I would assume a card that long might collide with the WLAN card. But maybe they are supposed to go on top of each other. Won't do that with the current notebook soon to be abandoned, so maybe of little relevance.
1 TB in that format now costs less than my 250 GB (2.5" SATA) 5.5 years ago.
Brad
@bradtaniguchi
Jan 10 22:40
I think if I were to open up my laptop again, I'd be adding a new replacement battery. IDK about replacing my HD. To much good stuff on this one haha
Jason Luboff
@JLuboff
Jan 10 22:41
Thats why you clone it to the new one
Brad
@bradtaniguchi
Jan 10 22:42
I haven't touched cloning software enough to be confident it would work :(
Jason Luboff
@JLuboff
Jan 10 22:42
Macrium Reflect works great
I used to use Casper too but it only gives a 30 day trial while Macrium is free
Blauelf
@Blauelf
Jan 10 22:43
dd anyone? :D
Brad
@bradtaniguchi
Jan 10 22:47
I'm on linux tho.... so I'd have to use dd right?
and dd scares the crap outa me XD
Jason Luboff
@JLuboff
Jan 10 22:47
Oh didn't realize it was linux
There should still be some sort of cloning software though
Blauelf
@Blauelf
Jan 10 22:51
On linux, there's usually at least one per file system type. I used ntfsclone before.
Brad
@bradtaniguchi
Jan 10 22:54
@Blauelf So like what would the flow look like to clone my HD using that?
roughly haha
Blauelf
@Blauelf
Jan 10 22:57
Used a GParted live CD to resize the copied partition later. Speaking of boot CDs, what do I boot from on a device without a CD drive? IIRC, last Thinkpad to feature a DVD drive was the T460p. Has booting from USB sticks improved? (was a pain last time I tried, even if I got grub to load, on most of my systems Linux crashed when loading USB drivers, and was stuck on USB1.1 speed if those were switched off)
Brad
@bradtaniguchi
Jan 10 23:00
@Blauelf I use usbs on all the machines I've worked on lately
Blauelf
@Blauelf
Jan 10 23:00
USB1.1 is more than just retro. It's "FULL SPEED". Which is much slower than "HIGH SPEED", and several orders of magnitude slower than "SUPER SPEED". What next, "LUDICROUS SPEED"?
Brad
@bradtaniguchi
Jan 10 23:01
Man I just new usb speed, and the "blue usb" speed XD
Blauelf
@Blauelf
Jan 10 23:04
I didn't even mention LOW SPEED.
alpox
@alpox
Jan 10 23:10
@Blauelf I install all my linux through bootable usb sticks or external harddisks
Brad
@bradtaniguchi
Jan 10 23:11
I used to Use discs, but by the time I wanted to use them again they were outdated and I don't have a disc drive to get the latest version of distros most of the time.
Blauelf
@Blauelf
Jan 10 23:11
I had a little less problems with external harddisks, not sure whether that's the existing partition table (not all sticks have one), or a different USB device class.
alpox
@alpox
Jan 10 23:14
@Blauelf I never had a problem except when I chose as example MBR instead of GPT and my bios didn't want to understand it
I don't know if you found it to be unstable because of unstable tools? I always used https://rufus.ie/
Blauelf
@Blauelf
Jan 10 23:15
I've never tried GPT, I guess my current system might understand it.
alpox
@alpox
Jan 10 23:16
All last installations I did needed GPT
The stick just didn't boot at all with MBR
Hmm and once it happened that ISO didn't work and I needed DD instead :D
Blauelf
@Blauelf
Jan 10 23:25
I'm pretty sure the systems where I had problems with booting from USB did not have (U)EFI, and did not know what a GPT is. Not convinced UEFI makes things better, given how many times I had to flash it because of critical security issues. Also, with UEFI we have created a way to build the perfect rootkit, being able to hide from the operating system completely.