These are chat archives for FreeCodeCamp/HelpFrontEnd

19th
Jun 2018
Stephen
@stephepush
Jun 19 2018 02:55

Dear god: has anyone figured out the Basic Algorithm Scripting: Slice and Splice exercise?
I can get it to return the answer, but only as a value for arr2:

function frankenSplice(arr1, arr2, n) {
  // It's alive. It's alive!
  var arr2 = arr2.splice(n, 0, ...arr1);

  return arr2;
}

frankenSplice([1, 2, 3], [4, 5, 6], 1);

But the prompt asks that the two original arrays not be modified. Okay, I try assigning the expression to a new var, arr3, and all I get is [ ]:

function frankenSplice(arr1, arr2, n) {
  // It's alive. It's alive!
  var arr3 = arr2.splice(n, 0, ...arr1);

  return arr3;
}

frankenSplice([1, 2, 3], [4, 5, 6], 1);

Can anyone nudge me in the right direction with this? It’s driving me nuts!

Tom
@moT01
Jun 19 2018 03:16
this is from mdn...
var myFish = ['angel', 'clown', 'drum', 'mandarin', 'sturgeon'];
var removed = myFish.splice(3, 1);

// removed is ["mandarin"]
// myFish is ["angel", "clown", "drum", "sturgeon"]
@stephepush
so when you call arr2.splice it modifies the original one like in the example there
you need to find a way to maybe copy the original arr2 into a new variable arr3 without modifying arr2 then calling your splice on arr3
Stephen
@stephepush
Jun 19 2018 03:21
mmm hmmm….
Tom
@moT01
Jun 19 2018 03:22
nudge
Stephen
@stephepush
Jun 19 2018 03:24
Definitely, but I mean I kinda already concluded that to be one (of possible many) solutions… back to thinking :)
Tom
@moT01
Jun 19 2018 03:25
two steps
copy array
modify new array
Stephen
@stephepush
Jun 19 2018 03:29
Yes, I think I see where you’re going. Think I have to look at my notes from JavaScript: Understanding the weird parts… how to make two variable stop referencing the same space in memory, perhaps?
Tom
@moT01
Jun 19 2018 03:32
javascript clone array (I'm feeling lucky)
Stephen
@stephepush
Jun 19 2018 03:34
Just finished googling, lol, duh. brb
Ha! It worked. I shouldve known that slice was suggested as a tool for good reasoning, lol
Thanks, @moT01
Tom
@moT01
Jun 19 2018 03:37
:thumbsup:
google is your friend
Stephen
@stephepush
Jun 19 2018 03:37
Sure, but I didn’t even think of using slice as a mechanism to cop
Tom
@moT01
Jun 19 2018 03:37
or sometimes you can try bing when you want to google something
Stephen
@stephepush
Jun 19 2018 03:37
copy
at least in that way
I was thinking of slapping .slice on the end of the arr2.splice(n, 0, ….) stuff
I slapped .map on the end of an expression with a method the other night and that was the way to do it… was thinking of method chaining, if that’s a thing, I guess...
Bing… good for microsoft rewards ;)
mpmaan
@mpmaan
Jun 19 2018 03:40
I can't pass the last test of this test. any suggestion?
  const resultDisplayArray = [];
  for(let i = 0; i < result.failure.length; ++i){
    resultDisplayArray.push(`<li class="text-warning">${result.failure[i]}</li>`);
  }
Tom
@moT01
Jun 19 2018 03:41
i saw a youtube video that said 3 of the top 6 searches in bing were google googgle goggle
little fun fact
mpmaan
@mpmaan
Jun 19 2018 03:41
haha
@stephepush if someone creates a script to search random things all day on bing, will that give reward points
?
Stephen
@stephepush
Jun 19 2018 03:43
@mpmaan, people have been trying to make stuff like that for years now, but microsoft figures out the patterns and ban people
there may be better scripts now, but Instead of taking the risk, I use bing to look at their popular news suggestions and to search MDN
mpmaan
@mpmaan
Jun 19 2018 03:44
yeah, something is better than nothing
Tom
@moT01
Jun 19 2018 03:44
what can you get with microsoft rewards
Stephen
@stephepush
Jun 19 2018 03:45
giftcards, and passes
mpmaan
@mpmaan
Jun 19 2018 03:45
some apps for free from microsoft store i guess
Stephen
@stephepush
Jun 19 2018 03:45
Amazon giftcards, target giftcards, 25 dollar hulu passes, multi month xbox passes
mpmaan
@mpmaan
Jun 19 2018 03:45
this conversation is triggering me to switch back to windows
Stephen
@stephepush
Jun 19 2018 03:46
skype, chipotle, starbucks
You can do the searches on any platform
mpmaan
@mpmaan
Jun 19 2018 03:46
so i just have to change search engine of browser?
Stephen
@stephepush
Jun 19 2018 03:46
although you can get 20 extra points a day if you use something that can run edge (theres an edge app for iPads)
@mpmaan, yeah, you could. There’s a lot of ways you can do it. Bing still is inferior to google...
maybe install a secondary browser and set its search engine to bing
Tom
@moT01
Jun 19 2018 03:48
woohoo - a 5$ gift card to chipotle
mpmaan
@mpmaan
Jun 19 2018 03:48
will try it if it doesn't give biased result or flood me with ads...currently is use duckduckgo
what's chipotle?
Tom
@moT01
Jun 19 2018 03:48
fast food chain
mpmaan
@mpmaan
Jun 19 2018 03:49
lol , did you look into the challenge problem i was facing?
Tom
@moT01
Jun 19 2018 03:49
yea
im not quite sure what the problem is yet
i really struggled with the es6 stuff
not because I didn't know how to do it
mpmaan
@mpmaan
Jun 19 2018 03:50
it is also not mentioned in the example code how to use ${}
Tom
@moT01
Jun 19 2018 03:51
i put a couple complaints on this issue about this freeCodeCamp/freeCodeCamp#17379
just on how difficult this section is
Stephen
@stephepush
Jun 19 2018 03:52
@mpmaan I’d recomend you use brave as your primary browser, but thats just me
Tom
@moT01
Jun 19 2018 03:53
cause it looks like your code should pass - but gimme a second, ill take a closer look
Stephen
@stephepush
Jun 19 2018 03:54
brave disables a lot of tracking stuff. I use it primarily to watch youtube without having to watch wix commercials ever 2 minutes
Lallo Vigil
@lalov1
Jun 19 2018 03:54
@zhouxiang19910319 Yes, that is correct
mpmaan
@mpmaan
Jun 19 2018 03:54
my adblocker blocks everything i wish to block
Tom
@moT01
Jun 19 2018 03:56
try using a .map()
mpmaan
@mpmaan
Jun 19 2018 03:57
@stephepush it's kinda difficult to migrate from google
@moT01 this is the test string if it helps
"testString": "getUserInput => assert(getUserInput('index').match(/\\<li class=\"text-warning\">\$\{\w+\}<\/li>\/g), 'Template strings were used');" }
Tom
@moT01
Jun 19 2018 03:58
i got it to pass using .map
did you do the grid challenges?
mpmaan
@mpmaan
Jun 19 2018 04:03
css grid?
Tom
@moT01
Jun 19 2018 04:04
yes
mpmaan
@mpmaan
Jun 19 2018 04:04
yeah, i did complete them
why are you asking about that?
Tom
@moT01
Jun 19 2018 04:05
just curious, are they any good?
mpmaan
@mpmaan
Jun 19 2018 04:06
i didn't know about css-grid before attempting them..so , they were helpful for me...i don't know how much you already know about css-grid
Stephen
@stephepush
Jun 19 2018 04:07
I did the grid exercises, they were okay at informing you about what you can do with grid. The responsive projects will help you use grid
mpmaan
@mpmaan
Jun 19 2018 04:08
@moT01 you can first read the challenge names on the curriculum page for the css-grid topics
If you encounter something you haven't heard of then complete that specific challenge
Tom
@moT01
Jun 19 2018 04:10
:smile:
a buddy and i made them
along with the ones on css variables
  • pats self on back
Stephen
@stephepush
Jun 19 2018 04:11
Oh...
You gotta get your head around grid and flexbox, its got a learning curve but its so much better than making your html, js and CSS a mess with bootstrap. I guess it also requires planning layout ahead of time too
Tom
@moT01
Jun 19 2018 04:13
i feel the same way
if your gonna use bootstrap you gotta go like 90+% bootstrap
mpmaan
@mpmaan
Jun 19 2018 04:13
lol..so you were asking for feedback
Tom
@moT01
Jun 19 2018 04:14
the few times I did use bootstrap it was like - well, I applied this class, now I just gotta make this change - and that change - and this change to that other class, and by the time you're done youre like, I should have just done pure css
Stephen
@stephepush
Jun 19 2018 04:14
There’s a lot of complaining in the FCC subreddit, but I like the new updates to the curriculum. There was a LOT missing from the old version. Algorithms just suddenly jumped into functional programming, is one example
Jesse
@ki4jgt
Jun 19 2018 04:14
How do I replace all 3-digit numbers in a page with hyperlinks which include those numbers? I've already tried: $(document).html($(document).html().replace(/\d{3}/g, '<a href = "/?call=$1">$1</a>'));
mpmaan
@mpmaan
Jun 19 2018 04:14
@moT01 you should add a challenge for calc() function in css
Tom
@moT01
Jun 19 2018 04:15
@mpmaan that actually entered my mind - cause I love that function
Stephen
@stephepush
Jun 19 2018 04:16
@moT01, I’m actually working through the responsive web design projects, and I wonder if I should go back to the grid examples in the curriculum or if I should just look stuff up on MDN, I choose MDN, but I think the curriculum is good at introducing possible tools to people
Tom
@moT01
Jun 19 2018 04:17
@stephepush yea, there's a lot that probly could be better - but it's tough to complain when it's all free and open source - i think everyone has done a pretty good job at creating the stuff
mpmaan
@mpmaan
Jun 19 2018 04:17
lol except for es6 i think
Tom
@moT01
Jun 19 2018 04:18
yea - i hear ya
Stephen
@stephepush
Jun 19 2018 04:18
what about es6?
Tom
@moT01
Jun 19 2018 04:19
its just tough and not very straight forward
mpmaan
@mpmaan
Jun 19 2018 04:19
@moT01 i doubt about regex
Tom
@moT01
Jun 19 2018 04:19
and maybe too tough to be in that area of javascript - specifically if your a beginner
what @mpmaan
Stephen
@stephepush
Jun 19 2018 04:20
Yeah, I’ve been going through the es6 section (I jump to differing sections), and man is the language vague. I kinda wonder if its intentionally that way?
Or if the team just didn’t have as much time as they needed to flesh the section out correctly
mpmaan
@mpmaan
Jun 19 2018 04:20
wait a minute
Tom
@moT01
Jun 19 2018 04:20
i think whoever built those challenges was just thinking too hard/ knew too much
Stephen
@stephepush
Jun 19 2018 04:21
the destructuring stuff kinda seems esoteric relative to the amount whoever wrote it is trying to drive the concept home
Tom
@moT01
Jun 19 2018 04:21
you might be better off coming back to that section later - and doing some of the other ones first
mpmaan
@mpmaan
Jun 19 2018 04:21
 \\/
 \/
 \\"
 \"
what will each of these do?
Stephen
@stephepush
Jun 19 2018 04:22
This isn’t my first rodeo, I’ve been working through learning this stuff for the last 2 years
I know a little bit of something about a lot of different things
Tom
@moT01
Jun 19 2018 04:22
they are incomplete @mpmaan
mpmaan
@mpmaan
Jun 19 2018 04:22
i don't why \\ has been used in regex for test instead of \
\" should match a " character
Tom
@moT01
Jun 19 2018 04:23
the first one \/ will escape a / and the first \ = the start of a regex - but there's no stop it
acutally im wrong there
mpmaan
@mpmaan
Jun 19 2018 04:24
i forgot to wrap them in / and /
Tom
@moT01
Jun 19 2018 04:24
yes, youre right \" would match "
mpmaan
@mpmaan
Jun 19 2018 04:25
then what does \\" will do?
Tom
@moT01
Jun 19 2018 04:25
looks invalid to me
escapes an escaped "
mpmaan
@mpmaan
Jun 19 2018 04:26
ok
so why do we use \\$ instead of just using \$ to match a $ character
?
Tom
@moT01
Jun 19 2018 04:27
hmm
not sure
why do you use either
isnt /w to match a character
mpmaan
@mpmaan
Jun 19 2018 04:28
check this
/\<li class=\"text-warning\">\\$\\{\\w+\\}<\\/li>\\/g
for matching / of the closing li tag, \\/ has been used instead of \/
Stephen
@stephepush
Jun 19 2018 04:29
Lol, haven’t touched regex yet, so I guess this a good time for me to turn in and go to sleep. Thank you for the conversation and help tom and mpmaan
Tom
@moT01
Jun 19 2018 04:29
<li class=\"text-warning\">.*?<\/li>
/<li class=\"text-warning\">.*?<\/li>/g
i dont think you need to escape <
@stephepush you can pm me anytime you need help - or im hanging out in here often
mpmaan
@mpmaan
Jun 19 2018 04:31
thats the codepen's problem...it started with /\`
and another backtick was used later
Tom
@moT01
Jun 19 2018 04:32
i dont understand - what are you working on
mpmaan
@mpmaan
Jun 19 2018 04:32
sorry not codepen but gitter
whatever was contained within two backticks was converted into code because of markdown
Stephen
@stephepush
Jun 19 2018 04:33
@moT01: gotcha, thanks and goodnight
Tom
@moT01
Jun 19 2018 04:33
okay - start over for me - what are you trying to match
mpmaan
@mpmaan
Jun 19 2018 04:34
i'm trying to match my code example which failed the test with the regex for the test
Tom
@moT01
Jun 19 2018 04:34
just the / in the closing <li>?
mpmaan
@mpmaan
Jun 19 2018 04:34
i went to regexpal.com for checking why i failed the tesst
it was showing me that the regex for test is wrong
search for challenge named 'Create Strings using Template..' on
pick the last test case regex
and check if the regex is correct or not
i know i'm asking for too much here
Tom
@moT01
Jun 19 2018 04:38
yea, im not quite sure
most of the time regex is more of a how close you can get it than right or wrong
you can paste into a regex tester and see what it matches
mpmaan
@mpmaan
Jun 19 2018 04:41
thanks for your help...i'll look into it after i have completed regex challenges
Tom
@moT01
Jun 19 2018 04:43
:thumbsup: yea - i think im done for the night - you can pm me if you ever need any help - or im usually in here - or if you want to work on an issue together let me know
mpmaan
@mpmaan
Jun 19 2018 04:43
ok
though regex101 is also showing that regex for test is wrong
Tom
@moT01
Jun 19 2018 04:43
yea, i see that
give it a fix
abraham anak agung
@padunk
Jun 19 2018 04:44
@mpmaan what regex?
mpmaan
@mpmaan
Jun 19 2018 04:44
good night i'll see what i can do
habibaatify
@habibatify_twitter
Jun 19 2018 04:44
hello, can we make a form in Facebook and store that form data in our database?
mpmaan
@mpmaan
Jun 19 2018 04:45
@padunk regex or rgular expression is a combination of characters to match a pattern in text
@habibatify_twitter i have no idea about facebook forms
abraham anak agung
@padunk
Jun 19 2018 04:46
@mpmaan yeah, i know. i mean do you need any help with it?
mpmaan
@mpmaan
Jun 19 2018 04:47
lol..i could not pass the last test of this challenge
so i think that regex for test is wrong
here is my code
  // change code below this line
  const resultDisplayArray = [];
  for(let i = 0; i < result.failure.length; ++i){
    resultDisplayArray.push(`<li class="text-warning">${result.failure[i]}</li>`);
  }
  // change code above this line
i don't know enough about regex so can't fix it
abraham anak agung
@padunk
Jun 19 2018 04:49
@mpmaan your function accept the arr parameter, so you it as your length and as input for your li element
cause at the end of the code result.failure is already passed to your makeList function
const resultDisplayArray = makeList(result.failure);
mpmaan
@mpmaan
Jun 19 2018 04:50
ok..didn't see that
does this make sense
  // change code below this line
  const resultDisplayArray = [];
  for(let i = 0; i < arr.length; ++i){
    resultDisplayArray.push(`<li class="text-warning">${arr[i]}</li>`);
  }
  // change code above this line
abraham anak agung
@padunk
Jun 19 2018 04:55
@mpmaan yes.
mpmaan
@mpmaan
Jun 19 2018 04:55
but this fails as well
check this
abraham anak agung
@padunk
Jun 19 2018 04:58
@mpmaan well, it has nothing to do with regex. it just an object literal challenge
what is the error?
mpmaan
@mpmaan
Jun 19 2018 04:59
My code fails the test which says Template String were used
see line 930-931
zhouxiang19910319
@zhouxiang19910319
Jun 19 2018 05:01
@lalov1 thanks!!!
mpmaan
@mpmaan
Jun 19 2018 05:02
@padunk i think the presence of [ and ] in ${arr[i]}is causing this problem
abraham anak agung
@padunk
Jun 19 2018 05:02
@mpmaan change your for loop with map
mpmaan
@mpmaan
Jun 19 2018 05:02
lol ..that's just an alternative way to pass the challenge
abraham anak agung
@padunk
Jun 19 2018 05:02
idk how the test in fcc working, but both will give same result
kind of a bug :smile:
mpmaan
@mpmaan
Jun 19 2018 05:03
it is not mentioned that we should use map or any other function
with map [, ] willl not be used and test will pass i believe
abraham anak agung
@padunk
Jun 19 2018 05:04
yeah, it should tell us that we need to use map
mpmaan
@mpmaan
Jun 19 2018 05:04
thanks for your help..for now i'll use map just to see a green tick mark
abraham anak agung
@padunk
Jun 19 2018 05:12
@mpmaan :+1:
Marc
@MWBauer
Jun 19 2018 05:40
If I have my js file in a js folder I would only need to use js/file.js to link it to my html, correct?
Dhaval Vira
@dhavalveera
Jun 19 2018 05:41
Yes
Marc
@MWBauer
Jun 19 2018 05:41
lol Then...why doesn't it work?
Dhaval Vira
@dhavalveera
Jun 19 2018 05:41
your js folder should be in main directly
like main folder is HTML, then your js files should be in HTML Folder
Marc
@MWBauer
Jun 19 2018 05:45
OK, that's different from what a friend was saying. He puts all of his CSS in a CSS folder and all of his JS in a JS folder and then links them to HTML.
Dhaval Vira
@dhavalveera
Jun 19 2018 05:45
Yes
main folder HTML with Sub-folder CSS & JS & HTML Folder contains HTML Links
so be assure that you have given correct name of folder & js n CSS File
Marc
@MWBauer
Jun 19 2018 05:46
<!DOCTYPE html>
<html lang="en-US">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>8.7 Random Image Generator using Arrays</title>
    <link href="css/ranimg87.css" rel="stylesheet" type="text/css">
 </head>

    <body>
    <p>Click Refresh (or Reload) to run the script again</p>
        <script src="js/ranimg87.js"></script>
    </body>
    </html>
<!DOCTYPE html>
<html lang="en-US">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>8.7 Random Image Generator using Arrays</title>
    <link href="css/ranimg87.css" rel="stylesheet" type="text/css">
 </head>

    <body>
    <p>Click Refresh (or Reload) to run the script again</p>
        <script src="js/ranimg87.js"></script>
    </body>
    </html>
<style>
table {width: 15em}
th {text-align: left}
</style>
Dhaval Vira
@dhavalveera
Jun 19 2018 05:47
<style>
table {width: 15em}
th {text-align: left}
</style>
this is in .CSS file ?
Marc
@MWBauer
Jun 19 2018 05:48
yes
var pictures = ["CPE", "EPT", "GPP", "GUI", "PERF", "PORT", "SEO"];
//pick a random image from the pictures array and displays by crating an img tag and appending the src attributes to the filename
document.write("<img src = \"" + "87RanImg/fig08_07" + pictures[Math.floor(Math.random() * 7)] + ".gif\" />");

/*const arr = [
  "C:\Devfun\ServerTests\public\fig08_07\CPE.gif",
  "C:\Devfun\ServerTests\public\fig08_07\EPT.gif",
  "C:\Devfun\ServerTests\public\fig08_07\GPP.gif",
  "C:\Devfun\ServerTests\public\fig08_07\GUI.gif",
  "C:\Devfun\ServerTests\public\fig08_07\PERF.gif",
  "C:\Devfun\ServerTests\public\fig08_07\PORT.gif",
  "C:\Devfun\ServerTests\public\fig08_07\SEO.gif"
];

let oImg = document.createElement("img");
oImg.setAttribute('src', arr[Math.floor(Math.random()*7)])0.;
document.body.appendChild(oImg);*/
These are my 3 files. I don't know why they aren't coming together.
Dhaval Vira
@dhavalveera
Jun 19 2018 05:48
if you are using External CSS then you don't to write <style> </style> in External CSS file
it will not Execute it
Marc
@MWBauer
Jun 19 2018 05:48
It's not executing anything.
The last prog I did I had to have the <style> tag or it wouldn't work.
Can you see why I'm getting so confused?
I offer a caveat. When I run the html it does open a window and shows the <p> contents. But that's it
I took the <style> tag out and it still isn't doing anything.
I'm too tired to think about this.
I'm going to bed.
Have a good night.
Ali Bulut
@ali27001
Jun 19 2018 08:09
The auto-forwarding code in the explorer is not running
$(window).attr('location', 'anasayfa.html') not working
Claudio Restifo
@Marmiz
Jun 19 2018 09:10
@ali27001 depends on how you use it. Many browser will block it to prevent CORS issues
mpmaan
@mpmaan
Jun 19 2018 10:32
How to solve this challenge?
I have passed it but i think my solution is really bad.
abraham anak agung
@padunk
Jun 19 2018 10:51
@mpmaan i still didn't get that challenge :smile:
mpmaan
@mpmaan
Jun 19 2018 10:52
the previous one?
abraham anak agung
@padunk
Jun 19 2018 10:52
no, the regex one. capturing groups
mpmaan
@mpmaan
Jun 19 2018 10:53
password checker?
abraham anak agung
@padunk
Jun 19 2018 10:54
yup.
mpmaan
@mpmaan
Jun 19 2018 10:56
positive lookahead checks if the pattern before lookahead is followed by a required pattern
const reg = /b(?=c)/; This will check if b is followed byc
negative lookahead is kind checks if....not followed...
const reg = /b(?!c)/; this will check if b is not followed by c
so to check password length you can do const reg= /(?=\w{n})/;
this will check if an empty string "" is followed by n letters
and for checking digits const reg = /(?=\D\d)/;
mpmaan
@mpmaan
Jun 19 2018 11:02
this will check if an empty string "" is followed by characters that begin with non-digits and have atleast 1 digit after non-digit characters
then you combine them together const finalReg = /(?=\w{n})(?=\D\d)/;
@padunk did you understand something?
mpmaan
@mpmaan
Jun 19 2018 13:03
is anybody online?
Nate Mallison
@NJM8
Jun 19 2018 13:06
yes
mpmaan
@mpmaan
Jun 19 2018 13:07
in this challenge, it says that the value outputTwo will be printed twice but in my browser it gets printed only once.
I have no clue why is that happening
Nate Mallison
@NJM8
Jun 19 2018 13:11
I have no idea what they are talking about. things don't get logged twice
Marc
@MWBauer
Jun 19 2018 13:11
I think it's trying to tell you what you're doing
Nate Mallison
@NJM8
Jun 19 2018 13:11
maybe they are trying to highlight that when you run your code again it doesn't clear the console
so it appears as though it logged twice
unless you clear the console for each run
mpmaan
@mpmaan
Jun 19 2018 13:14
@MWBauer lol...what do you mean?
Marc
@MWBauer
Jun 19 2018 13:14
It's telling you that outputTwo is going to show up twice, but then you clear it, and you shouldn't see Two at all, then outputOne should display.
I was just trying this challenge and it's telling me my regex is wrong. lol I didn't use regex
mpmaan
@mpmaan
Jun 19 2018 13:15
but outputTwo is showing up only once...good luck with your regex haha
Nate Mallison
@NJM8
Jun 19 2018 13:16
tbh I would skip this one, seems broken and irrelevant
"Values passed to console.log() in the text editor block run each set of tests as well as one more time for any function calls that you have in you code."
Marc
@MWBauer
Jun 19 2018 13:16
:thumpsup:
:thumbsup:
I haven't typed since yesterday
Nate Mallison
@NJM8
Jun 19 2018 13:17
moral of the story, if it logs something twice be aware it's because the code was run in the browser and in the test suite
mpmaan
@mpmaan
Jun 19 2018 13:17
yeah that's good
Nate Mallison
@NJM8
Jun 19 2018 13:17
I don't like the new FCC. :worried:
mpmaan
@mpmaan
Jun 19 2018 13:18
how do you type emoji here?
Nate Mallison
@NJM8
Jun 19 2018 13:18
trying some of the Rosetta code challenges and they are much different or badly presented
:
Marc
@MWBauer
Jun 19 2018 13:18
How does one open the dev console?
Nate Mallison
@NJM8
Jun 19 2018 13:18
colon then a pop up will come
for emoji
mpmaan
@mpmaan
Jun 19 2018 13:18
right click and choose inspect @MWBauer
Marc
@MWBauer
Jun 19 2018 13:19
:thumbsup:
mpmaan
@mpmaan
Jun 19 2018 13:19
:thumbsup: @NJM8
Nate Mallison
@NJM8
Jun 19 2018 13:19
what browser? check your tools > or dev tools dropdown to see what shortcut it is
Marc
@MWBauer
Jun 19 2018 13:21
normalize.min.css.map error
mpmaan
@mpmaan
Jun 19 2018 13:22
what is that?
Marc
@MWBauer
Jun 19 2018 13:23
in the dev console that's what it's saying.
mpmaan
@mpmaan
Jun 19 2018 13:23
are you talking about debugging challenge?
Marc
@MWBauer
Jun 19 2018 13:24
Also, it looks like there are just 3 commands. I might be missing something. But you console.log(outputTwo), then console.clear(), then console.log(outputOne) and it should work.
But it isn't.
Yes
mpmaan
@mpmaan
Jun 19 2018 13:24
yeah, that works
but without console.clear() outputTwo should be printed twice
Marc
@MWBauer
Jun 19 2018 13:27
It's working for you?
mpmaan
@mpmaan
Jun 19 2018 13:28
nope
Marc
@MWBauer
Jun 19 2018 13:28
Ok. I just cleared all that I had done, and I ran the tests without typing anything. It still says invalid regex. I think it's broken.
Has anyone looked back and seen the files I posted and figured out why they aren't linking together?
mpmaan
@mpmaan
Jun 19 2018 13:29
i get this
// running test
Use console.log() to print the outputTwice variable.  In your Browser Console this should print out the value of the variable two times.
Use console.log() to print the outputOne variable.
Use console.clear() to modify your output so that outputOne variable only outputs once.
// tests completed
@MWBauer you should tell us about tour directory structure
like which folder contains which files
which folder contains your css and js folder?
Marc
@MWBauer
Jun 19 2018 13:34
I have an html folder. I have the html file in that folder. I have a subfolder for js and css. I have the corresponding files in those folders.
<!DOCTYPE html>
<html lang="en-US">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>8.7 Random Image Generator using Arrays</title>
    <link href="ranimg87.css" rel="stylesheet" type="text/css">
 </head>

    <body>
    <p>Click Refresh (or Reload) to run the script again</p>
        <script src="js/ranimg87.js"></script>
    </body>
    </html>
and that's my html file
mpmaan
@mpmaan
Jun 19 2018 13:35
wait a minute
that's working for me
Marc
@MWBauer
Jun 19 2018 13:40
What does it do?
mpmaan
@mpmaan
Jun 19 2018 13:40
you can check by putting body{background:red;} in your css file
I created an index.html file in Desktop folder and css folder in the Desktop folder.Then i created main.css file in css folder and linked it using href="css/main.css"
Marc
@MWBauer
Jun 19 2018 13:43
I put the red background in, but my images aren't coming up
/*var pictures = ["CPE", "EPT", "GPP", "GUI", "PERF", "PORT", "SEO"];
//pick a random image from the pictures array and displays by crating an img tag and appending the src attributes to the filename
document.write("<img src = \"" + "87RanImg/fig08_07" + pictures[Math.floor(Math.random() * 7)] + ".gif\" />");*/

const arr = [
  "C:\Devfun\ServerTests\public\fig08_07\CPE.gif",
  "C:\Devfun\ServerTests\public\fig08_07\EPT.gif",
  "C:\Devfun\ServerTests\public\fig08_07\GPP.gif",
  "C:\Devfun\ServerTests\public\fig08_07\GUI.gif",
  "C:\Devfun\ServerTests\public\fig08_07\PERF.gif",
  "C:\Devfun\ServerTests\public\fig08_07\PORT.gif",
  "C:\Devfun\ServerTests\public\fig08_07\SEO.gif"
];

let oImg = document.createElement("img");
oImg.setAttribute('src', arr[Math.floor(Math.random()*7)])0.;
document.body.appendChild(oImg);
mpmaan
@mpmaan
Jun 19 2018 13:44
did your background got red?
Marc
@MWBauer
Jun 19 2018 13:44
Neither method seems to show anything.
Yeah. Css is working.
That's a start. But what about js
mpmaan
@mpmaan
Jun 19 2018 13:44
lol..js file will work too..
comment everything in your js file
and put alert("hello");
Marc
@MWBauer
Jun 19 2018 13:45
`alert("hello"); ?
mpmaan
@mpmaan
Jun 19 2018 13:45
i just updated it ...it will display a popup
or you can put console.log("hello");
to check if js file is getting linked or not
Marc
@MWBauer
Jun 19 2018 13:47
Ok. Mine is still just red with the Click to reload line.
/*var pictures = ["CPE", "EPT", "GPP", "GUI", "PERF", "PORT", "SEO"];
//pick a random image from the pictures array and displays by crating an img tag and appending the src attributes to the filename
document.write("<img src = \"" + "87RanImg/fig08_07" + pictures[Math.floor(Math.random() * 7)] + ".gif\" />");*/

/*const arr = [
  "C:\Devfun\ServerTests\public\fig08_07\CPE.gif",
  "C:\Devfun\ServerTests\public\fig08_07\EPT.gif",
  "C:\Devfun\ServerTests\public\fig08_07\GPP.gif",
  "C:\Devfun\ServerTests\public\fig08_07\GUI.gif",
  "C:\Devfun\ServerTests\public\fig08_07\PERF.gif",
  "C:\Devfun\ServerTests\public\fig08_07\PORT.gif",
  "C:\Devfun\ServerTests\public\fig08_07\SEO.gif"
];

let oImg = document.createElement("img");
oImg.setAttribute('src', arr[Math.floor(Math.random()*7)])0.;
document.body.appendChild(oImg);*/

`alert("hello");
mpmaan
@mpmaan
Jun 19 2018 13:47
lol remove that backtick before alert
Marc
@MWBauer
Jun 19 2018 13:47
There are 2 methods to display these pics and neither is coming up. The hello alert isn't coming up.
You're killing me, smalls.
mpmaan
@mpmaan
Jun 19 2018 13:48
haha..i did say that i just updated the code
of my comment
Marc
@MWBauer
Jun 19 2018 13:48
still nothing.
Changed to console.log("hello"); and that isn't coming up.
mpmaan
@mpmaan
Jun 19 2018 13:49
did you check browser console?
Marc
@MWBauer
Jun 19 2018 13:50
this is the line.
Loading failed for the <script> with source “file:///C:/Devfun/ServerTests/public/html/(%22js/ranimg87.js%22)”.
why does it do the file:/// ?
mpmaan
@mpmaan
Jun 19 2018 13:52
file:/// is a protocol for serving files like http:// is for serving webpages
can you check the name of your folder
Marc
@MWBauer
Jun 19 2018 13:53
ok. thanks.
I thought maybe i had added extra code somewhere without realizing it.
mpmaan
@mpmaan
Jun 19 2018 13:53
maybe you wrote it js instead of js
lol..maybe a space character before folder name is present
Marc
@MWBauer
Jun 19 2018 13:53
Yeah.
No.
Just renamed to be sure.
C:\Devfun\ServerTests\public\html
under that is js and css and my pic folder fig08_07
mpmaan
@mpmaan
Jun 19 2018 13:54
where is the pic folder?
Marc
@MWBauer
Jun 19 2018 13:54
same level as css and js
mpmaan
@mpmaan
Jun 19 2018 13:56
your directory is like public/html/js/ranimg87.js ?
make sure that there is no unnecessary space characters in folder and file names and the path that you have used in your html file
Marc
@MWBauer
Jun 19 2018 13:57
reight
mpmaan
@mpmaan
Jun 19 2018 13:59
i'm out of ideas now
Marc
@MWBauer
Jun 19 2018 14:00
and that's my aggravation. I do what it says to do and it doesn't work.
I know there's a key, there's something somewhere that's wrong, I know. I just don't know what it is. I just moved everything to the public folder and tried and now I'm disconnected from CSS>
mpmaan
@mpmaan
Jun 19 2018 14:01
figuring out such keys is our job
Marc
@MWBauer
Jun 19 2018 14:01
Right.
mpmaan
@mpmaan
Jun 19 2018 14:02
what is now in public directory?
html file, css and js folder?
Mark
@vinarius
Jun 19 2018 16:49
How's everyone doing with the new curriculum?
richRocksCodeBlocks
@richRocksCodeBlocks
Jun 19 2018 16:50
I'm getting tired of doing the record collection challenge. I've done it multiple times and for some reason it just wont save that particular challenge.
If I ever get it to stick and going to celebrate by playing with the Discogs api. LOL
Brad
@bradtaniguchi
Jun 19 2018 16:51
I got thru the new ES6 challenges, besides some things acting funny, I learned a few things. Going to start on the regex section next
richRocksCodeBlocks
@richRocksCodeBlocks
Jun 19 2018 16:52
Im halfway through the ES6, but I decided to backtrack a bit and complete the projects for the new certs.
I can tell that I have learned a lot. My new projects are looking much nicer. I'm really liking GridCSS
Mark
@vinarius
Jun 19 2018 16:55
Grid was pretty uncomfortable doing the tutorials. I think the next project I do I'm going to try to use SASS, react, and css grid to I can cement them in.
richRocksCodeBlocks
@richRocksCodeBlocks
Jun 19 2018 16:57
Wes Bos has a free video course on Grid. Working through that in addition to the FCC curriculum really helped me.
check it out here: https://cssgrid.io/
Mark
@vinarius
Jun 19 2018 16:58
Thanks. I understand it - it's just a lot to remember. Using it on a project is what will do the trick I think.
richRocksCodeBlocks
@richRocksCodeBlocks
Jun 19 2018 16:58
Yep, thats what work for me.
have you worked on the product landing page yet?
Mark
@vinarius
Jun 19 2018 17:00
Yeah. I completed the responsive web design cert. I have most of the javascript final algorithms done just from legacy content, but I am working through the front end library cert at the moment.
richRocksCodeBlocks
@richRocksCodeBlocks
Jun 19 2018 17:01
Is our email submit supposed to show something other than "there is no user by that name?" when sent to https://www.freecodecamp.com/email-submit
Mark
@vinarius
Jun 19 2018 17:01
I'll prob do the api one after that
Let me take a look
richRocksCodeBlocks
@richRocksCodeBlocks
Jun 19 2018 17:01
Same here. Im about half way through the ES6 but decided to backtrack and earn the new certs.
mpmaan
@mpmaan
Jun 19 2018 17:05
Bulding documentation page project is really boring
Mark
@vinarius
Jun 19 2018 17:06

So here is the user story:

User Story #12: When I click the #submit element, the email is submitted to a static page (use this mock URL: https://www.freecodecamp.com/email-submit) that confirms the email address was entered and that it posted successfully.

It appears to be a mock url that we are posting to. I don't think going to the url is going to show you anything. freecodecamp.com isn't a real domain anymore. It redirects to freecodecamp.org

So don't worry about the result on the server side. They are just looking for your action attribute to point to that mock url on your form.
mpmaan
@mpmaan
Jun 19 2018 17:07
yeah that's correct
richRocksCodeBlocks
@richRocksCodeBlocks
Jun 19 2018 17:07
@vinarius Thank you. Looks like ready to move on to my media queries .
Mark
@vinarius
Jun 19 2018 17:08
Nice man. :)
richRocksCodeBlocks
@richRocksCodeBlocks
Jun 19 2018 17:08
What are you documenting @mpmaan ?
mpmaan
@mpmaan
Jun 19 2018 17:09
haven't thought about it...been postponing for 4 days
initially i was going to build a copy of contributing guide of FCC
but that was really long
Does anybody know how to solve this challenge?
i passed it but my solution isn't good i think.
richRocksCodeBlocks
@richRocksCodeBlocks
Jun 19 2018 17:11
Just dive in. Document something that you use or that you would like to learn to use. maybe Slicksslider or something similar.
You would likely get a lot of hits on that page if you hosted it on Github. That could be cool.
mpmaan
@mpmaan
Jun 19 2018 17:12
i did use slick once for a project...that project has been pending for about a month lol
Brad
@bradtaniguchi
Jun 19 2018 17:12
what the heck is slick?
richRocksCodeBlocks
@richRocksCodeBlocks
Jun 19 2018 17:12
I used it on my Real Estate Site.
Slick Slider. The only slider you will ever need.
mpmaan
@mpmaan
Jun 19 2018 17:13
Slick is a carousel or image slider library
richRocksCodeBlocks
@richRocksCodeBlocks
Jun 19 2018 17:13
mpmaan
@mpmaan
Jun 19 2018 17:14
@richRocksCodeBlocks slick's documentation is kinda good already
richRocksCodeBlocks
@richRocksCodeBlocks
Jun 19 2018 17:15
It's better than many I agree.
But there where some things that where outdated at the time I was using it.
It was just an idea.
mpmaan
@mpmaan
Jun 19 2018 17:19
yeah which stimulates to think about other ideas
Brad
@bradtaniguchi
Jun 19 2018 17:21
Ah I see
Mark
@vinarius
Jun 19 2018 17:21
I was in the middle of the voting application when the new curriculum came out. I was kind of bummed that I won't get credit for it, but happy I don't have to clone pinterest now.
Brad
@bradtaniguchi
Jun 19 2018 17:23
I don't have the time/focus to do the projects anymore. Ive given up trying XD
mpmaan
@mpmaan
Jun 19 2018 17:23
haha...i started fcc in jan ...then stopped in between(a really wrong decision)...then started this month again
Brad
@bradtaniguchi
Jun 19 2018 17:24
I actually started like a year ago, when I was on vacation :P
mpmaan
@mpmaan
Jun 19 2018 17:24
if someone knows regex then please look into the link i provided
Mark
@vinarius
Jun 19 2018 17:25
check out regexr.com - maybe that will help
Brad
@bradtaniguchi
Jun 19 2018 17:25
If I go to it, I just get the challenge, what is your solution?
mpmaan
@mpmaan
Jun 19 2018 17:26
i wrote const regex = /^(\d+)\s\1\s\1$/;
it will pass the tests but if input is like 42, 42, 42, 3, it will fail
i wrote that regex considering the tests
Brad
@bradtaniguchi
Jun 19 2018 17:28
Yea, the end part doesn't seem right
mpmaan
@mpmaan
Jun 19 2018 17:28
and beginning part too..if input is 3, 10, 10, 10, 5 it will fail
Brad
@bradtaniguchi
Jun 19 2018 17:32
hmm, regexes are interesting, but I haven't done the challenge, and KNOW there's a better solution there, but I don't have it
mpmaan
@mpmaan
Jun 19 2018 17:32
thanks for your help
Brad
@bradtaniguchi
Jun 19 2018 17:34
In the time I messed around with it I have this:^(\d+\s?){3}$ but it ALSO accepts the 42, 42 input
my understanding is the {3}selects only 3 instances, but doesn't seem to be working as expected
I might try bashing my head against it during my lunch break, gotta get back to work :P
mpmaan
@mpmaan
Jun 19 2018 17:37
that challenge requires using \1 i guess
see the test cases
Brad
@bradtaniguchi
Jun 19 2018 17:40
Hmm,
mpmaan
@mpmaan
Jun 19 2018 17:41
what do you do at your job? @bradtaniguchi
Brad
@bradtaniguchi
Jun 19 2018 17:42
I'm a "software engineer" but I basically have been working on the front-end
mpmaan
@mpmaan
Jun 19 2018 17:42
cool
wanna try one more question?..i've spent more than an hour on this one
Brad
@bradtaniguchi
Jun 19 2018 17:43
Haha, if I can't figure it out in like 2 mins I will have to say so, cant get too distracted :P
mpmaan
@mpmaan
Jun 19 2018 17:43
no problem
here it is
Brad
@bradtaniguchi
Jun 19 2018 17:46
Yea that one I haven't done (As I said earlier I only started the new FCC stuff) but that one mixes in some new ES6 stuff I'm not very good at, so I couldn't help you in my allotted 2 minutes unfortunantly haha
mpmaan
@mpmaan
Jun 19 2018 17:46
lol..thanks
i have to sleep as well
Brad
@bradtaniguchi
Jun 19 2018 17:49
Ill check out the spread-operator one on my lunch break (which is in a few hours) and see if I can figure it out, so if you ask me tomorrow (if you remember, and didn't figure it out) I MIGHT have the solution haha
Or at least be able to point you in the right direction
Moisés Man
@moigithub
Jun 19 2018 17:49
a=[1,2,3]
copyOfa=[...a]
mpmaan
@mpmaan
Jun 19 2018 17:51
i know how to use spread operator and copy array but don't know how to combine them for this challenge @moigithub
Brad
@bradtaniguchi
Jun 19 2018 17:51
@moigithub If you got time/ finished the challenge already some insight would be nice :D
Moisés Man
@moigithub
Jun 19 2018 17:52
check the test cases ?
copyMachine([true, false, true], 2) should return[[true, false, true], [true, false, true]]
mpmaan
@mpmaan
Jun 19 2018 17:52
lol i did see them..seems kinda easy but i'm stuck
Moisés Man
@moigithub
Jun 19 2018 17:53
soo basiclly u need to "push" n copies of that array passed
the loop is already there
mpmaan
@mpmaan
Jun 19 2018 17:54
lol i just finished it :sunglasses:
Brad
@bradtaniguchi
Jun 19 2018 17:54
hahaha
mpmaan
@mpmaan
Jun 19 2018 17:54
i wrote newArr[num - 1] = [...arr]
@moigithub if there is any other way then i'm interested
Moisés Man
@moigithub
Jun 19 2018 17:55
push, unshift, assign operator, concat
u can use any of those to add elements to the array
newArr.push([...arr])
newArr.unshift([...arr])
newArr=newArr.concat([...arr])
mpmaan
@mpmaan
Jun 19 2018 17:56
i tried push() but i couldn't use spread operator ...this will work numArr.push(arr) but there is no spread operator
thanks @moigithub
Moisés Man
@moigithub
Jun 19 2018 17:56
cuz arr contains same reference to the one being passed.. to make a real copy u need to use spread op
Brad
@bradtaniguchi
Jun 19 2018 17:58
I feel stupid :P
mpmaan
@mpmaan
Jun 19 2018 17:59
there will always be someone superior than you at a given point of time
Moisés Man
@moigithub
Jun 19 2018 17:59
arrays and objects holds "memory location pointer"
soo when u do arr1 = arr2 basicly u copying the memory location instead of its values
Brad
@bradtaniguchi
Jun 19 2018 18:05
Yea, but I should figured it out yo XD
like this BS: NaN === NaN // false
Mark
@vinarius
Jun 19 2018 18:36
or typeof(NaN) //number
Brad
@bradtaniguchi
Jun 19 2018 18:54
I ended-up usingNumber.isNaN(whatImChecking)caught me off guard tho
Aita Kane
@aita-kane
Jun 19 2018 19:44
hello can someone help me with my dropdown please. I code the menu and and the container and content of my dropdown, but the problem is when I hover on "Mon panier" , I want the dropdown to be visible . Can someone help me with please ? the codepen link : https://codepen.io/akane96/pen/qKxqWE
richRocksCodeBlocks
@richRocksCodeBlocks
Jun 19 2018 20:11
@aita-kane Have you seen this example? https://www.w3schools.com/Css/css_dropdowns.asp
Nate Mallison
@NJM8
Jun 19 2018 21:06
@bradtaniguchi NaN === NaN // false makes sense if you think about it as it's something that is not a number, you don't know what it is but it isn't a number
try typeof NaN if you really want to mess with your head
Brad
@bradtaniguchi
Jun 19 2018 21:09
My head has been messed with enough already today XD
Nate Mallison
@NJM8
Jun 19 2018 21:10
lol
Alexander R Bott
@Abott1222
Jun 19 2018 21:35
anyone play with webassembly? Is it worth coding the web in python yet? :P