These are chat archives for FreeCodeCamp/Help

11th
Jul 2018
Prakash Kumar
@ThePrakashKumar
Jul 11 2018 03:07
Any guide's link to make iframe responsive and for layout properly.
Claudio Restifo
@Marmiz
Jul 11 2018 04:42
@ThePrakashKumar yeh, place it in a container positioned relative,
than give the iframe position absolute, width / height 100%
same you'd do with responsive images
May Kittens Devour Your Soul
@diomed
Jul 11 2018 07:39
@Adishjain58 how did u try?
Claudio Restifo
@Marmiz
Jul 11 2018 07:45
do or do not.
there is no try
Adish Jain
@Adishjain58
Jul 11 2018 07:46
@diomed ```
<style type='text/sass'>
  @each $color in blue,black,red{
.#{$color}-bg{background-color:$color;}
  }


  div {
    height: 200px;
    width: 200px;
  }
</style>

<div class="blue-bg"></div>
<div class="black-bg"></div>
<div class="red-bg"></div>
May Kittens Devour Your Soul
@diomed
Jul 11 2018 07:48
@Adishjain58 you need to follow that 2nd example, not first one
title of your task Use @each to Map Over Items in a List
A map has slightly different syntax. Here's an example:
@Marmiz when you do and it's not working, isn't that try?
Adish Jain
@Adishjain58
Jul 11 2018 07:50
@diomed still it's not getting passed
<style type='text/sass'>

$colors:(color1:blue,color2:black,color3:red);
  @each $key, $color in $colors{
.#{$color}-bg{background-color:$color;}
  }


  div {
    height: 200px;
    width: 200px;
  }
</style>

<div class="blue-bg"></div>
<div class="black-bg"></div>
<div class="red-bg"></div>
i am getting the output but cases are not getting passed
Claudio Restifo
@Marmiz
Jul 11 2018 07:54
@diomed we should ask yoda.
But he'll probably reply some gibberish about the force and stuff
May Kittens Devour Your Soul
@diomed
Jul 11 2018 07:59
@Adishjain58 you indented @each
make sure everything is in the beginning - without indenting
Adish Jain
@Adishjain58
Jul 11 2018 08:00
@diomed like this?
<style type='text/sass'>

$colors:(color1:blue,color2:black,color3:red);

@each $key, $color in $colors{
.#{$color}-bg{background-color:$color;}
  }


  div {
    height: 200px;
    width: 200px;
  }
</style>

<div class="blue-bg"></div>
<div class="black-bg"></div>
<div class="red-bg"></div>
errors are
Your .blue-bg class should have a background-color of blue.
Your .black-bg class should have a background-color of black.
Your .red-bg class should have a background-color of red.
May Kittens Devour Your Soul
@diomed
Jul 11 2018 08:04
@Adishjain58 I'm not sure what's wrong with that task. u should probably skip it
if you paste your code here: https://www.sassmeister.com/
u can clearly see it's converting it properly
Adish Jain
@Adishjain58
Jul 11 2018 08:05
@diomed same is happening with next task
May Kittens Devour Your Soul
@diomed
Jul 11 2018 08:05
and u also see it visually that it's good
probably some usual glitches on FCC
Adish Jain
@Adishjain58
Jul 11 2018 08:05
@diomed ok, Thnx
May Kittens Devour Your Soul
@diomed
Jul 11 2018 08:08

I didnt know such a thing exists
Claudio Restifo
@Marmiz
Jul 11 2018 08:47
does it even exists in JS? :rainbow:
May Kittens Devour Your Soul
@diomed
Jul 11 2018 11:26
What’s Mahomanungny :question:
Dimitris Nik.
@dimitrissnk
Jul 11 2018 13:05
Is there anything similar to the first-line pseudo element such as p::last-line { color: red; } ??
May Kittens Devour Your Soul
@diomed
Jul 11 2018 14:08
@Dimitrios51 mby last-of-type?
no such thing as last-line, sadly
Lee Arnold
@nsanity1
Jul 11 2018 14:59
Did anyone have issues with tests not running when they went through the JS lessons?
Kyle Holm
@thekholm80
Jul 11 2018 15:07
which lessons?
Christopher McCormack
@cmccormack
Jul 11 2018 15:28
@nsanity1 Yesterday I couldn't pass the second basic JS problem :)
make sure you use semicolons
(I normally do not)
Lee Arnold
@nsanity1
Jul 11 2018 15:33
one sec @thekholm80
@cmccormack they aren't failing, they just don't run
Christopher McCormack
@cmccormack
Jul 11 2018 15:34
@nsanity1 ah - maybe adblocker?
Lee Arnold
@nsanity1
Jul 11 2018 15:35
storing values...oper; understand case sen...; understanding uninitailzed...; increament/decrement a num...
the weird thing is that some of them are running just fine
but just those aren't so far
i haven't tried to run them from my desktop yet so I will try after work when I get home
Lee Arnold
@nsanity1
Jul 11 2018 15:43
be back in a bit...lunch break
Lee Arnold
@nsanity1
Jul 11 2018 17:02
ok...back
Kyle Holm
@thekholm80
Jul 11 2018 20:16
so quiet today
Karma Drukpa
@coderkarma
Jul 11 2018 20:17
hi Kyle
needs your help.
Kyle Holm
@thekholm80
Jul 11 2018 20:17
@coderkarma :wave:
Karma Drukpa
@coderkarma
Jul 11 2018 20:18
I don't Want answer from you but guidance for sure

Write a function which will reverse the vowels in a string. Any characters which are not vowels should remain in their original position. You should not consider "y" to be a vowel.

Examples:

reverseVowels("Hello!"); // "Holle!"
reverseVowels("Tomatoes"); // "Temotaos"
reverseVowels("Reverse Vowels In A String"); // "RivArsI Vewols en e Streng"
reverseVowels("aeiou"); // "uoiea"

function reverseVowels(string){
    let vowels = 'aeiouAEIOU'.split('');
    let newStr = '';
    let vowelKeeper = [];

    for (let i = 0; i < string.length; i += 1){
        let char = string[i];

      if(vowels.indexOf(char) === -1 ){
            newStr += char;

        } else if (vowels.indexOf(char) > -1 && i === vowels){
           // here if it is a vowel then i would swap but i bit confuse how can i do ?

        }
    }
    return newStr;
}
reverseVowels("Hello!"); // "Holle!"
that was overal approach.
Kyle Holm
@thekholm80
Jul 11 2018 20:20
if(vowels.indexOf(char) === -1 ){ you should check out Array.includes()
it will change your life
Karma Drukpa
@coderkarma
Jul 11 2018 20:20
In my else if statement, i want to swap the vowel if that character is a vowel
Array.include will return boolean right
Kyle Holm
@thekholm80
Jul 11 2018 20:20
yes
for example
Karma Drukpa
@coderkarma
Jul 11 2018 20:20
whether that particular char is included or not
Ahmed Tarek
@ahmedtarek2134
Jul 11 2018 20:21
its quite today because of the match πŸ˜ƒ
Kyle Holm
@thekholm80
Jul 11 2018 20:21
const arr = [1, 2, 3];
console.log(arr.includes(2)) // true
console.log(arr.includes(5)) // false
@ahmedtarek2134 did Croatia score yet?
Karma Drukpa
@coderkarma
Jul 11 2018 20:21
i understood that
Ahmed Tarek
@ahmedtarek2134
Jul 11 2018 20:21
yes
just scored now!!!!
Kyle Holm
@thekholm80
Jul 11 2018 20:22
are they ahead?
Ahmed Tarek
@ahmedtarek2134
Jul 11 2018 20:22
108th minute
yep they are
2-1
they were playing extra time
@diomed should be happy
Kyle Holm
@thekholm80
Jul 11 2018 20:22
@coderkarma also, when do you expect && i === vowels will evaluate true?
Ahmed Tarek
@ahmedtarek2134
Jul 11 2018 20:22
12 minutes to go
Kyle Holm
@thekholm80
Jul 11 2018 20:22
i is an integer, vowels is an array
Karma Drukpa
@coderkarma
Jul 11 2018 20:23
oh..
Kyle Holm
@thekholm80
Jul 11 2018 20:23
@ahmedtarek2134 i bet the cat is happy
Ahmed Tarek
@ahmedtarek2134
Jul 11 2018 20:24
surely he is but let's not keep our hopes up england might score πŸ˜€
Karma Drukpa
@coderkarma
Jul 11 2018 20:24
IMG_4942.JPG
people are going crazy here watching soccer
Ahmed Tarek
@ahmedtarek2134
Jul 11 2018 20:24
then the cat won't be that happy
its the world cup man every one is watching lol
Kyle Holm
@thekholm80
Jul 11 2018 20:24
i'm not
Ahmed Tarek
@ahmedtarek2134
Jul 11 2018 20:25
americans aren't**
Kyle Holm
@thekholm80
Jul 11 2018 20:25
we have real sports here
Karma Drukpa
@coderkarma
Jul 11 2018 20:25
i came here for coding meet ups but people are having fun watching soccer.
Kyle Holm
@thekholm80
Jul 11 2018 20:25
@coderkarma lol
Ahmed Tarek
@ahmedtarek2134
Jul 11 2018 20:25
for me baseball, football and all these american sports are too boring
even basketball
anyone offended yet? 😊
Kyle Holm
@thekholm80
Jul 11 2018 20:26
i watch disc golf, everything else is boring. i think i could get into cricket if i understood it better
Karma Drukpa
@coderkarma
Jul 11 2018 20:26
back to the question, so, i is integer there
Ahmed Tarek
@ahmedtarek2134
Jul 11 2018 20:27
yath it ith πŸ˜‹
Kyle Holm
@thekholm80
Jul 11 2018 20:27
@coderkarma yes
also, direct-compare of arrays is no bueno
image.png
Ahmed Tarek
@ahmedtarek2134
Jul 11 2018 20:28
guys what do you think about a command line application to write a webpack config by itself?
Christopher McCormack
@cmccormack
Jul 11 2018 20:29
@ahmedtarek2134 psst try out Parcel js
Ahmed Tarek
@ahmedtarek2134
Jul 11 2018 20:29
i did
Christopher McCormack
@cmccormack
Jul 11 2018 20:29
no bueno?
Karma Drukpa
@coderkarma
Jul 11 2018 20:29
ok
Ahmed Tarek
@ahmedtarek2134
Jul 11 2018 20:29
im just saying like should i create that idea
Kyle Holm
@thekholm80
Jul 11 2018 20:29
i think @cmccormack gets $1 every time he recommends parcel.js
Christopher McCormack
@cmccormack
Jul 11 2018 20:29
hah
Kyle Holm
@thekholm80
Jul 11 2018 20:29
:grin:
Ahmed Tarek
@ahmedtarek2134
Jul 11 2018 20:29
having a cli create a webpack config on its own
Christopher McCormack
@cmccormack
Jul 11 2018 20:29
@ahmedtarek2134 do you mean some kind of cli app that takes input, like npm init or eslint --init?
Ahmed Tarek
@ahmedtarek2134
Jul 11 2018 20:29
exactly
Christopher McCormack
@cmccormack
Jul 11 2018 20:30
will it also install dependencies?
Ahmed Tarek
@ahmedtarek2134
Jul 11 2018 20:30
yes
Christopher McCormack
@cmccormack
Jul 11 2018 20:30
Then sure why not
Kyle Holm
@thekholm80
Jul 11 2018 20:30
npx create-react-app my-app
Ahmed Tarek
@ahmedtarek2134
Jul 11 2018 20:30
even recommend plugins and loaders to choose
Kyle Holm
@thekholm80
Jul 11 2018 20:30
that does it all for you
Ahmed Tarek
@ahmedtarek2134
Jul 11 2018 20:31
what if i don't want react
Kyle Holm
@thekholm80
Jul 11 2018 20:31
but you do
Ahmed Tarek
@ahmedtarek2134
Jul 11 2018 20:31
not everyone uses webpack for react
Christopher McCormack
@cmccormack
Jul 11 2018 20:31
@thekholm80 yeah don't assume his framework/libarary
Kyle Holm
@thekholm80
Jul 11 2018 20:31
you might not know it yet, but you want react
participation is mandatory
Ahmed Tarek
@ahmedtarek2134
Jul 11 2018 20:31
actually sometimes i use vue
Christopher McCormack
@cmccormack
Jul 11 2018 20:31
@ahmedtarek2134 I think to build this the scope may grow quickly with all the different options
but if you keep it opinionated it wouldn't be so bad
Ahmed Tarek
@ahmedtarek2134
Jul 11 2018 20:32
i already created something kinda similar
Karma Drukpa
@coderkarma
Jul 11 2018 20:32
how can i swap if vowels.includes(char)
Ahmed Tarek
@ahmedtarek2134
Jul 11 2018 20:33
its initior on my github but like it creates a package json, other files and installs dependencies
Christopher McCormack
@cmccormack
Jul 11 2018 20:33
Can just use my perfect webpack config :)
Karma Drukpa
@coderkarma
Jul 11 2018 20:33
how can i swap if char is a vowel?
Kyle Holm
@thekholm80
Jul 11 2018 20:33
@coderkarma were it me, i'd probably create an array of all the vowels in the string, then use Array.reverse() to reorder them, then just start substituting
Christopher McCormack
@cmccormack
Jul 11 2018 20:33
perfect in that it works for me, sometimes
Kyle Holm
@thekholm80
Jul 11 2018 20:33
lol
Ahmed Tarek
@ahmedtarek2134
Jul 11 2018 20:34
i like parcel so much
but at the same time i prefer webpack's control
Kyle Holm
@thekholm80
Jul 11 2018 20:34
i had the perfect webpack config once. then they updated webpack. stupid webpack
Ahmed Tarek
@ahmedtarek2134
Jul 11 2018 20:34
i think a serious project should be with webpack
wait a second
is @diomed the only croatian that doesn't have a name ending with ić????
the whole team is modric, rakitic, mandzukic, perisic
croatia woonnnn
@diomed congratulations kitten
they in the final
Kyle Holm
@thekholm80
Jul 11 2018 20:38
maybe it's really diomedic but he shortened it
Ahmed Tarek
@ahmedtarek2134
Jul 11 2018 20:38
you never know πŸ€·β€β™‚οΈ
Mehdi Amlal
@mehdiamlal
Jul 11 2018 21:19
Hey guys! I've just finished a course about React basics. Since I'm a self-taught programmer and I wanted to learn about algorithms, data structures, and other CS principles. Is CS50 good for this?
Christopher McCormack
@cmccormack
Jul 11 2018 21:20
@mehdiamlal Is that the Harvard course?
I took that many years ago, it was very good
Mehdi Amlal
@mehdiamlal
Jul 11 2018 21:21
Yes it is
Would you recommend it?
Kyle Holm
@thekholm80
Jul 11 2018 21:21
@cmccormack they've updated it, and added 2 more. i want to do them all
i did the original a few years ago, it was awesome
Christopher McCormack
@cmccormack
Jul 11 2018 21:22
Yes I would recommend it. Even with a CS degree it was fairly challenging and that's a good thing
Mehdi Amlal
@mehdiamlal
Jul 11 2018 21:22
CS50?
@thekholm80 cs50?
Kyle Holm
@thekholm80
Jul 11 2018 21:22
yes
Mehdi Amlal
@mehdiamlal
Jul 11 2018 21:22
@thekholm80 They've added three more
Kyle Holm
@thekholm80
Jul 11 2018 21:23
i remember one for web dev and one for game dev
what's the 3rd new one?
mobile?
Mehdi Amlal
@mehdiamlal
Jul 11 2018 21:23
And another about rect native
Kyle Holm
@thekholm80
Jul 11 2018 21:23
oh, nice
Mehdi Amlal
@mehdiamlal
Jul 11 2018 21:24
It's cool because they invited Facebook engineers to do a few lectures
So would you recommend it guys? Cause many friends of mine have told me that it blew their minds
Kyle Holm
@thekholm80
Jul 11 2018 21:25
yes
Christopher McCormack
@cmccormack
Jul 11 2018 21:25
@mehdiamlal listen to your friends
it's free isn't it? Might as well give it a try
Kyle Holm
@thekholm80
Jul 11 2018 21:25
do the basic one first
there's a lot of fundamentals in there, and a high-level view of programming
Christopher McCormack
@cmccormack
Jul 11 2018 21:26
The one I did was with Python - that the basic one?
Kyle Holm
@thekholm80
Jul 11 2018 21:26
yeah
you start with scratch, then c, then python iirc
Christopher McCormack
@cmccormack
Jul 11 2018 21:26
I guess I could just go look it up... :)
Kyle Holm
@thekholm80
Jul 11 2018 21:26
btw i hate scratch lol
Mehdi Amlal
@mehdiamlal
Jul 11 2018 21:29
@thekholm80 I started hating carts because of it lmao
Kyle Holm
@thekholm80
Jul 11 2018 21:30
carts?
Mehdi Amlal
@mehdiamlal
Jul 11 2018 21:30
cats*
Kyle Holm
@thekholm80
Jul 11 2018 21:31
oh lol
hating cats isn't allowed, sorry
Kyle Holm
@thekholm80
Jul 11 2018 21:54
man, CenturyLink is not having a good day