6th
Feb 2017
Roberto Di Lillo
@koop4
Feb 06 2017 00:03

I'm working on the exercise smallest-common-multiple
and i have a problem in a for loop.
The Algorithm works this way:

• create a list of number in range between min and max (excluding them)
• loop to find a common multiple between the min and max.
• anytime it finds it, it tries to check if it's a common multiple for all the other number in the range

the problem is:
i tried to test with [1,5] ( expecting 60) but the loop keep going after it.
I added some console log and it seems that the variable found, which i use to check if more cycle are needed, seems to be properly set to true. But it doesn't stop
here's the code:

``````  console.log("################");
var min, max, i, k, list, found;

min = arr.reduce((a,b) => Math.min(a,b) );
max = arr.reduce((a,b) => Math.max(a,b) );

for(list = []; ++min<max; list.push(min));

min = arr.reduce((a,b) => Math.min(a,b) );
i=1;
k=1;
while(!found) {
console.log("---");
console.log("i:",i,"k:",k);
console.log(min*i);
if(min*i === max*k){
console.log("***");
found = list
.reduce( (a,b) => {
console.log("a",a );
console.log("current:",min*i );
console.log("b",b );
console.log("test: ",(min*i)%b===0 );
return a && (min*i)%b===0;
},
true );
console.log("* ",found);
}
increaseLower();
}

function increaseLower() {
if(min*i < max*k)
i++;
else
k++;
}``````
Feb 06 2017 00:12
sup? Check out my checklist app: http://emmanuelamador.com/dashnote/
xemexpress
@xemexpress
Feb 06 2017 00:32

hi everyone, i am doing wiki viewer and have getjson() set. But when loading the result, the console said "No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://s.codepen.io' is therefore not allowed access.". How to fix this?

Here is my codepen

here I just console.log() the result
Gulsvi
@gulsvi
Feb 06 2017 00:35
@xemexpress Add `origin=*` to your URL: http://stackoverflow.com/a/38921370
xemexpress
@xemexpress
Feb 06 2017 00:40
@SkyCoder01 thanks!!
CamperBot
@camperbot
Feb 06 2017 00:40
xemexpress sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
Robin
@LuckyRabbits
Feb 06 2017 00:46
@ObjectiveCFido YES! That's awesome news!
Skullvapor
@Skullvapor
Feb 06 2017 01:10
How do I make it so that HTML I write won't show unless the user clicks something?
Gulsvi
@gulsvi
Feb 06 2017 01:17
@Skullvapor Lots of ways. After the click, you can write the HTML with .html(), you could .hide() and .show() the elements, or use .css().
http://api.jquery.com/hide/
http://api.jquery.com/show/
http://api.jquery.com/html/
http://api.jquery.com/css/
Robin
@LuckyRabbits
Feb 06 2017 01:20
^ ohhh gtk.
Hello911
@Hello911
Feb 06 2017 01:36
``````var args=[].slice.call(5,4,3,2,1);
console.log(args);``````
This is weird. The returned result is not [5,4,3,2,1]. But I check my console. It says Array[0];
Robin
@LuckyRabbits
Feb 06 2017 02:07
@Hello911 What is the expected return?
o wait...derp
Moisés Man
@moigithub
Feb 06 2017 02:13
@Hello911 in that line of code.. u using 2 methods...
slice
call
Jacob Leatherwood
Feb 06 2017 02:13
Hello. I am finishing up my portfolio example. Can I have some help with some simple things?
My contact form (When you click contact in the navbar) is not spaced correctly. Can someone pinpoint what I need to do to fix it? http://codepen.io/dadleatherwood/pen/vgrpov
Colton Ehrman
@coltonehrman
Feb 06 2017 02:16
@dadleatherwood You have negative margin on your `.form-group`
You need to override it.
Jacob Leatherwood
Feb 06 2017 02:16
@coltonehrman How can I change that? Do you know why it happened?
Colton Ehrman
@coltonehrman
Feb 06 2017 02:17
Specifically this selector `.form-horizontal .form-group`
The negative margin makes it stick out
Just override it
Another option is to get rid of the `form-horizontal` class on your form
Moisés Man
@moigithub
Feb 06 2017 02:19
@dadleatherwood u have ur form-group nested.. one inside the other
check this example http://getbootstrap.com/css/#forms-horizontal
Jacob Leatherwood
Feb 06 2017 02:20
@moigithub You are amazing! Stinking divs. Thank you!!!
CamperBot
@camperbot
Feb 06 2017 02:20
dadleatherwood sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 2660 | @moigithub |http://www.freecodecamp.com/moigithub
Jacob Leatherwood
Feb 06 2017 02:21
@moigithub Do you happen to know how to get my links in the nevbar to reference the sections on the page?
@moigithub Looks like I figured that out. Thank you again!
CamperBot
@camperbot
Feb 06 2017 02:22
dadleatherwood sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
Tony
@FreakishLancer
Feb 06 2017 03:09
Hi, I was wondering if you guys could test my calculator for a bit and see if there is anything wrong with it. Thanks! http://codepen.io/Freaklancer/pen/NdzRxJ
Kevin
@KevinBruland
Feb 06 2017 03:16
Anyone around thats familiar with React?
@FreakishLancer Looks pretty good, chaining operations after hitting the equal sign is a bit awkward though
Tony
@FreakishLancer
Feb 06 2017 03:18
@KevinBruland Thanks. I'm currently trying to fix that. Will get back to you if I do. Might have to finish it tomorrow morning though.
Kevin
@KevinBruland
Feb 06 2017 03:18
EG, hitting: "9 * 8 = +" results in 648\
SamLee714
@SamLee714
Feb 06 2017 03:19
Hi coders, I'm trying to get a nav bar to run across the top of the page... I thought this would do it but it doesn't seem to be working.. any ideas?
<nav class="navbar navbar-default">
<div class="container-fluid">
<a class="navbar-brand" href="#">WebSiteName</a>
</div>
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Page 1</a></li>
<li><a href="#">Page 2</a></li>
<li><a href="#">Page 3</a></li>
</ul>
</div>
</nav>
Kevin
@KevinBruland
Feb 06 2017 03:20
@SamLee714 is it showing up stacked in the middle?
@SamLee714 and are you trying that on codepen?
SamLee714
@SamLee714
Feb 06 2017 03:21
@KevinBruland yes to both
Kevin
@KevinBruland
Feb 06 2017 03:22
looks like codepen recently updated to bootstrap 4 which has different class names
davidridwann
@davidridwann
Feb 06 2017 03:22
Kevin
@KevinBruland
Feb 06 2017 03:22
you can either look into bootstrap 4 navbars, OR you can use an older version of bootstrap
on codepen, replace the line where you added bootstrap with:
https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css
SamLee714
@SamLee714
Feb 06 2017 03:24
@KevinBruland Ok I'll look into it cheers
@KevinBruland thanks
CamperBot
@camperbot
Feb 06 2017 03:24
samlee714 sends brownie points to @kevinbruland :sparkles: :thumbsup: :sparkles:
Tony
@FreakishLancer
Feb 06 2017 03:27
@KevinBruland I changed a bit of my code. Can you check if my calculator works correctly now?
Kevin
@KevinBruland
Feb 06 2017 03:28
looks good
up for another issue?
did you run into a floating point decimal issue on the cashier?
Tony
@FreakishLancer
Feb 06 2017 03:30
You mean on the algorithm challenge?
Kevin
@KevinBruland
Feb 06 2017 03:30
yeah
Tony
@FreakishLancer
Feb 06 2017 03:31
Hmm, that's the Exact Change problem is it?
Kevin
@KevinBruland
Feb 06 2017 03:31
I believe so, yeah
on your calculator, if you add .01 + .01 + .01 + .01 + .01 + .01,
Tony
@FreakishLancer
Feb 06 2017 03:31
I solved that challenge a few weeks ago, so I may need a few moments to remember that.
Kevin
@KevinBruland
Feb 06 2017 03:31
you get a really long decimal, which is due to a floating point issue
Tony
@FreakishLancer
Feb 06 2017 03:32
Yeah, my quick solution for that was to just display "OUT OF BOUNDS" for numbers that get past 18 digits. I'm trying to find a better way though.
Andy
@andythedandyone
Feb 06 2017 03:32
i must be dum.. I dont get it WHERE i have to place that #thumbnail or box-shadow, which I created he css #thumbnail already.. however, not passing, any hint?
Kevin
@KevinBruland
Feb 06 2017 03:32
its up to you if you want to get that in depth with that
theres a pretty good explanation about it here:
http://floating-point-gui.de/basic/
Tony
@FreakishLancer
Feb 06 2017 03:34
For the Exact Change challenge, I think I ran into a problem with the pennies; specifically, I was getting 0.03 instead of 0.04 in pennies for one of the example tests.
So I did a few googling and found different approaches, like parseFloat or etc. whatnot. I ended up just using something like Math.round(value * 100) / 100
philiplee15
@philiplee15
Feb 06 2017 03:36
``````function findLongestWord(str) {
var strArray = str.split(" ");
var arrNum = [];
for(i=0; i<strArray.length; i++){
arrNum.push(strArray[i].length);
}
arrNum.sort(function(a,b){
return a-b;
});
return arrNum[arrNum.length-1];
}``````
Is there a better way to execute this algorithm?
feel like i took extraneous steps
Tony
@FreakishLancer
Feb 06 2017 03:36
@KevinBruland Anyway, this was my long code for the Exact Change challenge if you want to look at it. Are you asking because it may have something to do with my long decimal issue on my calculator atm?
``````// jshint esversion: 6

function checkCashRegister(price, cash, cid) {
"use strict";

var baseMoneyValues = {
"PENNY": 0.01,
"NICKEL": 0.05,
"DIME": 0.10,
"QUARTER": 0.25,
"ONE": 1.00,
"FIVE": 5.00,
"TEN": 10.00,
"TWENTY": 20.00,
"ONE HUNDRED": 100.00
};

var change = cash - price;

var changeArray = [];

for (var i = cid.length - 1; i >= 0; i--) {
if (cid[i][1] < change && cid[i][1] !== 0) {
change = Math.round((change - cid[i][1]) * 100) / 100;
changeArray.push([cid[i][0], Math.round(cid[i][1] * 100) / 100]);
}
else if (cid[i][1] > change && change !== 0) {
let countedMoney = cid[i][1] / baseMoneyValues[cid[i][0]];
for (var a = countedMoney; a >= 0; a--) {
if (a * baseMoneyValues[cid[i][0]] <= change) {
change = Math.round((change - (a * baseMoneyValues[cid[i][0]])) * 100) / 100;
if (a * baseMoneyValues[cid[i][0]] !== 0) {
changeArray.push([cid[i][0], Math.round((a * baseMoneyValues[cid[i][0]]) * 100) / 100]);
}
break;
}
}
}
if (i === 0 && change !== 0) {
if (change - cid[i][1] === 0) {
return "Closed";
}
return "Insufficient Funds";
}
if (change === 0) {
for (var j = i; j >= 0; j--) {
if (cid[i][1] !== 0) {
break;
}
if (j === 0) {
return "Closed";
}
}
}
}

return changeArray;
}

checkCashRegister(19.50, 20.00, [["PENNY", 0.50], ["NICKEL", 0], ["DIME", 0], ["QUARTER", 0], ["ONE", 0], ["FIVE", 0], ["TEN", 0], ["TWENTY", 0], ["ONE HUNDRED", 0]]);``````
Kevin
@KevinBruland
Feb 06 2017 03:37
Asked because that algorithm requires some sort of way to work around the floating decimal
looks like you used the multiply by 100 divide by a hundred method
Tony
@FreakishLancer
Feb 06 2017 03:38
Yup. I'm not sure how accurate it really is though for my purposes. I'll check into it.
Kevin
@KevinBruland
Feb 06 2017 03:38
you can look into toFixed
Tony
@FreakishLancer
Feb 06 2017 03:39
toFixed didn't end up working for me in the algorithm challenge though. Maybe it might help with the calculator. Anyway, I'll take care of that tomorrow. Thanks for the help @KevinBruland !
CamperBot
@camperbot
Feb 06 2017 03:39
freakishlancer sends brownie points to @kevinbruland :sparkles: :thumbsup: :sparkles:
Kevin
@KevinBruland
Feb 06 2017 03:39
np, best of luck!
Jean Marco Romero
@volkranium
Feb 06 2017 03:40
Hey guys what should i do if i designed a web page desktop approach first to make it responsive?
just found myself in a rush of inspiration , till i noticed i didnt pay attention to the mobile thingy
davidridwann
@davidridwann
Feb 06 2017 03:53
@volkranium you can see it http://getbootstrap.com/
xemexpress
@xemexpress
Feb 06 2017 04:16
hi guys, i am doing twitchTV. How to get the icon for those offline??
then it ends there??
how to retrieve its icon?
Trcer
@Trcer
Feb 06 2017 04:18
Hi, i'm building a random quote machine, I can't seem to find a problem here
But it won't generate a random quote.
Gulsvi
@gulsvi
Feb 06 2017 04:19
Trcer
@Trcer
Feb 06 2017 04:23
Ah ok, Thank you!
Stefan Langenborg
@slangenborg
Feb 06 2017 04:23
can anyone please explain why my getJSON call isn't going through?
\$.getJSON("https://en.wikipedia.org/w/api.php/w/api.php?action=query&format=json&list=search&utf8=1&srsearch=" + search, function(data){
\$(".title").html(search);
var inputs = data.query.search;
for (var i=0;i<inputs.length;i++){
var result = document.createElement('result');
result.type = "div";
result.html("<h1>"+ inputs[i].title + "</h1>");
\$(".results").append(result);
}
});
}
xemexpress
@xemexpress
Feb 06 2017 04:28

hi.. where does "Uncaught TypeError: Cannot set property '10' of undefined" come from?? :(

http://codepen.io/xemexpress/pen/xgzQwN

Michael Karpinski
@karpimpski
Feb 06 2017 04:28
hey guys, I could use a CSS guru. right now, I have some boxes that, upon hovering, change text. I do this by having 2 p tags in the box, and on hovering one's display is set to none and the other's is shown. on blur, the original text is back
xemexpress
@xemexpress
Feb 06 2017 04:28
in the console, i console.log() something
Michael Karpinski
@karpimpski
Feb 06 2017 04:28
I want the text to fade in. does anybody know how to do that?
Gulsvi
@gulsvi
Feb 06 2017 04:28
@slangenborg add `origin=*` to your url lots of people hitting this today :)
https://en.wikipedia.org/w/api.php/w/api.php?action=query&format=json&list=search&utf8=1&origin=*&srsearch=test
xemexpress
@xemexpress
Feb 06 2017 04:30
oh sorry, please neglect my question
but still, any ideas how to retrieve the icon images of offline streamers??
xemexpress
@xemexpress
Feb 06 2017 04:37
h1tag
@h1tag
Feb 06 2017 04:39
@xemexpress there was someone asking the same question and someone answered him that the method to do it is available in the API documentation, I think he was talking about the twitch API documentation
but idk how because I used the hard coded object
xemexpress
@xemexpress
Feb 06 2017 04:43
@fortMaximus what do you mean by "hard coded object"?? Is it that "push every JSON into an array, then add the img url to 'logo' property"??
especially for those offline
?
h1tag
@h1tag
Feb 06 2017 04:44
2nd paragraph
I didn't add an img url for the logo of offline channels, I just left it as it is
but if you like you can add one or just use a placeholder for the offline channels
I'm talking about the hard coded object
xemexpress
@xemexpress
Feb 06 2017 04:47
oic
thanks so much @fortMaximus I'll read more
CamperBot
@camperbot
Feb 06 2017 04:48
xemexpress sends brownie points to @fortmaximus :sparkles: :thumbsup: :sparkles:
Feb 06 2017 04:53
Hey gys I have a question about the "Build a Random Quote Machine" challenge.
Where can I get an API for random quotes and does it have to be in json format?
xemexpress
@xemexpress
Feb 06 2017 04:53
@fortMaximus This also solves the problem:
https://wind-bow.gomix.me/twitch-api/users/test_channel?callback=?
Feb 06 2017 04:54
I' seen other formats like jsonfm, don't know what to use
xemexpress
@xemexpress
Feb 06 2017 04:54
it provides a logo property of every users in twitch
h1tag
@h1tag
Feb 06 2017 04:55
@xemexpress `logo` is null?
Feb 06 2017 04:55
Ok , I see.
thanks @xemexpress `logo` is null?
CamperBot
@camperbot
Feb 06 2017 04:56
tadm123 sends brownie points to @xemexpress :sparkles: :thumbsup: :sparkles:
Feb 06 2017 04:56
ah sorry wrong person
xemexpress
@xemexpress
Feb 06 2017 04:56
@fortMaximus haha, sorry. try the freecodecamp
Feb 06 2017 04:56
thanks @fortMaximus
CamperBot
@camperbot
Feb 06 2017 04:56
tadm123 sends brownie points to @fortmaximus :sparkles: :thumbsup: :sparkles:
h1tag
@h1tag
Feb 06 2017 04:56
Feb 06 2017 04:56
ok
xemexpress
@xemexpress
Feb 06 2017 04:57
@fortMaximus that was a test_channel
CamperBot
@camperbot
Feb 06 2017 04:57
api offline
h1tag
@h1tag
Feb 06 2017 04:58
what's wrong with @camperbot !
xemexpress
@xemexpress
Feb 06 2017 04:58
interesting
h1tag
@h1tag
Feb 06 2017 05:01
@xemexpress is freecodecamp an offline channel in your object?
xemexpress
@xemexpress
Feb 06 2017 05:03
yes @fortMaximus
h1tag
@h1tag
Feb 06 2017 05:03
@xemexpress how did you solve it?
arvinsabares
@arvinsabares
Feb 06 2017 05:05
@karpimpski my suggestion is that you would have to set the display to block for both of your text and position them absolute on top of each other and give them a white background so that it doesn't look like one is overlapping the other. Then use css hover to trigger fade out css animation for the top text which then shows the bottom text.
xemexpress
@xemexpress
Feb 06 2017 05:09

@fortMaximus oh notice that I changed /stream/freecodecamp in

``"https://wind-bow.gomix.me/twitch-api/streams/freecodecamp?callback=?"``

which will return a null stream for those offline (so we can't get their icon)
to /users/freecodecamp like the following

``https://wind-bow.gomix.me/twitch-api/users/freecodecamp?callback=?``

which returns an icon url and is described at Twitch-API https://github.com/justintv/Twitch-API/blob/master/v3_resources/users.md#get-usersuser and allowed by https://wind-bow.gomix.me/

Michael Karpinski
@karpimpski
Feb 06 2017 05:10
@arvinsabares I'll try it, thanks!
CamperBot
@camperbot
Feb 06 2017 05:10
karpimpski sends brownie points to @arvinsabares :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for arvinsabares
xemexpress
@xemexpress
Feb 06 2017 05:10
/streams/ typo
h1tag
@h1tag
Feb 06 2017 05:25
@xemexpress how did you know that "/users" is the one that will solve your problem?
I mean there many formats for the url on: https://github.com/justintv/Twitch-API
did you read all of them?
xemexpress
@xemexpress
Feb 06 2017 05:30
@fortMaximus Oh I just need the icon :) /users has it
h1tag
@h1tag
Feb 06 2017 05:31
@xemexpress thanks for the info.
CamperBot
@camperbot
Feb 06 2017 05:31
fortmaximus sends brownie points to @xemexpress :sparkles: :thumbsup: :sparkles:
xemexpress
@xemexpress
Feb 06 2017 05:32
i was thinking "icon" may relate to "user" :)
welcome
h1tag
@h1tag
Feb 06 2017 05:33
@xemexpress I see. Clever ;)
playingwithinfinity
@playingwithinfinity
Feb 06 2017 06:04
How do I get my Pomodoro clock to show minutes and seconds instead of seconds? http://codepen.io/jimpix/full/mRpRdj/
xemexpress
@xemexpress
Feb 06 2017 06:14
@playingwithinfinity maybe you write some codes doing the conversion on seconds?
playingwithinfinity
@playingwithinfinity
Feb 06 2017 06:15
@xemexpress That's the part I don't get.
xemexpress
@xemexpress
Feb 06 2017 06:19

say you got 132 seconds as input.

``````var inputS = 132;
var mins = floor(inputS/60);     // get 2 (minutes)
var  secs = inputS % 60;              // get 12 (seconds)``````

then you plug these into your code wherever suitable?

i don't know whether this could solve your problem :)
guys, how do you pass an object by value?? Insterested to know:)
Isaac Burbank
@IMBurbank
Feb 06 2017 06:32
Anyone mind helping me with an odd HTML/CSS mystery? I haven't even started on the JS because making the layout was so fun, but for some reason, I can't get :hover or :active effects to work on my round game buttons. I've never had this problem before. https://codepen.io/IMburbank/pen/bgMZQm
xemexpress
@xemexpress
Feb 06 2017 06:34
@playingwithinfinity just in case you missed it (see the comments just below your question)
Isaac Burbank
@IMBurbank
Feb 06 2017 06:38
@playingwithinfinity if you're going to decrement the output by one, and intend output to represent munutes - you'll have to multiply it by 60 to convert to seconds before you begin subracting one per second. @xemexpress is pointing you in the right direction above for converting your time.
playingwithinfinity
@playingwithinfinity
Feb 06 2017 06:39
@IMBurbank I can't scroll for some reason.
Isaac Burbank
@IMBurbank
Feb 06 2017 06:40
@playingwithinfinity I typically take my input in minutes, convert it to seconds, and then convert it to a time object with a function kinda like this one:
@playingwithinfinity //convert seconds to time object
var secToMinSec = function(sec) {
return {
'total': sec,
'minutes': Math.floor(sec / 60),
'seconds': Math.floor(sec % 60)
};
}
xemexpress
@xemexpress
Feb 06 2017 06:42
@IMBurbank Thanks for correcting my mistakes
CamperBot
@camperbot
Feb 06 2017 06:42
xemexpress sends brownie points to @imburbank :sparkles: :thumbsup: :sparkles:
Isaac Burbank
@IMBurbank
Feb 06 2017 06:43
@xemexpress No problem
xemexpress
@xemexpress
Feb 06 2017 06:43
@IMBurbank Your game button is awesome. I always want to make this kind of figure purely by css and html
Isaac Burbank
@IMBurbank
Feb 06 2017 06:44
@xemexpress Thanks! I just can't figure out why I can't make my circle buttons work!
CamperBot
@camperbot
Feb 06 2017 06:44
imburbank sends brownie points to @xemexpress :sparkles: :thumbsup: :sparkles:
Isaac Burbank
@IMBurbank
Feb 06 2017 06:44
@xemexpress Not yet.
@xemexpress I can get the color pads to respond on hover and active, but not the buttons. It's perplexing...
Isaac Burbank
@IMBurbank
Feb 06 2017 06:58
@xemexpress Got it! Apparently, setting z-index on an element means nothing of it is nested inside another html element of a lower z-index. Fortunately, I was able to increase the z-index of the parent element without impacting rendering. I'm in business!
Feb 06 2017 06:58
Hey guys can someone help me out?
I'm in the "Random Quote Generator" project but can't get my left quote icon to align with the quote.
Sorry forgot to save
xemexpress
@xemexpress
Feb 06 2017 07:03
@IMBurbank so great
Mridul
@mridulmishra22
Feb 06 2017 07:05
Hi, I m in intermediate front end projects. api calls arnt working in my codepen. I don't understand why. here i was just testing api for weather app: http://codepen.io/mridulm/pen/egKxdE . api isnt working. Please help
xemexpress
@xemexpress
Feb 06 2017 07:08
@tadm123 oh i see the problem. Your API returns a quote nested in <p></p>
that would definitely make another block which won't let your left quotes be in the first line of your paragraph
Feb 06 2017 07:12
Thanks I'll try that
xemexpress
@xemexpress
Feb 06 2017 07:12
welcome
Feb 06 2017 07:13
yeah, I'm still getting the same problem
`<span class="quoteBody"><i class="fa fa-quote-left"></i></span>`
Maybe I should put both of them inline, using grids?
Don't know what else to do
xemexpress
@xemexpress
Feb 06 2017 07:15
@tadm123 nonono, I mean your API returns a <p> tag which is the problem
can you retrieve a pure text version?
h1tag
@h1tag
Feb 06 2017 07:16
@mridulmishra22 do you know `\$(document).ready();` and why it's used?
Feb 06 2017 07:16
Ah ok, yeah I'll look at another API
xemexpress
@xemexpress
Feb 06 2017 07:18
@mridulmishra22 hi, your api is working. However, you should get the function work when the page is loaded
say appending this in your js code
``````\$(document).ready(function(){
getQuote();
});``````
@tadm123 you could look into the result of the API first. See whether it is suitable for you
But I think you can continue with your current API. Just slice the string to get rid of <p> tag
xemexpress
@xemexpress
Feb 06 2017 07:23
Feb 06 2017 07:24
Can I do this?
alican karalar
@alicankaralar
Feb 06 2017 07:24
wooo finally done with this
Feb 06 2017 07:24
\$( "p" ).remove();
`\$('.quoteBody').remove("p").append(quote);`
I'll try to figure it out... brb.
Ayush Bahuguna
@relentless-coder
Feb 06 2017 07:28
Hey I've run into a problem. I've been given a design template and I need to code it, now all is good except there is section which contains boxes that have like triangle on top of it.
something like this
how do I achieve this.
xemexpress
@xemexpress
Feb 06 2017 07:31
@alicankaralar it looks cool
Ayush Kumar Singh
@Geomancer91
Feb 06 2017 07:50
@alicankaralar nice... will be moving to wikipedia viewer next :)
Ayush Kumar Singh
@Geomancer91
Feb 06 2017 07:56
Mridul
@mridulmishra22
Feb 06 2017 07:58
@xemexpress > @mridulmishra22 hi, your api is working. However, you should get the function work when the page is loaded: made that change. still not workin. its not a problem in code. problem seems in my codepen. if you run same code in your coded pen, it might work. see it in my codepen: http://codepen.io/mridulm/pen/egKxdE
Ivanov-Kirill
@Ivanov-Kirill
Feb 06 2017 08:05
https://codepen.io/Erizo/pen/bgvEYE?editors=1100v how to fix #button-header btn?
Marianissimus
@Marianissimus
Feb 06 2017 08:12
@Ivanov-Kirill hey, check your spelling:) it's container, not conteiner
xemexpress
@xemexpress
Feb 06 2017 08:31
@mridulmishra22 you got a typo in document
``````function getQuote(){
var url="http://api.openweathermap.org/data/2.5/weather?q=London,uk&appid=346ae288b8ec832ff678f49b26dd6b00";
\$.getJSON(url, function(data){
\$(".tst").html(data.coord.lon);
});
}

getQuote();
});``````
Besides declaring and defining a function, you should call it to let it work :)
stating the function in ready() is fine, then you should also call it once in ready()
``   getQuote();``
xemexpress
@xemexpress
Feb 06 2017 08:45
@IMBurbank hey, I am still amazed by your work. Where did you learn all these? Any suggestion for me to start getting around it?
Clyde Lobo
@oppiniated
Feb 06 2017 09:00
@relentless-coder use `:before`
Joel Santos
@St3ps
Feb 06 2017 09:29
I have 3 elements that share one class.
Supossedly, if i wanted to access these 3 elements individually, i could specify a nth-child selector, and they would be acessible through .my-class:nth-child(1), .my-class:nth-child(2) and so forth. Unfortunately, what happens is that as far as the DOM structure is concerned there is only 1 element, and the 3 elements count as one. So if i go .my-class:nth-child(1) and change the background to green, they all become green. There is only one element.
Any clues to why this is happening?
Clyde Lobo
@oppiniated
Feb 06 2017 09:33
@St3ps You have a wrong understanding of `:nth-child`.
Mike Boardley
@Boardley
Feb 06 2017 09:34
That should be what you are looking for
Ignore all of the JS on the far right
I just threw this in an existing code pen
Clyde Lobo
@oppiniated
Feb 06 2017 09:36
Mike Boardley
@Boardley
Feb 06 2017 09:37
@St3ps - You get it working?
Clyde Lobo
@oppiniated
Feb 06 2017 09:37
@Boardley Your example works because you have only 3 `.myClass` and they are all siblings, with the same parent
Joel Santos
@St3ps
Feb 06 2017 09:37
@oppiniated And would you tell me in how I am wrong?
Clyde Lobo
@oppiniated
Feb 06 2017 09:37
@St3ps Check the link I posted
Mike Boardley
@Boardley
Feb 06 2017 09:38
@oppiniated - I get that. I was doing it based on what he was aking for
Joel Santos
@St3ps
Feb 06 2017 09:38
@Boardley This is what I have done, doesn't work, i'm going to assume some voodoo is messing up the DOM, thank you anyway
CamperBot
@camperbot
Feb 06 2017 09:38
st3ps sends brownie points to @boardley :sparkles: :thumbsup: :sparkles:
Mike Boardley
@Boardley
Feb 06 2017 09:38
@St3ps - @oppiniated example is the better one
Clyde Lobo
@oppiniated
Feb 06 2017 09:38
@St3ps can you post a codepen link?
Joel Santos
@St3ps
Feb 06 2017 09:40
@oppiniated i can give you my css
``````.wenn_menu-col:nth-child(1) {

background: salmon;

}

background: cyan;

}

background: navy;

}``````
Clyde Lobo
@oppiniated
Feb 06 2017 09:40
@St3ps I also need to see the HTML,
Mridul
@mridulmishra22
Feb 06 2017 09:40
Check this code. Here long & latt are globally defined variable. but when i am calling it outside, it says undefined. Whats wrong?
Code: https://codepen.io/mridulm/pen/bgKJGm
Joel Santos
@St3ps
Feb 06 2017 09:41
@oppiniated
``````<!-- full width row with 3 full height columns -->

<a href="/space"><div class="col-md-4 col-sm-4 col-xs-12 wenn_menu-col"><div class='motto'>Space</div>
</div></a>
<a href="/active"><div class="col-md-4 col-sm-4 col-xs-12 wenn_menu-col"><div class='motto'>Active</div>
</div></a>
<a href="/evolution"><div class="col-md-4 col-sm-4 col-xs-12 wenn_menu-col"><div class='motto'>Evolution</div>
</div></a>
</div>``````
It's a wordpress site
Mike Boardley
@Boardley
Feb 06 2017 09:42
@St3ps , you can just do this as well and this for sure will work
``.wenn_menu-row a:nth-child``
Clyde Lobo
@oppiniated
Feb 06 2017 09:42
@mridulmishra22 Did you try checking if they are assigned values inside the `if` condition?
Joel Santos
@St3ps
Feb 06 2017 09:42
So it's hard to just put it out there. It very well might be php or something, it worked before thoug
@Boardley I don't think it matters, i mean, i did the following
``````var menuArr = \$.makeArray('.wenn_menu-col');

//in the browser dev tools i got the following output:
// Array[1]0: a.fn.initlength: 1__proto__: Array[0]``````
Clyde Lobo
@oppiniated
Feb 06 2017 09:44
@St3ps So here's what is wrong, `.wenn_menu-col` is the first child inside the `a` tag. Hence they all get the `.wenn_menu-col:nth-child(1)` rule
Joel Santos
@St3ps
Feb 06 2017 09:44
So it basically has 1 length
Mridul
@mridulmishra22
Feb 06 2017 09:44
@oppiniated yes they are assigned inside if condition and condition is true.
Joel Santos
@St3ps
Feb 06 2017 09:45
@oppiniated Ahhhh! Ok let me test that out
Clyde Lobo
@oppiniated
Feb 06 2017 09:48
@mridulmishra22 It's because your code fore `data2` and `data3` are executed before the callback for `getCurrentPosition` is run.
Mridul
@mridulmishra22
Feb 06 2017 09:59
@oppiniated Thnx. I have to use those variable later in api as you can see in the commented lines. This is creating problem. Any sollution? How to get getCurrentPosition run first?
CamperBot
@camperbot
Feb 06 2017 09:59
mridulmishra22 sends brownie points to @oppiniated :sparkles: :thumbsup: :sparkles:
macieqx
@macieqx
Feb 06 2017 10:02
Hey guys, i need help, cause something is not working
krckyboy
@krckyboy
Feb 06 2017 10:02
Is it a good decision to use VH nowadays, or height in percentages or anything like that? How to achieve the same vertical order of DIVs on big screens and on smaller screens, as well? Using VH, height in % or something else?
Clyde Lobo
@oppiniated
Feb 06 2017 10:03
@krckyboy I found `vh` to be more reliable than % heights
macieqx
@macieqx
Feb 06 2017 10:03
http://codepen.io/macieqx/pen/LxroQM
I want this element with destination move a bit down, like 30% of section, but when i put margin-top:
everything collapses
There is a big white bar
krckyboy
@krckyboy
Feb 06 2017 10:03
@oppiniated Thanks, but what about browser compatibility?
CamperBot
@camperbot
Feb 06 2017 10:03
krckyboy sends brownie points to @oppiniated :sparkles: :thumbsup: :sparkles:
macieqx
@macieqx
Feb 06 2017 10:03
CamperBot
@camperbot
Feb 06 2017 10:03
Clyde Lobo
@oppiniated
Feb 06 2017 10:04
@krckyboy Here is the browser support http://caniuse.com/#feat=viewport-units
krckyboy
@krckyboy
Feb 06 2017 10:05
@oppiniated So not that good, huh. I mean, for IE and Edge.
Clyde Lobo
@oppiniated
Feb 06 2017 10:05
krckyboy
@krckyboy
Feb 06 2017 10:06
@oppiniated Do you know any alternatives to this? For width, I know we can use Bootstrap, inline-block with percentage, flexbox, but dunno about height.
Joel Santos
@St3ps
Feb 06 2017 10:11
@Boardley @oppiniated sorry for the slow answer, was surprised by a few other issues before i could test it out, and yes i believe oppiniated had it right, thanks guys for your time :) <3
CamperBot
@camperbot
Feb 06 2017 10:11
st3ps sends brownie points to @boardley and @oppiniated :sparkles: :thumbsup: :sparkles:
:warning: st3ps already gave boardley points
Dany
@danyweis
Feb 06 2017 10:12
@macieqx sorry but on the codepen I can see nothing! There is one thing I did see is that if you did copy paste your code in codepen than i think 1. you not pasted everything it is some missing on the bottom and 2. I think you missed the <body> </body>
xemexpress
@xemexpress
Feb 06 2017 11:26
hi, i am doing TwitchTV. Why the html code is not rendered by the scripts?
I have been stuck at this for hours. Can anyone help? :(
P.S. The API is fine. I think the problem lies on the scopes. Any idea how to solve this?
PipsChips
@PipsChips
Feb 06 2017 11:32
Hi! Could someone pls check/try my Local weather app; and confirm that it works fine?
http://codepen.io/PipsChips/full/XpYvdm/
Dany
@danyweis
Feb 06 2017 11:32
@xemexpress If you look on the top right of js you have the arrow and in there you can analyze you JavaScript and it says that you do have a function within a loop
@PipsChips for me it works fine. Nice job
PipsChips
@PipsChips
Feb 06 2017 11:35
@danyweis
Thank you!
CamperBot
@camperbot
Feb 06 2017 11:35
pipschips sends brownie points to @danyweis :sparkles: :thumbsup: :sparkles:
Dany
@danyweis
Feb 06 2017 11:36
@PipsChips you are welcome
PipsChips
@PipsChips
Feb 06 2017 11:51
Can someone pls help me getting my json object (for a wiki viewer project)? I've been struggling (with CORS) a lot to get any result, and now I have pure HTML code. Is it possible (good) to use it (somehow) in my future work...?
http://codepen.io/PipsChips/pen/XpExwL
xemexpress
@xemexpress
Feb 06 2017 11:52
:) @danyweis but I need the for loop to do the iteration to get separate JSON, how can I make it happen? I don't want to hard code this..
xemexpress
@xemexpress
Feb 06 2017 11:58
``````\$.getJSON("https://en.wikipedia.org/w/api.php?action=query&formatversion=2&generator=prefixsearch&gpssearch=Albert%20Ei&gpslimit=10&prop=pageimages%7Cpageterms&piprop=thumbnail&pithumbsize=50&pilimit=10&redirects=&wbptterms=description&origin=*", function(data) {
console.log(data);
});``````
PipsChips
@PipsChips
Feb 06 2017 12:05
@xemexpress
I got blank console :). No result.
AJ Robisch
@AJFelidae
Feb 06 2017 12:09
Hey, i'm working on my "Show the Local Weather" app. How do you add variables in the url for getJSON?
\$.getJSON("http://api.openweathermap.org/data/2.5/weather?"+myZip+","+myCountry+"&appid=1cc57d1e8191c32b8d8cc5ab32e4b350", function(data) doesn't seem to include the variables, where myZip and myCountry are variables.
Abhishek Kumar
@Mr-Kumar-Abhishek
Feb 06 2017 12:10
https://mr-kumar-abhishek.github.io/tic-tac-toe/ <--- does this covers all the user stories ??
kirbyedy
@kirbyedy
Feb 06 2017 12:12
@Mr-Kumar-Abhishek pretty much yes, you could only allow the user to change his sign
once I select the X I can not change it anymore to O
AJ Robisch
@AJFelidae
Feb 06 2017 12:12
hmmm... it doesn't seem to keep the variable values from my acquireJSON function

var myZip = "";
var myCountry = "";
var temperature = "";
function acquireJSON() {
\$.getJSON("http://ip-api.com/json", function(data) {
myZip = data.zip;
myCountry = data.countryCode;
console.log(myZip);
console.log(myCountry);
});
};
acquireJSON();

function acquireWeatherData() {
\$.getJSON("http://api.openweathermap.org/data/2.5/weather?"+myZip+","+myCountry+"&appid=1cc57d1e8191c32b8d8cc5ab32e4b350", function(data) {
console.log(data);
});
}

});

What am i doing wrong?
PipsChips
@PipsChips
Feb 06 2017 12:14
@Aviendhaast
kirbyedy
@kirbyedy
Feb 06 2017 12:14
@Aviendhaast well for example it can not get my location because the ip-api.com gives empty string for ZIP
Abhishek Kumar
@Mr-Kumar-Abhishek
Feb 06 2017 12:14
@kirbyedy Thanks so I could move on to other projects then ?
CamperBot
@camperbot
Feb 06 2017 12:14
mr-kumar-abhishek sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star2: 1740 | @kirbyedy |http://www.freecodecamp.com/kirbyedy
xemexpress
@xemexpress
Feb 06 2017 12:14
@Aviendhaast it's something like
``````var url = "http://api.openweathermap.org/data/2.5/weather?"+myZip+","+myCountry+"&appid=1cc57d1e8191c32b8d8cc5ab32e4b350";
\$.getJSON(url, function(data){
...
});``````
kirbyedy
@kirbyedy
Feb 06 2017 12:14
@Mr-Kumar-Abhishek sure
Abhishek Kumar
@Mr-Kumar-Abhishek
Feb 06 2017 12:14
@kirbyedy I suppose .. I will have to enhance it later on though :)
AJ Robisch
@AJFelidae
Feb 06 2017 12:15
@xemexpress thanks, will try that
CamperBot
@camperbot
Feb 06 2017 12:15
aviendhaast sends brownie points to @xemexpress :sparkles: :thumbsup: :sparkles:
Abhishek Kumar
@Mr-Kumar-Abhishek
Feb 06 2017 12:18
@Aviendhaast also take a look on how to use geolocation :)
kirbyedy
@kirbyedy
Feb 06 2017 12:18
@Aviendhaast your api call is not correct, I checked it now on the web site it should be something like this: api.openweathermap.org/data/2.5/weather?zip=94040,us
note that there is the zip= sign followed by the number
which you dont have
AJ Robisch
@AJFelidae
Feb 06 2017 12:21
Ok, my issue is that the variables from the acquireJSON function revert back to the empty strings once the function finishes.
So i can't use them in the other functions.
kirbyedy
@kirbyedy
Feb 06 2017 12:26
@Aviendhaast just curious... why dont you use latitude and longitude ?
PipsChips
@PipsChips
Feb 06 2017 12:29
@Aviendhaast
Try declaring your variables inside json's function; and maybe converting them to string (just to be sure) with '.toString()' method...
@Aviendhaast
You need to pass your variables, defined in acquireJSON function, as a parameters of acquireWeatherData() function.
kirbyedy
@kirbyedy
Feb 06 2017 12:36
cant be more simpler then this:
and pull your lat and lon from that ip-api call
PipsChips
@PipsChips
Feb 06 2017 12:37
@Aviendhaast
``````\$(document).ready(function() {

\$.getJSON("http://ip-api.com/json", function(data) {
var myZip = "";
var myCountry = "";
var temperature = "";
myZip = data.zip.toString();
myCountry = data.countryCode.toString();
console.log(myZip);
console.log(myCountry);
acquireWeatherData(myZip, myCountry);
});

function acquireWeatherData(myZip, myCountry) {
\$.getJSON("http://api.openweathermap.org/data/2.5/weather?"+myZip+","+myCountry+"&appid=1cc57d1e8191c32b8d8cc5ab32e4b350",
function(data) {
console.log(data);
});
}

});``````
Try code above
PipsChips
@PipsChips
Feb 06 2017 12:48
Can someone pls help me getting my json object (for wiki viewer project)
http://codepen.io/PipsChips/pen/XpExwL
xemexpress
@xemexpress
Feb 06 2017 12:58
why the icons are repeated... (twitchTV..)
http://codepen.io/xemexpress/pen/xgzQwN
Serediuc Alexandru
@alexserediuc
Feb 06 2017 13:17
why is happening this when I set position to absolute ? http://codepen.io/alexserediuc99/pen/EZRqaP
Clyde Lobo
@oppiniated
Feb 06 2017 13:17
@alexserediuc Why do you wanna set position to absolute?
Serediuc Alexandru
@alexserediuc
Feb 06 2017 13:18
@oppiniated When I scroll down I want the navigation bar to stay on top
Clyde Lobo
@oppiniated
Feb 06 2017 13:18
That's not absolute, that's fixed
`position: fixed`
Serediuc Alexandru
@alexserediuc
Feb 06 2017 13:19
even fixed it still mess up my nav bar
Clyde Lobo
@oppiniated
Feb 06 2017 13:21
@alexserediuc add `display: block`
Serediuc Alexandru
@alexserediuc
Feb 06 2017 13:28
now I cant move "about me portfolio and contact" on the right side.
Marianissimus
@Marianissimus
Feb 06 2017 13:32
@alexserediuc hey, alex, add some content first for testing purposes. for instance, inside the body, add a div with a height: 500px and a background-color of your choice. also, apply id-s or separate classes to your divs, don't select all your rows (.row) in css, that will mess up your design
PipsChips
@PipsChips
Feb 06 2017 13:48
Can someone pls help me getting my json object (for wiki viewer project)
http://codepen.io/PipsChips/pen/XpExwL
Feb 06 2017 13:51
Hi! i am at tic tac toe project. so can anyone suggest me how to assign values to different moves in the board for minimax algo...
kirbyedy
@kirbyedy
Feb 06 2017 13:53
@vivekpadia70 you can put them in the array for example
Feb 06 2017 13:55
but there are possibly 3 lakh values for tic tac toe
@kirbyedy
kirbyedy
@kirbyedy
Feb 06 2017 14:13
lakh ?
Clyde Lobo
@oppiniated
Feb 06 2017 14:15
@kirbyedy In india, a hundred thousand is a lakh
No concept of millions
so he meant to say 3 hundred thousand combinations
Feb 06 2017 14:16
by value i mean to say game position or game state
@kirbyedy
kirbyedy
@kirbyedy
Feb 06 2017 14:19
well I did not worked with a minimax algorithm, but there is definately not 300.000 combinations for tic tac toe game :)
Feb 06 2017 14:19
so which method did you used?
kirbyedy
@kirbyedy
Feb 06 2017 14:20
checking the winning combination
horizontal, vertical and diagonal
thats pretty much all
Feb 06 2017 14:21
so how do you manage to make computer play with you? @kirbyedy
kirbyedy
@kirbyedy
Feb 06 2017 14:25
well you can use a random place on the board
computer will choose a random empty spot
Feb 06 2017 14:26
alright thank you @kirbyedy
CamperBot
@camperbot
Feb 06 2017 14:26
vivekpadia70 sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star2: 1741 | @kirbyedy |http://www.freecodecamp.com/kirbyedy
Franco Javier Danussi
@francodanussi
Feb 06 2017 14:36
Hello there
Could anyone help me creating a list of html objects after calling an API?
I already have the correct response, but I don't know how to generate divs for each object instance of the API response
playingwithinfinity
@playingwithinfinity
Feb 06 2017 14:38
How can I convert seconds to minutes and seconds? http://codepen.io/jimpix/pen/mRpRdj
Feb 06 2017 14:46
minutes = seconds/60;
seconds = seconds%60;
playingwithinfinity
@playingwithinfinity
Feb 06 2017 15:01
@vivekpadia70 Yeah, but how do I get it to display?
Serediuc Alexandru
@alexserediuc
Feb 06 2017 15:07
Hello guys ! Why I cant see my header ? http://codepen.io/alexserediuc99/pen/EZRqaP
Feb 06 2017 15:12
@alexserediuc - chances are that it is under the navbar - that's a common situation. Try adding some padding-top to the body?
``````body {
}``````
Serediuc Alexandru
@alexserediuc
Feb 06 2017 15:14
ty
Feb 06 2017 15:14
@playingwithinfinity - you don't want to use the same variable for `seconds = seconds % 60;` if you are using the `seconds` variable to keep the total seconds. You want to make some other variable like `displaySeconds` or somesuch...
Franco Javier Danussi
@francodanussi
Feb 06 2017 15:42
There's a problem with the data I request from the API, it shows for a moment and then dissapears, anyone?
Serediuc Alexandru
@alexserediuc
Feb 06 2017 15:42
Hello ! It's me again. How can I make the profile picture from "about" section to stay next to the "wall of text" .
Franco Javier Danussi
@francodanussi
Feb 06 2017 15:46
@alexserediuc just put the image and the text in the same div, and the assing that div class a flex display, and in-line block
assign, sorry
just put the image and the text in the same div, and then assign that div class a flex display with an in-line block disposition
Feb 06 2017 15:55

@francodanussi - I think that your problem is most likely that you are using a form to submit data, and the default action of the form is to submit a POST or GET request, which will reload the page. What you want to do is either take away the `<form>` wrapper and just keep your inputs and the search button click will be handled by your click handler, or make this change to your JS code:

``````\$("#searchButton").on("click", function(event) {
event.preventDefault();
var mySearch =``````

which takes away the default action from the form submit...

Franco Javier Danussi
@francodanussi
Feb 06 2017 15:56
@khaduch Thanks, I didn't notice the <form> wrapper was the cause of that action
CamperBot
@camperbot
Feb 06 2017 15:56
francodanussi sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
Franco Javier Danussi
@francodanussi
Feb 06 2017 15:57
It worked, in deed, you were very kind
Feb 06 2017 16:01
@francodanussi - you're welcome. I would say that probably the best thing to do with this it take away the `<form>` and `</form>` since you aren't really using it - it just doesn't make much sense to have it in there...
@mrpuer
Feb 06 2017 16:06
hi dear friends. here is my pen http://codepen.io/mrpuer/pen/ygKNJE
can you help? why function GetUserIP() return undefined instead a current IP? what am I doing wrong? Thanks.
Feb 06 2017 16:18
@mrpuer - I think that the problem is that you have a function to actually get the IP within your `currentIP` function - so you issue the `\$.getJSON` call, and some finite amount of time later, the data is returned, and you get the variable. But there are two things - the console.log that you are trying to do is not in sync with the asynchronous JSON transfer, and your `var getIP`, being defined in a function, is not in scope outside of that function. So it looks like you are actually getting data back, you are just not using it in sync with the data return, if that makes sense?
if you move the `console.log` within your getJSON callback function, you'll be able to see the data that was returned, then you just have to make adjustments to keep the value in a more "global" place - where it will be accessible to other parts of the code.
Hello911
@Hello911
Feb 06 2017 16:28
``````
function destroyer(arr,...not) {

}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);``````
I am trying to use rest parameter. But the error message tells me to use 'esversion:6'. How can I fix that issue.
Feb 06 2017 16:30
@Hello911 - I think that you just put that somewhere in the code - I haven't been trying to use ES6 in my exercises - I've heard that it doesn't always blend well with the tests. I know that people have been using it - maybe someone will chime in, or I can try to make sense out of a note that I wrote in my notebook and see if I can give you some help?
Hello911
@Hello911
Feb 06 2017 16:32
I passed the test thanks
Feb 06 2017 16:33

@Hello911 - I added this at the very top of my code -

``/*jshint esversion: 6 */``

and it eliminates the warnings about the features - it seems that the code runs without it, it's just the linting that is picking up the new code, I guess?

Hello911
@Hello911
Feb 06 2017 16:34
what does jshint mean?
Feb 06 2017 16:35
@Hello911 - jshint is a "linting" mechanism ("lint" is a tool that looks at code and flags suspicious things that you might want to fix. Like if you did a statement `if ( myVar = true)`, I think that it would tell you that you might want an `==` or `===` operator there instead of assignment. http://jshint.com/ is the website - I think that they have it built into your code editor in the freecodecamp lessons to help flag some problems that people might miss...
Hello911
@Hello911
Feb 06 2017 16:37
So `/*jshint esversion: 6 */` just tells the liniting mechanism not to show that message, but not really fixing up the issue?
Millen812
@Millen812
Feb 06 2017 16:37
hey guys :) Can someone tell me why on earth the padding unter the image doesnt work? !https://codepen.io/Millen812/pen/MJBwaJ
Clyde Lobo
@oppiniated
Feb 06 2017 16:38
@Millen812 `stlye` should be `style`
Feb 06 2017 16:39
@Hello911 - it probably turns on a mode in jshint to say that you are using ES6 features, so that it will not flag them as invalid javascript constructs... if there is something "broken" with the code, it might detect it, or it might be a functional bug that is not purely syntactical, so it would potentially "miss" some things. But it's a nice tool.
Millen812
@Millen812
Feb 06 2017 16:39
thx @oppiniated, the main thing was that I just can't see 9px :D Always thought it doesn't work
CamperBot
@camperbot
Feb 06 2017 16:39
millen812 sends brownie points to @oppiniated :sparkles: :thumbsup: :sparkles:
Tyler Moeller
@TylerMoeller
Feb 06 2017 16:40
@mrpuer jsonip.com only gives you an ip address, not location. Also, with getJSON, you can't return a value like you're attempting to do. Setting async: false should be a last resort, and as you see, it doesn't work for your scenario. See this stack overflow answer for details: http://stackoverflow.com/a/4200651
You can try this approach instead:
``````\$.getJSON('https://ipinfo.io/json', getWeather);

function getWeather(location) {
console.log(location)
}``````
Hello911
@Hello911
Feb 06 2017 16:42
CamperBot
@camperbot
Feb 06 2017 16:42
hello911 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
Evan
@EvanDCP
Feb 06 2017 16:46
hello guys I need help with my weather app
it's not showing my coordinates in the console
nor showing the line "assigning the data" for that matter. Console is blank :/
Tyler Moeller
@TylerMoeller
Feb 06 2017 16:47
@EvanDCP It works fine for me
Clyde Lobo
@oppiniated
Feb 06 2017 16:47
@EvanDCP works for me
Evan
@EvanDCP
Feb 06 2017 16:47
really? but the console shows nothing, I can't see my coordinates
and without that, I can't do the app
Tyler Moeller
@TylerMoeller
Feb 06 2017 16:48
One thing you can do is make sure you're calling the API over HTTPS: `https://ipinfo.io`, just in case you opened your pen over HTTPS instead of HTTP
Evan
@EvanDCP
Feb 06 2017 16:49
just tried with https but it doesn't show anything either
adblocker? how do I disable it?
Tyler Moeller
@TylerMoeller
Feb 06 2017 16:52
It depends on what ad blocker you're using
I'm sure if you click the ad blocker icon in your browser it will have an option to disable it
Evan
@EvanDCP
Feb 06 2017 16:53
i don't see any ad blocker icon though
man this sucks :(
Tyler Moeller
@TylerMoeller
Feb 06 2017 16:54
@EvanDCP Do you get location from this codepen? http://codepen.io/TylerMoeller/pen/ZBBEGq
It tries a bunch of different APIs, maybe you just need to use a different one
If it works, use the one next to "Location Provider: " in the table
Evan
@EvanDCP
Feb 06 2017 16:56
doesn't work either! what the hell?
i just inspected it and it says there are errors:
Mohamed
@moey4
Feb 06 2017 16:56
i need help
Evan
@EvanDCP
Feb 06 2017 16:56
Uncaught ReferenceError: \$ is not defined
it's like my chrome can't see javascript??
but I do have it allowed
Tyler Moeller
@TylerMoeller
Feb 06 2017 16:57
Franco Javier Danussi
@francodanussi
Feb 06 2017 17:03
Hi there, any suggestions on how to format the API response?
https://codepen.io/francodanussi/pen/oBpozE
After you make some search the results are displayed but in a horrible way and I'm not able to change that
Feb 06 2017 17:06

Hi, people. I really need your advice. I am working on tic tac toe game. Logic works just fine(in 'impossible' unbeatable). SOMETIMES!!!

I think my code doesn't have bugs. But once in a while, it has tiny errors. Like doesn't change the color of "X" or "O". Also, codepen complain about an infinite loop. What I did wrong? I don't understand

Evan
@EvanDCP
Feb 06 2017 17:09
is there a console on table device? because I can't see it
tablet*
anybody there? guys how can I check this on mobile/tablet
007Oleg
@007Oleg
Feb 06 2017 17:13
Can I put image in background instead of img-tag?
Sabrina Ferguson
@itsacoyote
Feb 06 2017 17:13
@EvanDCP is it an android or iOS tablet?
Evan
@EvanDCP
Feb 06 2017 17:14
android
Sabrina Ferguson
@itsacoyote
Feb 06 2017 17:14
@EvanDCP google and search for debugging andorid mobile on Chrome. You can plugin your tablet to your PC and be able to remotely debug and control tabs on your tablet from Chrome on your desktop
Tyler Moeller
@TylerMoeller
Feb 06 2017 17:15
Codepen's console isn't available on mobile - JSON.stringify() the response to your page instead or try that page I posted above to see if any of the four location providers work for you
@EvanDCP `\$('body').append(JSON.stringify(loc));`
Evan
@EvanDCP
Feb 06 2017 17:17
this actually works I think??
some numbers have appeared!
Tyler Moeller
@TylerMoeller
Feb 06 2017 17:18
Maybe you aren't looking at the right console? :)
Evan
@EvanDCP
Feb 06 2017 17:18
yup those are coordinates! thanks guys!
lol I mean there's only one console isn't there
the numbers appeared on the actual page
Tyler Moeller
@TylerMoeller
Feb 06 2017 17:18
One for every tab
I mean, you have to press F12 again if you switch to another tab
Evan
@EvanDCP
Feb 06 2017 17:19
oh and only works on my tablet. On my pc I can't see any numbers
my pc is fucked up or something :/
Ctiller93
@Ctiller93
Feb 06 2017 17:19
So I'm working on the weather app right now, but the geolocation API I'm using is pretty inaccurate. Can anyone recommend a good geolocation API?
The one I'm currently using is this one: http://ip-api.com/
Tyler Moeller
@TylerMoeller
Feb 06 2017 17:20
@Ctiller93 They're all inaccurate if you use IP-based location. You can always try navigator.geolocation first and then fall back to a less accurate API if the user blocks location in their browser.
Ctiller93
@Ctiller93
Feb 06 2017 17:20
Ahhh. I gotcha.
Sweet. Thanks for the tip!
Tyler Moeller
@TylerMoeller
Feb 06 2017 17:22
navigator.geolocation.getCurrentPosition(success, fail)
function sucess(position) { // do something with location}
function fail() { // call an ip-based location API }
Ctiller93
@Ctiller93
Feb 06 2017 17:22
Reading up on it right now. Thanks a ton @TylerMoeller !
CamperBot
@camperbot
Feb 06 2017 17:22
:star2: 1462 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
ctiller93 sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
Tyler Moeller
@TylerMoeller
Feb 06 2017 17:23
You're welcome, good luck :+1:
Evan
@EvanDCP
Feb 06 2017 17:24
okay so those numbers don't work
they are supposed to be my coordinates, but when I write them down the link says {"cod":401, "message": "Invalid API key. Please see http://openweathermap.org/faq#error401 for more info."}
Gulsvi
@gulsvi
Feb 06 2017 17:27

@francodanussi I just used a basic approach for html - a link with two <p> tags in each result. It might be easier than a table:

```````<a class="article" target="_blank" href="\${data[3][i]}">
<p class="article-title">\${data[1][i]}</p>
<p class="article-extract">\${data[2][i]}</p>
</a>```````

You can style it a lot once you get the basic data displaying. http://codepen.io/skycoder/pen/GrGQdJ?editors=0010

Ctiller93
@Ctiller93
Feb 06 2017 17:28
@EvanDCP did you request an API key on openweather?
Tyler Moeller
@TylerMoeller
Feb 06 2017 17:29
Right ^^ Your pen doesn't seem to have an API call to openweather either
Evan
@EvanDCP
Feb 06 2017 17:29
right... man I'm stupid
Ctiller93
@Ctiller93
Feb 06 2017 17:29
Hey, happens man. I know how you feel. :P
kevharvell
@kevharvell
Feb 06 2017 17:33
Hi all, am working on my weather app and am having trouble centering my ".weather-block" on the page. When I add a width of 400px, it stops staying centered. Have looked online, but no solutions seem to work for me. Thanks for your help
http://codepen.io/kevharvell/pen/wgmJgB
Evan
@EvanDCP
Feb 06 2017 17:34
thanks man xD okay so my chrome doesn't see captchas either so I can't register on that website. I'm gonna install firefox to see if I can make it work there. I have such bad luck today I swear T_T
Gulsvi
@gulsvi
Feb 06 2017 17:34
@kevharvell you can use auto left/right margins to center it:
margin: 50px auto 25px auto;
width: 400px;
Franco Javier Danussi
@francodanussi
Feb 06 2017 17:35
@SkyCoder01 thanks, gonna try that
CamperBot
@camperbot
Feb 06 2017 17:35
francodanussi sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
kevharvell
@kevharvell
Feb 06 2017 17:35
@SkyCoder01 bless you, thanks!
CamperBot
@camperbot
Feb 06 2017 17:35
kevharvell sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
playingwithinfinity
@playingwithinfinity
Feb 06 2017 17:53
Can somebody help me with my Pomodoro clock? How do I convert seconds and display them as minutes and seconds.
https://codepen.io/jimpix/pen/mRpRdj
mburroughs2408
@mburroughs2408
Feb 06 2017 17:56
This message was deleted
gavdbreeden
@gavdbreeden
Feb 06 2017 17:58
wazzzzup babies
mburroughs2408
@mburroughs2408
Feb 06 2017 17:58
This message was deleted
gavdbreeden
@gavdbreeden
Feb 06 2017 17:59
ur gay @mburroughs2408
mburroughs2408
@mburroughs2408
Feb 06 2017 17:59
This message was deleted
gavdbreeden
@gavdbreeden
Feb 06 2017 17:59
no im not @mburroughs2408
mburroughs2408
@mburroughs2408
Feb 06 2017 17:59
This message was deleted
gavdbreeden
@gavdbreeden
Feb 06 2017 17:59
noo @mburroughs2408
i need help @mburroughs2408
mburroughs2408
@mburroughs2408
Feb 06 2017 18:00
This message was deleted
gavdbreeden
@gavdbreeden
Feb 06 2017 18:00
i need help for real @mburroughs2408
mburroughs2408
@mburroughs2408
Feb 06 2017 18:00
This message was deleted
gavdbreeden
@gavdbreeden
Feb 06 2017 18:00
anyone ther?
Master Builder
@McGowanC
Feb 06 2017 18:12
what the hell is going on in here
Abhishek Kumar
@Mr-Kumar-Abhishek
Feb 06 2017 18:13
dunno ~
Feb 06 2017 18:58
anyone here familiar with Bootstrap4?
Ctiller93
@Ctiller93
Feb 06 2017 18:59
Can anyone help me understand how the geolocation API and asking for user permission works?
For context, this is the example I'm using:
So from how I understand it so far, navigator.geolocation is a "per browser" sort of thing. If the user has it, it can run, if they don't, then you get the error message.
But when I click the button, I'm prompted if I want to allow for the site to access my location data, all fine so far.
I click "allow" and it gives me my coordinates.
But if I click "block", then nothing happens. Why is this? Shouldn't it immediately jump to the else statement, or does the information on whether the user gave permission or not appear elsewhere?
And if so, is there a way for me to access the information on whether the user gave permission or denied permission?
Ctiller93
@Ctiller93
Feb 06 2017 19:06
facepalm I'm dumb.
turns out there's a "PERMISSION DENIED" error code. Neat.
Abhishek Kumar
@Mr-Kumar-Abhishek
Feb 06 2017 19:08
@Ctiller93 lol... I was about to give a alternative solution, however I am curious how you did it ...
Ctiller93
@Ctiller93
Feb 06 2017 19:08
I'm mostly just reading up on it right now.
Abhishek Kumar
@Mr-Kumar-Abhishek
Feb 06 2017 19:09
Tyler Moeller
@TylerMoeller
Feb 06 2017 19:09
@Ctiller93 not dumb :) Just in case you're still working on it, this may help explain better:
``````navigator.geolocation.getCurrentPosition(success, fail)

function sucess(position) {
// This code runs if navigator.geolocation succeeds
}

function fail() {
// This code runs if navigator.geolocaion fails
}``````
Ctiller93
@Ctiller93
Feb 06 2017 19:09
Yeeeeeep @TylerMoeller Pretty much that. I'm messing around with it right now.
Jack
@kr0nk
Feb 06 2017 19:10
Hello, fellow Code Campers. I’m having a bit of trouble with the Personal Portoflio challenge. I found a bit of code to help me get a floating header, and it worked at first… but I began introducing lots of divs and now the text floats in front of the header, instead of behind it! Any suggestions very welcome… :-) https://codepen.io/kr0nk/pen/RKxNwb
:P
Tyler Moeller
@TylerMoeller
Feb 06 2017 19:12
@kr0nk Check out the navbar docs, I think that's what you're going for: http://getbootstrap.com/components/#navbar-default
Ctiller93
@Ctiller93
Feb 06 2017 19:12
That reminds me that I'll totally want to redo my portfolio page when I get the chance.
Jack
@kr0nk
Feb 06 2017 19:12
@TylerMoeller Thanks Tyler, that does indeed look like what I’m trying to do. I’ll give them a read.
CamperBot
@camperbot
Feb 06 2017 19:12
kr0nk sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1463 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Abhishek Kumar
@Mr-Kumar-Abhishek
Feb 06 2017 19:12
@Ctiller93 thanks
Tyler Moeller
@TylerMoeller
Feb 06 2017 19:12
@Ctiller93 and @Mr-Kumar-Abhishek This is where I learned about the success/failure options: https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/Using_geolocation#JavaScript_Content
Ctiller93
@Ctiller93
Feb 06 2017 19:13
There was a page I saw earlier that listed off all of the possible errors. I need to find that again.
Vasile Botnaru
@VasileBotnaru
Feb 06 2017 19:13
``````
function titleCase(str) {
str = str.toLowerCase();
var tempArray = str.split(" ");

for (var i = 0; i < tempArray.length; i++) {
tempArray[i] = tempArray[i].split("");
tempArray[i][0] = tempArray[i][0].toUpperCase();
tempArray[i] = tempArray[i].join("");
}

str = tempArray.join(" ");

return str;
}

titleCase("I'm a little tea pot");``````
Abhishek Kumar
@Mr-Kumar-Abhishek
Feb 06 2017 19:14
@Ctiller93 @TylerMoeller thanks a lot for the references , it will clarify few things for me :)
CamperBot
@camperbot
Feb 06 2017 19:14
:warning: could not find receiver for ctiller93
mr-kumar-abhishek sends brownie points to @ctiller93 and @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1464 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Ctiller93
@Ctiller93
Feb 06 2017 19:14
You and me both man. :P
Oh, there we go:
Under "handling errors and rejections"
There's no Id tag so I can't link to it directly. :x
Chiu Yong
@chiuyong
Feb 06 2017 19:24
Can somebody help me?
Evan
@EvanDCP
Feb 06 2017 19:39
hey guys is this working for you?
brightodu
@brightodu
Feb 06 2017 19:44
Evan
@EvanDCP
Feb 06 2017 19:47
anyone there? please guys just tell me if it's working for you or not
Karthik Nallasivan
@furball514
Feb 06 2017 19:50
http://codepen.io/furball/pen/egGPeZ?editors=0010hello can soomebody help me with timing events in my simon memory game
NamdyFit Dev
@NAMDY
Feb 06 2017 20:00
hello world
Richard
Feb 06 2017 20:04
Hiho. I am making a Tribute Page at the moment and kinda stuck. I want to change the font size of the text which contains wikipedia link,but i cant figure out whats wrong. Here's my codepen,if someone wanna take a look. :)
Chiu Yong
@chiuyong
Feb 06 2017 20:07
can someone help me????
Richard
Feb 06 2017 20:08
whats the question
Gulsvi
@gulsvi
Feb 06 2017 20:08
Chiu Yong
@chiuyong
Feb 06 2017 20:08
well
I'm in trouble with flip cards
Richard
Feb 06 2017 20:10
i guess im not there yet,so i skip the opportunity :worried:
Gulsvi
@gulsvi
Feb 06 2017 20:11
Or maybe I'm misunderstanding? I don't see any code to try and change the font size in your tribute page
Richard
Feb 06 2017 20:13
hmm,theres a class declaration,but mb i did wrong
Gulsvi
@gulsvi
Feb 06 2017 20:13
@EvanDCP It works for me if I change the getjson link to http://ipinfo.io/json
@szazadikablak Oh sorry, I thought you meant the actual link, not the text around it. Multiple classes are separated by spaces, don't put them all in their own quotes: <p class="text-center paragraph1">
Richard
Feb 06 2017 20:14
ahha,let me try it out :)
gotcha,you are the man! thanks
Gulsvi
@gulsvi
Feb 06 2017 20:15
:)
Richard
Feb 06 2017 20:16
uh and about fonts,its the same as size?i mean i declare a class then change fonts on the <style>?
i want to change the font of quotes
Evan
@EvanDCP
Feb 06 2017 20:17
@SkyCoder01 thanks!!
CamperBot
@camperbot
Feb 06 2017 20:17
evandcp sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
Richard
Feb 06 2017 20:18
btw forgot the brownie :D thanks @SkyCoder01
CamperBot
@camperbot
Feb 06 2017 20:18
szazadikablak sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
Gulsvi
@gulsvi
Feb 06 2017 20:19
@szazadikablak We learned how to do that here: https://www.freecodecamp.com/challenges/set-the-font-family-of-an-element
You can get fonts from fonts.google.com and they will give you the CSS code needed
Or you can use standard fonts instead: http://www.w3schools.com/css/css_font.asp
Richard
Feb 06 2017 20:21
if i use those fancy fonts,people can read the text with that font even if that type is not on their pc ?
as far as i remember,not
Gulsvi
@gulsvi
Feb 06 2017 20:25
@szazadikablak I don't know for sure, but you have fallbacks for that just in case. I think it depends on the browser not the PC
trapmonk
@trapmonk
Feb 06 2017 20:28
Hello All
Feb 06 2017 20:30
hi to all
Piotr
@Ressvieth
Feb 06 2017 20:32
hello everyone
ashishkarki
@ashishkarki
Feb 06 2017 20:34
Hello all, how do i bypass the cors issue with codepen when trying to access images from a different site
Andrew
@rexmorgan89
Feb 06 2017 20:35
anyone willing to help a guy attempt intermediate algorithm scripting...?
Feb 06 2017 20:40
Has anybody here experienced problems with the codepen interface? I finally wrote my Random Quote Machine. It seems to work OK, but I realized, that it works only in debug mode on codepen. When I try the full page mode, the script does not react. I also tried it on my desktop and it worked.
Dan
@MindWhys
Feb 06 2017 20:40
Hello, would anyone mind checking to see if my Weather App works. The background image seems to come and go intermittently...https://codepen.io/MindWhys/pen/RKJLeP
Ayush Kumar Singh
@Geomancer91
Feb 06 2017 20:41
@rexmorgan89 u can ask will try to help if i can
Andrew
@rexmorgan89
Feb 06 2017 20:42
Thanks @Geomancer91! I'm working on the pseudocode for the RomanNumeral challenge atm.
CamperBot
@camperbot
Feb 06 2017 20:42
rexmorgan89 sends brownie points to @geomancer91 :sparkles: :thumbsup: :sparkles:
Feb 06 2017 20:43
@MindWhys It says that I am in Prague, but I am in Ceske Budejovice (about 170 km to south), but it looks awesome
ashishkarki
@ashishkarki
Feb 06 2017 20:43
@MindWhys looks fine in my chrome canary.
Andrew
@rexmorgan89
Feb 06 2017 20:44
First thing I do is define the roman numeral array and an empty array to represent the roman numeral I wish to return.
Dan
@MindWhys
Feb 06 2017 20:45
@radekjohn @ashishkarki thanks for checking it guys...I have no idea why the geolocator is so far out though
CamperBot
@camperbot
Feb 06 2017 20:45
mindwhys sends brownie points to @radekjohn and @ashishkarki :sparkles: :thumbsup: :sparkles:
Andrew
@rexmorgan89
Feb 06 2017 20:45
'''
var romArr = [];
var romNum = ['M','D','C','L','X','V','I'];
'''
CamperBot
@camperbot
Feb 06 2017 20:45
Feb 06 2017 20:46
@MindWhys I don`t thing it`s important
Andrew
@rexmorgan89
Feb 06 2017 20:46
``````var romArr = [];
var romNum = ['M','D','C','L','X','V','I'];``````
Tyler Moeller
@TylerMoeller
Feb 06 2017 20:47
@ashishkarki You can make a CORS enabled image by setting img.crossOrigin = 'anonymous'
``````var img = new Image();
img.crossOrigin = 'anonymous';
img.src = 'https://path to your image';``````
Justyna
@ignatkaj
Feb 06 2017 20:47
Hi, I'm working on my portfolio project. Could you please help me with the white space between two divs: http://codepen.io/ignatkaj/pen/vgZxqz
Dan
@MindWhys
Feb 06 2017 20:48
@radekjohn I think the place name comes out as a timezone so Prague might just be the closest timezone t has programmed to spit out for your location. Not perfect
Feb 06 2017 20:48
@MindWhys true. You are from the US?
Tyler Moeller
@TylerMoeller
Feb 06 2017 20:49
Andrew
@rexmorgan89
Feb 06 2017 20:49
@Geomancer91 , I'm thinking it would be better to convert the number to a string break the string into an array...?
Dan
@MindWhys
Feb 06 2017 20:49
Feb 06 2017 20:50
Andrew
@rexmorgan89
Feb 06 2017 20:50
Feb 06 2017 20:51
@MindWhys I thoughtt you are american becouse of the fahrenheit degrees ...
Ayush Kumar Singh
@Geomancer91
Feb 06 2017 20:52
@rexmorgan89 yeah convert to string and split the string and use loop
Tyler Moeller
@TylerMoeller
Feb 06 2017 20:53
@radekjohn Add jquery in your codepen settings, not at the top of the html panel of codepen
Andrew
@rexmorgan89
Feb 06 2017 20:53
@Geomancer91 thanks bud. I think I'll continue to tackle it solo and get back to you if I'm still havin' difficulties.
CamperBot
@camperbot
Feb 06 2017 20:53
:warning: rexmorgan89 already gave geomancer91 points
rexmorgan89 sends brownie points to @geomancer91 :sparkles: :thumbsup: :sparkles:
Dan
@MindWhys
Feb 06 2017 20:53
@radekjohn following you :) The API defaults to Fahrenheit...if you click the button it converts to Celcius.
Justyna
@ignatkaj
Feb 06 2017 20:54
@rexmorgan89 no, the white space between jumbotron and supporting div
Feb 06 2017 20:54
@TylerMoeller i had it that way and it did not worked. But I try it agin
Tyler Moeller
@TylerMoeller
Feb 06 2017 20:55
@radekjohn Also make sure you load your codepen over http `http://codepen.io/radekjohn/pen/xgzwvR`
You can't call an API via HTTP when your web page is loaded via HTTPS
@nogoss
Feb 06 2017 20:57
hello world!! i am new here and i am very glad to be chatting with you all!
Dan
@MindWhys
Feb 06 2017 20:57
@nogoss Hello :)
Feb 06 2017 20:57
@TylerMoeller how to do it? i am pretty new to this stuff
Ayush Kumar Singh
@Geomancer91
Feb 06 2017 20:58
@rexmorgan89 gr8, u can use this link on stackoverflow if u get stuck it can guide u http://stackoverflow.com/questions/9083037/convert-a-number-into-a-roman-numeral-in-javascript
Andrew
@rexmorgan89
Feb 06 2017 20:58
@ignatkaj it's because you're using the jumbotron class which comes w/ its own set of default padding settings
Tyler Moeller
@TylerMoeller
Feb 06 2017 20:58
@radekjohn See how it starts with `http://` instead of `https://`?
Andrew
@rexmorgan89
Feb 06 2017 20:59
I would suggest changing your jumbotron class in css to a unique id like #about and assigning that id to your about section.
Feb 06 2017 20:59
@TylerMoeller OK, I understand. Thats it. Thank you very much!
CamperBot
@camperbot
Feb 06 2017 20:59
radekjohn sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1465 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Andrew
@rexmorgan89
Feb 06 2017 21:00
@ignatkaj see my comment above... For example instead of saying
```
Feb 06 2017 21:00
@MindWhys following back. you are ahead of me. see you around
Andrew
@rexmorgan89
Feb 06 2017 21:02

@ignatkaj instead of using this class with that div

``````.jumbotron {
background-size: cover;
}``````

``````#about {
background-size: cover;
}``````
@ignatkaj Then adjust your padding down a bit to make it look closer to what you had before. Hope that helps @ignatkaj .
Dan
@MindWhys
Feb 06 2017 21:04
@radekjohn see ya, good luck :)
Feb 06 2017 21:04
Good night to everybody
Justyna
@ignatkaj
Feb 06 2017 21:07
@rexmorgan89 Thank you! I'll check that
CamperBot
@camperbot
Feb 06 2017 21:07
ignatkaj sends brownie points to @rexmorgan89 :sparkles: :thumbsup: :sparkles:
@nogoss
Feb 06 2017 21:10
@MindWhys nice meeting you dear sir :D
Ayush Kumar Singh
@Geomancer91
Feb 06 2017 21:16
http://codepen.io/Geomancer91/pen/ygEQBj/ can any1 check it if it works fine?
Evan
@EvanDCP
Feb 06 2017 21:18
guys can you please tell me if this is working for you? can you see the temperature, description, icons, does the C/F button work well?
Tom
@moT01
Feb 06 2017 21:19
@Geomancer91 @EvanDCP yea, theyre both working
Justyna
@ignatkaj
Feb 06 2017 21:20
@EvanDCP yes, everything works fine
kevharvell
@kevharvell
Feb 06 2017 21:21
Hi all, just finished weather app, Can you tell me if it's working well and displaying the correct weather? Thanks friends
http://codepen.io/kevharvell/full/wgmJgB/
Evan
@EvanDCP
Feb 06 2017 21:21
awesome! thanks @moT01 @ignatkaj ! Would you think this is a finished project? can I send it yet or does it need improvements?
CamperBot
@camperbot
Feb 06 2017 21:21
evandcp sends brownie points to @mot01 and @ignatkaj :sparkles: :thumbsup: :sparkles:
Ayush Kumar Singh
@Geomancer91
Feb 06 2017 21:21
@EvanDCP yeah it works .. but it shows an extra row like 14 C / 14 C for temp.. is it intended?
Evan
@EvanDCP
Feb 06 2017 21:22
whoa really? no, it's not intended, it should show the temperature in C and F (only once)
Tom
@moT01
Feb 06 2017 21:23
that's not intended? as a high and low temp
Evan
@EvanDCP
Feb 06 2017 21:23
oh! I thought he meant the main temperature
Tom
@moT01
Feb 06 2017 21:23
it does meet the the requirement i believe that the project asks for, ...looks pretty close to what mine looks like
Justyna
@ignatkaj
Feb 06 2017 21:24
@Geomancer91 it works fine. C/F button works but in fact I cannot see that is it a button, unless I click on it
Evan
@EvanDCP
Feb 06 2017 21:24
if it's high - low then yeah it's intended, although it's weird that it shows the same temperature for both high and low xD where does he live?
Tom
@moT01
Feb 06 2017 21:24
somewhere the temp won't change at all today
Evan
@EvanDCP
Feb 06 2017 21:24
@ignatkaj does it not appear blue (like a link)?
Ayush Kumar Singh
@Geomancer91
Feb 06 2017 21:25
@EvanDCP yeah ... i got tricked by that :) .. sry ..live in bangalore india btw :0
Evan
@EvanDCP
Feb 06 2017 21:25
whoa haha no problem! so weird xD here the temperature changes a lot during the day
(spain)
Gulsvi
@gulsvi
Feb 06 2017 21:27
@EvanDCP did you write all that code by yourself? Exactly the same as several other weather apps
gaberham
@gaberham
Feb 06 2017 21:27
how would I center the image within my jumbotron? http://codepen.io/gaberham/pen/dNjvmZ
kevharvell
@kevharvell
Feb 06 2017 21:27
Hi all, just finished weather app, Can you tell me if it's working well and displaying the correct weather? Thanks friends
http://codepen.io/kevharvell/full/wgmJgB/
Evan
@EvanDCP
Feb 06 2017 21:27
no @SkyCoder01 I followed a tutorial xD
Ayush Kumar Singh
@Geomancer91
Feb 06 2017 21:28
@ignatkaj i tried changing the color of C/F and put a diff. color underline as ..it was in demo.. can make it button though .. thanks for pointing out
CamperBot
@camperbot
Feb 06 2017 21:28
geomancer91 sends brownie points to @ignatkaj :sparkles: :thumbsup: :sparkles:
Gulsvi
@gulsvi
Feb 06 2017 21:28
Ahhh, lol
Evan
@EvanDCP
Feb 06 2017 21:28
it would take me ages to finish it by myself lol
Tom
@moT01
Feb 06 2017 21:29
@kevharvell looks like its working to me
kevharvell
@kevharvell
Feb 06 2017 21:29
@EvanDCP kind of defeats the purpose imo, i learn a lot more than what I am looking for by searching for the answer
Gulsvi
@gulsvi
Feb 06 2017 21:31
@kevharvell This doesn't work for canada, can't enter a postal code
Evan
@EvanDCP
Feb 06 2017 21:31
@kevharvell yeah you sure learn more but after like 2 weeks of work.. i think I'll learn more doing projects / coding every day even if I do it thanks to tutorials :P
CamperBot
@camperbot
Feb 06 2017 21:31
evandcp sends brownie points to @kevharvell :sparkles: :thumbsup: :sparkles:
kevharvell
@kevharvell
Feb 06 2017 21:33
@SkyCoder01 argh canada... I guess I'll just be US only, Trump would approve
Ayush Kumar Singh
@Geomancer91
Feb 06 2017 21:33
@kevharvell yeah works but my country postal code not working.. you can take automatic location
kevharvell
@kevharvell
Feb 06 2017 21:34
@Geomancer91 @SkyCoder01 my geolocation wasn't working on my browser, so I had to switch gears. Thanks for the feedback
CamperBot
@camperbot
Feb 06 2017 21:34
kevharvell sends brownie points to @geomancer91 and @skycoder01 :sparkles: :thumbsup: :sparkles:
Gulsvi
@gulsvi
Feb 06 2017 21:35
Karthik Nallasivan
@furball514
Feb 06 2017 21:38
@furball514
hey guys i need help
i need to have a time interval between each codeblock of the case.
```function game () { for (var i =0;i<compArr.length;i++){ console.log('iterate:'+compArr[i]); switch (compArr[i]) { case 1: one(); break; case 2: two(); break; case 3: three(); break; case 4: four(); break; } }}``` in this function how do i set delays between each case code to be executed for eg.one();
help somebody
Joffrey Nolting
@Yovvel
Feb 06 2017 21:43
@furball514 have you tried it with `setTimeout()` function?
Ayush Kumar Singh
@Geomancer91
Feb 06 2017 21:45
@furball514 :- setTimeout(function firstLineOfCode(){ //waits 100 milliseconds
write('abc');
},100) //u can try this
Karthik Nallasivan
@furball514
Feb 06 2017 21:49
@Geomancer91 yes i have
Tried that
Joffrey Nolting
@Yovvel
Feb 06 2017 21:50
@furball514 try this:
``````case 1:
setTimeout(1000);
one();``````
Karthik Nallasivan
@furball514
Feb 06 2017 21:50
@Yovvel I have tried it
Joffrey Nolting
@Yovvel
Feb 06 2017 21:50
1000= 1000 ms = 1 second
should be working
Karthik Nallasivan
@furball514
Feb 06 2017 21:50
@Yovvel You see the elements of the array im itersting through kepp changing
And my code block is for animating
settimeout isnt wotking perfectly
Perhaps is there a way to set delays betwen the for lopp itersting through the array?
Joffrey Nolting
@Yovvel
Feb 06 2017 21:51
let me think
Karthik Nallasivan
@furball514
Feb 06 2017 21:51
This is for the simon game btw
Anish3992
@Anish3992
Feb 06 2017 21:52
Hi everyone, just started my first project where i'm building the tribute page but i can't seem to get the image to work. Im copying the link but it/ only shows the alternate text. Can anyone help with this
Karthik Nallasivan
@furball514
Feb 06 2017 21:52
Gtg if u find the solution could u direct message me thanks in advance and ill thabk here as weel for the brownie points
@Yovvel
@Geomancer91
Joffrey Nolting
@Yovvel
Feb 06 2017 21:53
sure, but not staying online for long
normaliz3
@normaliz3
Feb 06 2017 21:54
hi guys i have a little problem here :) i am making the portfolia page. and im trying to add a collapse to the navbar for bether use on tablet and mobile, but it wont work..
Ayush Kumar Singh
@Geomancer91
Feb 06 2017 21:55
@Anish3992 can u put link of ur codepen
normaliz3
@normaliz3
Feb 06 2017 21:55
ah not me xD
Anish3992
@Anish3992
Feb 06 2017 21:57
Ayush Kumar Singh
@Geomancer91
Feb 06 2017 21:59
@Anish3992 write src=link ... u forgot =
Anish3992
@Anish3992
Feb 06 2017 21:59
@Geomancer91 Knew it was gonna be something so simple. Thanks for that
CamperBot
@camperbot
Feb 06 2017 21:59
anish3992 sends brownie points to @geomancer91 :sparkles: :thumbsup: :sparkles:
Ayush Kumar Singh
@Geomancer91
Feb 06 2017 22:00
@Anish3992 haha welcome.. it happens all the time with me :)
@mrpuer
Feb 06 2017 22:25
@TylerMoeller thank you, @khaduch thank you.
CamperBot
@camperbot
Feb 06 2017 22:25
mrpuer sends brownie points to @tylermoeller and @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1466 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Tyler Moeller
@TylerMoeller
Feb 06 2017 22:27
https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js
And then fix your button code to use `data-toggle="collapse"` instead of `data-toggle="navbar-collapse"`
@mcube25
Feb 06 2017 23:07
please i need my js code to be checked if im correct
var plus=['+'];
var minus= ['-'];
var divide=['/'];
var multiply=[''];
\$('input').on('click',function(){
});
\$('#op').on('click',function getNumber(numberA,numberB){
if (numberA + numberB==plus){
return numberA + numberB;
}else{
if (numberA - numberB==minus){
return numberA -numberB;
}else{
if (numberA
numberB==multiply){
return numberA *numberB;
}else{
numberA/numberB==divide;
}
}
}
});