These are chat archives for FreeCodeCamp/Help

11th
Aug 2017
Coy Sanders
@coymeetsworld
Aug 11 2017 00:00
strings are immutable yes, which is probably the reason toUpperCase doesn't mutated the string @Gersho
dyon3334
@dyon3334
Aug 11 2017 00:00
this is the task it have to capitalize each first letter of the word of a sentence
Coy Sanders
@coymeetsworld
Aug 11 2017 00:01
@dyon3334 I know what task it is, I outlined several problems you have with your code. Have you had a chance to read them yet?
dyon3334
@dyon3334
Aug 11 2017 00:01
yes but i dont understand im sorry
Coy Sanders
@coymeetsworld
Aug 11 2017 00:01
also look at the code I wrote above too
dyon3334
@dyon3334
Aug 11 2017 00:01
i dont understand what immutable is
Coy Sanders
@coymeetsworld
Aug 11 2017 00:01
it means it can't be changed
might be good to review those
if you haven't coded in a while you may want to refresh yourself on these
dyon3334
@dyon3334
Aug 11 2017 00:04
@coymeetsworld thanks !!!!
CamperBot
@camperbot
Aug 11 2017 00:04
:warning: dyon3334 already gave coymeetsworld points
dyon3334 sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
Coy Sanders
@coymeetsworld
Aug 11 2017 00:04
np
Gersho
@Gersho
Aug 11 2017 00:07
https://codepen.io/Gersho/pen/weVQjr
any bug or something i missed ?
(you can check console log if you don't want to memorize)
Drew Amandolia
@amandolia
Aug 11 2017 00:12
Hey guys and gals. I'm having a hard time formatting a <ul> element. Here is the codepen for the site --> https://codepen.io/amandolia/full/dzWPYB/
I tried making a style that did it but I'm trying to find out where I went worng
Coy Sanders
@coymeetsworld
Aug 11 2017 00:17
you should put your style in the CSS pane @amandolia
and can you be more specific on how you want to format?
Drew Amandolia
@amandolia
Aug 11 2017 00:18
When I put it in the CSS pane it deletes all of my changes for some reason. And I just want it to be centered like the example --> https://codepen.io/FreeCodeCamp/full/NNvBQW/
Coy Sanders
@coymeetsworld
Aug 11 2017 00:19
it shouldn't
Drew Amandolia
@amandolia
Aug 11 2017 00:20
I still had <style></style> around it! That's why. Still can't figure out the <ul> though
Gersho
@Gersho
Aug 11 2017 00:20
<center> doesn't do it ?
Coy Sanders
@coymeetsworld
Aug 11 2017 00:21
don't use center tags
they're deprecated
probably best way is to put the list inside a div, and center that div
Drew Amandolia
@amandolia
Aug 11 2017 00:22
When I searched it said <center> wasn't good to use
Gersho
@Gersho
Aug 11 2017 00:22
@coymeetsworld oh ok, didn't know
and like 1 hour ago i could have fixed my quote machine before sending it D/
Coy Sanders
@coymeetsworld
Aug 11 2017 00:23
centering div won't work exactly the way you want it either so nvm on that
Kyle Holm
@thekholm80
Aug 11 2017 00:24
@Gersho you can still update it after you turn it in
Gersho
@Gersho
Aug 11 2017 00:24
@thekholm80 guess i'll do that after eating then, thanks
CamperBot
@camperbot
Aug 11 2017 00:24
gersho sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1437 | @thekholm80 |http://www.freecodecamp.com/thekholm80
Drew Amandolia
@amandolia
Aug 11 2017 00:25
Yeah it's got me stumped. I read around and checked the example code and just don't get why my list displays differently.
akosuadenell
@akosuadenell
Aug 11 2017 00:47

<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

<link href="https://fonts.googleapis.com/css?family=Slabo" rel="stylesheet" type="text/css">

<div class="silver-background">
<head>
<title>
Angela Davis
</title>

</head>
<center><h2 class="black-text">Angela Yvonne Davis</h2></center>
<center>
<h1>A One of A Kind Revolutionary Woman</h1><img src="http://legacy.shadowandact.com/wp-content/uploads/2016/05/Angela-Davis-.jpg" width="600" height="600" alt="angela davis"></center>
<center><p>Click <a href="http://www.blackpast.org/aah/davis-angela-1944-0">Here </a>to learn more about Angela</p></center>
<h1> Key Facts</h1>
<ul>
<li>Born January 26, 1944</li>
<li>Studied at Brandeis University</li>
<li>Professor at ULCA</li>
<li>Black Panther</li>
<li>Revolutionary Woman</li>
</ul>
</div>

.silver-background {background-color: silver}
.black-text {
color: black;
}
h2
{font-size: 80px;
font-family: Lobster;}

ul{
text-align:left;
list-style-type:none;
border-left:5px solid red;
font-family: 28px slabo serif;

}

h1{
text-align:center;

}

li{
font-family: "Slabo", serif;
}
p
{
font-family:"Slabo", serif;
}

is my code
Coy Sanders
@coymeetsworld
Aug 11 2017 00:48
you don't need to post the code @akosuadenell you just need the codepen link
akosuadenell
@akosuadenell
Aug 11 2017 00:48
I am trying to change the font on my <li> and <p> but its not updaing
Coy Sanders
@coymeetsworld
Aug 11 2017 00:48
you don't have autosave on, so you have to click the run button each change
akosuadenell
@akosuadenell
Aug 11 2017 00:48
can you tell me why it isnt updating?
yes I tried that but it still isnt changing
Coy Sanders
@coymeetsworld
Aug 11 2017 00:49
I'm not familiar with the Slabo font, did you get that from somewhere?
oh wait i see it
akosuadenell
@akosuadenell
Aug 11 2017 00:49
yes google fonts
Coy Sanders
@coymeetsworld
Aug 11 2017 00:51
one thing is you don't use the type text/css
akosuadenell
@akosuadenell
Aug 11 2017 00:51
can you explain?
Coy Sanders
@coymeetsworld
Aug 11 2017 00:53
don't use type there
also I don't think that's the exact name
you need to use 13px or 27px probably
sigh
wnghero
@wnghero
Aug 11 2017 01:45
i need help with a JS problem if someone could dm me
Gulsvi
@gulsvi
Aug 11 2017 01:49
I can try to help @wnghero
wnghero
@wnghero
Aug 11 2017 01:50
@SkyC0der
"You've been given a string named waldoString. Waldo will be hiding in it somewhere. Return the index of where in the string 'Waldo' starts."
function findWaldo(str) {
var waldoPosition;
// Code below here
waldoString.indexOf('Waldo');
return waldoPosition;
}
_
this was suppose to be the hint
Gulsvi
@gulsvi
Aug 11 2017 01:52
@wnghero Have you studied regular expressions by chance?
wnghero
@wnghero
Aug 11 2017 01:54
nope
Gulsvi
@gulsvi
Aug 11 2017 01:54
I don't think it's necessary, but the main issues I see are that you don't assign anything to waldoPosition
And you are using waldoString but should be using str
So, it would just be:
function findWaldo(str) {
  var waldoPosition;
  // Code below here
  waldoPosition = str.indexOf("Waldo");
  return waldoPosition;
}
wnghero
@wnghero
Aug 11 2017 02:07
@SkyC0der OMG
@SkyC0der thank you you're a god
CamperBot
@camperbot
Aug 11 2017 02:07
wnghero sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2360 | @skyc0der |http://www.freecodecamp.com/skyc0der
wnghero
@wnghero
Aug 11 2017 02:08
ive been stuck for 3 hours!
Gulsvi
@gulsvi
Aug 11 2017 02:08
lol, just some small stuff - you're welcome @wnghero
Good thing we didn't need regular expressions for that one :)
can someone help me check where i got it all wrong
Claudio Restifo
@Marmiz
Aug 11 2017 02:44
@aisolae how are you serving those files? When you open up the HTML page, have you got some error in the console, like a 404 for not finding the css and js files?
Ai rui 艾瑞
@aisolae
Aug 11 2017 02:46
got no error but feel something is wrong
Claudio Restifo
@Marmiz
Aug 11 2017 02:46
@aisolae you have no jquery installed anywhare for example. is served somewhere else?
You should see a $ is undefined error in the console, at least
wnghero
@wnghero
Aug 11 2017 03:04
Create a shopping list in the variable myList. The list should be a multi-dimensional array containing several sub-arrays.
var myList = [ ["chocolate", 1] ["ice cream", 2] ["nuts", 3] ["jimmies", 4] ["rustled", 5] ];
what am i doing wrong?
nvm xhibit helped me i need more arrays in my arrays
Albert Cardona II
@daddycardona
Aug 11 2017 03:12
@ericmiller777 on the button do something like <button class="btn btn-default">Info</button>
@aisolae what is your github link?
or are you using codepen?
Bryan Reese
@breese8009
Aug 11 2017 03:16
hey guys, my images are local so their not working on code pen, but im gettin an error ---> "Cannot read property 'appendChild' of null
at createBoard"
i think my issue is in the flipCard function, lemme know if u see an issue https://codepen.io/brJitsu85/pen/mMwjMG?editors=1111
Albert Cardona II
@daddycardona
Aug 11 2017 03:18
where is your css that you are using?
it is failing to load that
for one
@breese8009
Russ Wilkie
@RussWilkie
Aug 11 2017 03:19
Quick question. I see the word 'Zipline' thrown around a lot for the CodePen project but could never find a clear definition of what Zipline is. Any clarity?
Albert Cardona II
@daddycardona
Aug 11 2017 03:21
I don't know that @RussWilkie
I have not seen it yet lol
wnghero
@wnghero
Aug 11 2017 03:25

Return the remaining elements of an array after chopping off n elements from the head.

The head means the beginning of the array, or the zeroth index.

function slasher(arr, howMany) {
// it doesn't always pay to be first
return arr;
}

slasher([1, 2, 3], 2);

so how would I do that? like slice the "n elements"?
Albert Cardona II
@daddycardona
Aug 11 2017 03:33
look at the hints n the list of methods they tell you to use :) that helped me alot just don't look at the answer you will be hurting yourself at the end @wnghero
wnghero
@wnghero
Aug 11 2017 03:33
yeah i read both the hint pages a few times i'm lost
Albert Cardona II
@daddycardona
Aug 11 2017 03:35
try using the slice method and see if that works try creating code and play with it :) then you would learn it I had the same issue but I tried first and had many errors lol
wnghero
@wnghero
Aug 11 2017 03:35
haha will do thanks man@
Albert Cardona II
@daddycardona
Aug 11 2017 03:36
no problem my main thing is do first fail and learn from the failures
wnghero
@wnghero
Aug 11 2017 03:36
wait youre doing to devmountain prep too?
Albert Cardona II
@daddycardona
Aug 11 2017 03:36
No I passed it
wnghero
@wnghero
Aug 11 2017 03:36
ahhhh ok nice
are you doing the dallas campus?
Albert Cardona II
@daddycardona
Aug 11 2017 03:37
I am about to redo my tribute page
wnghero
@wnghero
Aug 11 2017 03:37
maybe well see eachother haha
Albert Cardona II
@daddycardona
Aug 11 2017 03:37
dallas campus?
wnghero
@wnghero
Aug 11 2017 03:37
yeah november cohort
Albert Cardona II
@daddycardona
Aug 11 2017 03:37
no I am doing just fcc
Ai rui 艾瑞
@aisolae
Aug 11 2017 03:37
nothing much there , i will be sharing it later by next week. That's just discuss link
Bryan Reese
@breese8009
Aug 11 2017 03:39
@daddycardona no question with my css, its a js questions...css is loading property like it should
Albert Cardona II
@daddycardona
Aug 11 2017 03:42
well one thing where is your files?
images on your local computer
it says this.attribute is not a function
Albert Cardona II
@daddycardona
Aug 11 2017 03:54
where is your app.js at
if you have it on github you need to scr="fullpath to app.js"
@breese8009 if you constructed this on your local computer and then copy and pasted it to codepen then you need full paths to the src files that is what I am thinking
Gersho
@Gersho
Aug 11 2017 04:03
https://codepen.io/Gersho/pen/weVQjr
let me know about bugs or stuff i forgot
Joseph
@revisualize
Aug 11 2017 04:39

Node.js Design Patterns - Second Edition
https://www.packtpub.com/packt/offers/free-learning

That looks liek a good subject to learn.

DavyDrei
@dj4919
Aug 11 2017 04:55
can someone help me figure out how to make the shapes not appear on the border? (they dont always appear on the border and when ive tried changing the padding/margin of the container but the shapes sometimes appear on the border) https://codepen.io/dj4919/pen/XagBve
Bryan Reese
@breese8009
Aug 11 2017 04:56
@daddycardona what? that hasnt anything to do with my question man, i was asking about dom manipulation not about file paths
Gersho
@Gersho
Aug 11 2017 04:57
@dj4919 i don't think that' s a css issue, you should try changing your randoms for the shapes, so that it'll never do one close to a wall
DavyDrei
@dj4919
Aug 11 2017 04:58
you think reducing the sizes of the shapes in the js will help?
Gersho
@Gersho
Aug 11 2017 04:59
that's a solution too
is that a fcc challenge too ?
DavyDrei
@dj4919
Aug 11 2017 05:01
it worked thanks, and no haha this was issued from another web development educator
Udemy's complete web developers course to be exact
Gersho
@Gersho
Aug 11 2017 05:03
someone was asking for stuff on that challenge earlier too so i was wondering ^^
DavyDrei
@dj4919
Aug 11 2017 05:04
that was me also lol in the javascript chatroom i just modified the CSS
Gersho
@Gersho
Aug 11 2017 05:04
oh ok lol
Darren
@DarrenfJ
Aug 11 2017 05:12
evening fCC
Eric Miller
@ericmiller777
Aug 11 2017 05:15
@DarrenfJ hi
Darren
@DarrenfJ
Aug 11 2017 05:16
@ericmiller777 hey man :D
how goes it?
Eric Miller
@ericmiller777
Aug 11 2017 05:16
Hey you guys, so ive tryed atom and visual studio code, and i seem to prefer visual studio code (maybe because im used to using visual studio), but any reason i should use atom instead?
@DarrenfJ fine
@DarrenfJ wikipedia projects coming along
you can search but only with button
you doing alright?
Gersho
@Gersho
Aug 11 2017 05:18
i can't compare sorry, but i like atom
Darren
@DarrenfJ
Aug 11 2017 05:19
@ericmiller777 so far so good.. sorta trying out a few fCC projects... working on weather right now...
Eric Miller
@ericmiller777
Aug 11 2017 05:19
@DarrenfJ ah thats a fun one
Claudio Restifo
@Marmiz
Aug 11 2017 05:19
@ericmiller777 use whatever you like, the best tool for the job is the one that actually makes you productive
Ginger
@GingerChew
Aug 11 2017 05:20
Hey all! Can I get some constructive criticism on my project before I submit it? https://codepen.io/WatchConnorCode/pen/QMvoje
Darren
@DarrenfJ
Aug 11 2017 05:20
@ericmiller777 i haven't tried a lot of editors.. sorta started with sublime and stuck to it more or less
@Marmiz hey buddy! :D
Claudio Restifo
@Marmiz
Aug 11 2017 05:21
@DarrenfJ :wave:
Gersho
@Gersho
Aug 11 2017 05:21
i had a bit of trouble at first to make my own stylesheet, but once done it lookscoool
Darren
@DarrenfJ
Aug 11 2017 05:23
@ericmiller777 and mostly sublime only because i was doing a Udacity course and they recommended it and/or i think atom and atom was being funky downloading and installing
Manish Giri
@Manish-Giri
Aug 11 2017 05:30
@DarrenfJ :wave:
Darren
@DarrenfJ
Aug 11 2017 05:35
@Manish-Giri buddy! :D
what up brutha?
Manish Giri
@Manish-Giri
Aug 11 2017 05:47
ordered dominos, been 40 mins now, very annoying :angry:
@DarrenfJ
what's up your end
Ravi Kishore Thella
@ravikishorethella
Aug 11 2017 05:49
@Manish-Giri good news
Manish Giri
@Manish-Giri
Aug 11 2017 05:50
@ravikishorethella sup
Ravi Kishore Thella
@ravikishorethella
Aug 11 2017 05:50
@DarrenfJ :wave:
found operator-mono
Manish Giri
@Manish-Giri
Aug 11 2017 05:52
cool
:+1:
Joseph
@revisualize
Aug 11 2017 05:53
Note: I had an ex-coworker suggest https://www.gitbook.com/book/frontendmasters/front-end-handbook-2017/details to me for using to learn web development
Darren
@DarrenfJ
Aug 11 2017 05:53
@Manish-Giri this week ordered pizza pizza and they forgot pop.. waited an hour when they said they'd go back and get it and eventually walked dogs and picked it up myself.. that blew
Manish Giri
@Manish-Giri
Aug 11 2017 05:54
@DarrenfJ wow that sucked
Darren
@DarrenfJ
Aug 11 2017 05:55
@revisualize thanks for the reminder.. remembered that being passed around a while ago.. but looks liek they jazzed it up a bit now (only reviewed it quickly back then.. figured I'd give it another pass when i knew more)...
CamperBot
@camperbot
Aug 11 2017 05:55
darrenfj sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 4428 | @revisualize |http://www.freecodecamp.com/revisualize
Darren
@DarrenfJ
Aug 11 2017 05:55
probably as good a time as any to re-explore it
@Manish-Giri oh yah man, the local one (i moved last year) isn't as good as my old one... franchisee seems to be trying to save a coupla bux and it's even gone downhill the last year too lol!
but then.. my dogs needed the walk anyway
Manish Giri
@Manish-Giri
Aug 11 2017 06:09
lol
good for the :dog: s
Eric Miller
@ericmiller777
Aug 11 2017 06:10
<li id="testWiki" class="list-group-item btn btn-default" style="color: blue">test<span></li>
Darren
@DarrenfJ
Aug 11 2017 06:10
@Manish-Giri yah :fire: definitely had to maintain my calm
Eric Miller
@ericmiller777
Aug 11 2017 06:10
<li id="testWiki" class="list-group-item btn btn-default" style="color: blue">test</li>
im trying to append to that using jquery but seems i cant?
Darren
@DarrenfJ
Aug 11 2017 06:14
@ericmiller777 not sure what yer trying to do...
yer gonna force me to revisit the jQuery documentation ;)
@ericmiller777 you trying to append <spam> at the end of text test ?
Eric Miller
@ericmiller777
Aug 11 2017 06:17
i tryed that too
gibing the span an id
taht didnt seem to help
Darren
@DarrenfJ
Aug 11 2017 06:17
ha! just notice i wrote spam
spam ha!
:spam:
:hamster:
Claudio Restifo
@Marmiz
Aug 11 2017 06:18
@ericmiller777 you want to change the text of the li?
Eric Miller
@ericmiller777
Aug 11 2017 06:18
nevermind guys its just getting late
sorry to bother you lol
Darren
@DarrenfJ
Aug 11 2017 06:19
you should be able to do it with $( "#testWiki" ).append( "<span>" ); to give you the top line you posted...
<li id="testWiki" class="list-group-item btn btn-default" style="color: blue">test<span></li>
it is getting late
Eric Miller
@ericmiller777
Aug 11 2017 06:20
@DarrenfJ thanks
@Marmiz thanks
CamperBot
@camperbot
Aug 11 2017 06:20
ericmiller777 sends brownie points to @marmiz :sparkles: :thumbsup: :sparkles:
:star2: 1017 | @marmiz |http://www.freecodecamp.com/marmiz
Darren
@DarrenfJ
Aug 11 2017 06:20
@ericmiller777 i'm reading this cause i'm doing `.html' for myweather app; https://stackoverflow.com/questions/3015335/jquery-html-vs-append
so let's see what's the difference.. and realized it's too late to read this line and not go whaaaa?
Eric Miller
@ericmiller777
Aug 11 2017 06:21
I use append
Darren
@DarrenfJ
Aug 11 2017 06:21

"Whenever you pass a string of HTML to any of jQuery's methods, this is what happens:

A temporary element is created, let's call it x. x's innerHTML is set to the string of HTML that you've passed. Then jQuery will transfer each of the produced nodes (that is, x's childNodes) over to a newly created document fragment, which it will then cache for next time. It will then return the fragment's childNodes as a fresh DOM collection."

i need about 3 shots of Whiskey to read that
Eric Miller
@ericmiller777
Aug 11 2017 06:21
lol
Darren
@DarrenfJ
Aug 11 2017 06:22
thanks @Marmiz for helping too... :D
CamperBot
@camperbot
Aug 11 2017 06:22
darrenfj sends brownie points to @marmiz :sparkles: :thumbsup: :sparkles:
:star2: 1018 | @marmiz |http://www.freecodecamp.com/marmiz
Darren
@DarrenfJ
Aug 11 2017 06:27
was trying to see if there was some easy way to do an <img src="#" ...> and then use .html().replace('#" , [insert my url for weather icon]) to make it work but it's too late to figure it out also lol
ok gonna sneak off to bed probably
thanks to everyone hanging out, helping out, and still trying to make the gitter chats a community ;)
thanks @ericmiller777 @camperbot @Marmiz @Manish-Giri @ravikishorethella @Gersho
CamperBot
@camperbot
Aug 11 2017 06:31
darrenfj sends brownie points to @ericmiller777 and @camperbot and @marmiz and @manish-giri and @ravikishorethella and @gersho :sparkles: :thumbsup: :sparkles:
:cookie: 265 | @ericmiller777 |http://www.freecodecamp.com/ericmiller777
:cookie: 989 | @ravikishorethella |http://www.freecodecamp.com/ravikishorethella
:warning: darrenfj already gave marmiz points
:star2: 3379 | @camperbot |http://www.freecodecamp.com/camperbot
:cookie: 321 | @gersho |http://www.freecodecamp.com/gersho
:star2: 6397 | @manish-giri |http://www.freecodecamp.com/manish-giri
Darren
@DarrenfJ
Aug 11 2017 06:31
camperbot finally gets his due ;)
Eric Miller
@ericmiller777
Aug 11 2017 06:31
@DarrenfJ thanks you too
CamperBot
@camperbot
Aug 11 2017 06:31
ericmiller777 sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 1960 | @darrenfj |http://www.freecodecamp.com/darrenfj
Darren
@DarrenfJ
Aug 11 2017 06:32
@Manish-Giri after you hit 7K you get thrown into the fCC campfire as a sacrifice to newbie coders
Manish Giri
@Manish-Giri
Aug 11 2017 06:32
aww
ty @DarrenfJ
CamperBot
@camperbot
Aug 11 2017 06:32
manish-giri sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 1961 | @darrenfj |http://www.freecodecamp.com/darrenfj
Darren
@DarrenfJ
Aug 11 2017 06:32
like Vulcan in American Gods
Claudio Restifo
@Marmiz
Aug 11 2017 06:33
@DarrenfJ ty buddy <3
CamperBot
@camperbot
Aug 11 2017 06:33
marmiz sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 1962 | @darrenfj |http://www.freecodecamp.com/darrenfj
Manish Giri
@Manish-Giri
Aug 11 2017 06:33
@DarrenfJ I think you can do that with .attr()
$("img").attr("src", "link-to-image");
Darren
@DarrenfJ
Aug 11 2017 06:37
@Manish-Giri i just gave up and created a empty div with an ID and targetted that old school concatenating the string.. bah $("#weather-icon").html('<img id="weather-icon" src="' + data.weather[0].icon + '" alt="weather icon">')
Manish Giri
@Manish-Giri
Aug 11 2017 06:38
haha
Darren
@DarrenfJ
Aug 11 2017 06:38
but gonna save that snippet and see if I can play around tomorrow and refactor it
thank brutha
Manish Giri
@Manish-Giri
Aug 11 2017 06:38
:+1:
Mukul Agrawal
@mukul09
Aug 11 2017 07:04
is free code camp server down since yesterday?
stormfenris
@stormfenris
Aug 11 2017 07:10
I've been wondering about the user agent overwrites, I wonder if any of you can answer this question: why do some frameworks/people decide to list a lot of tags (ie html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, ...) instead of just typing: *{border:0;margin:0;} ??!
Long Nguyen
@longnt80
Aug 11 2017 07:56
@stormfenris for performance
Long Nguyen
@longnt80
Aug 11 2017 08:01
also there are other things that you don't want to be affected by the * selector, so it's better to write exactly what you want to have border and margin as 0
kalikota ssv teja
@tejakali
Aug 11 2017 09:06
is this api is right https://api.twitch.tv/kraken/streams/freecodecamp for twitch tv ??
heroiczero
@heroiczero
Aug 11 2017 09:16
@tejakali if you want to use the twitch api you need to sign up and get a key thats why we use the alternative :point_up:
kalikota ssv teja
@tejakali
Aug 11 2017 09:19
ohh thnq
heroiczero
@heroiczero
Aug 11 2017 09:33
@tejakali since streams is offline, "stream===null". try a stream that is online
@tejakali like https://wind-bow.glitch.me/twitch-api/streams/ESL_SC2
kalikota ssv teja
@tejakali
Aug 11 2017 09:34
ohh ok
heroiczero
@heroiczero
Aug 11 2017 09:39
@tejakali if you cant retrieve it, you can show offline. if "stream===null"
rscales02
@rscales02
Aug 11 2017 09:59
can someone tell me why
heroiczero
@heroiczero
Aug 11 2017 10:00
?
rscales02
@rscales02
Aug 11 2017 10:01
sorry, having technical difficulties (ie I'm slightly retarded)

``` var array = [];
function factorialize(num) {
for (a = num; a > 0; a--) {
array.push(a);
}
return num;
}

factorialize(5); ```

heroiczero
@heroiczero
Aug 11 2017 10:02
@rscales02 it is 5*4*3*2*1 but if you have 0 the answer is 1
rscales02
@rscales02
Aug 11 2017 10:03
can someone tell me why (a) that didn't go into a code window and (b) why that only gives me a return of 5
heroiczero
@heroiczero
Aug 11 2017 10:04
@rscales02 because you are return num so for factorialize(5); it will return the parameter 5 from the function
@rscales02 if you are trying to solve it in FCC, you can't use global variables or it will not register as a correct answer
rscales02
@rscales02
Aug 11 2017 10:05
thanks
heroiczero
@heroiczero
Aug 11 2017 10:05
@rscales02 np :)
DaX
@daxdax89
Aug 11 2017 10:06
How do i make logo here repsonsive?
http://buzaglocapitalgroup.com/
I did width:100; and height:auto; but it didn't work
heroiczero
@heroiczero
Aug 11 2017 10:08
@daxdax89 i would use @media or bootstrap 4img-fluid or bootstrap 3 img-responsive
DaX
@daxdax89
Aug 11 2017 10:09
@heroiczero those two classes didn't work.
heroiczero
@heroiczero
Aug 11 2017 10:11
@daxdax89 https://css-tricks.com/which-responsive-images-solution-should-you-use/ this can be a good read for solutions to make image responsive
rscales02
@rscales02
Aug 11 2017 10:13
var array = [];
function factorialize(num) {
  for (a = num; a > 0; a--) {
    array.push(a);
    var factorial = 1;
    for (i=0; i < array.length; i++) {
      factorial = factorial * array[i];
    }
  }
  return factorial;
}

factorialize(20);
this returns the correct answers for everything except 0, but doesn't pass me for anything
also it gives me a yellow warning "factorial used out of scope"
heroiczero
@heroiczero
Aug 11 2017 10:18
@rscales02 that does not seem correct factorial is https://www.mathsisfun.com/numbers/factorial.html
rscales02
@rscales02
Aug 11 2017 10:21
@heroiczero so i take my num (5), create an array [5,4,3,2,1], and then multiply them all. the return gives me 120 in the case of 5 and the correct answers in the case of 10 and 20 (the cases in the requirements)
a case of 0 returns nothing
not even 0
LydaTech
@lydatech
Aug 11 2017 10:22
anyone do any wp development?
heroiczero
@heroiczero
Aug 11 2017 10:22
@rscales02 case 0 returns 1
rscales02
@rscales02
Aug 11 2017 10:23
not with my code it appears :worried:
Am I approaching this completely wrong?
I just realized my loop wont run with a 0 number...
fixed that issue, not it works correctly from what I can tell. However it still won't pass any of the challenges...
heroiczero
@heroiczero
Aug 11 2017 10:27
@rscales02 you want to "multiply" not just store it in an arrray
rscales02
@rscales02
Aug 11 2017 10:28
So all in one step instead of many... ok
Praveen Saraogi
@saraogipraveen
Aug 11 2017 10:37
startup or MNC for fresher?
which is better to go for
same package both sides
rscales02
@rscales02
Aug 11 2017 10:45

function factorialize(num) {
  if (num === 0) {
    return 1;
  }
  return num*factorialize(num-1);
}

factorialize(5);
From what I understand (very little) shouldnt this return 20?
heroiczero
@heroiczero
Aug 11 2017 10:46
@rscales02 no because it goes through the function 5*4*3*2*1*1
rscales02
@rscales02
Aug 11 2017 10:52
@heroiczero thanks!
CamperBot
@camperbot
Aug 11 2017 10:52
rscales02 sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 1598 | @heroiczero |http://www.freecodecamp.com/heroiczero
rscales02
@rscales02
Aug 11 2017 12:04
function palindrome(str) {
  // Good luck!
  str.replace(/[0-9a-zA-Z]/gi, '');
  return str;
}



palindrome("eye()*&(*&(*^&*))");
can someone tell me why that doesn't return "eye"?
cowCrazy
@cowCrazy
Aug 11 2017 12:09
@rscales02 you want str to be 'eye' after replace?
rscales02
@rscales02
Aug 11 2017 12:10
yes, I think that code removes all the non-alpha numerics. However, it seems to do nothing
cowCrazy
@cowCrazy
Aug 11 2017 12:11
first if you want to see it's result you need to assign it to a new var so:
var newStr = str.replace(/[0-9a-zA-Z]/gi, '')
cause replace returns a new string, not modifying the current in process
rscales02
@rscales02
Aug 11 2017 12:14
Always the little things, now to figure out why it did exactly the opposite of what I was hoping
@cowCrazy thanks
CamperBot
@camperbot
Aug 11 2017 12:15
rscales02 sends brownie points to @cowcrazy :sparkles: :thumbsup: :sparkles:
:cookie: 319 | @cowcrazy |http://www.freecodecamp.com/cowcrazy
rscales02
@rscales02
Aug 11 2017 12:15
and fixed!
cowCrazy
@cowCrazy
Aug 11 2017 12:16
@rscales02 You can work with this if you don't want to check you console.log() to often. And well done!! :)
Daniel
@dkapexhiu
Aug 11 2017 12:17
how to create a backend server to connect with reactjs?
cowCrazy
@cowCrazy
Aug 11 2017 12:19
@dkapexhiu what do you want your server to do?
Daniel
@dkapexhiu
Aug 11 2017 12:19
i want the server to store the products in the webapp
cowCrazy
@cowCrazy
Aug 11 2017 12:19
so to work with a DB?
Daniel
@dkapexhiu
Aug 11 2017 12:19
yes
cowCrazy
@cowCrazy
Aug 11 2017 12:20
do you have something so far or just checking your options?
Daniel
@dkapexhiu
Aug 11 2017 12:21
cowCrazy
@cowCrazy
Aug 11 2017 12:23
@dkapexhiu you can send httpRequests from react to your server and then to query your db from it
Can you load your react files from an express server?
Stephen James
@sjames1958gm
Aug 11 2017 12:24
@dkapexhiu nodejs/express can provide the structure for an API that you can control from react
Daniel
@dkapexhiu
Aug 11 2017 12:25
yes but how to create.. if someone can help step by step.. what to do first?
cowCrazy
@cowCrazy
Aug 11 2017 12:25
@dkapexhiu have you worked with express?
Stephen James
@sjames1958gm
Aug 11 2017 12:26
@dkapexhiu https://github.com/facebookincubator/create-react-app
create-react-app sets up both front/back end for react app - you can then add to the backend as desired
Daniel
@dkapexhiu
Aug 11 2017 12:28
@cowCrazy no sorry
@sjames1958gm it sets only the front end
cowCrazy
@cowCrazy
Aug 11 2017 12:36
@dkapexhiu so first to get familier with express it would make your life much easier. Then you need to integrate reactjs to work with your project, I think webpack is doing the job well, afterwords you need to write http requests from your react app to your express server and from there to query your DB. It would take you some time to process all of this new things.... start with those videos and come back for questions as you advance through it
Stephen James
@sjames1958gm
Aug 11 2017 12:37
@dkapexhiu Ah, yes, think of the angular CLI which I was playing with recently - sorry
Daniel
@dkapexhiu
Aug 11 2017 12:38
ok thank you
IggySmith
@IggySmith
Aug 11 2017 12:43
this doesn't compute in my brain... should work no? since you can't apply toLowerCase directly to an array
image.png
cowCrazy
@cowCrazy
Aug 11 2017 12:48
@IggySmith when you write words[i] you already have it as a string, I don't think you need to use toString on it
IggySmith
@IggySmith
Aug 11 2017 12:49
@cowCrazy thought so too... but words[i].toLowerCase; also returns the same result
cowCrazy
@cowCrazy
Aug 11 2017 12:50
@IggySmith can you copy paste your code in here?
IggySmith
@IggySmith
Aug 11 2017 12:50

function titleCase(str) {
  var words = str.split(' ');

  for (i=0; i < words.length; i++) {
     words[i] = words[i].toLowerCase;
  }
    return words;
}


titleCase("I'm a little tea pot");
cowCrazy
@cowCrazy
Aug 11 2017 12:51
@IggySmith and toLowerCase is a function so toLowerCase() then
IggySmith
@IggySmith
Aug 11 2017 12:51
@cowCrazy thanks
CamperBot
@camperbot
Aug 11 2017 12:51
iggysmith sends brownie points to @cowcrazy :sparkles: :thumbsup: :sparkles:
:cookie: 320 | @cowcrazy |http://www.freecodecamp.com/cowcrazy
IggySmith
@IggySmith
Aug 11 2017 12:51
always the tiny erros man
cowCrazy
@cowCrazy
Aug 11 2017 12:52
practice makes little errors go away ;)
bambooch
@bambooch
Aug 11 2017 12:55
could anyone explain this bit of code to me ?
function inIframe () { try { return window.self !== window.top; } catch (e) { return true; } }
I can't seem to grasp the concept of a try catch statement
this is code from here
cowCrazy
@cowCrazy
Aug 11 2017 12:59
@bambooch try...catch is trying to check if an action is possible, if the try block would trow an error then the code in the catch block would run
Ken Haduch
@khaduch
Aug 11 2017 13:00
@bambooch - did you look at the documentation? The try block is a block of statements that will be attempted, and the catch is a block that will be active if some error or exception occurs on the code in the try
cowCrazy
@cowCrazy
Aug 11 2017 13:01
@bambooch with window.self and window.top it checks if the code runs inside an iframe element
Stephen James
@sjames1958gm
Aug 11 2017 13:03
@bambooch Not sure how return window.self !== window.top could throw an error the try/catch seems superfluous.
bambooch
@bambooch
Aug 11 2017 13:03
yeah that's bugging me too, it can only return true or false as far as I understand
Stephen James
@sjames1958gm
Aug 11 2017 13:06
@bambooch If window was undefined that could throw and error, maybe in some browsers window is not defined in iframe??
bambooch
@bambooch
Aug 11 2017 13:11
@cowCrazy would a new web page be an iframe element ? further into the code this function is used as a callback here
      {
        $('#tweet-quote').attr('href', 'https://twitter.com/intent/tweet?hashtags=quotes&related=freecodecamp&text=' + encodeURIComponent('"' + currentQuote + '" ' + currentAuthor));
        $('#tumblr-quote').attr('href', 'https://www.tumblr.com/widgets/share/tool?posttype=quote&tags=quotes,freecodecamp&caption='+encodeURIComponent(currentAuthor)+'&content=' + encodeURIComponent(currentQuote)+'&canonicalUrl=https%3A%2F%2Fwww.tumblr.com%2Fbuttons&shareSource=tumblr_share_button');
      }
this did not copy well
if(inIframe())
      {
        $('#tweet-quote').attr('href', 'https://twitter.com/intent/tweet?hashtags=quotes&related=freecodecamp&text=' + encodeURIComponent('"' + currentQuote + '" ' + currentAuthor));
        $('#tumblr-quote').attr('href', 'https://www.tumblr.com/widgets/share/tool?posttype=quote&tags=quotes,freecodecamp&caption='+encodeURIComponent(currentAuthor)+'&content=' + encodeURIComponent(currentQuote)+'&canonicalUrl=https%3A%2F%2Fwww.tumblr.com%2Fbuttons&shareSource=tumblr_share_button');
      }
what I make out of this is that the callback checks if these share buttons were clicked and then does some mumbo jumbo with the twitter and tumblr links and you can share the quote easily
so confused to be honest
cowCrazy
@cowCrazy
Aug 11 2017 13:16
@bambooch I think I found here what you looked for, basically if it is an iframe it has no access to the window.top property
Stephen James
@sjames1958gm
Aug 11 2017 13:24
@bambooch A web page can be loaded into another pages iframe
@bambooch for example, if you run in codepen your webpage is in codepen iframe
bambooch
@bambooch
Aug 11 2017 13:28
so if inIframe() returns true that means that the webpage is in an iframe?
Rishabh Kashyap
@iamrkcheers
Aug 11 2017 13:32

why does adding 2 decimal numbers does not give expected sum below ..

1.01 + 2.05
3.0599999999999996

Thanks.

cowCrazy
@cowCrazy
Aug 11 2017 13:38
@bambooch yes if the code runs inside an iframe it should return true
bambooch
@bambooch
Aug 11 2017 13:39
thank you @cowCrazy @sjames1958gm
CamperBot
@camperbot
Aug 11 2017 13:39
bambooch sends brownie points to @cowcrazy and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:cookie: 321 | @cowcrazy |http://www.freecodecamp.com/cowcrazy
:star2: 8293 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Ben
@bhmann
Aug 11 2017 13:41

Anyone able to help debug some bootstrap CSS/fluid-container mischief? I have two sections that are using the same grid framework on a page... one behaves fine but the other refuses to stack properly.

codepen link

cowCrazy
@cowCrazy
Aug 11 2017 13:42
@iamrkcheers it is built in JS. JS supports only floats and not integers if you want to have a number fixed to a certain amount of digits after the point you should use toFix()
Stephen James
@sjames1958gm
Aug 11 2017 13:49
@bhmann Do you want the bottom two to stack?
Klaus Mana
@KlausMana
Aug 11 2017 14:29
I need some help :sob:
why is it doing that
like it only appends stuff with the last value of the array
even though i do taht in every iteration of for
Darren
@DarrenfJ
Aug 11 2017 14:48
morning fCC helperPeeps
Klaus Mana
@KlausMana
Aug 11 2017 15:05
can someone help me apply this to my codepen? https://stackoverflow.com/a/13977142/6535158
Stephen James
@sjames1958gm
Aug 11 2017 15:09
@KlausMana Change the var i in your for loop to let i see if that works
@KlausMana Another option is to use forEach
Klaus Mana
@KlausMana
Aug 11 2017 15:10
thx I'll try
ok let i didn't work
I'll look into forEach now
@sjames1958gm how exactly would I use forEach here though?
Stephen James
@sjames1958gm
Aug 11 2017 15:14
  namesArray.forEach(function(cn_name, index) {
    var cn_fullname = fullNameArray[index];
Klaus Mana
@KlausMana
Aug 11 2017 15:15
yeah
Stephen James
@sjames1958gm
Aug 11 2017 15:15
@KlausMana Add a closing ) near the end
Klaus Mana
@KlausMana
Aug 11 2017 15:15
I kinda figured it out but thx anyway
oh k
It worked!
Thanks a lot @sjames1958gm
CamperBot
@camperbot
Aug 11 2017 15:16
klausmana sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8296 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Aug 11 2017 15:16
@KlausMana :+1:
Klaus Mana
@KlausMana
Aug 11 2017 15:16
you literally made my day :P
Stephen James
@sjames1958gm
Aug 11 2017 15:16
@KlausMana Glad to help.
Ben said
@BenSaidRachid
Aug 11 2017 15:26

hi all,i'm working nodejs server, i'm trying to make a module in order to get the file with the same extension

 var fs = require('fs');
var path = require('path');
var dirPath = process.argv[2];  //directory path
var fileType = '.'+process.argv[3]; //file extension
var l=0;
var files=[];
var exports = module.exports = {};
fs.readdir(dirPath, function(err,list){
    if(err) throw err;
    for(var i=0; i<list.length; i++)
    {
       if(path.extname(list[i])===fileType)
        {
                  files.push(list[i]);
        }
    }
});
exports.fileExt = function() {
 return files[0];
};

it works in fs.readdir, but when i try to send the variable "files" it becomes undefined,why?

Stephen James
@sjames1958gm
Aug 11 2017 15:50
@abdel974 Should your fileExt function have a callback and then call fs.readdir inside that function?
Ben said
@BenSaidRachid
Aug 11 2017 16:43

@sjames1958gm

var fs = require('fs');
var path = require('path');
var dirPath = process.argv[2];  //directory path
var fileType = '.'+process.argv[3]; //file extension
var l=0;
var files=[];
var exports = module.exports = {};

exports.fileExt = function() {
fs.readdir(dirPath, function(err,list){
    if(err) throw err;
    for(var i=0; i<list.length; i++)
    {
        if(path.extname(list[i])===fileType)
        {
                  files.push(list[i]);
                return files[i];
        }
    }
});
};

i did what you said,it works, i guess

var doc = require("./doc.js");
console.log(doc.fileExt());

how can i print the array then?

James Patrick Kerrane
@jamesjpk123
Aug 11 2017 16:45
On my website, https://chingu-coders.github.io/owl-24/, I am trying to mimic this jsfiddle that I made: http://jsfiddle.net/f4PV4/1220/.
However, it is not working for me. Here is the repo's relevant files: https://github.com/chingu-coders/owl-24/blob/master/index.html, https://github.com/chingu-coders/owl-24/blob/master/index.js. Can someone help me?
glitz20
@glitz20
Aug 11 2017 16:55
hey guys I am not being able to control the height of my carousel. Also how can I change the sliding style? https://codepen.io/sabin20/pen/EvPgMd
madhuri soni
@sonimadhuri
Aug 11 2017 16:56
hey guys i was trying to use font awesome unicodes in my javascript but it doesnt seem to appear .can someone check out and tell me what i am doing wrong?https://codepen.io/madhurisoni12/pen/MoaLYJ?editors=1010
@sabin20 the height isnt being applied because of the space between 390 and px .
glitz20
@glitz20
Aug 11 2017 17:00
@sonimadhuri thanks
CamperBot
@camperbot
Aug 11 2017 17:00
sabin20 sends brownie points to @sonimadhuri :sparkles: :thumbsup: :sparkles:
:cookie: 350 | @sonimadhuri |http://www.freecodecamp.com/sonimadhuri
Stephen James
@sjames1958gm
Aug 11 2017 17:02
@abdel974 What are the instructions?
Ben said
@BenSaidRachid
Aug 11 2017 17:03

This problem is the same as the previous but
introduces the concept of modules. You will need
to create two files to solve this.

Create a program that prints a list of files in
a given directory, filtered by the extension of
the files. The first argument is the directory
name and the second argument is the extension
filter. Print the list of files (one file per
line) to the console. You must use asynchronous
I/O.

You must write a module file to do most of the
work. The module must export a single function
that takes three arguments: the directory name,
the filename extension string and a callback
function, in that order. The filename extension
argument must be the same as what was passed to
your program. Don't turn it into a RegExp or
prefix with "." or do anything except pass it to
your module where you can do what you need to
make your filter work.

The callback function must be called using the
idiomatic node(err, data) convention. This
convention stipulates that unless there's an
error, the first argument passed to the callback
will be null, and the second will be your data.
In this exercise, the data will be your filtered
list of files, as an Array. If you receive an
error, e.g. from your call to fs.readdir(), the
callback must be called with the error, and only
the error, as the first argument.

You must not print directly to the console from
your module file, only from your original
program.

In the case of an error bubbling up to your
original program file, simply check for it and
print an informative message to the console.

These four things are the contract that your
module must follow.

  1. Export a single function that takes exactly the
    arguments described.
  2. Call the callback exactly once with an error or
    some data as described.
  3. Don't change anything else, like global
    variables or stdout.
  4. Handle all the errors that may occur and pass
    them to the callback.

    The benefit of having a contract is that your
    module can be used by anyone who expects this
    contract. So your module could be used by anyone
    else who does learnyounode, or the verifier, and
    just work.

Stephen James
@sjames1958gm
Aug 11 2017 17:04
exports.fileExt = function(callback) {
inside the function (and the callback from fs.readdir
callback(files);
}
a single function that takes three arguments: the directory name, the filename extension string and a callback function, in that order.
export.fileExt = function(dir, ext, callback) {

}
Then
if (err) callback(err, null);
callback(null, files);
John Edwards
@javajohnHub
Aug 11 2017 17:10

`constructor(private router: Router, private http: Http) {
console.log('constructor called');
}

canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
console.log('canActivate called');
this.http.get('http://localhost:3000/admin').map((response) => {
console.log(response.json());
this.router.navigate(['/admin'], { queryParams: { returnUrl: state.url }});
});
// not logged in so redirect to login page with the return url
this.router.navigate(['/login'], { queryParams: { returnUrl: state.url }});
return false;
}
`

Ben said
@BenSaidRachid
Aug 11 2017 17:13

@sjames1958gm

var fs = require('fs');
var path = require('path');
var dirPath = process.argv[2];  //directory path
var fileType = '.'+process.argv[3]; //file extension
var l=0;
var files=[];
var exports = module.exports = {};

exports.fileExt = function(callback) {
fs.readdir(dirPath, function(err,list){
    if(err) throw err;
    for(var i=0; i<list.length; i++)
    {
        if(path.extname(list[i])===fileType)
        {
                  files.push(list[i]);
        }
    }
});
callback(files);
};
export.fileExt = function(dir, ext, callback) {
if (err) callback(err, null);
callback(null, files);

like this?I'm not sure if I really understood

Stephen James
@sjames1958gm
Aug 11 2017 17:16
The function you export has three parameters and calls fs.readdir with these parameters
Then if error invoke the callback with the error
Else pass the files in the callback with null error
exports.fileExt = function(dir, ext, callback) {
  fs.readdir(dir, function(err,list){
      if(err) callback(err, null);
      for(var i=0; i<list.length; i++)
      {
          if(path.extname(list[i])===ext)
          {
               files.push(list[i]);
          }
      }
      callback(null, files);
  });
};
@abdel974 ^^^
Ben said
@BenSaidRachid
Aug 11 2017 17:28

@sjames1958gm ok i begin to understand, i hope lol, for the other file i did this

var doc = require("./doc.js");
doc.fileExt();

is that right?i have an error

binding.readdir(pathModule._makeLong(path), req);
          ^

TypeError: path must be a string
`
woesung
@woesung
Aug 11 2017 17:29
its they anyone
Stephen James
@sjames1958gm
Aug 11 2017 17:29
doc.fileExt(process.argv[2], process.argv[3], function(err, files) {
});
woesung
@woesung
Aug 11 2017 17:30
i need help for Create a Set of Radio Buttons
give me some tips
Stephen James
@sjames1958gm
Aug 11 2017 17:31
@woesung Use the example and create two of these using the options from the last instruction
Put them at the end of the <form>
woesung
@woesung
Aug 11 2017 17:34
i did the task per question but i run it. i think there have something wrong
Ben said
@BenSaidRachid
Aug 11 2017 17:35
@sjames1958gm thank you so much mate, i begin to understand, it doesn't work yet but i will find out by myself, you really helped, thanks
CamperBot
@camperbot
Aug 11 2017 17:35
abdel974 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8297 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Aug 11 2017 17:35
@abdel974 Glad to help.
woesung
@woesung
Aug 11 2017 17:36
so can you help me
Stephen James
@sjames1958gm
Aug 11 2017 17:54
@woesung Show the code you added
Margaret
@Margaret2
Aug 11 2017 17:55
:o :o a chelsea fan
Margaret2 @Margaret2 is a fan of Thibaut Courtois :smirk:
Stephen James
@sjames1958gm
Aug 11 2017 17:57
@Margaret2 :)
Ben said
@BenSaidRachid
Aug 11 2017 18:00
@sjames1958gm
my module just stopped working, i figured out that i needed to add '.' somewhere, i added a variable, it stopped working,i got back to the former code and it didn't work either
var fs = require('fs');
var path = require('path');
var files=[];
var exports = module.exports = {};
exports.fileExt = function(dir, ext, callback) {
  fs.readdir(dir, function(err,list){
      if(err) callback(err, null);
      for(var i=0; i<list.length; i++)
      {
          if(path.extname(list[i])===ext)
          {
               files.push(list[i]);
          }
      }
      callback(null, files);
  });
};
var doc = require("./doc.js");
doc.fileExt(process.argv[2], process.argv[3], function(err, files) {
});
here's my test : node doc2.js test txt (test is a directory with many files with the "txt "extension)
Stephen James
@sjames1958gm
Aug 11 2017 18:25
@abdel974 Yes, it appears you need the "."
node doc2.js test .txt
Then you need some code in the callback of doc2.js
Rishabh Kashyap
@iamrkcheers
Aug 11 2017 18:29
could anyone tell me the regex to find '2 consecutive same alphabets' ie 'aa' in 'aab' or 'bb' in 'abcdehbbafg'.
Thanks.
This message was deleted
Stephen James
@sjames1958gm
Aug 11 2017 18:30
@iamrkcheers Well, I could . . . :)
Ben said
@BenSaidRachid
Aug 11 2017 18:30
@sjames1958gm weird, at the beginning it has displayed my files ".txt" without the extension....
i need to print the files right?
Rishabh Kashyap
@iamrkcheers
Aug 11 2017 18:30
@sjames1958gm so .. tell me.
Stephen James
@sjames1958gm
Aug 11 2017 18:30
@abdel974 Yes
Rishabh Kashyap
@iamrkcheers
Aug 11 2017 18:31
@sjames1958gm btw Chelsea are going down this year dude.
Stephen James
@sjames1958gm
Aug 11 2017 18:31
This message was deleted
Oops
/(.)\1/
Ben said
@BenSaidRachid
Aug 11 2017 18:35

@sjames1958gm

var doc = require("./doc.js");
doc.fileExt(process.argv[2],"."+ process.argv[3], function(err, files) {
});

i did this ,it displays only the first argument

Rishabh Kashyap
@iamrkcheers
Aug 11 2017 18:35
@sjames1958gm thanks.
CamperBot
@camperbot
Aug 11 2017 18:35
iamrkcheers sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8298 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Aug 11 2017 18:36

@abdel974 I believe the instructions say to pass in the period from the cmd line

doc.fileExt(process.argv[2], process.argv[3], function(err, files) {
     // code here to test err and output files
});

The filename extension argument must be the same as what was passed to your program. Don't turn it into a RegExp or prefix with "." or do anything except pass it to your module where you can do what you need to make your filter work.

@iamrkcheers yw
Ben said
@BenSaidRachid
Aug 11 2017 18:40
@sjames1958gm ok i have it, thanks
CamperBot
@camperbot
Aug 11 2017 18:40
abdel974 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8299 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Joseph
@revisualize
Aug 11 2017 18:43
Hello.
10119
@10119
Aug 11 2017 18:48
Hi @ all! I would like to fetch this data: https://ethermine.org/api/miner_new/b395a19588af95d773CB0C9F1F01Db5E122438EC and rearrange it so i can see the most important data on kind of dashboard. I tried a few tutorials for jquery the last days but i really don't get it. Do you have any tips for good examples? I just want to create a small html dashboard to g
*have a better overview
korzo
@korzo
Aug 11 2017 18:54
@10119 I'm afraid you will not be able fetch data from javascript as their api doesn't support CORS
10119
@10119
Aug 11 2017 18:55
@korzo Ok, thanks. So what would be the best way to fetch and rearrange this data then?
CamperBot
@camperbot
Aug 11 2017 18:55
10119 sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
:cookie: 364 | @korzo |http://www.freecodecamp.com/korzo
Ben said
@BenSaidRachid
Aug 11 2017 18:57

Your additional module file [doc.js] does not
 export a single function. You must use the
 module.exports = function () {} pattern.

 # FAIL Your solution to MAKE IT MODULAR didn't
 pass. Try again!

my code

var fs = require('fs');
var path = require('path');
var files=[];
var point=".";
module.exports.fileExt = function(dir, ext, callback) {
        var extension=point.concat(ext);
  fs.readdir(dir, function(err,list){
      if(err) callback(err, null);
      for(var i=0; i<list.length; i++)
      {
          if(path.extname(list[i])===extension)
          {
               files.push(list[i]);
          }
      }
      callback(null, files);
  });
};

what's wrong with my code?

korzo
@korzo
Aug 11 2017 18:57
@10119 You need backend part running on server to fetch data
Abdulah Hamzic
@hamzicabdulah
Aug 11 2017 18:57
@10119 you just need to take that exact data that's on that page and manipulate it
?
korzo
@korzo
Aug 11 2017 18:58
@abdel974 try module.exports = function
Ben said
@BenSaidRachid
Aug 11 2017 19:00
like this
var fs = require('fs');
var path = require('path');
var files=[];
var point=".";
fileExt = function(dir, ext, callback) {
        var extension=point.concat(ext);
  fs.readdir(dir, function(err,list){
      if(err) callback(err, null);
      for(var i=0; i<list.length; i++)
      {
          if(path.extname(list[i])===extension)
          {
               files.push(list[i]);
          }
      }
      callback(null, files);
  });
};
module.exports = fileExt;
Abdulah Hamzic
@hamzicabdulah
Aug 11 2017 19:01
@abdel974 depends on how you are importing it
if you use module.exports.fileExt
then you need to import it with require('fileName').fileExt
korzo
@korzo
Aug 11 2017 19:01
@abdel974 according to description I think so . You must use the module.exports = function () {} pattern.
Abdulah Hamzic
@hamzicabdulah
Aug 11 2017 19:02
if you are importing it with require('fileName'), then the second example should work
Ben said
@BenSaidRachid
Aug 11 2017 19:06
var doc = require("./doc.jsfiles[i]").fileExt;
doc.fileExt(process.argv[2],process.argv[3], function(err, files) {
for(var i=0;i<files.length;i++)
        console.log(files[i]);
});
var fs = require('fs');
var path = require('path');
var files=[];
var point=".";
fileExt = function(dir, ext, callback) {
        var extension=point.concat(ext);
  fs.readdir(dir, function(err,list){
      if(err) callback(err, null);
      for(var i=0; i<list.length; i++)
      {
          if(path.extname(list[i])===extension)
          {
               files.push(list[i]);
          }
      }
      callback(null, files);
  });
};
module.exports = fileExt;
if i do this it doesn't work at all
Abdulah Hamzic
@hamzicabdulah
Aug 11 2017 19:06
what are you doing here? var doc = require("./doc.jsfiles[i]").fileExt
wnghero
@wnghero
Aug 11 2017 19:07

@wnghero
"Return the remaining elements of an array after chopping off n elements from the head."
anyone know what they mean by "n" elements?
function slasher(arr, howMany) {
// it doesn't always pay to be first

return arr;
}

slasher([1, 2, 3], 2);
pretty sure i have to do something like arr.splice()

Abdulah Hamzic
@hamzicabdulah
Aug 11 2017 19:08
@abdel974 require("./doc.jsfiles[i]") you can't require this. you need to require a file by its name
so if your file is named doc.js, then just require that
what is the files[i] part doing there
Ben said
@BenSaidRachid
Aug 11 2017 19:09

@hamzicabdulah i change it

var doc = require("./doc").fileExt;
doc.fileExt(process.argv[2],process.argv[3], function(err, files) {
for(var i=0;i<files.length;i++)
        console.log(files[i]);
});

it was a mistake

now i have those errors

✗ 

 Submission results did not match expected!

 ✓ 

 Additional module file exports a single function

 ✓ 

 Additional module file exports a function that
 takes 3 arguments

 ✗ 

 Your additional module file [doc.js] does not
 appear to pass back an error received from
 fs.readdir(). Use the following idiomatic
 Node.js pattern inside your callback to
 fs.readdir(): if (err) return callback(err)

 ✓ 

 Additional module file handles errors properly

 # FAIL Your solution to MAKE IT MODULAR didn't
 pass. Try again!
Abdulah Hamzic
@hamzicabdulah
Aug 11 2017 19:10
you don't need the .fileExt part in var doc = require("./doc").fileExt; now that you are exporting the function differently in the other file
just use var doc = require("./doc") now
Ben said
@BenSaidRachid
Aug 11 2017 19:20
@hamzicabdulah right now i have one last error

Your additional module file [doc.js] does not
 appear to pass back an error received from
 fs.readdir(). Use the following idiomatic
 Node.js pattern inside your callback to
 fs.readdir(): if (err) return callback(err)
Abdulah Hamzic
@hamzicabdulah
Aug 11 2017 19:23
doc.fileExt(process.argv[2],process.argv[3], function(err, files) {
for(var i=0;i<files.length;i++)
        console.log(files[i]);
});
you are not checking for the err parameter here
you need to handle the case where there's an error
try logging the error
before the for loop
if (err) return console.log(err)
that's in case you get an error instead of a list of files from the doc.js file
Ben said
@BenSaidRachid
Aug 11 2017 19:44

@hamzicabdulah

var doc = require("./doc");
doc.fileExt(process.argv[2],process.argv[3], function(err, files) {
if (err) return console.log(err)
for(var i=0;i<files.length;i++)
        console.log(files[i]);
});
var fs = require('fs');
var path = require('path');
var files=[];
var point=".";
fileExt = function(dir, ext, callback) {
        var extension=point.concat(ext);
  fs.readdir(dir, function(err,list){
      if(err) callback(err);
      for(var i=0; i<list.length; i++)
      {
          if(path.extname(list[i])===extension)
          {
               files.push(list[i]);
          }
      }
      callback(null, files);
  });
};
module.exports = fileExt;

same error

my bad it's worst lol now Submission results did not match expected!
Ben said
@BenSaidRachid
Aug 11 2017 19:53

doc.fileExt(process.argv[2],process.argv[3], function(err, files) {
    ^

TypeError: doc.fileExt is not a function
when i run my code i get this
Stephen James
@sjames1958gm
Aug 11 2017 20:00
@abdel974 doc is the function not doc.fileExt
Try:
var fileExt = require("./doc");
fileExt(...)
Ben said
@BenSaidRachid
Aug 11 2017 20:02
@sjames1958gm it works ,thanks
@hamzicabdulah thanks
CamperBot
@camperbot
Aug 11 2017 20:02
abdel974 sends brownie points to @sjames1958gm and @hamzicabdulah :sparkles: :thumbsup: :sparkles:
:cookie: 413 | @hamzicabdulah |http://www.freecodecamp.com/hamzicabdulah
:star2: 8300 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Aug 11 2017 20:02
@abdel974 :+1:
Ben said
@BenSaidRachid
Aug 11 2017 20:05

well ,i still have this error

 Your additional module file [doc.js] does not appear
 to pass back an error received from fs.readdir().
 Use the following idiomatic Node.js pattern inside
 your callback to fs.readdir(): if (err) return
 callback(err)

it pisses me off

Darren
@DarrenfJ
Aug 11 2017 20:24
@wnghero i suspect that n in this case is the number of items to remove from the array (n is used math as a general expression) but as you noted they then weirdly then use a variable howMany to actually represent n.. that's my guess anyway
Ravi Kishore Thella
@ravikishorethella
Aug 11 2017 20:29
@DarrenfJ ty buddy
CamperBot
@camperbot
Aug 11 2017 20:29
ravikishorethella sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 1963 | @darrenfj |http://www.freecodecamp.com/darrenfj
Kyle Holm
@thekholm80
Aug 11 2017 20:29
@ravikishorethella ty sir
CamperBot
@camperbot
Aug 11 2017 20:29
thekholm80 sends brownie points to @ravikishorethella :sparkles: :thumbsup: :sparkles:
:cookie: 991 | @ravikishorethella |http://www.freecodecamp.com/ravikishorethella
Ravi Kishore Thella
@ravikishorethella
Aug 11 2017 20:29
@thekholm80 sir????
@thekholm80 ty sir
CamperBot
@camperbot
Aug 11 2017 20:29
ravikishorethella sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1438 | @thekholm80 |http://www.freecodecamp.com/thekholm80
Kyle Holm
@thekholm80
Aug 11 2017 20:30
@ravikishorethella ma'am?
sorry thought you were a sir
Ravi Kishore Thella
@ravikishorethella
Aug 11 2017 20:30
I am a kid
Kyle Holm
@thekholm80
Aug 11 2017 20:30
lol
Manish Giri
@Manish-Giri
Aug 11 2017 20:30
he's Mr. Smith
:sunglasses:
Kyle Holm
@thekholm80
Aug 11 2017 20:30
oh, i should watch Mr & Mrs Smith
Ravi Kishore Thella
@ravikishorethella
Aug 11 2017 20:30
there comes the icon
Kyle Holm
@thekholm80
Aug 11 2017 20:30
love crappy action movies
John Edwards
@javajohnHub
Aug 11 2017 20:32
@thekholm80 youre still lurking this chat room ...geeeez
Kyle Holm
@thekholm80
Aug 11 2017 20:32
nope
you must be thinking of someone else
John Edwards
@javajohnHub
Aug 11 2017 20:33
lol
@thekholm80 you ever finish your crawler
Kyle Holm
@thekholm80
Aug 11 2017 20:33
yep
long time ago
John Edwards
@javajohnHub
Aug 11 2017 20:33
link
John Edwards
@javajohnHub
Aug 11 2017 20:34
cool font
i lose
Kyle Holm
@thekholm80
Aug 11 2017 20:35
lol
John Edwards
@javajohnHub
Aug 11 2017 20:35
good stuff man
Kyle Holm
@thekholm80
Aug 11 2017 20:35
hey thanks @javajohnHub
CamperBot
@camperbot
Aug 11 2017 20:35
thekholm80 sends brownie points to @javajohnhub :sparkles: :thumbsup: :sparkles:
:cookie: 185 | @javajohnhub |http://www.freecodecamp.com/javajohnhub
Darren
@DarrenfJ
Aug 11 2017 20:35
thank both of you!
thanks @thekholm80 @ravikishorethella
CamperBot
@camperbot
Aug 11 2017 20:35
darrenfj sends brownie points to @thekholm80 and @ravikishorethella :sparkles: :thumbsup: :sparkles:
:cookie: 992 | @ravikishorethella |http://www.freecodecamp.com/ravikishorethella
:star2: 1439 | @thekholm80 |http://www.freecodecamp.com/thekholm80
Darren
@DarrenfJ
Aug 11 2017 20:35
and you too
thanks @Manish-Giri
CamperBot
@camperbot
Aug 11 2017 20:36
darrenfj sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 6400 | @manish-giri |http://www.freecodecamp.com/manish-giri
Kyle Holm
@thekholm80
Aug 11 2017 20:36
@DarrenfJ thank you Mr Pirate
CamperBot
@camperbot
Aug 11 2017 20:36
thekholm80 sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 1964 | @darrenfj |http://www.freecodecamp.com/darrenfj
John Edwards
@javajohnHub
Aug 11 2017 20:36
@thekholm80 what did you use to make the assets
Kyle Holm
@thekholm80
Aug 11 2017 20:36
@javajohnHub Gimp
John Edwards
@javajohnHub
Aug 11 2017 20:36
nice
Kyle Holm
@thekholm80
Aug 11 2017 20:36
it was fun trying to draw
i got an F in art
John Edwards
@javajohnHub
Aug 11 2017 20:36
thats a good looking chicken
and your aliens look like aliens
Kyle Holm
@thekholm80
Aug 11 2017 20:37
my favorite is the clown
kind of proud of the clown
John Edwards
@javajohnHub
Aug 11 2017 20:38
one last question....are the boards randomly generated?
that is a funny clown!!
Kyle Holm
@thekholm80
Aug 11 2017 20:38
the first 4 levels are completely random, the final level is scripted
John Edwards
@javajohnHub
Aug 11 2017 20:38
that clown is disturbing
Daniel
@dkapexhiu
Aug 11 2017 20:40
where can i find a guide to connect mysql database with reactjs?
Kyle Holm
@thekholm80
Aug 11 2017 20:41
@dkapexhiu i don't know if you can do it without a back end, like node or rails or whatever
John Edwards
@javajohnHub
Aug 11 2017 20:41
@daniel yea thats more of a backend thing
Darren
@DarrenfJ
Aug 11 2017 20:42
i shall also enjoy checking out the crawler thanks Kyle :D
@thekholm80 tonight i am an assface
Kyle Holm
@thekholm80
Aug 11 2017 20:42
@DarrenfJ kick some butt! I promise it's winnable

why's that?

tonight i am an assface

Kyle Holm
@thekholm80
Aug 11 2017 20:43
@DarrenfJ oh fun
Darren
@DarrenfJ
Aug 11 2017 20:44
kind of proud of the clown
that's a clown to be proud of
Daniel
@dkapexhiu
Aug 11 2017 20:44
how can i create an api with nodejs to be called by reactjs?
Kyle Holm
@thekholm80
Aug 11 2017 20:44
@dkapexhiu you should try the back end lessons at freecodecamp
they'll teach you that
@DarrenfJ i've never been to an improv show, looks like fun
Razvan
@razvanlikespizza
Aug 11 2017 20:50
var cars = new Array("Saab", "Volvo", "BMW"); May somebody explain why would i use "NEW"? Why?Why?Why? PLeaseee!
Darren
@DarrenfJ
Aug 11 2017 20:50
@thekholm80 yah it can be
Coy Sanders
@coymeetsworld
Aug 11 2017 20:50
@thekholm80
Uncaught TypeError: this.generateHealth is not a function
    at Object.spawnBoss (index_bundle.js:20)
    at Object.nextDungeon (index_bundle.js:20)
    at u (index_bundle.js:20)
    at index_bundle.js:20
Darren
@DarrenfJ
Aug 11 2017 20:50
nug and nigel did mainstage here at Second City.. actually so did Kirsten
Sam Goldberg
@sgoldber61
Aug 11 2017 20:53
I'm beginning the data visualization section. Is it worth it to take the udemy course https://www.udemy.com/react-redux/ to lean react? Is react used a lot in the workforce?
Kyle Holm
@thekholm80
Aug 11 2017 20:54
@coymeetsworld well that's weird
@sgoldber61 that course is pretty awesome
Daniel
@dkapexhiu
Aug 11 2017 20:54
@thekholm80 it shows only projects
Gersho
@Gersho
Aug 11 2017 20:54
i'm also wondering on my objective after i'm done with front end
Coy Sanders
@coymeetsworld
Aug 11 2017 20:54
@thekholm80 it happens lvl 4, when i try to leave dungeon
Kyle Holm
@thekholm80
Aug 11 2017 20:55
react doesn't have as big of a market share as angular, but it's growing fast @sgoldber61
Coy Sanders
@coymeetsworld
Aug 11 2017 20:55
im at the door and now stuck, can't move
Kyle Holm
@thekholm80
Aug 11 2017 20:55
@coymeetsworld thanks, i've never had that happen before. I'll check it out
CamperBot
@camperbot
Aug 11 2017 20:55
thekholm80 sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:star2: 2991 | @coymeetsworld |http://www.freecodecamp.com/coymeetsworld
Daniel
@dkapexhiu
Aug 11 2017 20:56
any help? @thekholm80
Kyle Holm
@thekholm80
Aug 11 2017 20:56
@dkapexhiu help with what?
Coy Sanders
@coymeetsworld
Aug 11 2017 20:56
@thekholm80 @sgoldber61 https://stateofjs.com/2016/frontend/
react actually is king
Sam Goldberg
@sgoldber61
Aug 11 2017 20:56
@thekholm80 Ok thanks, sounds good. I will use that course to learn react.
CamperBot
@camperbot
Aug 11 2017 20:56
sgoldber61 sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1440 | @thekholm80 |http://www.freecodecamp.com/thekholm80
Coy Sanders
@coymeetsworld
Aug 11 2017 20:56
according to a survey at least
Kyle Holm
@thekholm80
Aug 11 2017 20:56
did you do the learn you node, learn you express, lessons?
@dkapexhiu
Daniel
@dkapexhiu
Aug 11 2017 20:57
it shows only videos and not the theory
Coy Sanders
@coymeetsworld
Aug 11 2017 20:57
@thekholm80 I'm also at lvl 4 w/ battle axe if that helps, near 100% health and about 50% exp to next level
Gersho
@Gersho
Aug 11 2017 20:57
so until there's some on fcc, we should seek knowledge elsewhere on react and do the fcc challenges in react ?
Daniel
@dkapexhiu
Aug 11 2017 20:57
send the link @thekholm80
that's where it starts. yes there is a video, but look at the instructions on the left
@Gersho i learned react from outside FCC
Gersho
@Gersho
Aug 11 2017 20:59
guess kung fu is the same no matter the village ^^
Kyle Holm
@thekholm80
Aug 11 2017 20:59
the steve girder course @sgoldber61 linked before is the best i've found that doesn't cost a fortune
Gersho
@Gersho
Aug 11 2017 21:00
but first gonna finish frontend :3 one step at a time
Daniel
@dkapexhiu
Aug 11 2017 21:03
ok thanks @thekholm80
CamperBot
@camperbot
Aug 11 2017 21:03
dkapexhiu sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1441 | @thekholm80 |http://www.freecodecamp.com/thekholm80
Kyle Holm
@thekholm80
Aug 11 2017 21:03
@coymeetsworld bleh, gonna leave it broken for now. i've updated node since i built that now webpack is angry
Coy Sanders
@coymeetsworld
Aug 11 2017 21:03
just revert node then lol
Kyle Holm
@thekholm80
Aug 11 2017 21:03
Error: Node Sass does not yet support your current environment: Linux 64-bit with Unsupporte
d runtime
Gersho
@Gersho
Aug 11 2017 21:03
just write "not implemented yet" on the lvl 5 door :P
Kyle Holm
@thekholm80
Aug 11 2017 21:04
oh wait, i have NVM installed, i wonder if i can roll back easily
AaronOoooo
@AaronOoooo
Aug 11 2017 21:30
Hello. I need help with adding an external link for my project "Build a Tribute Page" using Codepen. Anyone available?
Gersho
@Gersho
Aug 11 2017 21:31
@AaronOoooo try adding target=# in your href
AaronOoooo
@AaronOoooo
Aug 11 2017 21:32
@Gersho Thanks. Will give that a try now.
CamperBot
@camperbot
Aug 11 2017 21:32
aaronooooo sends brownie points to @gersho :sparkles: :thumbsup: :sparkles:
:cookie: 322 | @gersho |http://www.freecodecamp.com/gersho
Darren
@DarrenfJ
Aug 11 2017 21:35
chicken fists is going to be the name of my next nuMetal band ;)
AaronOoooo
@AaronOoooo
Aug 11 2017 21:36
@Gersho Yup! That did the trick!
Kyle Holm
@thekholm80
Aug 11 2017 21:37
@DarrenfJ lol
Gersho
@Gersho
Aug 11 2017 21:37
@DarrenfJ mine is Mystik Spiral but we're gonna change it soon
Darren
@DarrenfJ
Aug 11 2017 21:38
@AaronOoooo "Note that if you don't usetarget="_blank" on a link, and link to something not on CodePen, the link will simply fail due to our sandboxing and cross-origin security."
@Gersho :metal:
AaronOoooo
@AaronOoooo
Aug 11 2017 21:39
@Gersho Good to kno!
Darren
@DarrenfJ
Aug 11 2017 21:43
Something-Something Explosion
haven't watched enough of it but my gf did.. she loved it
Sydney
@SydneyWarren
Aug 11 2017 22:09
var fruits = ['mango', 'grapes', 'bananas'];

fruits.forEach(function(item, index) {
  if (item === 'mango') {
  item =  item.toUpperCase();
}else{item = item.toLowerCase();}
console.log(item);
});
console.log(fruits);
how come fruits haven't changed... when i log item it makes mango capitals but at the end nothings changed
Neville Lee
@Nevillealee
Aug 11 2017 22:10
Hey Im working on #15740. does anyone know which url the button should redirect to?
the Bug button on the ES6 challeneges
AaronOoooo
@AaronOoooo
Aug 11 2017 22:21
@DarrenfJ Thanks for the link!
CamperBot
@camperbot
Aug 11 2017 22:21
aaronooooo sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 1965 | @darrenfj |http://www.freecodecamp.com/darrenfj
Coy Sanders
@coymeetsworld
Aug 11 2017 22:27
@SydneyWarren don't believe forEach mutates the array
Sydney
@SydneyWarren
Aug 11 2017 22:28
oh ok so i'd have to push into a new array
foreach is similar to loop right
Coy Sanders
@coymeetsworld
Aug 11 2017 22:28
using the map function would be better
yeah its similar
elpatron17
@elpatron17
Aug 11 2017 22:30
Hello, would you help me with php code?
Liam Docherty
@ldocherty1
Aug 11 2017 22:30

Can anyone help me resolve my two problems which I have at the moment please?

Problem 1 - I have put an animate.css effect on my section two title text and hr element (line). However, the effect on activates when the page loads. As a result of this, I'm not looking for this to happen due to the user not being able to see the effect. . When the user goes to my section 2 I want the effect then to take place. Not to sure how to make that happen.
Problem 2 - Due to me wanting to have my navigation bar at the top of every section apart from section one which is known as #part1 I used the following CSS which is having a major effect on my navigation bar and nothing is straight and lined up and I was wondering how I could make everything straight and lined up and also have my navigation bar at the top of every section apart from section one.
CSS I used for navber - I think the display part is having an effect on the elements within the navbar. However, if I remove this and everything is lined up and perfect my navigation bar will be visible in section one which is not what I want.

.navbar {
    display: none;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 10;
    height: 4rem;
    background-color: #003554;
}

https://jsfiddle.net/qg7jbxs2/7/

elpatron17
@elpatron17
Aug 11 2017 22:36
can anyone help me with this code:

<!DOCTYPE html>
<html>
<head>
<title>Todoriev</title>
</head>

    <body bgcolor="lightblue">

        <h2 style="color:black" >Registration Here!</h2>

        <form action="registration.php" method="post">
            Username:
            <input type="text" name="username" placeholder="Enter new user name" required /> <br />
                                                                                             <br />
            Password:
            <input type="password" name="password" placeholder="Enter new password"/> <br />
                                                                                      <br />
            Re-password:
            <input type="password" name="repassword" placeholder="Enter password again"/> <br />
                                                                                           <br />

            <input type="button" onClick="parent.location='login.php'" 
                   name="login" value="Login" />
            <input type="submit" name="submit" value="Submit"  />


        </form>

        <p><strong></strong></p>

    </body>

</html>

<?php

$db=sqlite_open("main.db");

@sqlite_query($db, "CREATE TABLE users (user_id integer PRIMARY KEY AUTOINCREMENT, username varchar(15),password varchar(10))",$sqliteerror);

    if(isset($_POST['submit']))
    {
    $userofname = sqlite_escape_string($_POST['username']);
    $passwordof = sqlite_escape_string($_POST['password']);
    $repassword = sqlite_escape_string($_POST ['repassword']);

    $query ='SELECT * FROM users WHERE user_name = "$userofname"';


    $numrows = sqlite_query($db,$query);

    if($numrows == 0)
    {
        if($repassword == $passwordof)
        {
            if($query =sqlite_query($db,'INSERT INTO users VALUES ( "$userofname","$passwordof" )')) 


                        echo "Regisitered Successfully as $userofname!";

        }

        else
        {
            echo "Password doesn't match!";
        }
    }
        else
        {
            echo "Username already exist!";
        }
    }

    sqlite_close($db);

?>

the registration form does not work
Liam Docherty
@ldocherty1
Aug 11 2017 22:51

I have put an animate.css effect on my section two title text and hr element (line). However, the effect on these elements activates when the page loads. When the user goes to my section 2 I want the effect then to take place. Not to sure how to make that happen.

https://jsfiddle.net/qg7jbxs2/7/

jaygeet
@jaygeet
Aug 11 2017 23:23
anyone working on any coding/project? i would like to work with to learn python/C/JS on the fly.
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:30
@jaygeet you wanna see a nightmare?
jaygeet
@jaygeet
Aug 11 2017 23:31
i didnt get you ahmed
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:31
class App extends Component {
  constructor() {
    super()
    this.state = {
      aboutHeight: 0,
      aboutWidth: 0,
      aboutOpacity: 'none',
      projectsHeight: 0,
      projectsWidth: 0,
      projectsOpacity: 'none',
      photographyHeight: 0,
      photographyWidth: 0,
      photographyOpacity: 'none',
      contactHeight: 0,
      contactWidth: 0,
      contactOpacity: 'none',
      closeDisplay: 'none',
      clockColor: '#fff'
    }
  }
  aboutClicked() {
    this.setState({
      aboutHeight: '5px',
      aboutWidth: '5px'
    })
    setTimeout(()=> this.setState({aboutHeight: '100vh'}), 500)
    setTimeout(()=> this.setState({aboutWidth: '100vw', clockColor: '#111'}), 1000)
    setTimeout(()=> this.setState({aboutOpacity: 'block',closeDisplay: 'block'}), 1430)
  }
  projectsClicked() {
    this.setState({
      projectsHeight: '5px',
      projectsWidth: '5px'
    })
    setTimeout(()=> this.setState({projectsHeight: '100vh'}), 500)
    setTimeout(()=> this.setState({projectsWidth: '100vw', clockColor: '#111'}), 1000)
    setTimeout(()=> this.setState({projectsOpacity: 'block',closeDisplay: 'block'}), 1430)
  }
  photographyClicked() {
    this.setState({
      photographyHeight: '5px',
      photographyWidth: '5px'
    })
    setTimeout(()=> this.setState({photographyHeight: '100vh'}), 500)
    setTimeout(()=> this.setState({photographyWidth: '100vw', clockColor: '#111'}), 1000)
    setTimeout(()=> this.setState({photographyOpacity: 'block',closeDisplay: 'block'}), 1430)
  }
  contactClicked() {
    this.setState({
      contactHeight: '5px',
      contactWidth: '5px'
    })
    setTimeout(()=> this.setState({contactHeight: '100vh'}), 500)
    setTimeout(()=> this.setState({contactWidth: '100vw', clockColor: '#111'}), 1000)
    setTimeout(()=> this.setState({contactOpacity: 'block',closeDisplay: 'block'}), 1430)
  }
  closeClicked() {
    if (this.state.aboutWidth === '100vw' && this.state.aboutHeight === '100vh') {
      this.setState({
        aboutWidth: '5px',
        aboutOpacity: 'none',
        closeDisplay: 'none'
      })
      setTimeout(() => this.setState({aboutHeight: '5px',clockColor: '#fff'}), 500)
      setTimeout(() => this.setState({aboutHeight: '0px'}), 1000)
      setTimeout(() => this.setState({aboutWidth: '0px'}), 1430)
    } else if(this.state.projectsWidth === '100vw' && this.state.projectsHeight === '100vh') {
      this.setState({
        projectsWidth: '5px',
        projectsOpacity: 'none',
        closeDisplay: 'none'
      })
      setTimeout(() => this.setState({projectsHeight: '5px',clockColor: '#fff'}), 500)
      setTimeout(() => this.setState({projectsHeight: '0px'}), 1000)
      setTimeout(() => this.setState({projectsWidth: '0px'}), 1430)
    } else if(this.state.photographyWidth === '100vw' && this.state.photographyHeight === '100vh') {
      this.setState({
        photographyWidth: '5px',
        photographyOpacity: 'none',
        closeDisplay: 'none'
      })
      setTimeout(() => this.setState({photographyHeight: '5px',clockColor: '#fff'}), 500)
      setTimeout(() => this.setState({photographyHeight: '0px'}), 1000)
      setTimeout(() => this.setState({photographyWidth: '0px'}), 1430)
    } else if (this.state.contactWidth === '100vw' && this.state.contactHeight === '100vh') {
      this.setState({
        contactWidth: '5px',
        contactOpacity: 'none',
        closeDisplay: 'none'
      })
      setTimeout(() => this.setState({contactHeight: '5px',clockColor: '#fff'}), 500)
      setTimeout(() => this.setState({contactHeight: '0px'}), 1000)
      setTimeout(() => this.setState({contactWidth: '0px'}), 1430)
    } else {
      this.setState({
        contactWidth: '5px',
        photographyWidth: '5px',
        projectsWidth: '5px',
        aboutWidth: '5px',
        closeDisplay: 'none',
        contactOpacity: 'none',
        photographyOpacity: 'none',
        projectsOpacity: 'none',
        aboutOpacity: 'none'
      })
      setTimeout(() => {
        this.setState({
          contactHeight: '5px',
          photographyHeight: '5px',
jaygeet
@jaygeet
Aug 11 2017 23:31
@ahmedtarek2134 do you code
what is this langauge?
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:32
javascript, React
jaygeet
@jaygeet
Aug 11 2017 23:32
ok i guess i can start with js since it is inside browser
so what do you do in js?
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:32
continuation:
jaygeet
@jaygeet
Aug 11 2017 23:32
which is this project?
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:32
          projectsHeight: '5px',
          aboutHeight: '5px',
          clockColor: '#fff'
        })
      },500)
      setTimeout(() => {
        this.setState({
          contactHeight: 0,
          photographyHeight: 0,
          projectsHeight: 0,
          aboutHeight: 0
        })
      },1000)
      setTimeout(() => {
        this.setState({
          contactWidth: 0,
          photographyWidth: 0,
          projectsWidth: 0,
          aboutWidth: 0,
        })
      },1430) 
    }
  }
  render() {
    return (
      <div>
        <Clock color={this.state.clockColor}/>
        <Close display={this.state.closeDisplay} closeClicked={this.closeClicked.bind(this)}/>
        <About height={this.state.aboutHeight} width={this.state.aboutWidth} opacity={this.state.aboutOpacity}/>
        <Projects height={this.state.projectsHeight} width={this.state.projectsWidth} opacity={this.state.projectsOpacity}/>
        <Photography height={this.state.photographyHeight} width={this.state.photographyWidth} opacity={this.state.photographyOpacity}/>
        <Contact height={this.state.contactHeight} width={this.state.contactWidth} opacity={this.state.contactOpacity}/>
        <Header name="Ahmed Tarek" description="Front End Web Developer"/>
        <Navigation aboutClicked={this.aboutClicked.bind(this)} projectsClicked={this.projectsClicked.bind(this)} photographyClicked={this.photographyClicked.bind(this)} contactClicked={this.contactClicked.bind(this)}/>
      </div>
    )
  }
}
jaygeet
@jaygeet
Aug 11 2017 23:32
can i explain me step by step
can you explain me step by step
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:33
@jaygeet I am still coding this project, it's still not up yet
you don't know Reactjs for me to explain everything, I think so
guess this might help
jaygeet
@jaygeet
Aug 11 2017 23:35
i prefer direct learning/workign over tutorial/book/video
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:36
you can't do that with a language, you need to know how to write it first
know the syntax, methods...etc
jaygeet
@jaygeet
Aug 11 2017 23:36
do you work for any project where in i can fit/start my work directly?
i ll learn as and when needed
under your guidance
i dont want to read the whole book/tutorial/video at a time
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:37
if you aren't gonna read a book/documentation or watch a video, you won't learn anything
sorry but like for someone that doesn't know how to milk a cow, you need to teach him first not tell him go milk the cow without him knowing the proper steps
you can't expect writing js without learning it, you won't learn it by starting a project where you don't even know the syntax
jaygeet
@jaygeet
Aug 11 2017 23:39
i prefer the reverse way
Anthony DeSordi
@desordi3
Aug 11 2017 23:39
whats the difference between linux plans and windows plans on godaddy?
jaygeet
@jaygeet
Aug 11 2017 23:39
let us try
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:40
brrrooooooo listen to me, you ain't gonna apply for a job and tell them I will learn js after you hire me
you learn it first
code in i
it
and then you apply for a job
jaygeet
@jaygeet
Aug 11 2017 23:40
i have already applied in fact
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:40
brrruuhhhh
Anthony DeSordi
@desordi3
Aug 11 2017 23:40
lmaooo
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:41
@jaygeet do you know how to write a function in javascript?
jaygeet
@jaygeet
Aug 11 2017 23:41
is this a first task for me
?
i dont know yet
Razvan
@razvanlikespizza
Aug 11 2017 23:42
hahaha omg im dying
xDDDDDDDD
jaygeet
@jaygeet
Aug 11 2017 23:42
it may be either call by argument/value
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:42
if you don't know how to write a function, how can you expect getting accepted in the job :joy:
@razvanlikespizza I can't hahahahaha
Razvan
@razvanlikespizza
Aug 11 2017 23:43
@ahmedtarek2134 this guy is mortal xDD
jaygeet
@jaygeet
Aug 11 2017 23:43
employer will think about it; dont stress yourself @ahmedtarek2134
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:43
@jaygeet javascript is too large to just try and write something
function
loops
juni
@junipberry
Aug 11 2017 23:43

@ahmedtarek2134 can you take a look at this:

function getProperty(obj, key) {
  (obj[key]= 'value');
  return obj[key].value;

}

how can I get it to return value at the given key?

Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:43
variables
prototypes
classes
imports
Razvan
@razvanlikespizza
Aug 11 2017 23:44
@junipberry Its not Discrod here, just one please `
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:44
arrays
Razvan
@razvanlikespizza
Aug 11 2017 23:44
OBJECTS!!!!!!!!!!!!!!!
juni
@junipberry
Aug 11 2017 23:44
?
Razvan
@razvanlikespizza
Aug 11 2017 23:44
@junipberry You put 3 of these: ```
korzo
@korzo
Aug 11 2017 23:44
@junipberry return obj[key]
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:44
I ain't mentioning all man, too much for my brain to handle :joy:
Razvan
@razvanlikespizza
Aug 11 2017 23:45
I am smart
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:45
@razvanlikespizza dude
Razvan
@razvanlikespizza
Aug 11 2017 23:45
:|
juni
@junipberry
Aug 11 2017 23:45
don’t think that’s it, @korzo
Razvan
@razvanlikespizza
Aug 11 2017 23:45
@ahmedtarek2134 tsup dude?
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:45
Screen Shot 2017-08-12 at 2.45.03 AM.png
:joy: :joy:
jaygeet
@jaygeet
Aug 11 2017 23:45
@ahmedtarek2134 every large thing has an end
korzo
@korzo
Aug 11 2017 23:45
@junipberry that's answer to your question
juni
@junipberry
Aug 11 2017 23:45
nope
korzo
@korzo
Aug 11 2017 23:46
@junipberry but before you have to check, if given property exists
Razvan
@razvanlikespizza
Aug 11 2017 23:46
@ahmedtarek2134 Whats wrong with that guy?? :laughing:
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:46
@jaygeet that won't be relatable to your brain
Razvan
@razvanlikespizza
Aug 11 2017 23:46
@jaygeet Wanna learn JS together?
jaygeet
@jaygeet
Aug 11 2017 23:47
yes
Razvan
@razvanlikespizza
Aug 11 2017 23:47
Yeeey! <3
i know the basics lol..
jaygeet
@jaygeet
Aug 11 2017 23:47
let us start
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:47
@razvanlikespizza he doesn't even know how to write a function brrruuhhhh
jaygeet
@jaygeet
Aug 11 2017 23:47
i opened scratchpad
it is matter of 20 minutes to learn any function @ahmedtarek2134
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:48
@jaygeet its is a matter of hard work to learn a full language
jaygeet
@jaygeet
Aug 11 2017 23:48
did i say no?
Razvan
@razvanlikespizza
Aug 11 2017 23:48
<script>
function iGotHiredForAJavaScriptJobWithoutKnowingIt(){
console.log("That means Im an idiot.Thats cool.);
}
iGotHiredForAJavaScriptJobWithoutKnowingIt();
</script>
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:49
@jaygeet learn any function???? there is only one way to write one
Razvan
@razvanlikespizza
Aug 11 2017 23:49
@ahmedtarek2134 Its really hard, if you are a beginner its hardcore.
Coy Sanders
@coymeetsworld
Aug 11 2017 23:49
@ahmedtarek2134 false
Ravi Kishore Thella
@ravikishorethella
Aug 11 2017 23:49
@razvanlikespizza console.log("That's cool :smile: ");
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:50
let hello = () => {

}
Razvan
@razvanlikespizza
Aug 11 2017 23:50
omg thats all what I know about JS.
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:50
@coymeetsworld you mean that way?
Razvan
@razvanlikespizza
Aug 11 2017 23:50
@ahmedtarek2134 Is that JS man?
Coy Sanders
@coymeetsworld
Aug 11 2017 23:50
thats another way yeah
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:50
@razvanlikespizza yep :worried:
Razvan
@razvanlikespizza
Aug 11 2017 23:51
Hell no..
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:51
its the new way to write a function
we call the version
Razvan
@razvanlikespizza
Aug 11 2017 23:51
Uh really?
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:51
ES6
Razvan
@razvanlikespizza
Aug 11 2017 23:51
oh wow,this sh*t is gettin complicated
Coy Sanders
@coymeetsworld
Aug 11 2017 23:51
its just es6 syntax, but you don't always use it
there are differences
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:51
welcome to the javascript community where it has no end when you start getting into it
Razvan
@razvanlikespizza
Aug 11 2017 23:51
stoop that @ahmedtarek2134 ... :(
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:52
@razvanlikespizza ES6 needs to be compiled down to the older version
Coy Sanders
@coymeetsworld
Aug 11 2017 23:52
not necessarily
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:52
its just better for development
@coymeetsworld for better browser support
Coy Sanders
@coymeetsworld
Aug 11 2017 23:52
and javascript doesn't compile, it transpiles
if that's what you're talking about
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:52
can't forget ma homie IE9 :joy:
Coy Sanders
@coymeetsworld
Aug 11 2017 23:52
yes, but it doesn't HAVE to be transpiled
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:53
@coymeetsworld oke yah there is a version of babel that can be in your browser
5.8.somthing I think
Coy Sanders
@coymeetsworld
Aug 11 2017 23:53
no
babel is just a tool, its not part of the browser
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:53
there is a version that you can include it as a script tag
Razvan
@razvanlikespizza
Aug 11 2017 23:54
@ahmedtarek2134 guess with who I am talkin...?
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:54
@razvanlikespizza no need to specify
Razvan
@razvanlikespizza
Aug 11 2017 23:54
@ahmedtarek2134 ....:| This guy is not kiddin loololololol
Coy Sanders
@coymeetsworld
Aug 11 2017 23:54
you can do it that way, but its not part of the browser.
Razvan
@razvanlikespizza
Aug 11 2017 23:55
@ahmedtarek2134 I PMed you.look on private
Coy Sanders
@coymeetsworld
Aug 11 2017 23:55
you can import it into your project if you wanted, although I've never done it that way before
glitz20
@glitz20
Aug 11 2017 23:55
hey guys can anyone let me know why my media query is not working? https://codepen.io/sabin20/pen/EvPgMd
Ahmed Tarek
@ahmedtarek2134
Aug 11 2017 23:55
yeah same, I use webpack to handle it
Razvan
@razvanlikespizza
Aug 11 2017 23:58
@sabin20 Test it without any media query,is it working?
glitz20
@glitz20
Aug 11 2017 23:59
@razvanlikespizza yes it is