get help in general - we have more specialized help rooms here: https://gitter.im/FreeCodeCamp/home
.nav-pills .nav-item.show .nav-link, .nav-pills .nav-link.active {
color: #fff;
cursor: default;
background-color: #0275d8;
}
$('#search-user').on('submit', function(e){
e.preventDefault();
var user = $('#search-user').val();
console.log(user);
})
burinson sends brownie points to @cmccormack :sparkles: :thumbsup: :sparkles:
:star2: 1067 | @cmccormack |http://www.freecodecamp.com/cmccormack
louisheimel sends brownie points to @cmccormack :sparkles: :thumbsup: :sparkles:
:star2: 1068 | @cmccormack |http://www.freecodecamp.com/cmccormack
louisheimel sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1379 | @thekholm80 |http://www.freecodecamp.com/thekholm80
louisheimel sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:warning: louisheimel already gave thekholm80 points
class="fa fa-free-code-camp"
can someone helpme with this ?
When you are finished, click the "I've completed this challenge" button and include a link to your CodePen.
pleasee!!
parseInt("1/2") // 1
1/2
isn't an integer
1/2
is one divided by two, so 2 integers and an operator
@EgnaroDev i'm supposto make some king of bio website on code pen and i made it . the only the i'm strungle is with this last instruction that said "
When you are finished, click the "I've completed this challenge" button and include a link to your CodePen."
that means that the website have to be online?
with a link that i have to send them so they can see the website online?
codepen.io/pen/mywebsite
1/2
isn't a number, so you can't convert it to a number
egnarodev sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 3537 | @moigithub |http://www.freecodecamp.com/moigithub
ossitooh sends brownie points to @egnarodev :sparkles: :thumbsup: :sparkles:
:cookie: 522 | @egnarodev |http://www.freecodecamp.com/egnarodev
function caseInSwitch(val) {
var answer = "";
// Only change code below this line
switch(val){
case 1:
console.log("alpha");
break;
case 2:
console.log("beta");
break;
case 3:
console.log("gamma");
break;
case 4:
console.log("delta");
break;
}
// Only change code above this line
return answer;
}
// Change this value to test
caseInSwitch(1);
case 1:
console.log("alpha");
break;
case 1:
answer = "alpha";
break;
boobsled sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1380 | @thekholm80 |http://www.freecodecamp.com/thekholm80
:cookie: 320 | @reactorboy |http://www.freecodecamp.com/reactorboy
thekholm80 sends brownie points to @reactorboy :sparkles: :thumbsup: :sparkles:
return undefined;
""
is an empty string
typeof "" // => 'string'
typeof undefined // => 'undefined'
function abTest(a, b) {
// Only change code below this line
switch(a,b){
case(b<0):
case(a<0):
return undefined;
}
// Only change code above this line
return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));
}
// Change values below to test your code
abTest(2,2);
switch
is best there?
if (a < 0 || b < 0) return undefined
boobsled sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1382 | @thekholm80 |http://www.freecodecamp.com/thekholm80
about me h2
has a top:20px
to it. You can set it to 0
to have it align with the img div
entrys = ["0"]
so it acts like a real calculator and that will fix the AC action.
if(this.getAttribute("action") === "AC"){
entrys = ["0"]
updateScreen();
}
//checks if the value clicked is ce if it is then will remove by every click the last value inserted in the array returns nothing when array is equal to empty
else if(this.getAttribute("action") === "CE"){
if(entrys.length > 1){
entrys.pop();
updateScreen();
}else{
entrys = ["0"]
updateScreen();
}
}
$.get(url, function(data){
console.log(data);
});
$.getJSON( url, function())
1E+14
timjavins sends brownie points to @tiagocorreiaalmeida :sparkles: :thumbsup: :sparkles:
:cookie: 304 | @tiagocorreiaalmeida |http://www.freecodecamp.com/tiagocorreiaalmeida
tiagocorreiaalmeida sends brownie points to @timjavins :sparkles: :thumbsup: :sparkles:
:cookie: 118 | @timjavins |http://www.freecodecamp.com/timjavins
timjavins sends brownie points to @tiagocorreiaalmeida :sparkles: :thumbsup: :sparkles:
:warning: timjavins already gave tiagocorreiaalmeida points
function findLongestWord(str) {
var array=str.split(" ");
var temp;
for(var i=0;i<str.length;i++){
for(var j=0;j<array[i].length;j++){
if(array[j+1].length>array[i].length){
temp=array[i].length;
array[i]=array[j+1].length;
array[j+1]=temp;
}
}
}
return array;
}
findLongestWord("the brown fox jumped over the lazy dog");
a:visited {
color: blue;
}
a, a:visited{
color:blue;
}
>
or <
instead of -
.sort
function findLongestWord(str) {
var array=str.split(" ");
array.sort((a,b) => b.length - a.length);
return array;
}
return array[0]
in the sort callback, you mention how to sort - in this case, you're checking length of two strings, and putting the larger one first
the brown
=>
is just a shorthand for function()...
array.sort((a,b) => b.length - a.length);
array.sort(function(a,b) {
return b.length - a.length
});
function findLongestWord(str) {
var array=str.split(" ");
var temp;
for(var i=0;i<str.length;i++){
for(var j=0;j<array[i].length;j++){
if(array[j+1].length>array[i].length){
temp=array[i].length;
array[i]=array[j+1].length;
array[j+1]=temp;
}
}
}
return array;
}
findLongestWord("the brown fox jumped over the lazy dog");
array[i]=array[j+1].length;
if(array[j+1].length>array[i].length){
array[i]
, the array[j+1]
becomes undefined
array[j+1].length
, you're doing undefined.length
@Adishjain58 also please take a moment and review your logic.
with this:
for(var i=0;i<str.length;i++)
You are asking the program to iterate for the lenght of the string.
But exactly why?
Considering this example where string = 'test
Well, it's obvious that the longest word here is just test,
But still you are iterating 4
times thanks to the previous loop, even tho your string is just composed of 1 word.
marmiz sends brownie points to @adishjain58 :sparkles: :thumbsup: :sparkles:
:cookie: 243 | @adishjain58 |http://www.freecodecamp.com/adishjain58
function findLongestWord(str) {
str = str.split(' ');
var longest = 0;
for(var i=0; i<str.length;i++){
// check if str[i].length is greater than longest. If so, make longest to be str[i].length else don't do anything
}
return longest;
}
adishjain58 sends brownie points to @adiskywalker and @manish-giri and @marmiz :sparkles: :thumbsup: :sparkles:
:cookie: 248 | @adiskywalker |http://www.freecodecamp.com/adiskywalker
:star2: 1007 | @marmiz |http://www.freecodecamp.com/marmiz
:star2: 6328 | @manish-giri |http://www.freecodecamp.com/manish-giri
function findLongestWord(str) {
str=str.split(" ");
var longest=0;
for(var i=0;i<str.length;i++){
if(str[i].length>longest){
longest=str[i].length;
}
}
return longest;
}
findLongestWord("the brown fox jumped over the lazy dog");
function findLongestWord(str) {
return str.split(' ')
.reduce( (longest, current) => current.length > longest.length ? current : longest)
.length;
}
function findLongestWord(str) {
return str.split(' ')
.reduce( (longest, current) => current.length > longest ? current.length : longest, 0);
}
image-rendering
could help, but you can't make image bigger then it's resolution without loosing quality
typescript
is the answer
thekholm80 sends brownie points to @vittoriovt :sparkles: :thumbsup: :sparkles:
:cookie: 805 | @vittoriovt |http://www.freecodecamp.com/vittoriovt
<input type='text' name='plea' id='plea'>
<div id='dyn'></div>
$('#plea').change(function(){
$('#dyn').text($(this).val());
})
$('#plea').keyup(function(){
$('#dyn').text($(this).val());
})
$.getJSON(url, function(data){
console.log('hello');
});
url
?
&callback=?
at the end of the url
?callback=?
ay2306 sends brownie points to @adiskywalker :sparkles: :thumbsup: :sparkles:
:cookie: 250 | @adiskywalker |http://www.freecodecamp.com/adiskywalker
<center>Gender: <label class='radio-inline gender_radio'><input type='radio' name='gender'>Male</label>
<label class='radio-inline gender_radio'><input type='radio' name='gender'>Female</label></center>
Hi to you all.Please assist me i need to solve this. Using bracket notation select an element from myArray such that myData is equal to 8. // Setup
var myArray = [[1,2,3], [4,5,6], [7,8,9], [[10,11,12], 13, 14]];
// Only change code below this line.
var myData = myArray[0][0];
@cykins4good
myArray[0]=[1,2,3]
->myArray[0][0]=1;
->myArray[0][1]=2;
->myArray[0][2]=3;
So if you want to select the value 8 then change the index position accordingly.
njanne19 sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1383 | @thekholm80 |http://www.freecodecamp.com/thekholm80
thekholm80 sends brownie points to @charlesfreeborn and @dhcodes :sparkles: :thumbsup: :sparkles:
:warning: @charlesfreeborn's account is not linked with freeCodeCamp. Please visit the settings and link your GitHub account.
:star2: 1808 | @dhcodes |http://www.freecodecamp.com/dhcodes
cyberfistor sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1384 | @thekholm80 |http://www.freecodecamp.com/thekholm80
myData[2][1]
myArray
is an array, and it contains several arrays (sub-arrays) within it. Accessing it with myArray[0]
gives you access to the first sub-array which is [1,2,3]
. myArray[1]
would give you access to [4,5,6]
. To get to the second level values, you add another array index that refers to the element within the sub-array - so to get the value 3
which is the third element in the first sub-array, you would use myArray[0][2]
- as @eweiss17 pointed out, 0-based index, as you probably already know from just the simple single-dimension array.
var myArray = [[1,2,3], [4,5,6], [7,8,9]];
myArray[0]
is [1,2,3]
myArray[0][0]
is 1
myArray[0][1]
is 2
myArray[0][2]
is 3
myArray[1]
is [4,5,6]
myArray[1][0]
is 4
myArray[1][1]
is 5
myArray[1][2]
is 6
myArray[2]
is [7,8,9]
myArray[2][0]
is 7
myArray[2][2]
is 9
cykins4good sends brownie points to @khaduch and @eweiss17 and @adiskywalker and @revisualize :sparkles: :thumbsup: :sparkles:
:cookie: 254 | @adiskywalker |http://www.freecodecamp.com/adiskywalker
:cookie: 570 | @eweiss17 |http://www.freecodecamp.com/eweiss17
:star2: 3146 | @khaduch |http://www.freecodecamp.com/khaduch
:star2: 4387 | @revisualize |http://www.freecodecamp.com/revisualize
andreibratu26 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8182 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
sonimadhuri sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8183 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Anybody have a better method that works? I'm trying to get the image to display in its entirety and I want the text block to be overlayed exactly as it is. So it looks great right now, except for the fact it isn't centered on the screen. All of my attempts to center it aren't working, probably because it's inside a module, but the module is what got the image and text to behave.
<table>
<div module>
</div>
</table>
daddycardona sends brownie points to @timjavins and @darrenfj :sparkles: :thumbsup: :sparkles:
:cookie: 119 | @timjavins |http://www.freecodecamp.com/timjavins
:star2: 1935 | @darrenfj |http://www.freecodecamp.com/darrenfj
timjavins sends brownie points to @daddycardona :sparkles: :thumbsup: :sparkles:
:cookie: 288 | @daddycardona |http://www.freecodecamp.com/daddycardona
darrenfj sends brownie points to @timjavins :sparkles: :thumbsup: :sparkles:
:cookie: 120 | @timjavins |http://www.freecodecamp.com/timjavins
darrenfj sends brownie points to @daddycardona :sparkles: :thumbsup: :sparkles:
:cookie: 289 | @daddycardona |http://www.freecodecamp.com/daddycardona
timjavins sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 1936 | @darrenfj |http://www.freecodecamp.com/darrenfj
darrenfj sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 4388 | @revisualize |http://www.freecodecamp.com/revisualize
function writeLocalStorage(){
window.localStorage.setItem('recipes', JSON.stringify(recipes))
}
abdel974 sends brownie points to @cmccormack :sparkles: :thumbsup: :sparkles:
:star2: 1071 | @cmccormack |http://www.freecodecamp.com/cmccormack
if (window.localStorage.hasOwnProperty('recipes')) {
recipes = JSON.parse(window.localStorage.recipes)
}
andreibratu26 sends brownie points to @timjavins :sparkles: :thumbsup: :sparkles:
:cookie: 121 | @timjavins |http://www.freecodecamp.com/timjavins
import boto3
s3 = boto3.resource('s3')
bucket = s3.Bucket(name='mytestbucket')
allobjects = bucket.objects.filter()
a=[]
for obj in allobjects:
a.append(obj.last_modified)
a.sort()
b = a[-1]
for obj in allobjects:
if obj.last_modified == b:
c = obj.key
s3.Bucket('mytestbucket22').download_file(c, 'c:\latest.csv')
andreibratu26 sends brownie points to @timjavins :sparkles: :thumbsup: :sparkles:
:warning: andreibratu26 already gave timjavins points
import boto3
s3 = boto3.resource('s3')
bucket = s3.Bucket(name='mytestbucket')
allobjects = bucket.objects.filter()
a=[]
for obj in allobjects:
a.append(obj.last_modified)
a.sort()
b = a[-1]
for obj in allobjects:
if obj.last_modified == b:
c = obj.key
s3.Bucket('mytestbucket22').download_file(c, 'c:\latest.csv')
rajp1847 sends brownie points to @timjavins :sparkles: :thumbsup: :sparkles:
:cookie: 122 | @timjavins |http://www.freecodecamp.com/timjavins
<audio controls style="width: 100%" id="player">
<source id="player" src="http://www.sousound.com/music/healing/healing_01.mp3" type="audio/mpeg">
</audio>
.hide();
work?? i cant hide class card on my js. heres the codepen. https://codepen.io/artoo/pen/YxPOWP
timjavins sends brownie points to @daddycardona :sparkles: :thumbsup: :sparkles:
:cookie: 290 | @daddycardona |http://www.freecodecamp.com/daddycardona
timjavins sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1385 | @thekholm80 |http://www.freecodecamp.com/thekholm80
/me
I want to make a string based on the list values. If list has '1G', I want to append "" in string. If list has '100G', I want to append "new" in string.
For example, 1.py:
c = ''
a = ['1G', '100G']
for i in a:
if i == "1G":
b = ""
else:
b = "new" + ' '
c = c + b
print c
print type(c)
new
<type 'str'>
'"" new'
diomed sends brownie points to @timjavins :sparkles: :thumbsup: :sparkles:
:cookie: 123 | @timjavins |http://www.freecodecamp.com/timjavins
abdel974 sends brownie points to @pethaf and @alexanderkopke :sparkles: :thumbsup: :sparkles:
:cookie: 376 | @pethaf |http://www.freecodecamp.com/pethaf
:star2: 1628 | @alexanderkopke |http://www.freecodecamp.com/alexanderkopke
abdel974 sends brownie points to @pethaf :sparkles: :thumbsup: :sparkles:
:warning: abdel974 already gave pethaf points
https://maps.googleapis.com/maps/api/geocode/json?latlng="+lat+","+long
function stat(users){
$.getJSON('https://wind-bow.glitch.me/twitch-api/streams/' + users, function(jsonData){
//console.log(jsonData.stream);
if(jsonData.stream === null){
console.log('offline');
$('.card-deck > div').addClass('offline');
}else{
console.log('online');
$('.card-deck > div').addClass('online');
}
})
};
function getLocation() {
var city = "",
country = "";
$.getJSON('https://maps.googleapis.com/maps/api/geocode/json?latlng='+lat+','+long, function(data) {
console.log(data);
city=data.city;
country=data.country;
$("#location").html(city+", "+country);
});
function stat(users){
$.getJSON('https://wind-bow.glitch.me/twitch-api/streams/' + users, function(jsonData){
//console.log(jsonData.stream);
if(jsonData.stream === null){
console.log('offline');
$('.card-deck > div').addClass('offline');
}else if(jsonData.stream !== null){
console.log('online');
$('.card-deck > div').addClass('online');
}
})
};
ericmiller777 sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2259 | @skyc0der |http://www.freecodecamp.com/skyc0der
I was thinking you should check whether or not they're offline or online and add the class to the HTML as you create it
online
or offline
to the user
abdel974 sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2260 | @skyc0der |http://www.freecodecamp.com/skyc0der
dod\
a
jkk
function location(a) {
navigator.geolocation.getCurrentPosition(function (b) {
var latitude = position.coords.latitude;
var longitude = position.coords.latitude;
})
}
$.getJSON("https://fcc-weather-api.glitch.me/api/current?lat=" + latitude + "&lon=" + longitude, function (a) { $(".weather").append(a.main.temp + " " + a.main.pressure) });
location
is a reserved word, you'll need to use a different function name.
ericmiller777 sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:warning: ericmiller777 already gave skyc0der points
ace1122sp sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles:
:star2: 1629 | @alexanderkopke |http://www.freecodecamp.com/alexanderkopke
<div class="row">
<div class="col-xs-8">
<h2 class="text-primary text-center">CatPhotoApp</h2>
</div>
<div class="col-xs-4">
<a href="#"><img class="img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back. "></a>
</div>
</div>
s
vs row
```
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8" />
<link rel="stylesheet" href="styles/index.processed.css">
</head>
<title>My Tribute Page</title>
<head>
<body>
<div class="container">
<div class="jumbotron">
<div class="row">
<div class="col-xs-12">
<h1 class="text-center">Gladys Aylward</h1>
<h2 class="text-center"> <em> Her Life and Purpose</em></h2>
</div>
</div>
</div>
</div>
<ul>
<li>born: <strong> 1902</strong> Edmonton, London</li>
<li>died: <strong> 1970</strong> Taipei, Taiwan</li>
</ul>