These are chat archives for FreeCodeCamp/HelpFrontEnd

30th
Jan 2018
bv
@binduverma1
Jan 30 2018 00:09
I am using fCC weather api for Weather project but icons are not showing. Has anyone here used FCC weather app for this project and shown icon from with the FCC weather APP
Brad
@bradtaniguchi
Jan 30 2018 00:26
I kinda remember you needed to use font-awesome icons right?
Or at least you could
bv
@binduverma1
Jan 30 2018 00:37
Actually the FCC's app has icon and image link data in the response and I want to use those from just one resource rather than going to second resource.
Benny
@BenYoshi
Jan 30 2018 00:43
omg help
i broke freecodecamp and codepen
keeps freezing on the fibonnaci problem
Chris Cullen
@123xylem
Jan 30 2018 00:49

Hi. I have this number from an api . 546798150000000000
But it should be 0.546798150000000000

Im trying to make it that number with the following code

var data = JSON.parse(body); //Data from the body

  var balance = 

Number(data["result"]/(Number(data["result"])*10)); // Make the data[result] The number and then do maths to it to add a 0. infront of it
Any idea how?

Benny
@BenYoshi
Jan 30 2018 00:51
is there a way to disable the code check, i think i did an infinite loop and the page is broken: https://www.freecodecamp.org/challenges/sum-all-odd-fibonacci-numbers
@123xylem Is that number to big for javascript to handle? (im looking up if it is currently)
Chris Cullen
@123xylem
Jan 30 2018 00:53
@bradtaniguchi thanks I wouldnt have thought so
CamperBot
@camperbot
Jan 30 2018 00:53
123xylem sends brownie points to @bradtaniguchi :sparkles: :thumbsup: :sparkles:
:cookie: 353 | @bradtaniguchi |http://www.freecodecamp.org/bradtaniguchi
Brad
@bradtaniguchi
Jan 30 2018 00:53
@123xylem Yea I think it is, you'll need to do a workaround :)
Benny
@BenYoshi
Jan 30 2018 00:54
@bradtaniguchi thanks! this is the fix for codepen btw if anyone needs it: https://blog.codepen.io/2014/10/29/preventing-infinite-loops-grid/
CamperBot
@camperbot
Jan 30 2018 00:54
benyoshi sends brownie points to @bradtaniguchi :sparkles: :thumbsup: :sparkles:
:cookie: 354 | @bradtaniguchi |http://www.freecodecamp.org/bradtaniguchi
Brad
@bradtaniguchi
Jan 30 2018 00:55
@BenYoshi Np, I had to use that fix a number of times haha
Alexander Jarman
@HeinousTugboat
Jan 30 2018 02:42
@123xylem @bradtaniguchi Javascript can handle anything from 4.9406564584124654417656879286822137236505980261432476442558568250067550727020875186529983636163599238e-324 to 1.7976931348623157081452742373170435679807056752584499659891747680315726078002853876058955863276687817e+308, more or less. Your number's fine. ;-)
Brad
@bradtaniguchi
Jan 30 2018 02:43
@HeinousTugboat 1e308? that doesn't sound right at all...
Whats your source?
Alexander Jarman
@HeinousTugboat
Jan 30 2018 02:45
Any javascript console.
PS C:\Users\HeinousTugboat> node
> Number.MAX_VALUE
1.7976931348623157e+308
>
Brad
@bradtaniguchi
Jan 30 2018 02:45
That's node tho
I know it differs depending upon environment
Alexander Jarman
@HeinousTugboat
Jan 30 2018 02:46
image.png
image.png
TC-39 specifies that Number is a double float, so its max value is the same as the IEEE standard for doubles.
So any Javascript environment within spec should be fine up to that.
Brad
@bradtaniguchi
Jan 30 2018 02:48
I was using MAX_SAFE_INTEGER, as he was doing math calculations on it, I'm pretty fuzzy on which one he was using
Alexander Jarman
@HeinousTugboat
Jan 30 2018 02:49
I mean, regardless of that, JavaScript has exactly one Number type, and it's a double float. :-P
Even then, MAX_SAFE_INTEGER is ridiculously high.. but as soon as you add a decimal point, I'm pretty sure you lose that safety.
njordomir
@njordomir
Jan 30 2018 02:50

Hey guys, it's been a while! I'm working on a really simple (basically an academic resume) html doc for my brother. I've used a table to set up dates and the jobs that go with them as such.

<table>
<tr>
     <h3>Presentations</h3>
</tr>
<tr>
     <td>mm.Yyyy</td>
     <td>What the presentation was about, title and where it happened</td>
</tr>
<tr>
     <h3>Publications</h3>
</tr>
<tr>
     <td>mm.Yyyy</td>
     <td>Name of journal, title of publication, etc.  Blah blah</td>
</tr>
</table>

My problem is that those h3 headings float right up to the top of the document and aren't shown inline with the info they describe as they are in the html. What I mean is that Publications shows directly after presentations and all the publication data shows under both <h> tags. Is this normal table behavior? Is there an easy way around this?

I would prefer to learn some super cool css fix that I never knew about or something, otherwise I'll have to change all the <h> tags to <span class="*"> and set the heading-like attributes like bold, padding, size, etc. manually.

Can anyone give me a suggestion here, or explain why <h> tags move themselves to the top of the table?

Alexander Jarman
@HeinousTugboat
Jan 30 2018 02:50
I'm actually not sure how MAX_SAFE_INTEGER interacts with its floatness.
Brad
@bradtaniguchi
Jan 30 2018 02:50
Im curious at what the exact difference is, at least in his basic example. Everywhere I read says "not safe" or something
Alexander Jarman
@HeinousTugboat
Jan 30 2018 02:50
Honestly at anything less than e10 there shouldn't be any meaningful difference.
dragonkick
@dragonkick
Jan 30 2018 02:51
How do you do Factorialize a Number?
Alexander Jarman
@HeinousTugboat
Jan 30 2018 02:51
You don't really start getting into issues until you start risking overflowing the exponent/mantissa.
@njordomir Sounds like the <th> element was made for you. ;-)
dragonkick
@dragonkick
Jan 30 2018 02:52
How do you get the numbers they tell you need to get.
Alexander Jarman
@HeinousTugboat
Jan 30 2018 02:53
You math it. :laughing: What's your confusion? (And I'm assuming you mean factorize not factorial.)
dragonkick
@dragonkick
Jan 30 2018 02:53
yes
I mean factorize.
Alexander Jarman
@HeinousTugboat
Jan 30 2018 02:57
Well, I don't know what specifically you need help with, so here's the wikipedia page on the math involved.
The simplest way to factorize a number's to basically just divide it by smaller prime numbers until you can't anymore.
@bradtaniguchi So, a double float stores the mantissa in 53-bits, and the exponent in 11-bits. A 'safe' integer in JavaScript is any one that can be represented within 53-bits. Number.MAX_SAFE_INTEGER is 2^53 - 1. The safety check is literally just checking if you get the same number when you round it. Unfortunately, as soon as you involve a decimal, you drop from integer safety and go into actual float representations.
Brad
@bradtaniguchi
Jan 30 2018 03:02
@HeinousTugboat Thanks, Ill have to look into it more, you peaked my curiousity haha
CamperBot
@camperbot
Jan 30 2018 03:02
bradtaniguchi sends brownie points to @heinoustugboat :sparkles: :thumbsup: :sparkles:
:cookie: 331 | @heinoustugboat |http://www.freecodecamp.org/heinoustugboat
Alexander Jarman
@HeinousTugboat
Jan 30 2018 03:02
Same reason why 0.1 + 0.2 = 0.30000000000000004. There's no such thing as a safe float in most modern languages, I think.
(And if you're curious, I checked. MAX_SAFE_INTEGER is also identical in Chrome, Node and Firefox. :-) )
UnorthodoxThing
@UnorthodoxThing
Jan 30 2018 03:31
@sjames1958gm thx! I'll look into the link! :D
Ken Haduch
@khaduch
Jan 30 2018 03:45
@njordomir - not 100% sure but if you enclose those header tags within <td> and </td> tags, what happens then? :point_up: January 29, 2018 9:50 PM It looks like using that technique, putting a <td> inside the <tr> makes the header tags stay where you want them to.
kartikv20
@kartikv20
Jan 30 2018 04:14
can anyone help me with getting data from this website? https://market.mashape.com/andruxnet/random-famous-quotes
it has given me some stuff
but i cant seem to understand
i wanna use the fetch API
njordomir
@njordomir
Jan 30 2018 04:55
@HeinousTugboat Thanks for the tip about <th>. I ended up writing custom styles anyways, but I used <th colspan="2"> with a text align left as my basis for that. I appreciate the help.
CamperBot
@camperbot
Jan 30 2018 04:55
njordomir sends brownie points to @heinoustugboat :sparkles: :thumbsup: :sparkles:
:cookie: 333 | @heinoustugboat |http://www.freecodecamp.org/heinoustugboat
German Gamboa Gonzalez
@germangamboa95
Jan 30 2018 05:09
A really silly project I made tonight. Any feedback is welcomed https://codepen.io/germangamboa95/pen/xYxoJE
Alexander Jarman
@HeinousTugboat
Jan 30 2018 05:11
@germangamboa95 Any particular reason you're using <span>s?
Otherwise it's pretty cute and does exactly what it should. :-D
German Gamboa Gonzalez
@germangamboa95
Jan 30 2018 05:12
@HeinousTugboat I wanted them to be inline elements. Would a block level work better?
@HeinousTugboat And thanks lol
CamperBot
@camperbot
Jan 30 2018 05:12
germangamboa95 sends brownie points to @heinoustugboat :sparkles: :thumbsup: :sparkles:
:cookie: 334 | @heinoustugboat |http://www.freecodecamp.org/heinoustugboat
Alexander Jarman
@HeinousTugboat
Jan 30 2018 05:13
inline-block seems like it'd be perfect for you. ;-)
njordomir
@njordomir
Jan 30 2018 05:13
Well that's odd, how'd my table from earlier work it's way into the bottom of your project? This is some kind of browser bug or something. Vivaldi obviously isn't 100% stable.
German Gamboa Gonzalez
@germangamboa95
Jan 30 2018 05:13
@HeinousTugboat So make them divs and set the display property to inline-block?
Alexander Jarman
@HeinousTugboat
Jan 30 2018 05:14
Huh. Wasn't there before, it is now. :laughing: That's neat.
@germangamboa95 That would make the most sense to me, I think.
German Gamboa Gonzalez
@germangamboa95
Jan 30 2018 05:14
@njordomir No, I saw your snippet and wanted to have a go at seeing what was wrong, might have gotten lazy and just placed it into that pen to see....
Alexander Jarman
@HeinousTugboat
Jan 30 2018 05:14
:joy_cat: Confusing all the peoples!
njordomir
@njordomir
Jan 30 2018 05:15
Lol, I eventually figured it out thanks to Tugboat and some documentation reading
Alexander Jarman
@HeinousTugboat
Jan 30 2018 05:15
;-) Best way to teach is to show people where to learn. :-D
German Gamboa Gonzalez
@germangamboa95
Jan 30 2018 05:16
Tried out inline-block. Looks way better!
Alexander Jarman
@HeinousTugboat
Jan 30 2018 05:17
\o/ Yeah, inline is weird and fickle I've found. I hate using it unless I'm literally just doing things in the flow of text.
kartikv20
@kartikv20
Jan 30 2018 05:20
var myInit = { method: 'GET',
               headers: myHeaders,
               mode: 'cors',
               cache: 'default' };
where do i post the API key?
German Gamboa Gonzalez
@germangamboa95
Jan 30 2018 05:21
got it. What is everyone working on tonight?
Alexander Jarman
@HeinousTugboat
Jan 30 2018 05:22
@kartikv20 Gonna need more than that. API key for what?
German Gamboa Gonzalez
@germangamboa95
Jan 30 2018 05:22
@kartikv20 which API are you using?
kartikv20
@kartikv20
Jan 30 2018 05:22
Jack Lyons
@JackEdwardLyons
Jan 30 2018 05:22
hey guys I have a question about flattening an array of objects and arrays, its pretty deeply nested so im using LoDash
Alexander Jarman
@HeinousTugboat
Jan 30 2018 05:22
@germangamboa95 Avoiding sleep like a damn idiot, mostly. :laughing: Before I was working on a noise generator.
kartikv20
@kartikv20
Jan 30 2018 05:22
it asked me to make account and get api key
i got the key
now what to do?
Jack Lyons
@JackEdwardLyons
Jan 30 2018 05:22
Would anyone be able to help?
Alexander Jarman
@HeinousTugboat
Jan 30 2018 05:23
This is from their website:
// These code snippets use an open-source library. http://unirest.io/nodejs
unirest.post("https://andruxnet-random-famous-quotes.p.mashape.com/?cat=movies&count=10")
.header("X-Mashape-Key", "<required>")
.header("Content-Type", "application/x-www-form-urlencoded")
.header("Accept", "application/json")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
So make sure you set the header X-Mashape-Key in myHeaders to your API Key.
Ghost
@ghost~5a3ac208d73408ce4f843d6a
Jan 30 2018 05:24
@germangamboa95 I'm cloning the bbc tech news page
kartikv20
@kartikv20
Jan 30 2018 05:24
@HeinousTugboat im actually using the fetch API
Alexander Jarman
@HeinousTugboat
Jan 30 2018 05:24
So.. myHeaders.append('X-Mashape-Key', APIKey)
German Gamboa Gonzalez
@germangamboa95
Jan 30 2018 05:25
@WebDevDeja Nice, how is it going ?
Alexander Jarman
@HeinousTugboat
Jan 30 2018 05:25
Or inside the constructor. However you're instantiating myHeaders.
Ghost
@ghost~5a3ac208d73408ce4f843d6a
Jan 30 2018 05:25
@germangamboa95 My head hurts >.<
German Gamboa Gonzalez
@germangamboa95
Jan 30 2018 05:26
@HeinousTugboat Same, I was readying You don't know javascript then got bored and decided to make silly stuff.
@WebDevDeja Coffee helps! :D
kartikv20
@kartikv20
Jan 30 2018 05:26
var myHeaders = new Headers();

var myInit = { method: 'GET',
               headers: myHeaders.append('X-Mashape-Key', APIKey)
               mode: 'cors',
               cache: 'default' };
is this ok?
Ghost
@ghost~5a3ac208d73408ce4f843d6a
Jan 30 2018 05:27
@germangamboa95 I'm running low and I already had 3 cups today >.<
Alexander Jarman
@HeinousTugboat
Jan 30 2018 05:27
Nope. Go back to how you had it before, and change it to this:
var myHeaders = new Headers({'X-Mashape-Key', APIKey});
And make sure you actually, y'know, put your APIKey in there.
That should work now. :-)
I'm gonna go to bed, though. Hopefully someone else can help if you still need help.
If not, I'll be around tomorrow.
G'night y'all!
German Gamboa Gonzalez
@germangamboa95
Jan 30 2018 05:29
@HeinousTugboat Night!
@kartikv20 can I see your codepen?
Michael Cordero
@CyberPutty
Jan 30 2018 05:39
it runs and my tic tac toe AI will take a corner then the second time once the corner is taken when it gets to that corner and it hase to remove an index it breaks. I know my logic must be wrong.
kartikv20
@kartikv20
Jan 30 2018 05:40
@germangamboa95 im actually working on sublime
but its kinda running now
wait
see in the console
German Gamboa Gonzalez
@germangamboa95
Jan 30 2018 05:47
It works now you just need to render the data
Jack Lyons
@JackEdwardLyons
Jan 30 2018 05:55
Can anyone help me flatten out this array of objects and arrays?
kartikv20
@kartikv20
Jan 30 2018 06:33
on the Random Quote Generator, how do i make it fancy?
like the quote coming in a box
Markus Kiili
@Masd925
Jan 30 2018 06:42
@kartikv20 You need to make the box with html and css and then add text content inside it with js.
kartikv20
@kartikv20
Jan 30 2018 06:47
@Masd925 how do i make something like this?
SzymonKwasek
@SzymonKwasek
Jan 30 2018 07:52
250px.png
Hello, I woule like to ask if you guys could help me creating list like the one on the image.
The point is to use only pure HTML/CSS, the text on the left side should be resnposive, I think it is word-wrap. I just can't figure out how to create the shape of the list. It is just one element with box-shadow on it..
Roman Struna
@RomchyFCC
Jan 30 2018 08:17
the first thing that pops to mind in this situation is css grid,
i would use it as follow
create 8+ collumns then set up the text as
a a a a a a a .
. b b b b b b b
a a a a a a a .
. b b b b b b b
etc.
it would be fully responsive and never lose shape
@SzymonKwasek
SzymonKwasek
@SzymonKwasek
Jan 30 2018 09:01
right now I came out with something like this.. https://codepen.io/Ejsit/pen/MQYwrV
I cant figure out how to mask those shadows, since z-index doesnt seem to work
@RomchyFCC could you give me an example with this grid solution ?
Sorin Ruse
@sorinr
Jan 30 2018 09:09
@SzymonKwasek just comment out the box-shadow: 1px 2px 2px rgb(0,0,0); in css li{} part
Spacetime
@justinemar
Jan 30 2018 09:10
@SzymonKwasek z-index only works on positioned elements
Muhammad Amjad
@amjad4ever
Jan 30 2018 09:10
@emoudy hi
SzymonKwasek
@SzymonKwasek
Jan 30 2018 09:11
@sorinr this doesnt solve my problem..
Sorin Ruse
@sorinr
Jan 30 2018 09:13
@SzymonKwasek then maybe u didn't explained well whats the problem. you said "I cant figure out how to mask those shadows" and there are the only shadows u have in there :)
SzymonKwasek
@SzymonKwasek
Jan 30 2018 09:15
@sorinr I need the shadow to appear around the whole list, not every single li item.
Sorin Ruse
@sorinr
Jan 30 2018 09:16
@SzymonKwasek then u apply the box-shadow to the wrong element li instead of ul or the parent containing the list
SzymonKwasek
@SzymonKwasek
Jan 30 2018 09:19
I tried to apply it to the ul element, but this doesnt work either.
Spacetime
@justinemar
Jan 30 2018 09:21
the problem is your li doesn't have a background that's why the shadow doesn't go behind them.
Sorin Ruse
@sorinr
Jan 30 2018 09:21
@SzymonKwasek its working. try looking to this pen
Spacetime
@justinemar
Jan 30 2018 09:24
@SzymonKwasek
li:nth-of-type(odd){
    margin-left:-10px;
    border-bottom-left-radius: 3px;
    border-top-left-radius: 3px;
    z-index: -1;
  position:relative;
}
then add background to your li
SzymonKwasek
@SzymonKwasek
Jan 30 2018 09:24
@sorinr Thanks but this is not what I am looking for..
CamperBot
@camperbot
Jan 30 2018 09:24
szymonkwasek sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:star2: 1397 | @sorinr |http://www.freecodecamp.org/sorinr
Heathercoraje
@Heathercoraje
Jan 30 2018 09:24
Hi, I am on twitchtv project and I am stuck with CORS issue.
Spacetime
@justinemar
Jan 30 2018 09:25
@SzymonKwasek if you want some blur effect box-shadow: 1px 2px 5px 0px rgb(0,0,0);
Heathercoraje
@Heathercoraje
Jan 30 2018 09:25
Does anyone know how to solve CORS policy trouble? Is this because I am not doing it on codepen? (currently just coding locally)
SzymonKwasek
@SzymonKwasek
Jan 30 2018 09:26
@justinemar THATS IT! Thank you very much.
CamperBot
@camperbot
Jan 30 2018 09:26
szymonkwasek sends brownie points to @justinemar :sparkles: :thumbsup: :sparkles:
:cookie: 40 | @justinemar |http://www.freecodecamp.org/justinemar
Sorin Ruse
@sorinr
Jan 30 2018 09:26
@SzymonKwasek thats why i said try explaining it better. putting the right question its 50% of the solution to the problem
SzymonKwasek
@SzymonKwasek
Jan 30 2018 09:26
@sorinr I am sorry, I posted a picture and I thought that would be enough
Spacetime
@justinemar
Jan 30 2018 09:28
@Heathercoraje can you make a gist of your code
Sorin Ruse
@sorinr
Jan 30 2018 09:29
@SzymonKwasek haven't see the pic. just took a look at your codepen
SzymonKwasek
@SzymonKwasek
Jan 30 2018 09:31
@sorinr mb
Heathercoraje
@Heathercoraje
Jan 30 2018 09:31
var url = 'https://wind-bow.gomix.me/twitch-api/streams/freecodecamp?callback=?origin=*'; $.get(url, function (data) { $('#msg').html(data); console.log('data has been loaded'); })
@justinemar it seems like this has to be configured in server side then I don't have a server.
Heathercoraje
@Heathercoraje
Jan 30 2018 09:40
I tried with $.getJSON(url, callback) and it returns data.
I mean, if it does not allow $.get, why does it allow $.getJSON?
Any help'd appreciated :)
Joshua Frias
@Juke-Magic
Jan 30 2018 09:46
guys is my .sub super close to the border?
its not working
even the console is not showing data now
what is wrong?
Heathercoraje
@Heathercoraje
Jan 30 2018 09:51
@Juke-Magic I think it looks fine
@kartikv20 Sorry I don't see any console.log?
iso
@iso1048
Jan 30 2018 09:59

@kartikv20 the js below seemed to work

var myUrl = 'https://andruxnet-random-famous-quotes.p.mashape.com/';
var myInit = {
    method: "GET",
    headers: {
    "X-Mashape-Key": "fuRZt6gJsRmshWoAPhLvf89yvIYip1YTySNjsnaheobz360KZO",
    "Content-Type": "application/x-www-form-urlencoded",
    "Accept": "application/json"
}};

function getQuote(){
    fetch(myUrl, myInit)
    .then(response=>response.json())    
    .then(data => {
        document.getElementById("quote").innerText = data.quote;
      console.log(data);
        })    
}

window.onload = function() {
  document.getElementById("center-text").addEventListener('click',getQuote); 
};

is that what you need? (I haven't used fetch before)

Heathercoraje
@Heathercoraje
Jan 30 2018 10:00
@kartikv20 function getQuote is never being called. as @user-ap posted, remove a set of curry bracket inside getQuote before Fetch.
@kartikv20 It can be confusing.
William Watts
@Braillon7
Jan 30 2018 10:24
Hey guys, I've been trying to clean up some code I had that, previously, worked. In the midst of it I initialized a new object and my ".length" is no longer working. Any suggestions? https://codepen.io/Braillon7/pen/bLGdNg
Here's my previous code
iso
@iso1048
Jan 30 2018 10:30
@Braillon7 should gameState.elements.pokemonDB.length at line 45 be gameState.elements.pokemonEl.length instead?
UnorthodoxThing
@UnorthodoxThing
Jan 30 2018 10:55
Can anyone look at my codepen and see why when I hover over one of the menu tabs 'menu' the submenu gets scattered display. :O
William Watts
@Braillon7
Jan 30 2018 11:12
Eh new code still doesn't work. Guess I'll try to debug it when I get home
abyshukla
@abyshukla
Jan 30 2018 11:21
How do I save my code on git? Is there a browser way?
Aditya
@ezioda004
Jan 30 2018 11:22
@abyshukla You mean on github? git is a tool.
abyshukla
@abyshukla
Jan 30 2018 11:23
github :blush:
Stephen James
@sjames1958gm
Jan 30 2018 11:23
@abyshukla There are gui tools for create a git repository, which you can push to github.
Generally, you should learn the CLI as that is what will be expected in the real world
SzymonKwasek
@SzymonKwasek
Jan 30 2018 11:23
Can someone answer me, why when I add display: inline; my text-overflow: ellipsis; doesnt seem to work anymore ?
I tried to add display:inline in li and in div and it still doesnt work..
https://codepen.io/Ejsit/pen/WMbxXa
Aditya
@ezioda004
Jan 30 2018 11:24
@abyshukla You can go to your profile -> new repository -> drag and drop files but as @sjames1958gm said learning CLI would benefit you and its easy.
abyshukla
@abyshukla
Jan 30 2018 11:24
drag and drop? Let me try...
Ali Bulut
@ali27001
Jan 30 2018 11:25
hi guys. https://www.freecodecamp.org/challenges/build-a-random-quote-machine I will do homework. Do you know there is an open API for this
Aditya
@ezioda004
Jan 30 2018 11:26
@ali27001 There are a bunch, but I used forismatic
Stephen James
@sjames1958gm
Jan 30 2018 11:27
@ali27001 I'll recommend forismatic as well.
abyshukla
@abyshukla
Jan 30 2018 11:27
@ali27001 in another life, I stuffed my quotes in an array. randomized and printed it :P
Ali Bulut
@ali27001
Jan 30 2018 11:30
which makes more sense
abyshukla
@abyshukla
Jan 30 2018 11:30
and is easier
You can be selective of your quotes...
Ali Bulut
@ali27001
Jan 30 2018 11:31
do you have examples
Stephen James
@sjames1958gm
Jan 30 2018 11:33
@ali27001 I think part of the challenge it introduction to using APIs in your code. But, I used an local array of quotes and just randomized over the array. Basically:
var quoteIndex = Math.floor(Math.random() * quotes.length);
Marianissimus
@Marianissimus
Jan 30 2018 11:35
@ali27001 I too couldn't find a reliable quotes API. So I made an excel file with the quotes, converted it to JSON (there's an app for that), hosted it online (for free) and linked to it.
Ali Bulut
@ali27001
Jan 30 2018 11:36
@Marianissimus Have you created a utility yourself
Marianissimus
@Marianissimus
Jan 30 2018 11:37
a converter? no, there are many online;
abyshukla
@abyshukla
Jan 30 2018 11:52
@ali27001 I went over to IMDB copied all the quotes I liked and pasted them between [ ]
Anshul Adlakha
@anshuladlakha
Jan 30 2018 12:06
Does anyone here has any experience with Mozilla add-ons/Chrome extensions development, I need some help.
Simon Cordova
@gbsimon87
Jan 30 2018 13:41
@anshuladlakha what do you need help with exactly?
ahmed-issa-mohd
@ahmed-issa-mohd
Jan 30 2018 13:44
can I have question , please ?
Matej Bošnjak
@mbosnjak01
Jan 30 2018 14:25
@ahmed-issa-mohd :question: here you go :D
Stephen James
@sjames1958gm
Jan 30 2018 14:37
@ahmed-issa-mohd Ask your question.
Heathercoraje
@Heathercoraje
Jan 30 2018 14:54
Hi, I am trying to fetch data by using $.getJSON(url) and return it so I can use it in another function. but I get undefined when I pass fetch function to console.log it
Tom
@moT01
Jan 30 2018 14:56
@Heathercoraje lets see the code
Heathercoraje
@Heathercoraje
Jan 30 2018 14:56
function fetchData (url, callback) {
  var data;
  $.getJSON(url, function (res) {
    data = res;
    return data
  });
}


$( '#all' ).on( 'click', function() {
  users.forEach(function (user) {
    fetchData(makeUrl(user), function(data) {
      console.log(data);
      console.log('hello?');
    });
  });
});
my hello is a bit sad now.
Stephen James
@sjames1958gm
Jan 30 2018 14:56
@Heathercoraje Your fetchData function will need to call your callback
@Heathercoraje Your function is called by $.getJSON and the return data goes nowhere
Heathercoraje
@Heathercoraje
Jan 30 2018 14:57
I figured..
@sjames1958gm Sorry I am not sure what you mean by that
fetch function calling the callback
Stephen James
@sjames1958gm
Jan 30 2018 14:58
@Heathercoraje inside of $getJSON callback ==> callback(data) or callback(res) either way
Heathercoraje
@Heathercoraje
Jan 30 2018 14:58
I see!
Oh that I am not passing anything to callback to be invoked
?
Nitin bisht
@ntnbst
Jan 30 2018 15:02
hey
Heathercoraje
@Heathercoraje
Jan 30 2018 15:07
@sjames1958gm I am a bit lost.
Then where do I define callback?
Stephen James
@sjames1958gm
Jan 30 2018 15:08
@Heathercoraje You already do
    fetchData(makeUrl(user), function(data) { // this function here is passed to fetchData as callback
      console.log(data);
      console.log('hello?');
    });
Heathercoraje
@Heathercoraje
Jan 30 2018 15:11
function fetchData(url, callback(data)) {
  $.getJSON(url, function (data) {
    return data
  });
}


$( '#all' ).on( 'click', function() {
  users.forEach(function (user) {
    fetchData(makeUrl(user), function(data) {
      console.log(data);
    });
  });
});
@sjames1958gm I get an error and..
Stephen James
@sjames1958gm
Jan 30 2018 15:12
@Heathercoraje
function fetchData(url, callback) {
  $.getJSON(url, function (data) {
    callback(data);
  });
}
Heathercoraje
@Heathercoraje
Jan 30 2018 15:13
I am confused with callbacks..
So when I hate the data from getJSON, I call the callback which I define below.
Is my understanding right?
Stephen James
@sjames1958gm
Jan 30 2018 15:14
Yes. Since you pass the callback to fetchData you can call it from inside the function called back by getJSON.
@Heathercoraje With callbacks you have to break from thinking about where code is in the file, but WHEN the code is executed
If you put these logs in you will see that "after" happens before "inside"
function fetchData(url, callback(data)) {
  $.getJSON(url, function (data) {
    console.log("inside");
  });
 console.log("after");
}
Heathercoraje
@Heathercoraje
Jan 30 2018 15:16
Because the callback needs to be executed once getJSON is done?
I will check that out
Nitin bisht
@ntnbst
Jan 30 2018 15:16
hey need to make this responsive any help
??
and everything is overflowing
Heathercoraje
@Heathercoraje
Jan 30 2018 15:18
@sjames1958gm I get outside then inside at very last
Tom
@moT01
Jan 30 2018 15:18
@ntnbst one thing that goes a long way - is to add a max-width: 100% to containers
Heathercoraje
@Heathercoraje
Jan 30 2018 15:19
@sjames1958gm Thank you. I think I've got a hang of it a bit.
CamperBot
@camperbot
Jan 30 2018 15:19
heathercoraje sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8918 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
Stephen James
@sjames1958gm
Jan 30 2018 15:20
@Heathercoraje It is one of the js concepts that takes a bit to become instinctive.
Tom
@moT01
Jan 30 2018 15:22
@ntnbst media queries as well - you can use them to change style for certain screen sizes
Nitin bisht
@ntnbst
Jan 30 2018 15:23
@moT01 didn't work for max-width 100% :worried:
Tom
@moT01
Jan 30 2018 15:27
@ntnbst https://s.codepen.io/moT01/pen/MQYvJK - here's a small example
Heathercoraje
@Heathercoraje
Jan 30 2018 15:27
@sjames1958gm Fairly new to programming as a whole. It works now though :)
Stephen James
@sjames1958gm
Jan 30 2018 15:27
@Heathercoraje :+1:
Emmanuel Kaku
@jindeli05
Jan 30 2018 15:47
can i get css help
kartikv20
@kartikv20
Jan 30 2018 15:48
hello
i cant seem to get the position displayed here
navigator.geolocation.getCurrentPostion(function(position){
    console.log(position.coords.latitude,position.coords.longitude);
})
whats wrong?
Stephen James
@sjames1958gm
Jan 30 2018 15:49
@kartikv20 looks like a typo in your function name
@kartikv20 navigator.geolocation.getCurrentPosition
dinesh
@1532j0004kg
Jan 30 2018 15:50
@sjames1958gm hi james , How r u ?
kartikv20
@kartikv20
Jan 30 2018 15:52
@sjames1958gm did it but its still not showing anything in console
dinesh
@1532j0004kg
Jan 30 2018 15:52
would you tried FCC task ?
@kartikv20
In one task that was given .
kartikv20
@kartikv20
Jan 30 2018 15:53
what
i dont get you
dinesh
@1532j0004kg
Jan 30 2018 15:53
did u explored FCC ?
kartikv20
@kartikv20
Jan 30 2018 15:53
yea
dinesh
@1532j0004kg
Jan 30 2018 15:54
in one task that task was given .
i mean getting current position task .
Stephen James
@sjames1958gm
Jan 30 2018 15:54
@1532j0004kg :wave:
dinesh
@1532j0004kg
Jan 30 2018 15:55
if (navigator.geolocation) {
  navigator.geolocation.getCurrentPosition(function(position) {
    $("#data").html("latitude: " + position.coords.latitude + "<br>longitude: " + position.coords.longitude);
  });
}
@kartikv20
Stephen James
@sjames1958gm
Jan 30 2018 15:56
@kartikv20 Have you tried, just console.log(position) to see if anything is passed?
dinesh
@1532j0004kg
Jan 30 2018 15:56
hi james , did u ever explored firebase , because i need help !
@kartikv20 may be ur browser problem !
@kartikv20 better u check the site settings .
@moT01 I successfully hosted db in mlab :smile:
Darren
@DarrenfJ
Jan 30 2018 16:01
@kartikv20 yah as @1532j0004kg pointed out yer missing the part where you add the positions to the page via the .html
kartikv20
@kartikv20
Jan 30 2018 16:02
@sjames1958gm works now!
Darren
@DarrenfJ
Jan 30 2018 16:02
@kartikv20 but as a side note I had a problem with it one one of my computers and realized i habitually say 'no' to the part where it asks if you want location tracking on
d'oh!
i had to log into the setting and reset that manually
Stephen James
@sjames1958gm
Jan 30 2018 16:03
@kartikv20 lol :+1:
@1532j0004kg Only a little firebase (in a couple of online courses)
dinesh
@1532j0004kg
Jan 30 2018 16:04
so where to start @sjames1958gm
I want to learn how to do CRUD operations.
in firebase
Stephen James
@sjames1958gm
Jan 30 2018 16:05
@1532j0004kg I always hit up you tube when I first try something
@1532j0004kg google might even have some tutorials
dinesh
@1532j0004kg
Jan 30 2018 16:05
do you have any good tutorials ?
!
Tom
@moT01
Jan 30 2018 16:06
:thumbsup: @1532j0004kg lets see it
dinesh
@1532j0004kg
Jan 30 2018 16:07
:+1:
Stephen James
@sjames1958gm
Jan 30 2018 16:09
@1532j0004kg maybe go to the source:
https://firebase.google.com/docs/web/setup
dinesh
@1532j0004kg
Jan 30 2018 16:10
:+1: @sjames1958gm
Xavier Artot
@xavierartot
Jan 30 2018 18:10
@sjames1958gm Do you want to pair with me
Someone can help to understand I did the first project in Visualisation but apparently I am wrong
https://codesandbox.io/s/github/xavierartot/markdown
Do you have other project?
I mean FCC seems to change a lot
Gaurav
@gauravmagan
Jan 30 2018 18:45
hi coders hope you guys are fighting great!!
keep pushing yourself

'''

'''

CamperBot
@camperbot
Jan 30 2018 18:46
:bulb: to format code use backticks! ``` more info
Matej Bošnjak
@mbosnjak01
Jan 30 2018 18:46
:fist:
Gaurav
@gauravmagan
Jan 30 2018 18:49
would like to know how can i post a pen from codepen into this window to learn my issues
would you guys mind if you can say how to
thank you
Matej Bošnjak
@mbosnjak01
Jan 30 2018 18:50
just post a link to that pen
Ken Haduch
@khaduch
Jan 30 2018 18:50
@gauravmagan - just copy the URL from the address bar, put comments about what you want people to comment on, ask questions, etc.
Gaurav
@gauravmagan
Jan 30 2018 18:52
thanks @khaduch i just got that
CamperBot
@camperbot
Jan 30 2018 18:52
gauravmagan sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3704 | @khaduch |http://www.freecodecamp.org/khaduch
Screen Shot 2018-01-30 at 1.53.30 PM.png
this is my pen need to work on the new page when i click about html and paste it in the url im getting these errors
i tried to remove the files and also removed the extra css the page aint shoing the navbars
Xavier Artot
@xavierartot
Jan 30 2018 19:02
@gauravmagan Remove the Doctype element
just before <html lang="en">
Ghost
@ghost~5a4a80acd73408ce4f859755
Jan 30 2018 19:03
Does anyone know how to make a PHP file on Windows 10?
Xavier Artot
@xavierartot
Jan 30 2018 19:03
Windows seriously?
Ghost
@ghost~5a4a80acd73408ce4f859755
Jan 30 2018 19:04
Im just a student. Trying to learn to code with PHP
Don't know where i can write PHP code and debug it as well
Do you know how to do it on dreamweaver?
Ken Haduch
@khaduch
Jan 30 2018 19:04
@gauravmagan - many (or all ) of your things that you are using the "assets" folder for cannot be referenced in a CodePen "pen" in that way - you have to have full URL for each file, and the correct place to put those on a CodePen pen is in the CSS config or JS config (depending on the type of file). Any of your custom CSS or JS have to be stored in the CSS or JS panel. There is one "project" available on the free version of CodePen, that can have assets in folders, etc. I have not used it, and you only have one unless you subscribe to the "Pro" version. There is a way to store different JS and CSS in the standard pen resources, and then link to those through the config entries. See https://blog.codepen.io/documentation/editor/adding-external-resources/ for https://blog.codepen.io/documentation/editor/adding-external-resources/#other-pens. It looks like it's going to be a lot of work to set this up given all of the resources that you've used.
You might be able to use a github project (I forget the term for it) you can upload your project to github and set up a method to access it with a URL and view it in the browser. I think that they call that "github pages" - here is a URL for that https://pages.github.com
Ghost
@ghost~5a4a80acd73408ce4f859755
Jan 30 2018 19:14
Can someone help me out please?
shivendrarox
@shivendrarox
Jan 30 2018 19:22
yes @Muhammed-K
whats d problem @Muhammed-K
Matej Bošnjak
@mbosnjak01
Jan 30 2018 19:24
@Muhammed-K You can do it by making txt file and add .php extension to it....Example: script.php
you can also install XAMPP to make your local Apache server and then test your code via localhost in browser
Ghost
@ghost~5a4a80acd73408ce4f859755
Jan 30 2018 19:25
But how can i run it in my browser to test it out?
I downloaded Apache Server but didn't know what to do thereafter so i deleted it
Matej Bošnjak
@mbosnjak01
Jan 30 2018 19:25
get XAMPP
Ghost
@ghost~5a4a80acd73408ce4f859755
Jan 30 2018 19:26
If i do so again now can you run me through the steps please?
Matej Bošnjak
@mbosnjak01
Jan 30 2018 19:26
look
shivendrarox
@shivendrarox
Jan 30 2018 19:26
enter ur Ip in url of ur browser
Ghost
@ghost~5a4a80acd73408ce4f859755
Jan 30 2018 19:26
ok
how do i get my IP?
shivendrarox
@shivendrarox
Jan 30 2018 19:27
it must have shown during istallation
Matej Bošnjak
@mbosnjak01
Jan 30 2018 19:27
@Muhammed-K I will write it down, plain and simple
just give me a minute please
Ghost
@ghost~5a4a80acd73408ce4f859755
Jan 30 2018 19:27
Ok, thank you very much :)
Sorry im just a beginner and have no clue what to do!
shivendrarox
@shivendrarox
Jan 30 2018 19:28
np,i am also a beginer
but i have setup a apache server in my linux
so i thought of helping you
Ghost
@ghost~5a4a80acd73408ce4f859755
Jan 30 2018 19:29
Very kind of you :)
shivendrarox
@shivendrarox
Jan 30 2018 19:30
:-D
any feedbacks for above
LydaTech
@lydatech
Jan 30 2018 19:38
@Muhammed-K php is a server side language. It doesnt render directly in the browser window. You need a backend that executes the php and sends it to the browser
Ghost
@ghost~5a4a80acd73408ce4f859755
Jan 30 2018 19:39
@lydatech Got it, thanks a lot :)
CamperBot
@camperbot
Jan 30 2018 19:39
muhammed-k sends brownie points to @lydatech :sparkles: :thumbsup: :sparkles:
:star2: 2628 | @lydatech |http://www.freecodecamp.org/lydatech
Ghost
@ghost~5a4a80acd73408ce4f859755
Jan 30 2018 19:40
wait what did i just do? lool
@shivendrarox I made a tribute page too, ill send it to you
ILdar Nogmanov
@Ildarik
Jan 30 2018 19:40
Hey guys!
Could you give me some advice about implementing something like this?
I have react component with an array of fields (redux-form). Then I click the add button and a new input field appears. I want to limit amount of this new fields and hide the add button so that the fields count equals 5. I need to use state, right? And add "AddEventListener" to onClick event on the add button and after measure the length array of the fields?
Matej Bošnjak
@mbosnjak01
Jan 30 2018 19:41
it's automatic cookie when you thank somebody for an advice @Muhammed-K
CamperBot
@camperbot
Jan 30 2018 19:41
mbosnjak01 sends brownie points to @muhammed-k :sparkles: :thumbsup: :sparkles:
:cookie: 4 | @muhammed-k |http://www.freecodecamp.org/muhammed-k
Matej Bošnjak
@mbosnjak01
Jan 30 2018 19:41
lel
Ghost
@ghost~5a4a80acd73408ce4f859755
Jan 30 2018 19:41
oh lmao, they know when you thank someone
just by saying the word thank? @mbosnjak01
Matej Bošnjak
@mbosnjak01
Jan 30 2018 19:42
it's a simple script actually
checking a string for certain word and executing other code if certain word is found...most likely
Ghost
@ghost~5a4a80acd73408ce4f859755
Jan 30 2018 19:42
I would love to script a code for a chat like this... i mean a website with a chat room
that must be it, im learning :) lool
Nitin bisht
@ntnbst
Jan 30 2018 20:23
thanks @moT01
CamperBot
@camperbot
Jan 30 2018 20:23
ntnbst sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 970 | @mot01 |http://www.freecodecamp.org/mot01
Anders Nicolai Magnussen
@nicolaimagnussen
Jan 30 2018 20:55
hi
Tom
@moT01
Jan 30 2018 21:08
hi
disjfa
@disjfa
Jan 30 2018 21:12
hi
Anders Nicolai Magnussen
@nicolaimagnussen
Jan 30 2018 21:17
Whats up :)
I figured out my mistake :P
RehabThis
@RehabThis
Jan 30 2018 21:48
Hoping to get some help with this issue I am having. I am working on the Portfolio project. Essentially, I want to have an image pulled from the net and scaled down to 50% of viewport. Maybe I am misunderstanding something, but I thought Bootstrap (v3) allowed you to do that using classes on divs. My logic keeps getting all twisted though, because I also thought that the div would stretch based on content inside. So, what is the preferred method of limiting an img to a % of the viewport?
Lee
@LeeConnelly12
Jan 30 2018 22:11
@RehabThis Setting the image's height to 50vh should scale it to 50% of the view port
Ghost
@ghost~5a4a80acd73408ce4f859755
Jan 30 2018 22:30
To do the Portfolio Project, which programming languages are required? Are HTML, CSS and JavaScript enough?
Lee
@LeeConnelly12
Jan 30 2018 22:51
@Muhammed-K Just html and css i think