These are chat archives for FreeCodeCamp/Help

28th
Aug 2017
Razvan
@razvanlikespizza
Aug 28 2017 00:02
Text relative to an image?
This message was deleted
.img img { width: 40%; } .text { position: relative; top: -400px; left: 1000px; }
Josebuendia
@Josebuendia
Aug 28 2017 00:48

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

<style>
{
}

<h2 { font-family: Lobster, Monospace; .class="text-primary"; </h2>


}
.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
border-radius: 50%;
}

{
width: 100px;
}
</style>

<div class="container-fluid">

<p>Click here for <a href="#">cat photos</a>.</p>

<a href="#"><img class="thick-green-border"class="img-responsive" src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back. "></a>

<img src="https://bit.ly/fcc-running-cats" alt="Three kittens running towards the camera. ">
<div class="row">
<div class="col-xs-4">
<button class="btn btn-block btn-primary">Like</button>
</div>
<div class="col-xs-4">
<button class="btn btn-block btn-info">Info</button>
</div>
<div class="col-xs-4">
<button class="btn btn-block btn-danger">Delete</button>
</div>
</div>

<form action="/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor"> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality"> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Crazy</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
</div>

I need to do the following but am unsure how I haven't Your h2 element should now have the class text-primary.

Add the img-responsive class to your top image.

just1witness
@just1witness
Aug 28 2017 01:14
I have an error I'm not seeing here... "arr2.slice(arr2[j], 2);" is not executing
function updateInventory(arr1, arr2) {
 for(var i = 0; i < arr1.length; ++i){
  for(var j = 0; j < arr2.length; ++j){
   if(arr1[i][1] === arr2[j][1]){
    arr1[i][0] = arr1[i][0] + arr2[j][0];
     arr2.slice(arr2[j], 2);
        }
         }
          }
 return arr1.concat(arr2).sort();
            }
updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]]);
Moisés Man
@moigithub
Aug 28 2017 01:17
was the purpuse of tht slice ? @just1witness
just1witness
@just1witness
Aug 28 2017 01:17
To get rid of a subarray once it's value is added to arr1
from arr2
it should slice the current arr2, subarray that was just used to add to the total of the subarray with the equivalent key in arr1
everything works right except slice
Moisés Man
@moigithub
Aug 28 2017 01:21
arr2.splice(j,1)
mdn.io/splice
just1witness
@just1witness
Aug 28 2017 01:23

no dice.

here it is with comments

function updateInventory(arr1, arr2) {
 for(var i = 0; i < arr1.length; ++i){ //iterate through arr1
  for(var j = 0; j < arr2.length; ++j){ //iterate through arr2
   if(arr1[i][1] === arr2[j][1]){ //if arr1[i] has a string equal to arr2[j]...
    arr1[i][0] = arr1[i][0] + arr2[j][0]; //  add the integer in arr2[j] to arr1[i]'s int.
     arr2.slice(arr2[j], 2); //remove arr2[j] form arr2
        }
         }
          }
 return arr1.concat(arr2).sort(); // add remainder of arr2, sort
            }
updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]]);
just1witness
@just1witness
Aug 28 2017 01:33
@moigithub Ahh shoot, I didn't see that you said sPlice, not slice. Splice did something
just1witness
@just1witness
Aug 28 2017 01:39
@moigithub thank you
CamperBot
@camperbot
Aug 28 2017 01:39
just1witness sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 3611 | @moigithub |http://www.freecodecamp.com/moigithub
just1witness
@just1witness
Aug 28 2017 02:19
Sooo close yet so far, why is ONE subarray not sorting properly... :/
function updateInventory(arr1, arr2) {
 for(var i = 0; i < arr1.length; ++i){ //iterate through arr1
  for(var j = 0; j < arr2.length; ++j){ //iterate through arr2
   if(arr1[i][1] === arr2[j][1]){ //if arr1[i] has a string equal to arr2[j]...
    arr1[i][0] = arr1[i][0] + arr2[j][0]; //  add the integer in arr2[j] to arr1[i]'s integer.
     arr2.splice([j], 1);//remove arr2[j] from arr2
        }
         }
          }
  return arr1.concat(arr2).sort(function(a, b){
        return a[1] - b[1];
  });
            }
updateInventory([[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [[2, "Hair Pin"], [3, "Half-Eaten Apple"], [67, "Bowling Ball"], [7, "Toothpaste"]]);
Moisés Man
@moigithub
Aug 28 2017 02:21
index [1] are strings like "Bowling", "Dirty"
soo u cant use - substraction / math
just1witness
@just1witness
Aug 28 2017 02:21
The out put is
[[88, "Bowling Ball"], [2, "Dirty Sock"], [3, "Hair Pin"],   [3, "Half-Eaten Apple"],[5, "Microphone"]],  [7, "Toothpaste"]]);
Moisés Man
@moigithub
Aug 28 2017 02:22
if (a[1]> b[1]){ return 1; }
else { return -1; }
sort callback need to return positive, 0 or negative values to determine sort order
soo u can use greater than or lower than comparison operators..
just1witness
@just1witness
Aug 28 2017 02:22
oh, yes, I didn't notice that the parameters I'm working with are already mostly sorted
@moigithub You sir, are a genius. XD
@moigithub Thank you!
CamperBot
@camperbot
Aug 28 2017 02:26
just1witness sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:warning: just1witness already gave moigithub points
just1witness
@just1witness
Aug 28 2017 02:27
I will be writing some notes about this sort function.
Randell Dawson
@RandellDawson
Aug 28 2017 04:09
@just1witness - I sent you a pm.
John Gabriel Simmons
@sosmaniac-FCC
Aug 28 2017 05:02
Clicking one of the recipe headers and ignoring the wonky translation animation, the height of the gray wrapping container changes to accommodate the newly rendered ingredients sub-section. Is there a way to nail this gray container's dynamic change in height down to some sort of property so that I could animate it using CSS transitions (the height property is not working in this situation). I played around with ReactCSSTransitionGroup as well to no avail.
Mukesh Kumar Angrish
@MukeshAngrish
Aug 28 2017 06:20
Hey guys, I need some help as my Tic Tac Toe app is not working properly. I have fairly good reasons to believe that is issue is with the minmax() function as I have tried running the app without using the minmax()function and it worked.
Darren
@DarrenfJ
Aug 28 2017 06:48
evening fCC
@sjames1958gm I ended up driving off all over to check out cliffs and falls.... it was a nice RL break
Luke-Rogerson
@Luke-Rogerson
Aug 28 2017 06:56
@Morched23MJ Thanks!
CamperBot
@camperbot
Aug 28 2017 06:56
luke-rogerson sends brownie points to @morched23mj :sparkles: :thumbsup: :sparkles:
:cookie: 299 | @morched23mj |http://www.freecodecamp.com/morched23mj
xingkuanBai
@xingkuanBai
Aug 28 2017 09:51
..
Rajan
@ProgramNovice
Aug 28 2017 12:39
Hi guys
i have doubt to ask you all
For Python language, indentation is very important.
Likewise, is indentation important for CSS and Bootstrap?
Klaus Mana
@KlausMana
Aug 28 2017 13:04
hello, I am doing this challenge https://www.freecodecamp.org/challenges/sorted-union
my question is, since it gives the arguments as separate arrays, and the function itself only gets one argument, how am I supposed to reference to the other arrays?
as you can see in the challenge, it only takes the argument arr, but when called, multiple arguments are passed to the function
how do I reference to those other arguments?
Stephen James
@sjames1958gm
Aug 28 2017 13:19
@KlausMana The arguments object holds references to all values passed to the function.
@ProgramNovice For Python indentation is a language requirement. It is only for readability in CSS.
Dylan
@dhcodes
Aug 28 2017 13:33
@KlausMana a map or a loop
Jill Lee
@jill-lee
Aug 28 2017 13:39
Hi I need help with the missing resources under the console in Github how do I go about it?
https://ibb.co/m6tZxQ
Dylan
@dhcodes
Aug 28 2017 13:42
@phoenix-burn it looks like your page is requesting CSS from an http:// address instead of secure https://
find a CDN for the CSS that comes from a secure https:// address
CamperBot
@camperbot
Aug 28 2017 13:42
find a cdn for the css that comes from a secure https address
nothing found
Stephen James
@sjames1958gm
Aug 28 2017 13:45
@phoenix-burn - these lines are going to request files from your houseofmax repo - but you don't have them there.
  <script src="jquery.fixedbg.min.js"></script>

  <script src="js/jquery.js"></script>
  <script src="js/bootstrap.min.js">
Jill Lee
@jill-lee
Aug 28 2017 13:46
@dhcodes thanks I'll try that
CamperBot
@camperbot
Aug 28 2017 13:46
phoenix-burn sends brownie points to @dhcodes :sparkles: :thumbsup: :sparkles:
:star2: 1831 | @dhcodes |http://www.freecodecamp.com/dhcodes
Rajan
@ProgramNovice
Aug 28 2017 13:59
@sjames1958gm Ok thanks Stephen :)
CamperBot
@camperbot
Aug 28 2017 13:59
programnovice sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8402 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Mukul Agrawal
@mukul09
Aug 28 2017 14:01
I give a shot to JavaScript Calculator. I would love to have some reviews. It would be appreciated. https://codepen.io/mukul09/pen/ZJJVYB?editors=0010
Rishabh Kashyap
@iamrkcheers
Aug 28 2017 14:18
do we really have to provide credit card info on 'Cloud 9'.
can't we do without it.
Any ideas ?!?
Moisés Man
@moigithub
Aug 28 2017 14:19
https://glitch.com/ @iamrkcheers
or install everything on ur computer
node + git ( n probably mongo)
Rishabh Kashyap
@iamrkcheers
Aug 28 2017 14:22
@mukul09 when I have a result on the screen (say 4 + 1 gives me 5), and I click on another number, nothing happens.
Other than that, brilliant.
@moigithub thanks.
CamperBot
@camperbot
Aug 28 2017 14:23
iamrkcheers sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 3612 | @moigithub |http://www.freecodecamp.com/moigithub
Mukul Agrawal
@mukul09
Aug 28 2017 14:30
@iamrkcheers Thanks. I'll fix that one
CamperBot
@camperbot
Aug 28 2017 14:30
mukul09 sends brownie points to @iamrkcheers :sparkles: :thumbsup: :sparkles:
:cookie: 319 | @iamrkcheers |http://www.freecodecamp.com/iamrkcheers
Josebuendia
@Josebuendia
Aug 28 2017 14:45
I've to Nest your h2 element within a div with the class col-xs-8.
But I thought I'd done that?

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

<div class="row">
<style>
<div class="col-xs-8">
h2 {
font-family: Lobster, Monospace;
}
</div>
.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
border-radius: 50%;
}
</div>
</style>

<div class="container-fluid">
<h2 class="text-primary text-center">CatPhotoApp</h2>
<div class="col-xs-4">
<a href="#"><img class="img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back. "></a>
</div>

<img src="https://bit.ly/fcc-running-cats" class="img-responsive" alt="Three kittens running towards the camera. ">
<div class="row">
<div class="col-xs-4">
<button class="btn btn-block btn-primary">Like</button>
</div>
<div class="col-xs-4">
<button class="btn btn-block btn-info">Info</button>
</div>
<div class="col-xs-4">
<button class="btn btn-block btn-danger">Delete</button>
</div>
</div>
<p>Things cats <span class="text-danger">love:</span></p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
<form action="/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor"> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality"> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Crazy</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
</div>

Nahuel Ovejero
@NahuelOvejero
Aug 28 2017 14:54
@Josebuendia wich one is your h2?
Darren
@DarrenfJ
Aug 28 2017 14:54
morning fCC
Nahuel Ovejero
@NahuelOvejero
Aug 28 2017 14:54
morning :wave:
Darren
@DarrenfJ
Aug 28 2017 14:54
@Josebuendia you've got html for the div in the CSS section of the code
@NahuelOvejero hey buddy :D
Nahuel Ovejero
@NahuelOvejero
Aug 28 2017 14:55
How its everything going? Guess they revert the /help change, its alive now
Darren
@DarrenfJ
Aug 28 2017 14:56
@Josebuendia everything between the style tags is CSS that affects everythign below it in the html.. you can tell the html because it has tags that look this <somethingHTML> basically anything with < > these is html
Lauri Välja
@OFFLlNE
Aug 28 2017 14:56
what :D what is /help? :o
Darren
@DarrenfJ
Aug 28 2017 14:56
@NahuelOvejero did they?
Nahuel Ovejero
@NahuelOvejero
Aug 28 2017 14:56
I guess, because have been a really long time since i've seen html/css problems here
/help is this room
Darren
@DarrenfJ
Aug 28 2017 14:57
@Josebuendia so this is html wrapped around the CSS for h2:
<div class="col-xs-8">
h2 {
font-family: Lobster, Monospace;
}
</div>
@NahuelOvejero it comes sometimes if you hang out in the room long enough ;)
Lauri Välja
@OFFLlNE
Aug 28 2017 14:58
wait wait.. HTML and CSS are like 85% of the problems here :p afair
Nahuel Ovejero
@NahuelOvejero
Aug 28 2017 14:58
I check this room daily and a few of times, just lurk a lot :P
a days ago there wasn't any single one
just me and Kyle talking and random question about APIs
Lauri Välja
@OFFLlNE
Aug 28 2017 15:00
:D
it seems more quiet in the summertime tho
Feel like people discover that when they actually are studying.. like I did :p
Darren
@DarrenfJ
Aug 28 2017 15:00
yah.. since they got rid of the help button there's been very little of the basic html CSS questions anymore.. about a month and a half or so now
Lauri Välja
@OFFLlNE
Aug 28 2017 15:00
oh really :D why did they get rid of dat? :D
Nahuel Ovejero
@NahuelOvejero
Aug 28 2017 15:01
What is summertime in the whole world? :P
Lauri Välja
@OFFLlNE
Aug 28 2017 15:01
automating challenges... No work for helpers :'(
Darren
@DarrenfJ
Aug 28 2017 15:02
there was a forum thread on it.. something like 'too much activity of no value' in the gitter chats so drive questions to the forum
too frentic for new people..and also too many logins expected for new people too
something like that
@Josebuendia you try to move the div into the html?
Lauri Välja
@OFFLlNE
Aug 28 2017 15:04
yeaa, if they have a way or knowledge to come here if they need help, then it is fine I guess :D
Darren
@DarrenfJ
Aug 28 2017 15:04
@Josebuendia the div with the row, and the col-8, needs to go around the h2 in the html section...
Lauri Välja
@OFFLlNE
Aug 28 2017 15:04
just as long as we do not lose people's interest with that change. Hope they are tracking that :D I will ask the team :p
Darren
@DarrenfJ
Aug 28 2017 15:06
yah...well. many of the people who used to come to help don't really come in anymore cause you can be in here for an hour or more with no actual help questions now
Lauri Välja
@OFFLlNE
Aug 28 2017 15:07
yea :D so weird
Darren
@DarrenfJ
Aug 28 2017 15:07
I htink they just hang out in the casual or main room now
Lauri Välja
@OFFLlNE
Aug 28 2017 15:07
I have occasionally lurked, seems so quiet, I want to help :D
I will go watch GOT now :p
Darren
@DarrenfJ
Aug 28 2017 15:07
:D
Nahuel Ovejero
@NahuelOvejero
Aug 28 2017 15:07
yeah, its frustrating to have a really small error, like a dot, space, mayus, and wait hours for it
Darren
@DarrenfJ
Aug 28 2017 15:08
it's especially quiet when i usually get on like 2 am EST...
but i heard there isn't a exercise to login to the gitter anymore.. it's now just on a help page somewhere...
you can be in here for hours too and help people and no brownies ;)
but then yer helping like 1 person :/
Nahuel Ovejero
@NahuelOvejero
Aug 28 2017 15:09
Brownies are good, but irl :P
Darren
@DarrenfJ
Aug 28 2017 15:10
i know i know it's the satisfaction of helping people ;)
but back when we had a bit of a community of regulars we had a little joking around brownie fest... you know for fun
@Josebuendia sorry we were chatting if we missed yer reply.. you got it figured out?
@Josebuendia tell us what you tried :D
Nahuel Ovejero
@NahuelOvejero
Aug 28 2017 15:13
@DarrenfJ ty for your service
CamperBot
@camperbot
Aug 28 2017 15:13
:star2: 1991 | @darrenfj |http://www.freecodecamp.com/darrenfj
nahuelovejero sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
Darren
@DarrenfJ
Aug 28 2017 15:16
@NahuelOvejero ty for yours too :D
CamperBot
@camperbot
Aug 28 2017 15:16
:cookie: 793 | @nahuelovejero |http://www.freecodecamp.com/nahuelovejero
darrenfj sends brownie points to @nahuelovejero :sparkles: :thumbsup: :sparkles:
Darren
@DarrenfJ
Aug 28 2017 15:16
and thanks @OFFLlNE for the chat
Nahuel Ovejero
@NahuelOvejero
Aug 28 2017 15:16
I don't serve too much tho :P But i have actual brownies, and you have stars.
CAN YOU EAT THE STARS?! I guess NO
take that higher point user!
;P
Darren
@DarrenfJ
Aug 28 2017 15:21
they taste so sparkly and delish
forum discussion on gitter help that gives you the lowdown for when yer back @OFFLlNE
Darren
@DarrenfJ
Aug 28 2017 15:26
thanks @OFFLlNE
CamperBot
@camperbot
Aug 28 2017 15:26
darrenfj sends brownie points to @offllne :sparkles: :thumbsup: :sparkles:
:star2: 1064 | @offllne |http://www.freecodecamp.com/offllne
Darren
@DarrenfJ
Aug 28 2017 15:26
ok gonna go watch vods and code and etc etc.. back later
Josebuendia
@Josebuendia
Aug 28 2017 15:30

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

<div class="row">
<style>
.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
border-radius: 50%;
}
</div>
</style>
<div class="row">
<div class="col-xs-4">
<div class="col-xs-8">
h2 {
font-family: Lobster, Monospace;
}
</div>
<div class="container-fluid">
<h2 class="text-primary text-center">CatPhotoApp</h2>
<div class="col-xs-4">
<a href="#"><img class="img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back. "></a>
</div>

<img src="https://bit.ly/fcc-running-cats" class="img-responsive" alt="Three kittens running towards the camera. ">
<button class="btn btn-block btn-primary">Like</button>
</div>
<div class="col-xs-4">
<button class="btn btn-block btn-info">Info</button>
</div>
<div class="col-xs-4">
<button class="btn btn-block btn-danger">Delete</button>
</div>
</div>
<p>Things cats <span class="text-danger">love:</span></p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
<form action="/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor"> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality"> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Crazy</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
</div>
@Darre

@DarrenfJ Is that what you mean?
Stephen James
@sjames1958gm
Aug 28 2017 15:47
@Josebuendia The <div class="row"> goes right before the h2 (after the container-fluid)
Then <div class="col-xs-8"> goes next (also before the h2)
Then close the col-xs-8 div with </div> right after the h2
@Josebuendia
  <div class="row">
    <div class="col-xs-8">
     <h2 class="text-primary text-center">CatPhotoApp</h2>
    </div>

    <div class="col-xs-4">
      <a href="#"><img class="img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back. "></a>
    </div>
   </div>
See how the columns wrap the <h2> and the <a>
and the row wraps the two columns.
Josebuendia
@Josebuendia
Aug 28 2017 15:58
Thanks, @sjames1958gm
Why do you have two closing div tags?
CamperBot
@camperbot
Aug 28 2017 15:58
josebuendia sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8403 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Ravi Kishore Thella
@ravikishorethella
Aug 28 2017 16:39
@Josebuendia the last </div> tag is for the class row
Stephen James
@sjames1958gm
Aug 28 2017 17:16
@Josebuendia count the opening <div> and you will see you need to closing ones.
Tiago Correia
@tiagocorreiaalmeida
Aug 28 2017 17:37
can you just test my pen and see if you can point anything that's missing or error ? https://codepen.io/tiagocorreia/full/QMVRxr/ thanks
glitz20
@glitz20
Aug 28 2017 18:08
hey anyone who can please have a look at my project and find what is the problem?https://glitch.com/edit/#!/adjoining-river?path=routes/collection.js:8:56 Thanks
Moisés Man
@moigithub
Aug 28 2017 18:27
Error: Cannot find module '../models/movieinstance' @sabin20
glitz20
@glitz20
Aug 28 2017 18:32
@moigithub I am trying to delete movieinstance and anothe problem is that it says collection is undefined at app.js
Moisés Man
@moigithub
Aug 28 2017 18:33
there r few codes which refer to movieinstance.. so probably u need to delete/comment out those too...
or change to point to something else
glitz20
@glitz20
Aug 28 2017 18:35
@moigithub I will do that and let you know
Moisés Man
@moigithub
Aug 28 2017 18:36
Error: Cannot find module '../models/book'
glitz20
@glitz20
Aug 28 2017 18:46
@moigithub where did you see /models/book?
Moisés Man
@moigithub
Aug 28 2017 18:55
if u click Logs [error] button (below the avatar icons)
a console window opens below @sabin20
glitz20
@glitz20
Aug 28 2017 18:56
@moigithub yeah I got it
I am working on it now. Will let you know if futher problem arises
glitz20
@glitz20
Aug 28 2017 19:03
@moigithub I have made chages. Now it says it has some problem with mongo
Tiago Correia
@tiagocorreiaalmeida
Aug 28 2017 19:07
image.png
how can I point that the 1.0.0 its atually the latest and not 10.0.1
1.0.1*
Grigor Minasyan
@gogminsam
Aug 28 2017 19:19
Can someone help with this regexp in javascript, im trying to use or in us telephone numbers
    var reg1 = /\d{10}/;
    var reg2 = /\d{3}-\d{3}-\d{4}/;
    if ((reg1+"|"+reg2).test(str)) {
      return true;
    }
Is there any syntax error?
Gersho
@Gersho
Aug 28 2017 19:24
i can't say for sure there is, but i am unsure you can use "|" that way
maybe have 2 different tests with a && in the if ?
Stephen James
@sjames1958gm
Aug 28 2017 19:26
@gogminsam reg1 is a RegExp object not a string.
Grigor Minasyan
@gogminsam
Aug 28 2017 19:27
@sjames1958gm so i have to test with || inside if() right?
Stephen James
@sjames1958gm
Aug 28 2017 19:28
@gogminsam Yes - two calls to test as @gersho implied
Grigor Minasyan
@gogminsam
Aug 28 2017 19:28
OK, thanks @sjames1958gm @Gersho
CamperBot
@camperbot
Aug 28 2017 19:28
gogminsam sends brownie points to @sjames1958gm and @gersho :sparkles: :thumbsup: :sparkles:
:star2: 8404 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
:cookie: 363 | @gersho |http://www.freecodecamp.com/gersho
Stephen James
@sjames1958gm
Aug 28 2017 19:29
@gogminsam :+1:
Gersho
@Gersho
Aug 28 2017 19:29
and i was about to not answer because i was really unsure about it xD
but someone showed up on the helpJS room anyway :3
Grigor Minasyan
@gogminsam
Aug 28 2017 19:31
actually
/(\d{10})|(\d{3}-\d{3}-\d{4})/
worked
maybe I had some syntax mistake before
Gersho
@Gersho
Aug 28 2017 19:32
it was your attempt to fuse them that went wrong, the regex itself was valid (i guess? i sux at regex)
Gersho
@Gersho
Aug 28 2017 20:44
https://codepen.io/Gersho/pen/RZJPrZ
reworked the design a bit, opinions please :3
Stephen James
@sjames1958gm
Aug 28 2017 21:31
. @Gersho looks good didn't find any bugs
Mike Batista
@mbmontana
Aug 28 2017 21:41
I'm stuck on Truncate a String but I think I'm close. Might just be a matter of my confusion with indexing. The only place I'm not getting the green checkmark is when the second argument is a .length. Anyone got a hint?
function truncateString(str, num) {
  // Clear out that junk in your trunk
 var subStr;
  if (num <= 3) {subStr = str.slice(0, num) + "..."; 
  }
  else if (str.length + 1  > num) {subStr = str.slice(0, num-3) + "...";
  }
  else if (str.length + 1 <= num) {subStr = str;
  }

  return subStr;
}

truncateString("Apple", "Apple".length);
korzo
@korzo
Aug 28 2017 21:53
@mbmontana You should return str if num is less/equal str.length
Ian Hicks
@ijhicks
Aug 28 2017 21:55
hi.. i need some help with the weather api app stuff
so my issue is..
im trying to get lat and long
theres the navigator.geolocation business going on
then i try to store the location in to the lat/long variable and then log them to the console.
they come up undefined in that first call.. but then in the gotData function the call works?
i want to utimately build the api call from the lat long variables
Mike Batista
@mbmontana
Aug 28 2017 22:01
@korzo So if a string is five characters, does str.length start counting the characters at 0?
korzo
@korzo
Aug 28 2017 22:02
@mbmontana str.length <= num
@mbmontana array index counts from 0, not length
Mike Batista
@mbmontana
Aug 28 2017 22:07
@korzo Thanks! Man, that one was harder than it seemed.
CamperBot
@camperbot
Aug 28 2017 22:07
mbmontana sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
:cookie: 422 | @korzo |http://www.freecodecamp.com/korzo
Sly Fox
@Gurukorgi
Aug 28 2017 22:15
hello world
Gersho
@Gersho
Aug 28 2017 22:17
@sjames1958gm thanks for the review !
CamperBot
@camperbot
Aug 28 2017 22:17
gersho sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8407 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Aug 28 2017 22:25
@Gurukorgi hello
Sly Fox
@Gurukorgi
Aug 28 2017 22:26
@sjames1958gm thanks for having me here
CamperBot
@camperbot
Aug 28 2017 22:26
gurukorgi sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8408 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Aug 28 2017 22:27
@ijhicks getCurrentPosition is asynchronous, so you cannot use the lat lon until the callback is executed which will not be inline with the other code in the file.
@Gurukorgi :+1:
Sly Fox
@Gurukorgi
Aug 28 2017 22:27
its been a while since i was here
so what is the latest
Stephen James
@sjames1958gm
Aug 28 2017 22:39
Not a lot new - seems there are less people on line than before -
Gersho
@Gersho
Aug 28 2017 22:39
will probably grow back up in september
hopefully :)
Morchid Chellali
@Morched23MJ
Aug 28 2017 23:06
Can someone browsing on Chrome or Opera see if the two bottom timers along with the icon between them, are centered? Because on Mozilla, they're not.
Here is the pen: https://codepen.io/Morched23MJ/full/PKeQYQ/
Stephen James
@sjames1958gm
Aug 28 2017 23:07
@Morched23MJ On chrome they are centered
Morchid Chellali
@Morched23MJ
Aug 28 2017 23:07
Why on Mozilla they're not? out of date?
I'm on Linux too
Stephen James
@sjames1958gm
Aug 28 2017 23:11
@Morched23MJ Where are they on Mozilla (firefox?)
Morchid Chellali
@Morched23MJ
Aug 28 2017 23:12
They're a little on the left, it's like the text-align: center isn't working. Yes, firefox
Stephen James
@sjames1958gm
Aug 28 2017 23:14
@Morched23MJ Not sure the text-align has any impact with flex box
Morchid Chellali
@Morched23MJ
Aug 28 2017 23:14
How come it's working on other browsers? :l
Gersho
@Gersho
Aug 28 2017 23:18
https://ibb.co/bHnjxQ
left vivaldi, right firefox (linux mint)
if you click start multiple times the timer gets crazy
Morchid Chellali
@Morched23MJ
Aug 28 2017 23:21
Yes
If you want to re-start, you have to reset then, start a new session
should I block the start button after the first press?
Gersho
@Gersho
Aug 28 2017 23:21
you could fuse start and pause, that way you can't click start if it's already started
should I block the start button after the first press?
Yes
Yuserah Din
@YuserahN
Aug 28 2017 23:22
https://forum.freecodecamp.org/t/freecodecamp-algorithm-challenge-guide-arguments-optional/14271
On the first code solution on this page, arg2 was never initialized. So how does c + arg2 = a number? For example, if c is equal to 2, how does c + arg2 = 5, even though the code never stated what arg2 was supposed to equal?
Gersho
@Gersho
Aug 28 2017 23:22
if something can be used the wrong way make it impossible for them to break it
@YuserahN you mean like
function blabla(a){
}
blabla(a,b,c,d);
?
Morchid Chellali
@Morched23MJ
Aug 28 2017 23:23
Thank you, @Gersho. Else than that, do you see any bugs? and do you like the design?
CamperBot
@camperbot
Aug 28 2017 23:23
:cookie: 367 | @gersho |http://www.freecodecamp.com/gersho
morched23mj sends brownie points to @gersho :sparkles: :thumbsup: :sparkles:
Gersho
@Gersho
Aug 28 2017 23:24
@Morched23MJ the fields are a bit big for the value we plan to put on them (1-2 digits) and they could have a base value (25/5 ?)
Morchid Chellali
@Morched23MJ
Aug 28 2017 23:25
Well, the user could enter custom values, I can just put the value at 25/5 on the start
Gersho
@Gersho
Aug 28 2017 23:26
@Gersho oh and when you click reset, you should make it update the timer display right away (rather than having it resfresh at start) so the user knows the reset happened
Morchid Chellali
@Morched23MJ
Aug 28 2017 23:28
Found the location.reload() way easier. :smile: Will try to do it another way
@Gersho, why the outline still appears, even after I modified the css on focus to outline: none?
Gersho
@Gersho
Aug 28 2017 23:29
i dunno much about css sorry :P
try !important
Morchid Chellali
@Morched23MJ
Aug 28 2017 23:31
Where I put it tho?
Gersho
@Gersho
Aug 28 2017 23:32
div{
color:blue !important;
}
Morchid Chellali
@Morched23MJ
Aug 28 2017 23:34
Still persists. Anyway, thank you, @Gersho
CamperBot
@camperbot
Aug 28 2017 23:34
morched23mj sends brownie points to @gersho :sparkles: :thumbsup: :sparkles:
:warning: morched23mj already gave gersho points
Marin
@MarinBegovic
Aug 28 2017 23:51
yo anyone know how can i include my login modal on all my pages using php/jquery but still be able to link some jquery functions to the modal
i want to be able to manipulate the modal with jquery after i include it on the active page