These are chat archives for FreeCodeCamp/Help

8th
Nov 2018
Supra01
@Supra01
Nov 08 2018 02:01
@ezioda004 Is something wrong with sorted[1]?
Aditya
@ezioda004
Nov 08 2018 02:48
@Nirajn2311 No, the gulp error persists. I look up and gulp.series is used in gulp 4 but its still in alpha, I've tried installing that but for some reason npm doesnt want to use this module.
@Supra01 No, thats fine - I suggested that you should check from largest to smallest. Like for [1, 13] get 13 multiples, check if the multiple is divisible by 12 then 11 and so on. If it isnt divisible by any in b/w numbers then break the loop, get the next 13's multiple and repeat the process.
Supra01
@Supra01
Nov 08 2018 03:33
@ezioda004 I'll give that a shot
Claudio Restifo
@Marmiz
Nov 08 2018 05:13
how cool are template literals, and how cool that you can make you own template engine with just vanillaJS
Luc Martin
@fmartin5
Nov 08 2018 05:19
But we still need to learn JSX :/
Claudio Restifo
@Marmiz
Nov 08 2018 05:30
no, why
Claudio Restifo
@Marmiz
Nov 08 2018 05:37
I mean:
const arr = ['Iron Man', 'Thor', 'Hulk'];
function render(avenger) {
 return `<p>${avenger}</p>`
}

// on whatever - like document ready
let avengersP = arr.map(el => render(el)).join('');

document.getElementById('app').innerHTML = avengersP;
now your #app content has 3 <p> with the name of the avengers in them
Claudio Restifo
@Marmiz
Nov 08 2018 05:42

And since you can use expressions in them, you can use things like if - else

function render(avenger) {
 return `<p class="${avenger !== 'Hulk' ? 'red' : 'green'}">${avenger}</p>`
}

Pretty much like you would do in JSX. But this is just plain old vanilla

garanation
@garanation
Nov 08 2018 05:56
Hello guys
Why is this program writing only (this is number 10)?
For(I=0; I<10,I++){console.log("this is number" + I );
Manish Giri
@Manish-Giri
Nov 08 2018 06:04
use ;
garanation
@garanation
Nov 08 2018 06:05
Yeah after the 10; the shit is not still looping
abraham anak agung
@padunk
Nov 08 2018 06:05
@garanation you have wrong syntax var i = 0; i < 10; i++
garanation
@garanation
Nov 08 2018 06:06
Yes I use lowerletter I
abraham anak agung
@padunk
Nov 08 2018 06:06
use keyword var or you will make a global variable
Claudio Restifo
@Marmiz
Nov 08 2018 06:06
closing } ?
garanation
@garanation
Nov 08 2018 06:07
I close the {}
Manish Giri
@Manish-Giri
Nov 08 2018 06:07
its working in the bin link
abraham anak agung
@padunk
Nov 08 2018 06:07
@garanation show ur new code
Manish Giri
@Manish-Giri
Nov 08 2018 06:08
f in for and ; instead of , and close the }
Claudio Restifo
@Marmiz
Nov 08 2018 06:08
@garanation oh the comma in console.log
console.log("some string", someVar)
no comma, syntax error
garanation
@garanation
Nov 08 2018 06:09
Var i =0;
abraham anak agung
@padunk
Nov 08 2018 06:10
it will concat it no?
garanation
@garanation
Nov 08 2018 06:10
The new code now is
Claudio Restifo
@Marmiz
Nov 08 2018 06:10
@padunk yeah, I missed the +
garanation
@garanation
Nov 08 2018 06:11
For(i=0;i<10;i++){console.log("the number is", + i)}
It's still not iterating
Manish Giri
@Manish-Giri
Nov 08 2018 06:12
is that in a setTimeout()?
Claudio Restifo
@Marmiz
Nov 08 2018 06:12
@garanation For or for
abraham anak agung
@padunk
Nov 08 2018 06:12
lowercase for
garanation
@garanation
Nov 08 2018 06:12
for
Can you run it and show me the results
This is very weird for me
abraham anak agung
@padunk
Nov 08 2018 06:13
anyone use graphQL?
abraham anak agung
@padunk
Nov 08 2018 06:13
where u put ur code? restart the browser maybe?
garanation
@garanation
Nov 08 2018 06:15
I think the browser fucking with my head
Manish Giri
@Manish-Giri
Nov 08 2018 06:15
I've always considered learning graph ql
but i haven't found a good reason to
garanation
@garanation
Nov 08 2018 06:16
thanks @Marmiz
abraham anak agung
@padunk
Nov 08 2018 06:17
@Manish-Giri why not? i considered learning it too.
is it another query language?
Manish Giri
@Manish-Giri
Nov 08 2018 06:19
@padunk because it is an additional level of complexity that I felt wasn't currently necessary..the course I was studying had extremely complicated setup just to get to step 1..
abraham anak agung
@padunk
Nov 08 2018 06:21
i see. what course r u studying right now? @Manish-Giri
Manish Giri
@Manish-Giri
Nov 08 2018 06:22
there's this docker course on udemy
that one
kinopotato
@kinopotato
Nov 08 2018 06:25
hello, can someone please help me with math? hehe
my code is running right, and I'm following the formula (I think) but I'm not getting the number that it wants.
function orbitalPeriod(arr) {
  var GM = 398600.4418;
  var earthRadius = 6367.4447;
  //copy arr into a new array called mainArr
  let mainArr = arr.concat();
  //access each object section to get value of avgAlt and then calculate for T
  for (let x of mainArr){
    //access avgAlt and cube it
    //add that to earth radius
    //divide answer to GM
    //square root the answer
    console.log(Math.pow(x["avgAlt"], 3) + " cube avgAlt");
    console.log(Math.pow(x["avgAlt"], 3) + earthRadius + " add cubed to earthRadius");
    console.log((Math.pow(x["avgAlt"], 3) + earthRadius) / GM + " divide the answer to GM");
    console.log((Math.sqrt((Math.pow(x["avgAlt"], 3) + earthRadius) / GM)) + " get square root");
    console.log((2*3.14)*(Math.sqrt((Math.pow(x["avgAlt"], 3) + earthRadius) / GM)) + " multiply 2 and pi then multiply that to square root answer");
x.orbitalPeriod = (2 * 3.14) * (Math.sqrt((Math.pow(x["avgAlt"], 3) + earthRadius) / GM));
  }
  return mainArr; //orbitalPeriod must be 86400 but returns 67585
}
orbitalPeriod([{name : "sputnik", avgAlt : 35873.5553}]);
kinopotato
@kinopotato
Nov 08 2018 06:32
I've calculated each, and the values are the same, :| how am I understanding the formula wrong?
oh shit I just saw
I was cubing the wrong shit
Aditya
@ezioda004
Nov 08 2018 06:36
Yeah, add the radius before cubing. Also, you could use Math.PI for more accurate results, though you'd still have to round the result.
kinopotato
@kinopotato
Nov 08 2018 06:37
so I'm returning a nearer number, but the exercise says it wants me to round
I'm guessing I'm supposed to round everything and not just the final answer
@ezioda004 wow, Math.PI made a huge difference
Karma Drukpa
@coderkarma
Nov 08 2018 06:39
Math.round for rounding.
kinopotato
@kinopotato
Nov 08 2018 06:40
@coderkarma thanks dude! I'm trying to figure out where to put that
wooo, I did it! now I should either do es6 section or move on to the projects :|
abraham anak agung
@padunk
Nov 08 2018 06:45
@Manish-Giri ah docker, still far away from my learning list, read the docs but can't really get it. :+1:
garanation
@garanation
Nov 08 2018 07:14
@kinopotato how do you get exercises for practice or challenges
Claudio Restifo
@Marmiz
Nov 08 2018 07:46
@garanation there are a lot of websites that offers coding challenges.
One of the most popular (or at least the one that I see popping out the most here) is codewars
Niraj Nandish
@Nirajn2311
Nov 08 2018 07:50
@diomed Any more challenges
garanation
@garanation
Nov 08 2018 07:52
Okay codewar
Niraj Nandish
@Nirajn2311
Nov 08 2018 07:54
@ezioda004 I think someone had mentioned about the gulp issue, could be me, in the contributors room
Aditya
@ezioda004
Nov 08 2018 07:55
@Nirajn2311 Is there a fix for it?
Niraj Nandish
@Nirajn2311
Nov 08 2018 07:56
I dont remember at the moment, but ill tell if i do remember
Aditya
@ezioda004
Nov 08 2018 08:01
:thumbsup:
BuntyBru
@BuntyBru
Nov 08 2018 08:54
<tr _ngcontent-c1="">
                                    <td _ngcontent-c1=""> RDB</td>
                                    <td _ngcontent-c1="">id</td>
                                    <td _ngcontent-c1="">16</td>
                                    <td _ngcontent-c1="">0 </td>
                                    <td _ngcontent-c1=""><input _ngcontent-c1="" id="checkBoxPrimary" type="checkbox" value=""></td>
                                  </tr>
this i the row and i want that as soon as i click on the checkbox the row gets hidden
the display
how do i achieve that through jQuery
May Kittens Devour Your Soul
@diomed
Nov 08 2018 09:02
@Nirajn2311 integrate my json into vue table :P

Time to die, Pusheen❣️

Niraj Nandish
@Nirajn2311
Nov 08 2018 09:03
How long does it take for you to learn json
May Kittens Devour Your Soul
@diomed
Nov 08 2018 09:03
3 million seconds, it seems
Niraj Nandish
@Nirajn2311
Nov 08 2018 09:04
Ok, give me the link
BuntyBru
@BuntyBru
Nov 08 2018 09:07
<tr _ngcontent-c1="">
                                    <td _ngcontent-c1=""> RDB</td>
                                    <td _ngcontent-c1="">id</td>
                                    <td _ngcontent-c1="">16</td>
                                    <td _ngcontent-c1="">0 </td>
                                    <td _ngcontent-c1=""><input _ngcontent-c1="" id="checkBoxPrimary" type="checkbox" value=""></td>
                                  </tr>
using parent() can make tr hidden
May Kittens Devour Your Soul
@diomed
Nov 08 2018 09:08
@Nirajn2311 do u still have vue table installed
link is not public, I'll send you pm
=^● ⋏ ● ^=
Niraj Nandish
@Nirajn2311
Nov 08 2018 09:11
You mean your vue-table
May Kittens Devour Your Soul
@diomed
Nov 08 2018 09:13
only data belongs to me. table is one of choice, not made by me
Niraj Nandish
@Nirajn2311
Nov 08 2018 09:14

@Nirajn2311 do u still have vue table installed

No i deleted my fork

May Kittens Devour Your Soul
@diomed
Nov 08 2018 09:14
._.
Aditya
@ezioda004
Nov 08 2018 09:15
.-.
Niraj Nandish
@Nirajn2311
Nov 08 2018 09:15
|:
May Kittens Devour Your Soul
@diomed
Nov 08 2018 09:16
˙-˙
you can always fork mine, I guess
Niraj Nandish
@Nirajn2311
Nov 08 2018 09:17
:wink:
May Kittens Devour Your Soul
@diomed
Nov 08 2018 09:18
Milk in Movies: Why Do Characters Drink It?
@ezioda004 did you get some sleep
did you fall asleep installing FCC on your localhost?
Niraj Nandish
@Nirajn2311
Nov 08 2018 09:19
:fireworks: :fireworks: HAPPY DIWALI EVERYONE :fireworks: :fireworks:
Aditya
@ezioda004
Nov 08 2018 09:19
:sparkles:
Niraj Nandish
@Nirajn2311
Nov 08 2018 09:20
@ezioda004 the error you were getting was due to gulp, right??
Aditya
@ezioda004
Nov 08 2018 09:20
@diomed Still not installed, its broken
May Kittens Devour Your Soul
@diomed
Nov 08 2018 09:20
Happy holiday of light, to you, guys :)
Aditya
@ezioda004
Nov 08 2018 09:20
@Nirajn2311 Yes
Niraj Nandish
@Nirajn2311
Nov 08 2018 09:21
Are you doing it in cmd or powershell
As i did it in git bash and it worked for me
Aditya
@ezioda004
Nov 08 2018 09:22
I was doing in WSL, dont think its because of that, the gulp package is the problem
Did you additionally installed gulp@next?
Niraj Nandish
@Nirajn2311
Nov 08 2018 09:23
No
BuntyBru
@BuntyBru
Nov 08 2018 09:39

Guys i have a table with a lot of table rows
And each table row has a grandchild checkbox

Now as soon as i click on a checkbox, i want that grandparent gets into an array and later on when i click on a button all those elements in the Array gets hidden

the display is hidden
Can anyone help me with that ?
Praveen Saraogi
@saraogipraveen
Nov 08 2018 10:41
@BuntyBru can you explain it more
Praveen Saraogi
@saraogipraveen
Nov 08 2018 11:49
const realNumberArray = [4, 5.6, -9.8, 3.14, 42, 6, 8.34, -2];
const squareList = (arr) => {
  "use strict";
  // change code below this line
  const squaredIntegers = arr.filter((a)=> {

    if(a>0){

      if(a.toString().split(".").length == 1){

        return parseInt(a)*parseInt(a);
      }
    }

  });


  // change code above this line

  return squaredIntegers;
};
// test your code
const squaredIntegers = squareList(realNumberArray);
console.log(squaredIntegers);
i don't understand whats going wrong here.. everything is correct still it is not returning the square of the element, it is returning the element itself
output coming is : [4,42,6]
Aditya
@ezioda004
Nov 08 2018 11:54
@raviloop Seems like you meant to use .map() instead of .filter().
kinopotato
@kinopotato
Nov 08 2018 12:12
Just want to share this youtube vid, this may not be the best but it helped me a ton. Title is "how to think like a programmer" I think this will help people like me without formal coding education and is just beginning
https://www.youtube.com/watch?v=azcrPFhaY9k
May Kittens Devour Your Soul
@diomed
Nov 08 2018 13:13
🏮 :honey_pot: 🏮
Luc Martin
@fmartin5
Nov 08 2018 13:47
@BuntyBru Why as soon as you click on a checkbox? It would be easier to hide the checked rows all at once when you click on the button
Praveen Saraogi
@saraogipraveen
Nov 08 2018 13:47
@ezioda004 but that challenge wants me to use filter not map
Aditya
@ezioda004
Nov 08 2018 13:48
@raviloop Which challenge is it?
Praveen Saraogi
@saraogipraveen
Nov 08 2018 13:52
@ezioda004 ok got it .. filter will not change the value, it will just return the filtered array thats what it meant to do , and map will work like for each .. thanks .. i solved it now.. i just need to map the filtered array to find sqares
 let squaredIntegers = arr.filter((a)=> a>0 && a.toString().split(".").length == 1 ? parseInt(a)*parseInt(a) : null) 

    squaredIntegers =squaredIntegers.map((s)=>s*s)
this helped to me to understand the clear diff between .map() and .filter()
BuntyBru
@BuntyBru
Nov 08 2018 14:03
@fmartin5
Sorry forgot to close the issue
Actually i was able to solve it
@raviloop
Sorry , forgot to say i closed the issue
Aditya
@ezioda004
Nov 08 2018 14:05
@raviloop Nice, though you could improve the .filter() method, theres Number.isInteger()that can help you check for integers or you could also check with num % 1 === 0, if theres any decimal then it wont be equal to 0.
CoderOO7
@CoderOO7
Nov 08 2018 14:31
@ezioda004
@ezioda004 you can directly check for any pa
Aditya
@ezioda004
Nov 08 2018 14:34
@CoderOO7 pa?
CoderOO7
@CoderOO7
Nov 08 2018 14:39
@ezioda004 I'm saying that you can directly check type by using "typeof " operator
Aditya
@ezioda004
Nov 08 2018 14:41
@CoderOO7 There is no "int" type in JS, only "numbers".
CoderOO7
@CoderOO7
Nov 08 2018 14:42
@ezioda004 yes you are right...
Victor Popescu
@VicPopescu
Nov 08 2018 14:44
Nicolas Ramirez
@kamatheuska
Nov 08 2018 14:58
Hello SOS! I need help, i think I just rm my whole projects folder
SOMEONE??
Tom
@moT01
Nov 08 2018 14:59
uh oh
no backup?
Nicolas Ramirez
@kamatheuska
Nov 08 2018 15:04
yes!
just lost the work of last 5 days or so
but I have done a lot in those days
I am gonna die....sht
Luc Martin
@fmartin5
Nov 08 2018 15:11
:/
That's why I never use rm too scary
I take the time to manually delete my files in the GUI
Supra01
@Supra01
Nov 08 2018 15:13
I'm working on the smallest common multiple and my code works on node but it's still not passing the last test on the freeCodeCamp website. Any help would be appreciated.

function smallestCommons(arr) {
  //Sort argument from greatest to least
  const sorted = arr.sort((a, b) => a - b);
  //Create the range of numbers from argument
  let range = []
  for (let i = sorted[1]; i >= sorted[0]; i--) {
    range.push(i);
  }

  function hasNoRemainder(num) {
    for (let j = 0; j < range.length; j++) {
      if (num % range[j] !== 0) {
        return false;
      }
    }
    return true;
  }

  for (let k = 1; k++;) {
    let multiple = k * sorted[1];
    if (hasNoRemainder(multiple) === true) {
      return multiple;
    }
  }
}

console.log(smallestCommons([1,13]));
Tom
@moT01
Nov 08 2018 15:15
@Supra01 there's a time limit in the tests
if the first couple are passing, but not some of the last ones - then the code is going too slow
Supra01
@Supra01
Nov 08 2018 15:16
@moT01 Thanks for letting me know!
@moT01 is there a part of my code that I could speed up?
Tom
@moT01
Nov 08 2018 15:17
A lot of people have had that problem - there should be a note added to let the users know - or make the time limit biggger
I'm not sure - is there anything you can remove? do you need that sort at the beginning?
do you need to push that stuff to range?
can't you maybe just count from one number to the other.... like for(i=arr[0]; i<arr[1]; i++) - or something like that
you can check the tests to see the input from each test - I think it's always the smaller number first, then the bigger number in the argument
Luc Martin
@fmartin5
Nov 08 2018 15:23
The problem is more likely in the algo
Maybe they want you to research some smart algo
I remember having trouble to pass this challenge as well, and unfortunately I think my code is lost :(
Tom
@moT01
Nov 08 2018 15:24
really sucks that it doesn't save that
Aditya
@ezioda004
Nov 08 2018 15:25
@Supra01 Did a small change, from j = 0 to j = 1 and it passes:
for (let j = 1; j < range.length; j++) {
      if (num % range[j] !== 0) {
        return false;
      }
    }
Luc Martin
@fmartin5
Nov 08 2018 15:25
Yea it used to but now no more
Aditya
@ezioda004
Nov 08 2018 15:26
All challenges have a limit of 100ms. Project euler problems in particular are pain to solve within that limit.
Ariel
@ArielLeslie
Nov 08 2018 15:26
That's sort of the point of Project Euler though. It's a project to encourage elegant solutions.
Luc Martin
@fmartin5
Nov 08 2018 15:27
Yeah brute force almost never works :'(
Tom
@moT01
Nov 08 2018 15:27
100ms seems short for some of those, even for the fastest code
May Kittens Devour Your Soul
@diomed
Nov 08 2018 15:28
I've read somewhere that Euler was greatest mathematician of all time
if not all time, but modern age surely
Supra01
@Supra01
Nov 08 2018 15:28
image.png
@ezioda004
Ariel
@ArielLeslie
Nov 08 2018 15:28
That's subjective, but he's certainly been extremely influential in modern computational problem solving.
Plus, Euler's Identity is just sexy as hell
Luc Martin
@fmartin5
Nov 08 2018 15:29
Ramanujan is great too
Supra01
@Supra01
Nov 08 2018 15:29
@ezioda004 I've tried this algorithm before and when other people tested my code it past
Ariel
@ArielLeslie
Nov 08 2018 15:29

@Supra01

  function hasNoRemainder(num) {
    for (let j = 0; j < range.length; j++) {
      if (num % range[j] !== 0) {
        return false;
      }
    }
    return true;
  }

Ask yourself, do you really need to check all these values, starting at 0, every time?

May Kittens Devour Your Soul
@diomed
Nov 08 2018 15:30
@fmartin5 oh pls, Ramanjuan was just god's prophet
Aditya
@ezioda004
Nov 08 2018 15:30
I'd agree but challenges such as this have test inputs in million. I've yet to see an algorithm which passes this one.
May Kittens Devour Your Soul
@diomed
Nov 08 2018 15:32
he was like : ok, this is how it is
and then people around him sent Shia LaBeouf to scream at him:

PROVE IT, JUST PROVE IT - YOU HAVE TO PROVE IT

Aditya
@ezioda004
Nov 08 2018 15:32

I think that loop is fine - his range is in descending order:

  for (let i = sorted[1]; i >= sorted[0]; i--) {
    range.push(i);
  }

Though range[0] is sorted[1] so that can be skipped.

Supra01
@Supra01
Nov 08 2018 15:33
image.png
May Kittens Devour Your Soul
@diomed
Nov 08 2018 15:33
or so I've heard, @fmartin5 :yum:
Luc Martin
@fmartin5
Nov 08 2018 15:33
:D
Supra01
@Supra01
Nov 08 2018 15:34
@ArielLeslie Still not passing but thank you for the tip.
Aditya
@ezioda004
Nov 08 2018 15:34
@Supra01 I dont have an explanation for why it doesnt passes for you, but it passes for me.
Ariel
@ArielLeslie
Nov 08 2018 15:35
@ezioda004 If you go to Project Euler, after you've submitted an answer (your algorithm isn't timed) you get access to discussions of the problem and you can see how others have solved it more efficiently
Supra01
@Supra01
Nov 08 2018 15:37
@ezioda004 This is happened to me twice. I had friend run my code and it worked for them too
@ezioda004 Thanks for taking so much time to help me out
Aditya
@ezioda004
Nov 08 2018 15:43

@Supra01 Can you try this algo and see if it passes the tests?

const lcm = (a, b) => a*b / gcd(a, b);
const gcd = (a, b) => b === 0 ? a : gcd(b, a%b);
function smallestCommons(arr) {
  const max = Math.max(...arr);
  const min = Math.min(...arr);
  let num = min;
  for (let i = min+1; i <= max; i++){
      num = lcm(i, num);
  }
  return num;
}

@ArielLeslie Ah, didnt know you can access discussions there. Thanks for that. Although I do check others solutions for euler problems but so far IMO the time limit in fcc should be increased.

Ariel
@ArielLeslie
Nov 08 2018 15:44
The time limit is based on infinite loop protection. It's not FCC's way of forcing you to write optimal algorithms so much as it is saving you from crashing your browser.
Aditya
@ezioda004
Nov 08 2018 15:45
Yes, I know that, but when the solution provided by challenge author doesnt passes the tests, you know something is wrong :smile:
Supra01
@Supra01
Nov 08 2018 15:59
@ezioda004 That worked
@ezioda004 @ArielLeslie my friend tried my code and got this
image.png
Ariel
@ArielLeslie
Nov 08 2018 16:04
Looks like it ran just a tiny bit faster in their browser.
Supra01
@Supra01
Nov 08 2018 16:04
I see
I'll just lay down for a while
and think of how I should refactor
Aditya
@ezioda004
Nov 08 2018 16:07
@Supra01 Look into euclidean algorithm, its efficient.
Supra01
@Supra01
Nov 08 2018 16:08
@ezioda004 will do
Christopher McCormack
@cmccormack
Nov 08 2018 16:34
@willybeans if you don't want a component to mount until a side effect completes, run the side effect in the parent then render the component when complete
Beans
@willybeans
Nov 08 2018 16:35
The thing it is waiting for is the redux action, not the app itself. How exactly would you make a component wait to be rendered?
Sorry i deleted the post, i was going to add something to it in hopes that no one saw it yet... :-D
Luc Martin
@fmartin5
Nov 08 2018 16:40
Ugh I called d3.domain and d3.range with two args instead of with an array of length 2 - there were no errors in the console to help me
Christopher McCormack
@cmccormack
Nov 08 2018 16:44
@fmartin5 it's good to add tests right below when building it to make sure it's working, that can be a pain point
Luc Martin
@fmartin5
Nov 08 2018 17:09
@cmccormack true
I'm going to sprinkle log statements everywhere :(
Eric Weiss
@eweiss17
Nov 08 2018 17:19
ah yes the poor man's debug
Christopher McCormack
@cmccormack
Nov 08 2018 17:20
yeah!
Luc Martin
@fmartin5
Nov 08 2018 17:21
:laughing:
May Kittens Devour Your Soul
@diomed
Nov 08 2018 17:37
_ _ _
_ _ S _ _ _ Y
_ F
_ _ _ S
category :: book title
@eweiss17 @cmccormack @ezioda004 are you ready?
@fmartin5
Luc Martin
@fmartin5
Nov 08 2018 17:42
Who plays first :)
May I propose a solution?

The heights of the bars should correspond to the data values : expected '90.324' to equal '90.323'

Ugh...

May Kittens Devour Your Soul
@diomed
Nov 08 2018 17:45
@fmartin5 u
Luc Martin
@fmartin5
Nov 08 2018 17:46
Then I guess I can buy best vowel E
May Kittens Devour Your Soul
@diomed
Nov 08 2018 17:46
sure. propose a solution if you know :yum:
Luc Martin
@fmartin5
Nov 08 2018 17:46
The Mystery of Ages
I cheated just to find the last word :p
May Kittens Devour Your Soul
@diomed
Nov 08 2018 17:47
_ _ E
_ _ S _ _ _ Y
_ F
_ E E S
Luc Martin
@fmartin5
Nov 08 2018 17:47
:'(
May Kittens Devour Your Soul
@diomed
Nov 08 2018 17:47
:smirk_cat:
Eric Weiss
@eweiss17
Nov 08 2018 17:47
one B please
May Kittens Devour Your Soul
@diomed
Nov 08 2018 17:48
B coming right up :exclamation:
_ _ E
_ _ S _ _ _ Y
_ F
B E E S
Ghost
@ghost~5928d90bd73408ce4f629b9e
Nov 08 2018 17:49

Why this doesn't work with FormData?

     const formData = new FormData({
      uid: user.id,
      time,
      product: id,
      name: productNmae.value,
      public: isPublic,
     });

i get 500 error when doing this
but when i use the ugly append it works.

ajthemaniac
@ajthemaniac
Nov 08 2018 17:49
Hey I am using react-table library , but getting the error : "ReactTable .map is not a function in ReactJs" . when i try to add object to my existing data array of objects
May Kittens Devour Your Soul
@diomed
Nov 08 2018 17:50
Eric Weiss
@eweiss17
Nov 08 2018 17:51
@2HexGFX_twitter name: productNmae.value? a mispelling perhaps?
ajthemaniac
@ajthemaniac
Nov 08 2018 17:51
@diomed Will do
Eric Weiss
@eweiss17
Nov 08 2018 17:51
i mis when this board was filled with people who didn't know basic html... now it's all advanced js libraries
Ghost
@ghost~5928d90bd73408ce4f629b9e
Nov 08 2018 17:52
Yeah i misspelled it when i type here
May Kittens Devour Your Soul
@diomed
Nov 08 2018 17:52
@eweiss17 :bee: :bee:
I miss it too. at least then I was useful
Eric Weiss
@eweiss17
Nov 08 2018 17:53
@2HexGFX_twitter do you think it's a syntax error?
May Kittens Devour Your Soul
@diomed
Nov 08 2018 17:53
is it normal to have user id, time, ?!?
prolly is , since no1 is saying anything
diomed @diomed shrugs
Eric Weiss
@eweiss17
Nov 08 2018 17:54
time may be date created or something like that
if you wanted to sort by most recent it would be useful
May Kittens Devour Your Soul
@diomed
Nov 08 2018 17:55
yeah, but he has that under uid:
Ghost
@ghost~5928d90bd73408ce4f629b9e
Nov 08 2018 17:55
No idea the FormData accepts key-value pair with .append so why not directly inside the empty object.
time is just shorthand i want the key to be time too
Eric Weiss
@eweiss17
Nov 08 2018 17:55
indeed!
Ghost
@ghost~5928d90bd73408ce4f629b9e
Nov 08 2018 17:55
shortcut to time: time
Eric Weiss
@eweiss17
Nov 08 2018 17:55
the error is the creation of this?
or are you trying to fill it and then get the error
Ghost
@ghost~5928d90bd73408ce4f629b9e
Nov 08 2018 17:56
No.. i dont know which causing the error..
Eric Weiss
@eweiss17
Nov 08 2018 17:57
public: isPublic, . that does not have trailing comma in your code right?
Ghost
@ghost~5928d90bd73408ce4f629b9e
Nov 08 2018 17:57
No it'll say if it was that
eslint is making me do that trailing comma thing
Eric Weiss
@eweiss17
Nov 08 2018 17:59
this is react right
Ghost
@ghost~5928d90bd73408ce4f629b9e
Nov 08 2018 17:59
yes
Eric Weiss
@eweiss17
Nov 08 2018 17:59
@diomed M
Ghost
@ghost~5928d90bd73408ce4f629b9e
Nov 08 2018 18:00
im not sure if i can actually do what im doing.. but seems right to do it..
May Kittens Devour Your Soul
@diomed
Nov 08 2018 18:01
@eweiss17 there is no M ! To the gallows with you!
Eric Weiss
@eweiss17
Nov 08 2018 18:03
@2HexGFX_twitter are you confident that is causing the error? if you remove it is it resolved?
T ?
Luc Martin
@fmartin5
Nov 08 2018 18:12
H
May Kittens Devour Your Soul
@diomed
Nov 08 2018 18:13
T H E
H _ S T _ _ Y
_ F
B E E S
Luc Martin
@fmartin5
Nov 08 2018 18:14
the history of bees
Eric Miller
@ericmiller777
Nov 08 2018 18:16
let quoteSample = "Beware of bugs in the above code; I have only proved it correct, not tried it.";
let vowelRegex = /[aeiou]/; // Change this line
let result = quoteSample.match(vowelRegex); // Change this line
lol
i think i see it
May Kittens Devour Your Soul
@diomed
Nov 08 2018 18:16
well done @fmartin5 :ballot_box_with_check: :congratulations:
:bee:
Eric Miller
@ericmiller777
Nov 08 2018 18:16
eh
Luc Martin
@fmartin5
Nov 08 2018 18:17
:smiley:
Eric Miller
@ericmiller777
Nov 08 2018 18:17
still doesnt work
May Kittens Devour Your Soul
@diomed
Nov 08 2018 18:17
@fmartin5 u sure it isn't histery, tho? :yum:
Eric Miller
@ericmiller777
Nov 08 2018 18:17
could someone look at that
Luc Martin
@fmartin5
Nov 08 2018 18:17
@diomed No I'm not :laughing:
Anand Potukuchi
@anandpotukchi
Nov 08 2018 18:20
@ericmiller777 what exactly are you trying to achieve
You are not matching uppercase. And a lot of other things. Would like to help but it's already 12AM
Eric Miller
@ericmiller777
Nov 08 2018 19:17
idk why its working now
@anandpotukchi ty
Henry
@GitHub-Henry
Nov 08 2018 19:22
this is a good tool to help figure out regular expressions https://regexr.com/
Eric Weiss
@eweiss17
Nov 08 2018 19:24
'idk why its working now'
great quote for all devs
Henry
@GitHub-Henry
Nov 08 2018 19:26
https://regexr.com/ breaks down all the component parts of a regex and explains each part
Eric Miller
@ericmiller777
Nov 08 2018 19:27
ty guys
Eric Miller
@ericmiller777
Nov 08 2018 19:39
let quoteSample = "Blueberry 3.141592653s are delicious.";
let myRegex = /h-s2-6/ig; // Change this line
let result = quoteSample.match(myRegex); // Change this line
Cannot read property 'length' of null
keep getting that
im pretty sure thats right
Ariel
@ArielLeslie
Nov 08 2018 19:57
@ericmiller777 Read up on the global flag.
May Kittens Devour Your Soul
@diomed
Nov 08 2018 19:58
:flags:
Eric Weiss
@eweiss17
Nov 08 2018 20:09
Do i have to always throw a new exception in order to catch it...
Niraj Nandish
@Nirajn2311
Nov 08 2018 20:10
@diomed I like that flag, it's :yum:
May Kittens Devour Your Soul
@diomed
Nov 08 2018 20:11
looks a bit :fish: y
skpmit
@skpmit
Nov 08 2018 20:12
How to Uncomment HTML ?
May Kittens Devour Your Soul
@diomed
Nov 08 2018 20:12
go to editor an click on uncomment button
or Toggle comment
skpmit
@skpmit
Nov 08 2018 20:13
@diomed I AM LEARNING ON FREECODECAMP NOT ON EDITOR
May Kittens Devour Your Soul
@diomed
Nov 08 2018 20:13
in the end it looks smth like this:
<!-- <p class="text-grey-dark mt-2 mb-6"> I could watch Jake Gyllenhaal murder people all day. </p> -->
Eric Weiss
@eweiss17
Nov 08 2018 20:13
<!-- remove these ->>
May Kittens Devour Your Soul
@diomed
Nov 08 2018 20:14
I sure picked a sentence. lol
oh right- it's uncomment. :cat:'s a noob
never could tell difference between those 2
Eric Weiss
@eweiss17
Nov 08 2018 20:16
anyone familiar with spaghetti php
skpmit
@skpmit
Nov 08 2018 20:18
@eweiss17 Thank you :)
May Kittens Devour Your Soul
@diomed
Nov 08 2018 20:19
I wonder where is @thekholm80
last time I heard about him was when he was trippin to see his friends or family
I hope they ain't canibals or something...
...
He's absent from here suspiciously long for a coder
skpmit
@skpmit
Nov 08 2018 20:21
who knows full stack development here
Binyamin Aron Green
@b3u
Nov 08 2018 20:21
Kind of. What?
skpmit
@skpmit
Nov 08 2018 20:23
web applications
Binyamin Aron Green
@b3u
Nov 08 2018 20:24
What's your question?
skpmit
@skpmit
Nov 08 2018 20:25
I need help to build a website and app..
Binyamin Aron Green
@b3u
Nov 08 2018 20:25
In what language?
May Kittens Devour Your Soul
@diomed
Nov 08 2018 20:26
html
:trollface:
skpmit
@skpmit
Nov 08 2018 20:26
english,madrid etc
Binyamin Aron Green
@b3u
Nov 08 2018 20:26
What's the issue?
skpmit
@skpmit
Nov 08 2018 20:26
already i have purchased domain
Binyamin Aron Green
@b3u
Nov 08 2018 20:26
Cool!
Eric Weiss
@eweiss17
Nov 08 2018 20:27
how much dev skills do you know right now
May Kittens Devour Your Soul
@diomed
Nov 08 2018 20:27
I think he reached uncommenting html
so far
skpmit
@skpmit
Nov 08 2018 20:27
i know html,html5,css basics thats it.
@diomed it not like that
Binyamin Aron Green
@b3u
Nov 08 2018 20:28
Can someone help me here?
Please...
skpmit
@skpmit
Nov 08 2018 20:29
sometimes any intelligent fellow also get stuck in most easiest topics ....
Binyamin Aron Green
@b3u
Nov 08 2018 20:29
True
May Kittens Devour Your Soul
@diomed
Nov 08 2018 20:29
@skpmit what is your site gonna be about?
skpmit
@skpmit
Nov 08 2018 20:30
related to travel
spiritualhikes.com
Eric Weiss
@eweiss17
Nov 08 2018 20:30
@b3u mmm u doing one of the front end projects?
Binyamin Aron Green
@b3u
Nov 08 2018 20:30
Nope.
Eric Weiss
@eweiss17
Nov 08 2018 20:30
@skpmit is this for profit or just a personal project
Binyamin Aron Green
@b3u
Nov 08 2018 20:31
This is part of a personal full-stack project.
skpmit
@skpmit
Nov 08 2018 20:31
for profit
Kyle Holm
@thekholm80
Nov 08 2018 20:31
@diomed i'm around
Eric Weiss
@eweiss17
Nov 08 2018 20:31
@b3u what is the question in less than 10 words
Binyamin Aron Green
@b3u
Nov 08 2018 20:31
The form on codepen doesn't matter; it's really the question
skpmit
@skpmit
Nov 08 2018 20:31
my sole aim of life is build something which help generations
Binyamin Aron Green
@b3u
Nov 08 2018 20:33
let's say, a form is 100px wide. The label is as wide as the text. I want the input to be the width of the form minus the width of the label. good?
May Kittens Devour Your Soul
@diomed
Nov 08 2018 20:35
@thekholm80 that's nice. I was a bit worried already. as :cat: can be. ._.
Binyamin Aron Green
@b3u
Nov 08 2018 20:35
should probably remove your email so spambots don't get it.
@skpmit
skpmit
@skpmit
Nov 08 2018 20:36
@b3u Right
Binyamin Aron Green
@b3u
Nov 08 2018 20:37
I made that mistake once also.
Eric Weiss
@eweiss17
Nov 08 2018 20:37
@b3u so the input box takes up the rest of the width of the form ?
Binyamin Aron Green
@b3u
Nov 08 2018 20:38
yep
Eric Weiss
@eweiss17
Nov 08 2018 20:38
What have you tried so far
Binyamin Aron Green
@b3u
Nov 08 2018 20:39
I don't know where to start really. Grid has auto to take up remaining space, but i feel like there should be something easier.
May Kittens Devour Your Soul
@diomed
Nov 08 2018 20:40
what's easier than grid?
flexbox?
Binyamin Aron Green
@b3u
Nov 08 2018 20:40
true
I'll try grid
Eric Weiss
@eweiss17
Nov 08 2018 20:40
yeah i'm thinking flexbox
ugh lol i'll try to do it myself...
skpmit
@skpmit
Nov 08 2018 20:41
Bye Friends !
Binyamin Aron Green
@b3u
Nov 08 2018 20:41
good luck
May Kittens Devour Your Soul
@diomed
Nov 08 2018 20:42
bye, pink avatar
Eric Weiss
@eweiss17
Nov 08 2018 20:44
wow i just flexed and it did it
check out my spaghetti (do not do what I did kids)
May Kittens Devour Your Soul
@diomed
Nov 08 2018 20:45
@eweiss17 input is self-closing. has FCC taught you nothing? :ghost:
Binyamin Aron Green
@b3u
Nov 08 2018 20:46
@eweiss17 WOW! Thanks.
Eric Weiss
@eweiss17
Nov 08 2018 20:46
crap are they gonna revoke my certificate now
Binyamin Aron Green
@b3u
Nov 08 2018 20:46
: - }
Eric Weiss
@eweiss17
Nov 08 2018 20:46
i also used styling in the html.... take me to jail plz
@b3u ya dude flexbox is super useful.... definitely learn how and when to use it
Henry
@GitHub-Henry
Nov 08 2018 21:00
@thekholm80 :wave:
Kyle Holm
@thekholm80
Nov 08 2018 21:00
@GitHub-Henry hey buddy
Henry
@GitHub-Henry
Nov 08 2018 21:00
how was your visit?
Kyle Holm
@thekholm80
Nov 08 2018 21:00
had a good time, thanks
Henry
@GitHub-Henry
Nov 08 2018 21:00
back home then
Kyle Holm
@thekholm80
Nov 08 2018 21:01
yessir
May Kittens Devour Your Soul
@diomed
Nov 08 2018 21:01
pfft. human talk
Henry
@GitHub-Henry
Nov 08 2018 21:02
i like travel in late oct great time, cool weather, fall color, most of US
i was in NYC once when Yankees won their championship, so they had a parade down the canyon of heros (a ticker tape parade) with sky scrapers on both sides, quite an experience.
Kyle Holm
@thekholm80
Nov 08 2018 21:03
sounds awesome
Henry
@GitHub-Henry
Nov 08 2018 21:05
also theme parks are empty in late oct. great time to ride all the rides. i went to disneyland recently, late oct, walk right up the the rides and get on, only a few rides had lines.
kids are in school
Eric Weiss
@eweiss17
Nov 08 2018 21:08
I'd recommend Cedar Point. Has the best roller coasters.
Henry
@GitHub-Henry
Nov 08 2018 21:12
Drew Carey territory, I've only been there for a short visit.
@thekholm80 welcome back, good to see you around.
May Kittens Devour Your Soul
@diomed
Nov 08 2018 21:16
I'm big and white and round and my back is real hairy,
Yes, you guessed it, my name is Drew Carey.
Henry
@GitHub-Henry
Nov 08 2018 21:18
is drew really dilbert?
image.png
they look the same to me.
May Kittens Devour Your Soul
@diomed
Nov 08 2018 21:19
oh god. the resemblance is uncanny.
why are movies not being made?
this is beyond belief
Eric Weiss
@eweiss17
Nov 08 2018 21:25
@diomed how did u get on the sidebar on the right?
May Kittens Devour Your Soul
@diomed
Nov 08 2018 21:26
by being here while I'm awake, I guess :yum:
only reasonable explanation
May Kittens Devour Your Soul
@diomed
Nov 08 2018 21:42
@eweiss17 if you see that :penguin: who's on first you'll get the idea
Darren
@DarrenfJ
Nov 08 2018 21:50
morning fCC
@GitHub-Henry hey buddy! :smile:
Eric Miller
@ericmiller777
Nov 08 2018 21:50
@DarrenfJ good morning
Henry
@GitHub-Henry
Nov 08 2018 21:50
@DarrenfJ :wave:
where in the world are you? morning.
Darren
@DarrenfJ
Nov 08 2018 21:52
@ericmiller777 hey man :wave:
you know, it's all a blur to me now. I work nights til 4 then days 1pm til 5 pm...
split the shift... gah
so it might be night.. who knows..
Henry
@GitHub-Henry
Nov 08 2018 21:53
@DarrenfJ i thought you were in on the canada side of the boston area.
or ny
Darren
@DarrenfJ
Nov 08 2018 21:53
I am... Trawna
@daddycardona buddy! sorry for missing your hello.. I am in and out of here quite infrequently now...
but i exist on Sri Lankan time now
Henry
@GitHub-Henry
Nov 08 2018 21:54
the joys of distributed teams
Darren
@DarrenfJ
Nov 08 2018 21:54
i know... :/
Henry
@GitHub-Henry
Nov 08 2018 21:55
how's that working out for you?
besides odd hours?
Darren
@DarrenfJ
Nov 08 2018 21:58
fun
running QA though so doing so little actual work and tons of timesheets :wink:
Henry
@GitHub-Henry
Nov 08 2018 22:01
seems like it's keeping you busy, don't see you much these days
Darren
@DarrenfJ
Nov 08 2018 22:02
my core hangout and/or code hours were midnight to 3 am and I am now online with SL working... bit of drag in that regard...
so I am just plodding through all the new exercises in fCC all the higher stuff...
about as much as I have energy to lately...
what have you been up to?
Henry
@GitHub-Henry
Nov 08 2018 22:04
going through the new certs almost done with front end.
two more react projects.
Darren
@DarrenfJ
Nov 08 2018 22:04
cool
i have a ton done but behind on the projects.. apparently that's my MO ha!
Henry
@GitHub-Henry
Nov 08 2018 22:06
react is so hot these days, i thought it would help to read the reactjs docs.
not bad once you've done a few react projects and understand what they are taking about.
Darren
@DarrenfJ
Nov 08 2018 22:14
yah.. on my to do list... :smile:
gotta head back into the frey... have fun guys
codeOn!
Henry
@GitHub-Henry
Nov 08 2018 22:15
tty l8r
dyon gerwen
@fullstackinprogress_gitlab
Nov 08 2018 22:53
can someon explain em this line its a piece of a node.js project
const { body: { user } } = req;
Christopher McCormack
@cmccormack
Nov 08 2018 23:05
@fullstackinprogress_gitlab it's saying "destructure the property body from req, then destructure the property user frombody", so you can use user as a variable
you can even assign a default value to user if you want!
const { body: { user } } = req;
is the same as
const user = req.body.user
dyon gerwen
@fullstackinprogress_gitlab
Nov 08 2018 23:07
@cmccormack thanks a lot great :)
Christopher McCormack
@cmccormack
Nov 08 2018 23:07
np
Bjorn van de Peut
@bjorno43
Nov 08 2018 23:07
:wave:
Christopher McCormack
@cmccormack
Nov 08 2018 23:08
this example isn't a very good use of destructuring, but if there were more it would be better
@bjorno43 heya
Bjorn van de Peut
@bjorno43
Nov 08 2018 23:08
@cmccormack Hey m8, how's it goin?
dyon gerwen
@fullstackinprogress_gitlab
Nov 08 2018 23:09
@bjorno43 yoo :) @cmccormack yeah im gonna read mzoilla about destructering i had done it with arrays also a bit with obkects but maybe because they are using only 1 its a bit confusing
Christopher McCormack
@cmccormack
Nov 08 2018 23:09
Good man, too much work to do before the holiday freeze so been focused on that for now
Bjorn van de Peut
@bjorno43
Nov 08 2018 23:10
@fullstackinprogress_gitlab Hey
Christopher McCormack
@cmccormack
Nov 08 2018 23:10
@bjorno43 how are you?
Bjorn van de Peut
@bjorno43
Nov 08 2018 23:12
@cmccormack Struggling a bit with my bloodsugar, but other than that pretty good. We're at the beta stage of that chatsystem I was working on right now and we're looking at about 200 beta testers in just the first 2 weeks. Steady climb of about 15 users a day :)
Which I think isn't rly too bad considering no advertisement of any kind has been done yet, haha
Had some issues with supporting IE / Edge in the end, untill I discovered that holy grail Babel you guys mentioned about a thousend times before :joy:
Christopher McCormack
@cmccormack
Nov 08 2018 23:15
Yeah, besides the blood sugar, that's great! What is the app called?
Bjorn van de Peut
@bjorno43
Nov 08 2018 23:15
Icecub Chat
It's in Dutch though: https://www.icecub.nl
If you want, I can set you up with a test account so I can show you around a bit
dyon gerwen
@fullstackinprogress_gitlab
Nov 08 2018 23:17
@bjorno43 broo im also from the netherlands but its not legal to ask a copy of an id its against the law so maybe you need the remove that featre other then that looking great !
Bjorn van de Peut
@bjorno43
Nov 08 2018 23:18
@fullstackinprogress_gitlab Actually no, for us that's called the AVG law (AVG wet). And it obligates me to ask it :P
dyon gerwen
@fullstackinprogress_gitlab
Nov 08 2018 23:19
@ why ?
Christopher McCormack
@cmccormack
Nov 08 2018 23:20
I don't understand the words on this page at all
Bjorn van de Peut
@bjorno43
Nov 08 2018 23:21
Just ask those idiots that wrote the law. Basicly it has to do with the users right for private data transparrency and you're obligated to ask for a copy of the ID in case a users whats to excesize that right
It's a bit complicated and a lot easier for me to explain in Dutch than in English, haha
@cmccormack Ye I didn't expect you to, haha
@fullstackinprogress_gitlab Just read the Privacy Statement on that website. It explains how that law works for the most part
Bjorn van de Peut
@bjorno43
Nov 08 2018 23:29
@cmccormack It's just the default stuff there. "By using our website you agree to our terms and conditions etc etc". Login / Register. Register asks for Username / Password / Repeat Password / Gender / Birthdate / Email / Copy ID (not obligated, but recommended) and that's pretty much it :joy:
Christopher McCormack
@cmccormack
Nov 08 2018 23:29
I wonder why google doesn't try to translate it for me
@bjorno43 you mean that for me?
Bjorn van de Peut
@bjorno43
Nov 08 2018 23:29
Ye thought I give you a quick rundown of what it all says
No idea what Google doesn't translate it. I mean, it's not like I'm using any crazy elements or something
Wait, maybe I do know why
Christopher McCormack
@cmccormack
Nov 08 2018 23:31
ohh thanks
meta?
Bjorn van de Peut
@bjorno43
Nov 08 2018 23:32
Well I didn't set the docs lang ye. Did it now. It'll probably work if you do a hard refresh
Christopher McCormack
@cmccormack
Nov 08 2018 23:33
hmm it says it's in Dutch but it fails to translate
Bjorn van de Peut
@bjorno43
Nov 08 2018 23:33
Weird..
Christopher McCormack
@cmccormack
Nov 08 2018 23:35
yeah
could be because I'm on a work network, not sure
Bjorn van de Peut
@bjorno43
Nov 08 2018 23:36
Added 1 more meta. Should work according to google, but not sure
Ah well. It's not very important. The website is ment for Dutch users only. There's no point for English (or other language) users to login to a chatsystem where everyone speaks Dutch, haha
And I can't imagine Google translating data coming over a websocket live :joy: That'd be amazing if it could, lol
Bjorn van de Peut
@bjorno43
Nov 08 2018 23:42
Honestly, where's the universal translator when you need one?
Christopher McCormack
@cmccormack
Nov 08 2018 23:46
haha dunno
I'll take you up on your login later though @bjorno43 gotta log off and make dinner
Bjorn van de Peut
@bjorno43
Nov 08 2018 23:47
Sure m8 @cmccormack Enjoy your dinner!
Christopher McCormack
@cmccormack
Nov 08 2018 23:47
thanks :)
Albert Cardona II
@daddycardona
Nov 08 2018 23:59
what up @DarrenfJ nice to hear from you @ericmiller777 Yeah me too LOL @diomed LOL @Manish-Giri yeah sorry so late :)