These are chat archives for FreeCodeCamp/Help

21st
Oct 2017
Manish Giri
@Manish-Giri
Oct 21 2017 00:47
@DarrenfJ @heroiczero @thekholm80 @khaduch ty
CamperBot
@camperbot
Oct 21 2017 00:47
manish-giri sends brownie points to @darrenfj and @heroiczero and @thekholm80 and @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1522 | @thekholm80 |http://www.freecodecamp.com/thekholm80
:star2: 2160 | @darrenfj |http://www.freecodecamp.com/darrenfj
:star2: 1912 | @heroiczero |http://www.freecodecamp.com/heroiczero
:star2: 3387 | @khaduch |http://www.freecodecamp.com/khaduch
artbohr
@artbohr
Oct 21 2017 01:07
@Manish-Giri how to enter the free cookies club? lol
Manish Giri
@Manish-Giri
Oct 21 2017 01:14
@artbohr your membership application has been submitted to the "league of legends", here's a cookie pending approval, ty
CamperBot
@camperbot
Oct 21 2017 01:14
manish-giri sends brownie points to @artbohr :sparkles: :thumbsup: :sparkles:
:cookie: 314 | @artbohr |http://www.freecodecamp.com/artbohr
Darren
@DarrenfJ
Oct 21 2017 02:42
kudos and thanks to the regulars
thanks @Manish-Giri @daddycardona @heroiczero @GitHub-Henry @thekholm80 @sjames1958gm @khaduch
CamperBot
@camperbot
Oct 21 2017 02:43
darrenfj sends brownie points to @manish-giri and @daddycardona and @heroiczero and @github-henry and @thekholm80 and @sjames1958gm and @khaduch :sparkles: :thumbsup: :sparkles:
:cookie: 402 | @daddycardona |http://www.freecodecamp.com/daddycardona
:star2: 1913 | @heroiczero |http://www.freecodecamp.com/heroiczero
:cookie: 402 | @github-henry |http://www.freecodecamp.com/github-henry
:star2: 3388 | @khaduch |http://www.freecodecamp.com/khaduch
:star2: 1523 | @thekholm80 |http://www.freecodecamp.com/thekholm80
:star2: 6667 | @manish-giri |http://www.freecodecamp.com/manish-giri
:star2: 8587 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Albert Cardona II
@daddycardona
Oct 21 2017 02:49
Thanks yall @Manish-Giri @DarrenfJ @heroiczero @GitHub-Henry @thekholm80 @sjames1958gm @khaduch
CamperBot
@camperbot
Oct 21 2017 02:49
daddycardona sends brownie points to @manish-giri and @darrenfj and @heroiczero and @github-henry and @thekholm80 and @sjames1958gm and @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 2161 | @darrenfj |http://www.freecodecamp.com/darrenfj
:star2: 1914 | @heroiczero |http://www.freecodecamp.com/heroiczero
:star2: 3389 | @khaduch |http://www.freecodecamp.com/khaduch
:star2: 6668 | @manish-giri |http://www.freecodecamp.com/manish-giri
:star2: 8588 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
:star2: 1524 | @thekholm80 |http://www.freecodecamp.com/thekholm80
:cookie: 403 | @github-henry |http://www.freecodecamp.com/github-henry
Albert Cardona II
@daddycardona
Oct 21 2017 02:49
Now back to this truthy one, I am confused with it like it just notworking for me
Henry
@GitHub-Henry
Oct 21 2017 03:12
@daddycardona hello, ty for the brownies
CamperBot
@camperbot
Oct 21 2017 03:12
github-henry sends brownie points to @daddycardona :sparkles: :thumbsup: :sparkles:
:cookie: 403 | @daddycardona |http://www.freecodecamp.com/daddycardona
artbohr
@artbohr
Oct 21 2017 03:24
@Manish-Giri sweet ^^ ty :D
CamperBot
@camperbot
Oct 21 2017 03:24
artbohr sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 6669 | @manish-giri |http://www.freecodecamp.com/manish-giri
Joshua Arnett
@josha5
Oct 21 2017 03:32
Could anyone help me with why my tic tac toe AI is selecting boxes that arent blank
heroiczero
@heroiczero
Oct 21 2017 03:59
@GitHub-Henry @daddycardona @DarrenfJ @Manish-Giri @thekholm80 @sjames1958gm @khaduch @alpox @longnt80 TY :cookie: :squirrel: For the regulars who come in daily.
CamperBot
@camperbot
Oct 21 2017 03:59
heroiczero sends brownie points to @github-henry and @daddycardona and @darrenfj and @manish-giri and @thekholm80 and @sjames1958gm and @khaduch and @alpox and @longnt80 :sparkles: :thumbsup: :sparkles:
:cookie: 404 | @github-henry |http://www.freecodecamp.com/github-henry
:cookie: 404 | @daddycardona |http://www.freecodecamp.com/daddycardona
:star2: 2162 | @darrenfj |http://www.freecodecamp.com/darrenfj
:star2: 8589 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
:star2: 1371 | @alpox |http://www.freecodecamp.com/alpox
:star2: 6670 | @manish-giri |http://www.freecodecamp.com/manish-giri
:cookie: 604 | @longnt80 |http://www.freecodecamp.com/longnt80
:star2: 3390 | @khaduch |http://www.freecodecamp.com/khaduch
:star2: 1525 | @thekholm80 |http://www.freecodecamp.com/thekholm80
Albert Cardona II
@daddycardona
Oct 21 2017 04:03
josha I will try to look into it tomorrow :) I am really tired right now and can't decipher nada lol
@josha5
heroiczero
@heroiczero
Oct 21 2017 04:15
@josha5 you are just getting any randomNumber with return Math.floor(Math.random()*9);(it should be 10 since Math.random() is between 0 and 1 but not equal to one and you are doing Math.floor() which rounds down) You have to instruct your AI to not choose another square if player chose it. You probably have to do a if statement where it generates a randomNumber until it is an empty square. Personally, i would have designed it with a multidimensional array for organizational purposes.
Long Nguyen
@longnt80
Oct 21 2017 04:32
hey guys, what do think is a good approach to detect which item is chosen in this:
https://codepen.io/longnt80/pen/rGRRMb?editors=0010
btw, @heroiczero thanks for the :cookie:
CamperBot
@camperbot
Oct 21 2017 04:32
longnt80 sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 1915 | @heroiczero |http://www.freecodecamp.com/heroiczero
Kyle Holm
@thekholm80
Oct 21 2017 05:12
holy cookies batman
Thanks @Manish-Giri @DarrenfJ @heroiczero
CamperBot
@camperbot
Oct 21 2017 05:12
thekholm80 sends brownie points to @manish-giri and @darrenfj and @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 1916 | @heroiczero |http://www.freecodecamp.com/heroiczero
:star2: 6671 | @manish-giri |http://www.freecodecamp.com/manish-giri
:star2: 2163 | @darrenfj |http://www.freecodecamp.com/darrenfj
Kyle Holm
@thekholm80
Oct 21 2017 05:12
and thanks @daddycardona
wake up cbot
@daddycardona thanks
CamperBot
@camperbot
Oct 21 2017 05:13
thekholm80 sends brownie points to @daddycardona :sparkles: :thumbsup: :sparkles:
:cookie: 405 | @daddycardona |http://www.freecodecamp.com/daddycardona
eman
@emonaly
Oct 21 2017 08:34

wsuuup im bac

yo yo everybody

nvm,that was sooo lame!
Henry
@GitHub-Henry
Oct 21 2017 09:45
@heroiczero hello, ty for the brownies
CamperBot
@camperbot
Oct 21 2017 09:45
github-henry sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 1918 | @heroiczero |http://www.freecodecamp.com/heroiczero
gishy1
@gishy1
Oct 21 2017 10:27
does anyone know how to run jscript on atom io
im not understanding how to do it
alpox
@alpox
Oct 21 2017 10:29
@gishy1 i usually dont use atom but i believe they mist have an integrated terminal where you can run it from
gishy1
@gishy1
Oct 21 2017 10:30
@alpox bro its hard enough learning javascript talk to me like the illiterate computer peasant I am
:cry:
@alpox do i have to install the atom runner
?
alpox
@alpox
Oct 21 2017 10:32
@gishy1 that would sure be one solution
gishy1
@gishy1
Oct 21 2017 10:32
@alpox the other?
alpox
@alpox
Oct 21 2017 10:33
@gishy1 running it in a terminal :D
The atom runner might be easier for you
gishy1
@gishy1
Oct 21 2017 10:34
@alpox so I download it and how does it interact with the the atom io
alpox
@alpox
Oct 21 2017 10:35
@gishy1 dunno. Take a look at their documentation. I never use atom, sry :) i always use Visual Studio Code
gishy1
@gishy1
Oct 21 2017 10:35
@alpox :facepunch:
that was meant to be a punch
alpox
@alpox
Oct 21 2017 10:36
@gishy1 thanks :D According to the docs, you should be able to run the currently active script withCtrl-R
CamperBot
@camperbot
Oct 21 2017 10:36
alpox sends brownie points to @gishy1 :sparkles: :thumbsup: :sparkles:
:cookie: 241 | @gishy1 |http://www.freecodecamp.com/gishy1
gishy1
@gishy1
Oct 21 2017 10:37
@camperbot i want actually cookies :neutral_face:
There they say how to use it
shivam gupta
@shivamg11000
Oct 21 2017 12:45
what's the difference between stream and buffer in node
Barkha54
@Barkha54
Oct 21 2017 12:56
Hi, I'm cloning the FCC repo onto my windows laptop and while running gulp it is showing me could not find module babel-core/register. I tried installing babel-core using npm install babel-core/register but it is showing me a lot of errors.
image.png
Can someone help me with his please?
image.png
Adel
@AdelMahjoub
Oct 21 2017 13:18

@shivamg11000
Stream

Streams can be readable, writable, or both. All streams are instances of EventEmitter.

Buffer

Instances of the Buffer class are similar to arrays of integers but correspond to fixed-sized, raw memory allocations outside the V8 heap. The size of the Buffer is established when it is created and cannot be resized.

const http = require('http');
const Stream = require('stream');

http
  .createServer((req, res) => {

    console.log(req instanceof Stream); // true
    console.log(res instanceof Stream); // true

    console.log(req instanceof Buffer); // false
    console.log(res instanceof Buffer); // false

    req.on('readable', () => {
      console.log('I\'m a readable stream');
    })

    req.on('end', () => {
      console.log('I\'m a writable stream');
      res.write(Buffer.from('Hello from nodejs'));
      res.end();
    });
  })
  .listen(8080);
@shivamg11000
const http = require('http');
const Stream = require('stream');

http.get('http://google.com', res => {

  console.log(res instanceof Stream) // true
  console.log(res instanceof Buffer) // false

  res.once('data', chunk => {
    console.log(chunk instanceof Buffer) // true
    console.log(chunk instanceof Stream) // false

    console.log('res: I\'m a readable stream, read buffers on me');
    console.log(chunk);
  });

  res.on('end', () => {})

});
Joshua Arnett
@josha5
Oct 21 2017 14:13
@heroiczero hmm ok thanks I plan on getting it cleaned up I just want something working for now. I've tried different variations of if statements to get it to work but I can't find one that does. What would be the basic setup for the if/else statements?
CamperBot
@camperbot
Oct 21 2017 14:13
josha5 sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 1919 | @heroiczero |http://www.freecodecamp.com/heroiczero
shivam gupta
@shivamg11000
Oct 21 2017 14:41
@AdelMahjoub thanks for the explaination
these streams and buffers are confusing
they seem like same thing
CamperBot
@camperbot
Oct 21 2017 14:41
shivamg11000 sends brownie points to @adelmahjoub :sparkles: :thumbsup: :sparkles:
:cookie: 593 | @adelmahjoub |http://www.freecodecamp.com/adelmahjoub
Victor Abeledo
@victorja
Oct 21 2017 15:22
Hi guys I'm working on this mock project, and I can't figure out why my overlay background color is still bigger than the image. It's not much but it ruins the effect (only image 1 is has hover)
https://codepen.io/victorabeledo/pen/EwJVwY
do you know how to fix it?
Adel
@AdelMahjoub
Oct 21 2017 15:26
@shivamg11000 you can think of streams as 'transporters' of buffers, you can write buffers on a writable stream, read buffers from a stream => readable stream, read and write => duplex stream
Darren
@DarrenfJ
Oct 21 2017 15:32
morning fCC... how goes the code?
Henry
@GitHub-Henry
Oct 21 2017 19:12
@DarrenfJ hello
Ken Haduch
@khaduch
Oct 21 2017 19:25
@DarrenfJ @GitHub-Henry - hello folks. Not too much activity here today?
Henry
@GitHub-Henry
Oct 21 2017 19:30
@khaduch hello, yeah life marches on, kinda keeps folks busy
Moisés Man
@moigithub
Oct 21 2017 19:33

@victorja wrap ur img + overlay on a container

      <div class="column third">
        <div class="imgcard">
          <img class="imagen" src="......">
            <div class="overlay">
                 <div class="text">Hello World
            </div>
          </div>
        </div>

set width

 img, .imgcard {
    width: 100%;
    height: 100%;
        position: relative;
}
artbohr
@artbohr
Oct 21 2017 19:44
Hey guys, can someone tell me if you need to import "bootstrap" to use "react-bootstrap" in webpack? Or it's not neccesary to have it
also I thought that I need to import jquery to use bootstrap, but by installing "bootstrap" and "react-bootstrap" dependencies in webpack normal bootstrap syntax is working fine, can some one explain the details why it works without jquery and if I need normal bootstrap as dependency to work with "react-bootstrap"?
artbohr
@artbohr
Oct 21 2017 19:58
ok I figured it out, if someone is interested it's because: react-bootstrap does not include bootstrap css, that's why you need both to use react-bootstrap and bootstrap css, also you don't need jquery if you are not using bootstrap JS or using react-bootstrap instead of bootstrap js, I hope I got it right.