These are chat archives for FreeCodeCamp/HelpFrontEnd

27th
Aug 2017
aRtoo
@artoodeeto
Aug 27 2017 00:00
@ehutchllew I could just check both if its integer by the function with parameter c
I mean x
Long Nguyen
@longnt80
Aug 27 2017 00:01
@artoodeeto which challenge?
ehutchllew
@ehutchllew
Aug 27 2017 00:02
@artoodeeto you could have a condition checking the typeof each argument being passed into your function
Pagnito
@Pagnito
Aug 27 2017 00:06
@ehutchllew imagine tho a rewind event for any event, that would be so nice lol
ehutchllew
@ehutchllew
Aug 27 2017 00:11
@Pagnito It'd be interesting. Like setting breakpoints when certain events occur, and being able to dip back into the state of the events at that breakpoint.
Pagnito
@Pagnito
Aug 27 2017 00:12
@ehutchllew ya
ehutchllew
@ehutchllew
Aug 27 2017 00:13
@artoodeeto Also, look into Array.from(arguments)
Rafael Monroy
@rafaelmonroy
Aug 27 2017 00:15

hey guys, I am having trouble posting my quotes to twitter using the twitter update status API, can anyone shine some light on me?


$(document).ready(function(){

  $("#btn").on("click", function(){
    $("#tweet").delay(1500).fadeIn();
    $.ajax({
      type: "GET",
      url: "https://talaikis.com/api/quotes/random/",
      success: function(quotes){
         $("#quote").html("Author: "+quotes.author+"<br> Quote: "+quotes.quote+"<br>")
      },
      error: function(){
        alert("error loading quotes");
      }
    }) 
  });

  $("#tweet").on("click", function(){
    $.ajax({
      type:"POST",
      url: "https://api.twitter.com/1.1/statuses/update.json",
      success: function(quotes){
         "Author: "+quotes.author+"<br> Quote: "+quotes.quote+"<br>"
      },
      error: function(){
        alert("error tweeting quotes");
      }
    })
  });

});

everything is operating smoothly except when I try to tweet our the quote

I keep getting the error message i set up lol
ehutchllew
@ehutchllew
Aug 27 2017 00:20
@rafaelmonroy Been a while since I used jQuery, but I don't see where you're posting any data.
Rafael Monroy
@rafaelmonroy
Aug 27 2017 00:23
i think I am posting here?
 $("#tweet").on("click", function(){
    $.ajax({
      type:"POST",
      url: "https://api.twitter.com/1.1/statuses/update.json",
      success: function(quotes){
         "Author: "+quotes.author+"<br> Quote: "+quotes.quote+"<br>"
      },
      error: function(){
        alert("error tweeting quotes");
      }
    })
  });
@ehutchllew
do you know anywhere where I can find more informaiton about posting status with AJAX?
ehutchllew
@ehutchllew
Aug 27 2017 00:24
@rafaelmonroy Again, someone correct me if I'm wrong, but what you're doing here is trying to send something back to a database with new data, but you're not stating which data.
@rafaelmonroy I believe you need a data: "something" property in your POST call
Rafael Monroy
@rafaelmonroy
Aug 27 2017 00:25
@ehutchllew oh ok, i see what you’re saying
ehutchllew
@ehutchllew
Aug 27 2017 00:26
Rafael Monroy
@rafaelmonroy
Aug 27 2017 00:26
let me mess around with this new information lol
@ehutchllew thanks!
CamperBot
@camperbot
Aug 27 2017 00:26
rafaelmonroy sends brownie points to @ehutchllew :sparkles: :thumbsup: :sparkles:
:cookie: 355 | @ehutchllew |http://www.freecodecamp.com/ehutchllew
ehutchllew
@ehutchllew
Aug 27 2017 00:26
np
Zachary Orona-Calvert
@TheTRUEHoohah
Aug 27 2017 00:39
hey guys how would i make the black boarder of a text box blend in with my background?
Rafael Monroy
@rafaelmonroy
Aug 27 2017 00:45
@TheTRUEHoohah you want to set the border color the same as background color?
Dante M Brown
@Vyceroy
Aug 27 2017 00:52
I am in need of some help with basic algorithm scripting in javascript
Rafael Monroy
@rafaelmonroy
Aug 27 2017 01:01
@Vyceroy maybe i can help you, I just finished that section last week
Dante M Brown
@Vyceroy
Aug 27 2017 01:02
I can't figure out the whole Title casing a sentence
Rafael Monroy
@rafaelmonroy
Aug 27 2017 01:04
@Vyceroy I seperate the whole string into words first
can i see your code? @Vyceroy
Dante M Brown
@Vyceroy
Aug 27 2017 01:06

function titleCase(str) {
var arrStr = str.split(' ');
for (var i = 0; i < arrStr.length; i++) {
arrStr[i].replace(arrStr[i].charAt(0), arrStr[i].charAt(0).toUpperCase());
}
return arrStr.join(' ');
}

titleCase("i'm a little tea pot");

Moisés Man
@moigithub
Aug 27 2017 01:08
since string is immutable
all strings methods return a new string
sooo u need to reassign that new value
Rafael Monroy
@rafaelmonroy
Aug 27 2017 01:11
@Vyceroy after seperating the string into words and going through the first loop, you can create a new variable that equals to =arrStr[i].split(‘’) so you can target each individual word’s first letter with newVar[0]
Zachary Orona-Calvert
@TheTRUEHoohah
Aug 27 2017 01:11

<!DOCTYPE html>

<html>

<head>

<style>
body {
height:cover;
background: red; / For browsers that do not support gradients /
background: -webkit-linear-gradient(red, yellow); / For Safari 5.1 to 6.0 /
background: -o-linear-gradient(red, yellow); / For Opera 11.1 to 12.0 /
background: -moz-linear-gradient(red, yellow); / For Firefox 3.6 to 15 /
background: linear-gradient(red, yellow); / Standard syntax (must be last) /
}
</style>
</head>

<body>

<h3>Linear Gradient - Top to Bottom</h3>

<p>This linear gradient starts at the top. It starts red, transitioning to yellow:</p>

<div id="grad1"></div>

<p><strong>Note:</strong> Internet Explorer 9 and earlier versions do not support gradients.</p>

</body>
</html>
how would i make it fill that page

Rafael Monroy
@rafaelmonroy
Aug 27 2017 01:12
then set newVar[0] = newVar[0].toUpperCase(); @Vyceroy
Dante M Brown
@Vyceroy
Aug 27 2017 01:19
It still isn't doing anything
Moisés Man
@moigithub
Aug 27 2017 01:27

string is immutable..

replace return a new string soo u need to reassign it IF u wanna keep this new value @Vyceroy

Bigyan Karki
@bigyankarki
Aug 27 2017 01:27
can anyone help me to set billing address and shipping address same while i check "same as shipping address" in billing panel
korzo
@korzo
Aug 27 2017 01:33
@bigyankarki You should add ids'/names to fields in #shippingInfo
@bigyankarki Then listen on change event on checkbox and copy values from #shippingInfo form
Moisés Man
@moigithub
Aug 27 2017 01:36
move the id's from the div to the input/textbox elements @bigyankarki
Bigyan Karki
@bigyankarki
Aug 27 2017 01:42
okay doing that
Bigyan Karki
@bigyankarki
Aug 27 2017 01:48
DAMN!! it works :D
cant thank you enough @moigithub
CamperBot
@camperbot
Aug 27 2017 01:49
bigyankarki sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 3607 | @moigithub |http://www.freecodecamp.com/moigithub
Rafael Monroy
@rafaelmonroy
Aug 27 2017 01:52
@Vyceroy since you split your array into letters also, you have to join them back before returning
Ruchika Sharma
@ruchika90
Aug 27 2017 03:01
@Manish-Giri thx it worked
CamperBot
@camperbot
Aug 27 2017 03:01
ruchika90 sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 6468 | @manish-giri |http://www.freecodecamp.com/manish-giri
Ismail Hozain
@ismailhozain
Aug 27 2017 03:26
Hey so i have an issue with my wikipedia viewer and the real problem is :I have absolutely NO clue how on earth i can output my info.Please help https://codepen.io/ismailhozain/pen/OjvzaZ?editors=1010
iso
@iso1048
Aug 27 2017 03:31
@ismailhozain Do you know what data you receive from the json?
Ismail Hozain
@ismailhozain
Aug 27 2017 03:43
@gothamknight not too sure but it is supposed to be a series of wikipedia entries
iso
@iso1048
Aug 27 2017 03:53

@ismailhozain I think you may be using different search parameters than i did, because you want to be getting the name of the page, the first sentence on the page and a link to the page. try using the url below:

var url = "https://en.wikipedia.org/w/api.php?action=opensearch&format=json&origin=*&search=" +'test';

Then look on your browser console to see the json you receive.

and remove var results = info.query.search; that line of code for the time being
Ismail Hozain
@ismailhozain
Aug 27 2017 03:55
Here are my parameters " var url = "https://en.wikipedia.org/w/api.php?action=query&format=json&origin=*&list=search&srsearch=" + searchInput;
iso
@iso1048
Aug 27 2017 03:57
@ismailhozain replace what you have with the one i gave above bro
Ismail Hozain
@ismailhozain
Aug 27 2017 03:57
ok
iso
@iso1048
Aug 27 2017 03:58
then look on the browser console to see the json
Ismail Hozain
@ismailhozain
Aug 27 2017 03:58
i got an error
iso
@iso1048
Aug 27 2017 03:59
did you remove this line: var results = info.query.search;?
Ismail Hozain
@ismailhozain
Aug 27 2017 03:59
same issue
and same error
it does not like the search part of the link
iso
@iso1048
Aug 27 2017 04:00
can you link your pen again please
iso
@iso1048
Aug 27 2017 04:02
@ismailhozain just delete that line above and it works. So only have this:
$.ajax({
    url: url,
    success: function(info) {
      console.log(url);
      console.log(info);
      $("#output").html(results);
    }
  });
as your ajax call
Ismail Hozain
@ismailhozain
Aug 27 2017 04:03
oh i am sorry i was deleting the wrong line at first stupid me
ok it worked but now how do i output it
iso
@iso1048
Aug 27 2017 04:05
no worries. so do you see the json in the browser console?
Ismail Hozain
@ismailhozain
Aug 27 2017 04:05
yep
Zachary Orona-Calvert
@TheTRUEHoohah
Aug 27 2017 04:09
hey guys check out my Rubiks Cube Scramble and stopwatch https://codepen.io/theTRUEHOOHAH/pen/NvgXgb?q=rubiks%20timer
click on link pen doesnt render right
Ismail Hozain
@ismailhozain
Aug 27 2017 04:10
cool
@gothamknight you there
/
?
iso
@iso1048
Aug 27 2017 04:11

ok, so you see that it is an array which contains 3 arrays within it - the first nested array is the title, the second is the summary and the third is the link.

So if i wanted to display these on the page, i could do something like:

$("#target_element").html(
"<h1>"+info[1][i]+"</h2>" +
"<a href="+ info[3][i]+ "><p>"+info[2][i]+"</p></a>"
)
so you can use a for-loop with i to loop through the arrays
Ismail Hozain
@ismailhozain
Aug 27 2017 04:13
new issue it shows a really funky line of code in place of my output
node.js somethin
g
i tried your suggestion nothing is showing up
iso
@iso1048
Aug 27 2017 04:17
your searchInput variable doesnt have a value. you want to declare that variable and make the ajax call inside a button-click function
Ismail Hozain
@ismailhozain
Aug 27 2017 04:18
ok i will try that
how do you want me to define searchinput it is attached to the form
iso
@iso1048
Aug 27 2017 04:21
the way you have it currently is fine I think. It just needs to be inside the click function
Ismail Hozain
@ismailhozain
Aug 27 2017 04:21
oh ok
argh not getting anything
here i am sorry for wasting your time but i gotta go (parents might get mad)
iso
@iso1048
Aug 27 2017 04:25
@ismailhozain no worries bro. haha ok.
Ismail Hozain
@ismailhozain
Aug 27 2017 04:26
ok bye
thanks though
iso
@iso1048
Aug 27 2017 04:26
no problem
bye
Zachary Orona-Calvert
@TheTRUEHoohah
Aug 27 2017 04:58
hey guys made some quick changes
https://codepen.io/theTRUEHOOHAH/pen/NvgXgb
prakash chandra yadav
@prakashyadav008
Aug 27 2017 05:25
hey can anyone help me out
https://codepen.io/prakashyadav008/pen/brjQOb
i cant see the background color in section1-1
A_A
@Otto-AA
Aug 27 2017 05:44
@prakashyadav008 In CSS you don't comment out with # but with /* height: 30px; */. Maybe that is the error?
prakash chandra yadav
@prakashyadav008
Aug 27 2017 05:45
@Otto-AA thats not an error
how do i remove the space between the search bar and search button
A_A
@Otto-AA
Aug 27 2017 05:46
@prakashyadav008 But the hash in this place is definitely invalid css ^^
prakash chandra yadav
@prakashyadav008
Aug 27 2017 05:46
A_A
@Otto-AA
Aug 27 2017 05:49
@prakashyadav008 Maybe read this stackoverflow question: https://stackoverflow.com/questions/9832754/i-cant-remove-the-margin-between-two-input-fields
(If you don't understand it there, I can explain it to you, but it's always a good idea to learn reading Stackoverflow Questions and Answers :smile: )
Jonny Blewitt
@Jonny-B
Aug 27 2017 08:26
I've got a beginner CSS question if anyone has a second.
iso
@iso1048
Aug 27 2017 08:27
yeah fire away
Jonny Blewitt
@Jonny-B
Aug 27 2017 08:27
I'm not sure how to post code so bear with me...
iso
@iso1048
Aug 27 2017 08:28
use 3 of these: `, at the top and bottom of the code
Jonny Blewitt
@Jonny-B
Aug 27 2017 08:28
So, I'm trying to reference my CSS file and it will simply not find it. I've got my most recent code on my git repo or I can post the file paths here.
<link rel="stylesheet" type="text/css" href="test">
CamperBot
@camperbot
Aug 27 2017 08:29
:bulb: to format code use backticks! ``` more info
Jonny Blewitt
@Jonny-B
Aug 27 2017 08:29
ok
So would you like to see the repo or just handle it in here?
iso
@iso1048
Aug 27 2017 08:30
ill take a look at the repo too. (by the way, I might not be able to solve this issue but I will still try)
so in my views/index.erb
trying to link my css doc.
which is in assets/css/table.css
I've tried every path I can think of without success.
shoot.
Wait ya thats the path its says it cant find it at
That seems like the right path to find it in. Obviously that link wont help you but its from my console output.
Jonny Blewitt
@Jonny-B
Aug 27 2017 08:36
Thoughts?
iso
@iso1048
Aug 27 2017 08:37
does budget/lib/assets/css/table.css work? I do not have practice with navigating through file systems, but would you want to rename the assets/css folder, so that is does not contain a / ?
probably wont matter actually
Jonny Blewitt
@Jonny-B
Aug 27 2017 08:40
my linter doesn't seem to think there is any issue with the formatting of the css file.
But the error is a 404 which means it can't even find the file.
assets doesn't have a '/' in the filename.
*"foldername"
do you mean in the href?
iso
@iso1048
Aug 27 2017 08:42
nah that was my mistake. forget I said that. So budget/lib/assets/css/table.css didnt work?
Jonny Blewitt
@Jonny-B
Aug 27 2017 08:42
nope
One sec though.
Looks like I didn't push latest to github.
There
I had two view folders
I wonder if that is why it was confused...
Jonny Blewitt
@Jonny-B
Aug 27 2017 08:52
So I just dragged the css file into the folder with the erb file
changed the href to <link rel="stylesheet" type="text/css" href="table.css">
Still didn't work.
There is something else going on...
iso
@iso1048
Aug 27 2017 08:57
href="/table.css"?
Jonny Blewitt
@Jonny-B
Aug 27 2017 08:57
nope
I think I'm doing something else wrong.
If the two files are in the same folder it shouldn't have a problem finding it.
iso
@iso1048
Aug 27 2017 09:00
sorry bro i don't have any other ideas. I am still interested to know the problem though
Fabien SHAN
@X140hu4
Aug 27 2017 09:01
../../assets/css/table.css
maybe?
Jonny Blewitt
@Jonny-B
Aug 27 2017 09:01
I'll let you know if I figure it out
@X140hu4 I'll try that.
nope
Fabien SHAN
@X140hu4
Aug 27 2017 09:03
I understand that the css file is: Excersizes/budget/lib/assets/css/table.css and the file you want to link it to Excersizes/budget/lib/views/index.erb
is this right?
Jonny Blewitt
@Jonny-B
Aug 27 2017 09:03
yep
Something to not.
Fabien SHAN
@X140hu4
Aug 27 2017 09:04
can you try this ? ../assets/css/table.css
Jonny Blewitt
@Jonny-B
Aug 27 2017 09:04
When I put the css and erb files in question into the same folder and change the href to table.css it still doesn't work.
*change the href to href="table.css" it still doesn't work
Still doesn't work.
when I try ../assets/css/table.css
Fabien SHAN
@X140hu4
Aug 27 2017 09:11
it works for me. add a background color to an element that will help determine if it is linked correctly.
Jonny Blewitt
@Jonny-B
Aug 27 2017 09:13
The 404 error tells me its not finding the file.
lazzlo
@lazzlo
Aug 27 2017 10:55
@Jonny-B To access other files in the same folder try: ./FILENAME.js
So only one dot
why this is not working for status please help me
idrees khan
@khanidrees
Aug 27 2017 11:03
and why the List is changing
order
just1witness
@just1witness
Aug 27 2017 11:13
I'm assuming stream is input from an API, is that the only possible input? Maybe your getting a different result that hasn't been addressed and therefore it is returning undefined?
@khanidrees
Trommelochse
@Trommelochse
Aug 27 2017 11:14
@khanidrees for me it's working
idrees khan
@khanidrees
Aug 27 2017 11:15
is it changing the order on run? @Trommelochse
Trommelochse
@Trommelochse
Aug 27 2017 11:16
yes, it does
idrees khan
@khanidrees
Aug 27 2017 11:17
i am unable to find the problem
LiciniusRex
@hashtagyolo1
Aug 27 2017 11:17
I am so close to being done with the weather app that I can taste it. However I can't work out why this isn't working now.
https://codepen.io/LiciniusRex/pen/rzKwvG?editors=1011
say the left hand side is assignment is invalid.
Trommelochse
@Trommelochse
Aug 27 2017 11:18
@khanidrees I believe it is because you are making async requests, and some responses are faster than others (randomly), hence it is rendered in random order
just1witness
@just1witness
Aug 27 2017 11:18
@khanidrees Maybe that is due to calling the username list twice using the for loop?
I don't know
Trommelochse
@Trommelochse
Aug 27 2017 11:18
to tackle the problem I would split the ajax calls from teh rendering
first get the userdata and store it in some variable.
then take the userdata and render it
just1witness
@just1witness
Aug 27 2017 11:20
Your calling it twice with the for loop index
I don't know what that would do, did you try re initiating i to 0 first?
before the second call?
@hashtagyolo1 I can't see your pen, you have errors in your javascript
idrees khan
@khanidrees
Aug 27 2017 11:22
Can anyone tell me why it is changing the order
of the array
Trommelochse
@Trommelochse
Aug 27 2017 11:22
@khanidrees read what I wrote above
just1witness
@just1witness
Aug 27 2017 11:22
Try setting the value of i to 0 before you call it again
@khanidrees
@khanidrees or do what @Trommelochse said, that sounds good. :)
just1witness
@just1witness
Aug 27 2017 11:25
Haha! That was funny, yeah, do what @Trommelochse says
LiciniusRex
@hashtagyolo1
Aug 27 2017 11:27
I now @just1witness , trying to work out wjy they'r there
know*
function tempChange(){
  if (document.getElementById("tempButton").innerHTML === "C"){
    document.getElementById("temperature").innerHTML = document.getElementById("temperature").innerHTML * 1.8 + 32 && document.getElementById("tempButton").innerHTML = "F";
  } else {
    document.getElementById("temperature").innerHTML - 32 / 1.8 && document.getElementById("tempButton").innerHTML = "C";
  }
}
error seem to be after && before the else
just1witness
@just1witness
Aug 27 2017 11:28
@hashtagyolo1 I would try a few things, but I can't update your pen
Do you have some privacy setting on?
LiciniusRex
@hashtagyolo1
Aug 27 2017 11:29
nope, don't have pro
just1witness
@just1witness
Aug 27 2017 11:31
huh, weird. I can update @khanidrees pen
LiciniusRex
@hashtagyolo1
Aug 27 2017 11:32
no idea as to what would be causing that. I'll try forking it and see if that allows change
just1witness
@just1witness
Aug 27 2017 11:32
XD XD XD @hashtagyolo1 your about section though! XD
LiciniusRex
@hashtagyolo1
Aug 27 2017 11:32
Don't remember what it says :/
just1witness
@just1witness
Aug 27 2017 11:33
@hashtagyolo1 nvm I forked it
I'll pay with it a bit
Oh, I get it, you have auto preview on, that's why there's no run button... where am I going without a helmet?
LiciniusRex
@hashtagyolo1
Aug 27 2017 11:35
@just1witness , yeah. I keep forgetting to turn it off
Mukesh Kumar Angrish
@MukeshAngrish
Aug 27 2017 11:36
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. Also I have some issue with the html/css maybe as the divs move from their location when I click on them.
just1witness
@just1witness
Aug 27 2017 11:40
@hashtagyolo1 I know this isn't breaking it, but out of curiosity, do you mean to have temperature called out twice, the first one being empty?
document.getElementById("temperature").innerHTML = document.getElementById("temperature").innerHTML * 1.8 + 32 &&
LiciniusRex
@hashtagyolo1
Aug 27 2017 11:44
I've rewritten it so it's a lot clearer if this helps
function tempChange(){
  var tempSign = document.getElementById("tempButton").innerHTML;
  var temperature = document.getElementById("temperature").innerHTML
  if (tempSign === "C"){
    temperature = temperature * 1.8 + 32 && 
      tempSign = "F";
  } else {
    temperature - 32 / 1.8 && 
      tempSign = "C";
  }
}
never mind. I think I've got it now. Trying to condense it seemed to break it in a different way, but I'm nearly there now. I think I need to get a duck
just1witness
@just1witness
Aug 27 2017 11:47
@hashtagyolo1 I'm not sure what is going wrong on yours, but I thought I would share another way to do it. This is how I did my conversion using onclick
  console.log('ready');
$("#c").on("click", myFunction);
 function myFunction() {
   console.log('Clicked');
This being followed by the conversion command
here
```
here
var celsius = (temp -32)*.5556; 
  var converted = Math.ceil(celsius);
converted =  $('#temp').html('Current Temperature: ' + converted + '&deg;C')
LiciniusRex
@hashtagyolo1
Aug 27 2017 11:50
Your's looks a lot less hacky than my own @just1witness
just1witness
@just1witness
Aug 27 2017 11:51
lol, hacky's fun!
@hashtagyolo1
LiciniusRex
@hashtagyolo1
Aug 27 2017 11:52
It is. WHich is lucky. It's all I have this early in the game
just1witness
@just1witness
Aug 27 2017 11:52
@hashtagyolo1 very cool, it works well now. Now you just have to get rid of all those decimal places, haha. ;)
LiciniusRex
@hashtagyolo1
Aug 27 2017 11:52
I basically have it working. However when converting to Fahrenheit it's subtracting the 32, but then not divising by 1.8. Not sure why
just1witness
@just1witness
Aug 27 2017 11:53
order of operations
you need strategically placed parentheses
LiciniusRex
@hashtagyolo1
Aug 27 2017 11:53
ah, hadn't thought of bodmas. Thanks
just1witness
@just1witness
Aug 27 2017 11:53
no prob
gtg, I hope it goes well for you, I remember wanting to bang my head against a brick wall doing that one. :) @hashtagyolo1
LiciniusRex
@hashtagyolo1
Aug 27 2017 11:56
I spent 2 days trying to get the Darksky API to work before finding out that it won't work properly via codepen...
WOHOO! thanks @just1witness. All my maths is now working :D
CamperBot
@camperbot
Aug 27 2017 11:58
hashtagyolo1 sends brownie points to @just1witness :sparkles: :thumbsup: :sparkles:
:cookie: 299 | @just1witness |http://www.freecodecamp.com/just1witness
Mukesh Kumar Angrish
@MukeshAngrish
Aug 27 2017 11:58
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. Also I have some issue with the html/css maybe as the divs move from their location when I click on them.
LiciniusRex
@hashtagyolo1
Aug 27 2017 12:20
sorry @MukeshAngrish. Got no idea why it's moving around like that
Mukesh Kumar Angrish
@MukeshAngrish
Aug 27 2017 12:24
@hashtagyolo1 Hey LiciniusRex, did you check the other issue(the one involving minmax() function)? I could solve the html issue by recreating the app differently. But I want to solve the programming issue first.
LiciniusRex
@hashtagyolo1
Aug 27 2017 12:30
@MukeshAngrish let me look again
just1witness
@just1witness
Aug 27 2017 12:32
@hashtagyolo1 Huh, that's odd, I used darksky and it's still working for me
LiciniusRex
@hashtagyolo1
Aug 27 2017 12:33
I think that's a bit too advanced for me at the moment @MukeshAngrish
just1witness
@just1witness
Aug 27 2017 12:33
At least I think... does it tell you your local temp? @hashtagyolo1
https://codepen.io/Just1witness/pen/BZRozr
LiciniusRex
@hashtagyolo1
Aug 27 2017 12:34
yep, works fine
just1witness
@just1witness
Aug 27 2017 12:34
@MukeshAngrish what @hashtagyolo1 said.
@hashtagyolo1 thanks :)
CamperBot
@camperbot
Aug 27 2017 12:34
just1witness sends brownie points to @hashtagyolo1 :sparkles: :thumbsup: :sparkles:
:cookie: 265 | @hashtagyolo1 |http://www.freecodecamp.com/hashtagyolo1
Mukesh Kumar Angrish
@MukeshAngrish
Aug 27 2017 12:35
@hashtagyolo1 @just1witness no worries. Thanks for looking into the issue.
CamperBot
@camperbot
Aug 27 2017 12:35
mukeshangrish sends brownie points to @hashtagyolo1 and @just1witness :sparkles: :thumbsup: :sparkles:
:cookie: 266 | @hashtagyolo1 |http://www.freecodecamp.com/hashtagyolo1
:cookie: 300 | @just1witness |http://www.freecodecamp.com/just1witness
just1witness
@just1witness
Aug 27 2017 12:35
@MukeshAngrish Wish I could be more helpful :)
LiciniusRex
@hashtagyolo1
Aug 27 2017 12:36
Just need to work out how to turn the image return url into html and then i can move on to the next project
just1witness
@just1witness
Aug 27 2017 12:36
Nice. I went with css styling and made my life much more difficult than it had to be, but I learned lot in the process.
I could have just used darksky icons
Mukesh Kumar Angrish
@MukeshAngrish
Aug 27 2017 12:37
@hashtagyolo1 what project are you working on? I might be able to help
LiciniusRex
@hashtagyolo1
Aug 27 2017 12:39
weather app. https://codepen.io/LiciniusRex/pen/KvxbQa?editors=1111
Just starting on the final section before making it all look not fugly.
BuntyBru
@BuntyBru
Aug 27 2017 12:40
Can anyone explain
WHat is the difference between " ===" and "==" in JavaScript
?
Ahmed raza
@Raza403
Aug 27 2017 12:40
Hi I need help for my "Wikipedia viewer", I am trying to get json from wikipedia open search but I am not receiving JSON, Can't figureout whats the problem, Need some help please https://codepen.io/raza403/pen/mMGqML
just1witness
@just1witness
Aug 27 2017 12:40
strict equality "===" loose equality "=="
@BuntyBru
in other words 1 === 1 = true
1 ==="1" = false
1 == "1 = true
@BuntyBru
1 == "1" = true*
BuntyBru
@BuntyBru
Aug 27 2017 12:42
ok
thanks
just1witness
@just1witness
Aug 27 2017 12:42
no prob
Mukesh Kumar Angrish
@MukeshAngrish
Aug 27 2017 12:42
@BuntyBru
== checks if a value is same as the other. e.g. 5 is same as “5”. But one is integer and the other is a string.
=== solves this issue by checking the type of the value too. So in this case 5 is not same as “5”
Vasily Belolapotkov
@vbelolapotkov
Aug 27 2017 12:43
@Raza403 you have attached click handler to the button element, but when you click that button form submit event is fired as well
@Raza403 as you don’t have any handle on form submit the default browser behaviour is to send HTTP POST request
Ahmed raza
@Raza403
Aug 27 2017 12:44
@vbelolapotkov I don't get it
BuntyBru
@BuntyBru
Aug 27 2017 12:44

@MukeshAngrish

var num= prompt("Enter a number");
var secretNumber =7;
if(num==secretNumber)
{
alert("You got it right");
}
else if (num > 7)
{

console.log("Too high");
}

else if( num<7)
{
console.log("TOO LOW");
}

now in this code if in the third line i put (num===secretNumber) I do not get the alert

@just1witness
put the value of num=7
LiciniusRex
@hashtagyolo1
Aug 27 2017 12:45
WOO, got it :D
Vasily Belolapotkov
@vbelolapotkov
Aug 27 2017 12:46
@Raza403 apply following changes
$("#searchButton").click(function (evt) {
   evt.preventDefault()
  ...
}
BuntyBru
@BuntyBru
Aug 27 2017 12:46
@hashtagyolo1
got what :P
Mukesh Kumar Angrish
@MukeshAngrish
Aug 27 2017 12:46
@BuntyBru Because the prompt returns 7 as a string which is not same as the integer 7 of the num variable
just1witness
@just1witness
Aug 27 2017 12:47
It looks like your variable "num" needs to be updated to the input. @MukeshAngrish
As it is it equals prompt("Enter a number");
I would store the input in another variable and use that
Ahmed raza
@Raza403
Aug 27 2017 12:47
@vbelolapotkov Ok I am doing it
just1witness
@just1witness
Aug 27 2017 12:48
instead of num @MukeshAngrish
BuntyBru
@BuntyBru
Aug 27 2017 12:48

@MukeshAngrish

okay , that was very useful
Thanks mate

CamperBot
@camperbot
Aug 27 2017 12:48
buntybru sends brownie points to @mukeshangrish :sparkles: :thumbsup: :sparkles:
:cookie: 297 | @mukeshangrish |http://www.freecodecamp.com/mukeshangrish
just1witness
@just1witness
Aug 27 2017 12:49
sorry wrong person @BuntyBru above
LiciniusRex
@hashtagyolo1
Aug 27 2017 12:49
Just need to get it to not be to 10 decimal places now
Ahmed raza
@Raza403
Aug 27 2017 12:50
@vbelolapotkov No change occured
Vasily Belolapotkov
@vbelolapotkov
Aug 27 2017 12:50
@Raza403 Some additional explanation - as your <button> is placed inside <form> all button clicks will fire form ‘submit’ event by default. As you don’t have custom handler for the form ‘submit’ event browser uses default behaviour, which is send new http post request to the server. This request leads to browser page reload.
just1witness
@just1witness
Aug 27 2017 12:50
Good job @hashtagyolo1 , do you know how to round the numbers so you only get a whole integer?
Ahmed raza
@Raza403
Aug 27 2017 12:50
Ok I,ll work on it
Mukesh Kumar Angrish
@MukeshAngrish
Aug 27 2017 12:50
@hashtagyolo1 Congratulations!!
Ahmed raza
@Raza403
Aug 27 2017 12:50
@vbelolapotkov
LiciniusRex
@hashtagyolo1
Aug 27 2017 12:51
Just working on that now @just1witness
just1witness
@just1witness
Aug 27 2017 12:51
:)
Ahmed raza
@Raza403
Aug 27 2017 12:53
@vbelolapotkov Thanks for pointing out
CamperBot
@camperbot
Aug 27 2017 12:53
raza403 sends brownie points to @vbelolapotkov :sparkles: :thumbsup: :sparkles:
:cookie: 260 | @vbelolapotkov |http://www.freecodecamp.com/vbelolapotkov
Vasily Belolapotkov
@vbelolapotkov
Aug 27 2017 12:53
@Raza403 you need to update url as well
add &origin=* to the end
it will not block request by ‘Access-Control-Allow-Origin’ policy
Ahmed raza
@Raza403
Aug 27 2017 12:55
@vbelolapotkov I have added it to the url, But first I should work on my form
Vasily Belolapotkov
@vbelolapotkov
Aug 27 2017 12:56
@Raza403 With that you shoul be able to get some data in the console.
In your url search for the ‘api’ is encoded. Do you have this in the console?
Ahmed raza
@Raza403
Aug 27 2017 12:57
I will change 'api' with the search term, I was just checking with the default url provided by wikipedia
@vbelolapotkov And yes I am getting data now
Vasily Belolapotkov
@vbelolapotkov
Aug 27 2017 12:59
@Raza403 cool! So you’re pretty close to make it work ;) Let me know if need further assistance
Ahmed raza
@Raza403
Aug 27 2017 13:00
@vbelolapotkov Yes I think so, Thanks a lot for the help
CamperBot
@camperbot
Aug 27 2017 13:00
raza403 sends brownie points to @vbelolapotkov :sparkles: :thumbsup: :sparkles:
:warning: raza403 already gave vbelolapotkov points
LiciniusRex
@hashtagyolo1
Aug 27 2017 13:02
officially done. Big thanks to all for your help on the weather app. Way too lazy to make it look pretty.
just1witness
@just1witness
Aug 27 2017 13:09
Good job! @hashtagyolo1 Now you can sigh a breath of relief, anddddddd start the twitch.io app! :D
Oh, wait, I mean wiki viewer, haha. I haven't worked on the projects for awhile, I decided to finish the algo's first
LiciniusRex
@hashtagyolo1
Aug 27 2017 13:12
I was too ready to start putting things into practice. I was starting feel like ti was all an intellectual exercise without a real use case at the end. I'm looking forward to getting back into them once these 2 are done
assuming I can ever work out how the hell the wiki api works
just1witness
@just1witness
Aug 27 2017 13:15
It's a tough one, but I had a harder time with the weather app personally. I haven't done the Twitch.io app yet. Only 5 more advanced algo's left before I work on projects again. I would recommend looking at exact change though, it is very practical, and I learned more with that than any challenge or project so far. @hashtagyolo1
It took me 4 days to figure out, but it was a great experience!
Marat
@Marat89bluolyu
Aug 27 2017 13:32
Hi all, need help with my function calculator. I need to check for two numbers. But now i have check for only one. How to do this?
https://codepen.io/marat89/pen/OjodLX
BERTINI Nickolas
@Ophellia
Aug 27 2017 13:51
Hello, can someone help me with scrollspy for bootstrap 4 ? i cant fint where is my mistake https://codepen.io/Ophe/pen/WEgaLy
Ken Haduch
@khaduch
Aug 27 2017 13:53
@Ophellia - not sure if this is the problem, but it is a problem. You are missing an add-in that's causing an error: Uncaught Error: Bootstrap dropdown require Popper.js (https://popper.js.org) at bootstrap.min.js:6 at bootstrap.min.js:6 at bootstrap.min.js:6
I added that in my working copy - it has to be loaded before bootstrap.js, and it changed the behavior. Still not working.
idrees khan
@khanidrees
Aug 27 2017 14:00
@just1witness please
Marat
@Marat89bluolyu
Aug 27 2017 14:01
i have many else if statements in my code
https://codepen.io/marat89/pen/OjodLX
how to short it and make beautify?
Ken Haduch
@khaduch
Aug 27 2017 14:03
@Ophellia - after adding that "Popper.js", add this in your JS panel: $('body').scrollspy({ target: '#scroll' }) that enables the feature, at least it seems to be working for me in the copy of your Pen that I'm working with.
@Ophellia - i saved the working copy of your pen here in my pens in case you have questions about how I got it working.
BERTINI Nickolas
@Ophellia
Aug 27 2017 14:06
@khaduch it's working finaly, thanks a lot
CamperBot
@camperbot
Aug 27 2017 14:06
ophellia sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3243 | @khaduch |http://www.freecodecamp.com/khaduch
Ken Haduch
@khaduch
Aug 27 2017 14:06
@Ophellia - great! You're welcome and best of luck as you continue working on it.
Ken Haduch
@khaduch
Aug 27 2017 14:14
@Marat89bluolyu - Just a quick thought - you could potentially put your two values into an array and use one of the array methods or even a for loop to process them. That would eliminate some of the redundant code where you are doing the same tests on numb1 and numb2
Kevin Elser
@CoffeeCodeKevin
Aug 27 2017 14:21
If anyone gets the chance, could someone look at my codepen (https://codepen.io/keccakec/pen/mMGvVV) and help me figure out why my rendition of Game of Life seems to be allowing exponential growth? The function used to check for neighbors and their status seems to get the correct neighbors in the 8 directions around a tile, and patterns like still life still work. This leads me to believe it is the rendering or updating itself that is the issue, the check I have in place to see how many of the neighbors are living, or something else I haven't noticed. I'm currently doing some housework between working on this, so apologies if I take a bit to reply. Any help at all is appreciated.
Also, I know what can be done to speed up the app and plan to implement it soon, I just wanted to figure this issue out first.
Marat
@Marat89bluolyu
Aug 27 2017 14:26
@khaduch thank you!
CamperBot
@camperbot
Aug 27 2017 14:26
marat89bluolyu sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3244 | @khaduch |http://www.freecodecamp.com/khaduch
Marat
@Marat89bluolyu
Aug 27 2017 15:12
@khaduch i remaked my calc with arrays, but cant equal values after that for my variables numb1 & numb2. How to do that?
https://codepen.io/marat89/pen/OjodLX
Tom
@moT01
Aug 27 2017 15:43
@keccakec i took a look,
stuck on understanding the algorithm, i haven't used those ? tests much
idrees khan
@khanidrees
Aug 27 2017 15:44
help me
Tom
@moT01
Aug 27 2017 15:44
you sure you're using that right?
@khanidrees whats the problem
Richard
@rylew0925
Aug 27 2017 15:45
Would someone please help answer a question I have about the "Target a Specific Child of an Element Using jQuery" lesson?
Tom
@moT01
Aug 27 2017 15:46
@rylew0925 no need to ask for help, just ask your question
idrees khan
@khanidrees
Aug 27 2017 15:46
@moT01 the array is changing after run
Ahmed raza
@Raza403
Aug 27 2017 15:46
I have made 'Wikipedia viewer'
idrees khan
@khanidrees
Aug 27 2017 15:47
@moT01 the status and channel info is fluctuating
Richard
@rylew0925
Aug 27 2017 15:48
In the "Target a Specific Child of an Element Using jQuery" lesson, how would the program know that the "animated bounce" class would be used under the "well" class? The code never mentioned anything about where to place the "bounce class"
your code is running faster than the results get returned, ---forEach stops that
pretty sure anyway
Richard
@rylew0925
Aug 27 2017 15:52
I meant how would the program know where to place the animation since the code did not mention any parent or child class?
Tom
@moT01
Aug 27 2017 15:54
it's targeting the nth-child(3)
means the third child
Richard
@rylew0925
Aug 27 2017 15:59
But how would the program know that the third child is referring to the target classes?
Tom
@moT01
Aug 27 2017 16:02
the example code $(".target:nth-child(3)").addClass("animated bounce");
so i suppose it targets the third .target
Richard
@rylew0925
Aug 27 2017 16:03
Oh. I'm so blind
Amit Patel
@AmitP88
Aug 27 2017 16:04
@AmitP88
hey guys, I'm working on the Markdown Previewer project and I'm stuck on an error that I need help overcoming.
error.png
I'm trying to use react-bootstraps' grid system for my app. I know that the error says that I likely forgot to export my component , but I don't understand that because I exported my App component at the bottom of the file. Also, since <Code> is part of react-bootstrap, I thought that as long as I imported that part of the framework that it should work. I dunno, I'm confused =/
Tom
@moT01
Aug 27 2017 16:07
@rylew0925 don't forget to read the instructions, they usually point you in the right direction
Moisés Man
@moigithub
Aug 27 2017 16:08

https://react-bootstrap.github.io/getting-started.html#es6 @AmitP88
...hmmm ..cant see any Code component

 import Button from 'react-bootstrap/lib/Button';
// or
import { Button } from 'react-bootstrap';

u importing Grid Row and Col from another library.... should be react-bootstrap

Amit Patel
@AmitP88
Aug 27 2017 16:11
yeah, that's what I'm using
LiciniusRex
@hashtagyolo1
Aug 27 2017 16:11
anybody knows how to use Math.sum();? Nothing I do seems to work with it
Amit Patel
@AmitP88
Aug 27 2017 16:11
already installed it via npm
Moisés Man
@moigithub
Aug 27 2017 16:14
ok.. lemme be more explicit :)
your code import {Grid, Row, Col} from 'react-dom';
should be import {Grid, Row, Col} from 'react-bootstrap';
@AmitP88
Amit Patel
@AmitP88
Aug 27 2017 16:14
facepalm ugh, I'm an idiot. Thanks lol =P
Tom
@moT01
Aug 27 2017 16:15
@hashtagyolo1 javascript? i dont see a math.sum
Trommelochse
@Trommelochse
Aug 27 2017 16:15
@hashtagyolo1 Math.sum() does not exist natively in javascript (as far as I know)
Amit Patel
@AmitP88
Aug 27 2017 16:15
hmmm, "react-bootstrap does not contain an export named 'Code'"..
Moisés Man
@moigithub
Aug 27 2017 16:16
yep.. thats what i said above too :)
Trommelochse
@Trommelochse
Aug 27 2017 16:17
however, you can add it by
Math.sum = (a,b) => a+b
Amit Patel
@AmitP88
Aug 27 2017 16:17
hmmm, when I remove Code from the import line, I get Code is not defined lol
LiciniusRex
@hashtagyolo1
Aug 27 2017 16:17
not to worry. I worked it out.
Moisés Man
@moigithub
Aug 27 2017 16:17
u could include form n label components on the list too.. all part of the same library
import {Grid, Row, Col, FormGroup, ControlLabel} from 'react-bootstrap';
im not sure where u saw Code component.. or IF its part of another library..
if u not sure.. then i would remove it :)
Amit Patel
@AmitP88
Aug 27 2017 16:19
ah ok, there we go. I removed it and now it works. I saw it on here: https://react-bootstrap.github.io/components.html#grid within the Col tags =P
Jorge
@OrangeKulture
Aug 27 2017 16:21
@gothamknight so sry man .. i kinda spaced out cuz some ppl came over and i forgot to get back to you about the steamroller .. definitely looks nice, back when i did it, i hardly used the ternary .. good use of that
hey wazzup people
Tom
@moT01
Aug 27 2017 16:27
making a chat app
why data.stream is undefined in second .getJSON
Moisés Man
@moigithub
Aug 27 2017 16:30

forEach uses a callback
this callback takes parameters @khanidrees

[1,2,3].forEach( function(num){ 
  console.log(num)
})

shows
1
2
3

Ken Haduch
@khaduch
Aug 27 2017 16:31

@Marat89bluolyu - after you convert both numbers, you are trying to do this:

    numb1 = +numbers[i];  
    numb2 = +numbers[i];

So you are taking the same value and storing it into both numb1 and numb2 - is that the problem that you are having? If it's always two numbers, you can just work with the array value as numbers[0] and numbers[1] or change your code to use :

    numb1 = +numbers[0];  
    numb2 = +numbers[1];
Tom
@moT01
Aug 27 2017 16:33
you a new father ken? i see you changed your picture
Liam Docherty
@ldocherty1
Aug 27 2017 16:34

Hi, when a user clicks on my search button on my navigation bar to search on my site whatever they inputted into the search box, how can I let the process only accept certain words which are "projects"," about" & "contact" and bring them to that section on my one page website portfolio?

Would I use JS for this process?

Moisés Man
@moigithub
Aug 27 2017 16:34

@khanidrees u using username on ur getJSON
but... var username=["freecodecamp", "ESL_SC2", "OgamingSC2", "cretetion", "storbeck", "habathcx", "RobotCaleb", "noobs2ninjas"];
that variable is an array

u should pick ONE name from that array and use in the getJSON

username.forEach( function(name){
   //do something with that single name
}

probably i would name usernames or usernameList to that array variable

Ken Haduch
@khaduch
Aug 27 2017 16:34
@moT01 - no, I'm an old father, but a new (well, new for the second time) grandfather...
Tom
@moT01
Aug 27 2017 16:35
congrats
@ldocherty1 do you have any more context? make an if statement
Ken Haduch
@khaduch
Aug 27 2017 16:39
@moT01 - thank you!
CamperBot
@camperbot
Aug 27 2017 16:39
khaduch sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 815 | @mot01 |http://www.freecodecamp.com/mot01
idrees khan
@khanidrees
Aug 27 2017 16:40
@moigithub thanks i got the array of status but iam unable to see it on the page
CamperBot
@camperbot
Aug 27 2017 16:40
khanidrees sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 3609 | @moigithub |http://www.freecodecamp.com/moigithub
Moisés Man
@moigithub
Aug 27 2017 16:40
navigation bar.. and bring them to a section.....
use anchor links ie <a href="#aboutPage">About</a>
then make a section using that ID <div id="aboutPage">....</div>
@ldocherty1
idrees khan
@khanidrees
Aug 27 2017 16:43
@moigithub why it is not displaying the status
and why the status is fluctuating on run
Moisés Man
@moigithub
Aug 27 2017 16:45
@khanidrees ajax methods like getJSON are asynchronous
they dont execute immediatelly ..
when u set a request.. they goes to server.. do stuff.. then the result comes back
that takes time
soo u get the result later
cuz of this.. async code gets queued (on a separated process) u can check youtube for event loop for better understanding/explanation
... on the meanwhile all the rest of ur Synchronous code continue executing
soo ur allurl alllogo allstatus arrays are empty when ur code reach ur for/loop at the end of ur code
thats why it shows undefined
idrees khan
@khanidrees
Aug 27 2017 16:47
but sir it is showing the username and link
Ken Haduch
@khaduch
Aug 27 2017 16:48

@khaduch - one other thing that you could do in your code is instead of having two separate tests for isNaN, you can do that first conversion to remove the comma, and then afterward just check the resulting value for isNaN. Also, I see that within your (just looking at it again) that you have this code:

      numb1 = numbers[i] + '';
      numb1 = numbers[i].replace( /,/, '.' );

within that loop where you are removing the comma, you should store the result back into numbers[i] so that you can access it later - that is another minor problem with what you are currently doing.

Moisés Man
@moigithub
Aug 27 2017 16:48
cuz username is a fixed data array.. u have declared on top of ur code @khanidrees
link is also undefined.. if u hover ur mouse over it
idrees khan
@khanidrees
Aug 27 2017 16:49
how to fix it
Moisés Man
@moigithub
Aug 27 2017 16:51
nest ur code inside the callback function
getJSON("url", function(data1){
       getJSON("url", function(data2){
                 //do something with data1 and data2
      })
})
Kevin Elser
@CoffeeCodeKevin
Aug 27 2017 17:11
@moT01 Do you mean tests like (some thing ? some thing : some thing)?
If so, it is essentially an "if (some thing 1) { some thing 2 } else { some thing 3}"
Moisés Man
@moigithub
Aug 27 2017 17:12
ternary operator
on other languages is also called inline IF
Kevin Elser
@CoffeeCodeKevin
Aug 27 2017 17:13
For example, x = ( 2 == 1 ? y : z ) would have x equal z, since 2 does not equal 1.
Tom
@moT01
Aug 27 2017 17:13
@keccakec im confused on your usage of it, maybe its fine but you have that inside an if conditional
Kevin Elser
@CoffeeCodeKevin
Aug 27 2017 17:13
Which line in particular do you mean, if you don't mind showing me?
Moisés Man
@moigithub
Aug 27 2017 17:13
correct
Tom
@moT01
Aug 27 2017 17:13
the first if of you algorithm
lemme go find the link again
Kevin Elser
@CoffeeCodeKevin
Aug 27 2017 17:14
I think you mean this?
if (i > 0 ? nextGen[i - 1][j].alive : false)
Tom
@moT01
Aug 27 2017 17:15
yes
Kevin Elser
@CoffeeCodeKevin
Aug 27 2017 17:15
If so, the if statement will only proceed to execute the code in the code block if the argument if takes is true.
So I'm using the ternary operator to determine whether or not (i > 0) is true before executing the code in the if block.
Tom
@moT01
Aug 27 2017 17:16
okay, i think i gotcha now
yea that makes sense
so its either if(true) or if(false)
Kevin Elser
@CoffeeCodeKevin
Aug 27 2017 17:17
In hindsight, I should probably comment my code more. I tend to forget until I'm finished to go back and add comments to explain things.
Yes, you have that right.
Moisés Man
@moigithub
Aug 27 2017 17:17
that code looks weird.. i would probably split in separates lines to makes clear
Tom
@moT01
Aug 27 2017 17:17
i think everyones guilty of the comment issue
its an if inside an if test, it does seem wierd, but i feel like it should work
Kevin Elser
@CoffeeCodeKevin
Aug 27 2017 17:19
@moigithub Actually, looking at it, I believe I could just use &&. Like if (i > 0 && nextGen[i - 1][j].alive), since the .alive is either true or false.
Either way, I should have probably specified that those if statements seem to be working and checking the right tiles when I did a test, but the test could always be flawed.
Tom
@moT01
Aug 27 2017 17:20
yea, i feel like there's just a flaw one of those if statements or something that its not working quite right. cause it looks like its really close to working
Kevin Elser
@CoffeeCodeKevin
Aug 27 2017 17:22
One thing that is bugging me about my app is that it seems to generate a lot more straight lines than the example application, if that makes sense.
So the tile patterns look more 'jagged'. Then there's the thing with them seeming to spread too fast.
Tom
@moT01
Aug 27 2017 17:23
yea i dont think that pattern looks right
Kevin Elser
@CoffeeCodeKevin
Aug 27 2017 17:23
I almost think I'm misinterpreting the Game of Life itself, but I've reread the wikipedia page, and watched the video on it. Something somewhere is going over my head, just need to figure out where, or if it's even in my code.
idrees khan
@khanidrees
Aug 27 2017 17:24
@moigithub i got the output but it is fluctuating for forEeach also
@moigithub thanks
CamperBot
@camperbot
Aug 27 2017 17:24
khanidrees sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:warning: khanidrees already gave moigithub points
Tom
@moT01
Aug 27 2017 17:26
@keccakec i think there's a flaw in the algorithm
Tom
@moT01
Aug 27 2017 17:32
i might be on to something @keccakec
at the bottom of the .map when you set the tile value
that sets it in nextGen?
if that's true, then you set the tile value, and on the next loop when it checks to see if the neighbor is alive, it won't be accurate if you just changed one of the values of nextGen
Kevin Elser
@CoffeeCodeKevin
Aug 27 2017 17:42
So, after staring at my code for a solid 15 minutes, I noticed that and came back on here to say exactly that, to see you told me several minutes before hand. I should have kept this window open, haha.
I'll run some tests and see if that fixes it, thanks @moT01.
CamperBot
@camperbot
Aug 27 2017 17:42
keccakec sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 816 | @mot01 |http://www.freecodecamp.com/mot01
Kevin Elser
@CoffeeCodeKevin
Aug 27 2017 17:44
Oh, and the reason for that is something I'll be making sure to avoid doing in the future. I'm working in my own dev environment locally and copying and pasting changes to codepen, since that's where it will be going eventually anyway. The editor I use, atom, has a replace feature that allows me to search for any string and replace it. At the time, all instances of this.state.gridMap were in that function, so I didn't even notice hitting replace all instead of replace. Whoops.
Tom
@moT01
Aug 27 2017 17:46
@keccakec might be easier to put it on github
copying and pasting to codepen became a pain when i got to the react stuff
Siddarth Krishnan
@siddarthk123
Aug 27 2017 18:18
anyone
want to pair up to do the simon game?
Jorge
@OrangeKulture
Aug 27 2017 18:44
hey guys .. anyone here? looking to get some feedback on the tic tac toe ..if someone can test it out for me, let me know please
Morchid Chellali
@Morched23MJ
Aug 27 2017 19:22
I want to fix position of the two h1 in my Pomodoro project, because when the timer starts they keep moving, and thus the icon between them moves too. I set position to absolute but they collapse when the screen gets smaller.
Here is the pen: https://codepen.io/Morched23MJ/pen/PKeQYQ
I know I could use media queries to fix it when the screen gets smaller, but I would see if there is a better way to do it.
iso
@iso1048
Aug 27 2017 19:31
@OrangeKulture no worries man - we all have things to do outside of the chat! Thanks for the feedback
CamperBot
@camperbot
Aug 27 2017 19:31
gothamknight sends brownie points to @orangekulture :sparkles: :thumbsup: :sparkles:
:cookie: 444 | @orangekulture |http://www.freecodecamp.com/orangekulture
Tom
@moT01
Aug 27 2017 20:24
@OrangeKulture lets see it
Tom
@moT01
Aug 27 2017 20:38
@Morched23MJ
  .container 
    width: 100%
    display: flex
    justify-content: space-evenly
  #sessionTimer
    width: 400px
  #breakTimer
    width: 400px
what i came up with
iso
@iso1048
Aug 27 2017 20:40
@moT01 what is space-evenly? I thought it was space-between or space-around?
Tom
@moT01
Aug 27 2017 20:40
yea, first time ive seen it
its there
not sure what the difference is
Gaurav
@gauravmagan
Aug 27 2017 20:41
{"name":"error","length":111,"severity":"FATAL","code":"28P01","file":"auth.c","line":"307","routine":"auth_failed"}
Tom
@moT01
Aug 27 2017 20:42
looks like space between puts margin on each thing, so you get 5px on each end or whatever, and 5+5 = 10px between each item
and space evenly puts the same margin on the ends
if that makes sense
Gaurav
@gauravmagan
Aug 27 2017 20:42
this error was while fetching the data from the table
{"name":"error","length":111,"severity":"FATAL","code":"28P01","file":"auth.c","line":"307","routine":"auth_failed"}
iso
@iso1048
Aug 27 2017 20:43
@moT01 yeah true. good to know
Gaurav
@gauravmagan
Aug 27 2017 20:47
Screen Shot 2017-08-27 at 2.12.23 PM.png
Morchid Chellali
@Morched23MJ
Aug 27 2017 21:01
@moT01, it worked, thanks. Is there a way to change a class from fa-5x to fa-4x with media queries?
CamperBot
@camperbot
Aug 27 2017 21:01
morched23mj sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 817 | @mot01 |http://www.freecodecamp.com/mot01
iso
@iso1048
Aug 27 2017 21:04
@Morched23MJ not sure but you could change the font-size with media queries as another option
Morchid Chellali
@Morched23MJ
Aug 27 2017 21:05
Yup
Ken Haduch
@khaduch
Aug 27 2017 21:34
@Morched23MJ - probably the fa-4x translates to a certain font-size anyway. You can probably find the settings that correspond to those classes and just make different CSS settings for the media query, you might already have done that.
Ken Haduch
@khaduch
Aug 27 2017 21:45
@Morched23MJ - fa-4x only has a setting for font-size: 4em; and fa-5x is font-size: 5em; so you could easily make a class/setting customized with media queries.
Elizabeth Paul
@Kowalatam
Aug 27 2017 21:53
so my calculator catches other errors apart from XX as it sees it as ** which is correct, but i want it to see it as error https://codepen.io/Kowalatam/pen/oeqrxa
iso
@iso1048
Aug 27 2017 21:53
@Kowalatam shit you've gotten ahead. made some good progress.
Elizabeth Paul
@Kowalatam
Aug 27 2017 21:54
@gothamknight i skipped some algorithm :).. got bored
thnks:)
Morchid Chellali
@Morched23MJ
Aug 27 2017 22:13
@khaduch Thank you, got it done.
CamperBot
@camperbot
Aug 27 2017 22:13
morched23mj sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3245 | @khaduch |http://www.freecodecamp.com/khaduch
Morchid Chellali
@Morched23MJ
Aug 27 2017 22:14
@Kowalatam, same lol. Got 5 algos remaining
Richard
@rylew0925
Aug 27 2017 22:16
What does the container class do?
Morchid Chellali
@Morched23MJ
Aug 27 2017 22:18
Ehm, centers elements inside I think
Richard
@rylew0925
Aug 27 2017 22:19
When I omitted the container class, nothing changed
Richard
@rylew0925
Aug 27 2017 22:25
is container class needed or can the code still run without it?
iso
@iso1048
Aug 27 2017 22:26
@rylew0925 code can run without it. It is not essential
David J. Leys
@davidjleys
Aug 27 2017 23:03
Hello everyone. I am having an issue with the TwitchTV JSON API project that has me stumped. I cannot seem to differentiate between an invalid channel and an offline channel. In both cases, the api (using https://wind-bow.gomix.me/twitch-api) returns a stream of null. How would I go about finding out if the channel simply does not exist (rather than offline)?
Tom
@moT01
Aug 27 2017 23:05
need to get that data from another request
so if the stream is null you check that url and the returned data should tell you if i recall correctly
David J. Leys
@davidjleys
Aug 27 2017 23:07
haha, wow. That is so simple and I have been trying to figure it out for ages. Thanks a ton @moT01 !
CamperBot
@camperbot
Aug 27 2017 23:07
davidjleys sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 818 | @mot01 |http://www.freecodecamp.com/mot01