get help in general - we have more specialized help rooms here: https://gitter.im/FreeCodeCamp/home
hi guys , quick C question
I have
void getNumbers(struct Numbers *);
in my .h file
and in my .c file
I have
void getNumbers(struct Numbers *){
some codes here
}
but it gives me an error, unnamed prototype parameters not allowed when body is present. expect a formal parameter list, not a type list
anyone know what's wrong
manish-giri sends brownie points to @heroiczero and @darrenfj and @thekholm80 and @github-henry :sparkles: :thumbsup: :sparkles:
:star2: 1528 | @thekholm80 |http://www.freecodecamp.com/thekholm80
:star2: 2166 | @darrenfj |http://www.freecodecamp.com/darrenfj
:cookie: 408 | @github-henry |http://www.freecodecamp.com/github-henry
:star2: 1926 | @heroiczero |http://www.freecodecamp.com/heroiczero
thekholm80 sends brownie points to @manish-giri and @heroiczero and @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 1927 | @heroiczero |http://www.freecodecamp.com/heroiczero
:star2: 2167 | @darrenfj |http://www.freecodecamp.com/darrenfj
:star2: 6675 | @manish-giri |http://www.freecodecamp.com/manish-giri
field names may not start with $
?
db.movies.aggregate([
{
$project: {
titleLengths: {$split: ["title", " "]}
}
},
{
$match : { titleLengths : { $size: 1 } }
}
]).itcount()
Using the Aggregation Framework, find a count of the number of movies that have a title composed of one word. To clarify, "Cinderella" and "3-25" should count, where as "Cast Away" would not.
titleLengths: {$split: ["title", " "]}
should have been titleLengths: {$split: ["$title", " "]}
heroiczero sends brownie points to @manish-giri and @thekholm80 and @sjames1958gm and @khaduch and @darrenfj and @github-henry and @alpox and @korzo :sparkles: :thumbsup: :sparkles:
:star2: 3397 | @khaduch |http://www.freecodecamp.com/khaduch
:star2: 8598 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
:star2: 1529 | @thekholm80 |http://www.freecodecamp.com/thekholm80
:cookie: 655 | @korzo |http://www.freecodecamp.com/korzo
:cookie: 409 | @github-henry |http://www.freecodecamp.com/github-henry
:star2: 6676 | @manish-giri |http://www.freecodecamp.com/manish-giri
:star2: 1378 | @alpox |http://www.freecodecamp.com/alpox
:star2: 2168 | @darrenfj |http://www.freecodecamp.com/darrenfj
khaduch sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
darrenfj sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 1929 | @heroiczero |http://www.freecodecamp.com/heroiczero
darrenfj sends brownie points to @manish-giri and @thekholm80 and @sjames1958gm and @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1530 | @thekholm80 |http://www.freecodecamp.com/thekholm80
:star2: 3398 | @khaduch |http://www.freecodecamp.com/khaduch
:star2: 6677 | @manish-giri |http://www.freecodecamp.com/manish-giri
:star2: 8599 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
there's an array arr = [20, 21, 22, 24];
for (var i = 0; i < arr.length; i++) {
if (arr[i]+1 != arr[i+1]) {
return arr[i]+1
}
}
is it correct way to find missed number in array?
var arr = [20,21,22,24]
var newar = [];
var missed;
for (var i = 0; i < arr.length; i++) {
newar.push(arr[i].charCodeAt());
if (newar[i] - newar[i-1] != 1) {
missed= newar[i]-1;
}
}
if ( (arr[i+1] - arr[i]) !== 1) {
missed= arr[i]+1;
}
function fearNotLetter(str) {
var arr = str.split("");
var newar = [];
var missed;
for (var i = 0; i < arr.length; i++) {
newar.push(arr[i].charCodeAt());
if (newar[i] - newar[i-1] != 1) {
missed = String.fromCharCode(newar[i]-1);
} else {
missed = undefined;
}
}
return missed;
}
console.log(fearNotLetter('abcdefghjklmno'));//returns undefined WTF
darrenfj sends brownie points to @isaaknazar :sparkles: :thumbsup: :sparkles:
:cookie: 286 | @isaaknazar |http://www.freecodecamp.com/isaaknazar
newar.push(arr[i].charCodeAt());
?
console.log(fearNotLetter('abce'));// returns d
console.log(fearNotLetter('abcdefghjklmno'));//returns undefined
!==
and not !=
!==
or !=
result the same
isaaknazar sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2169 | @darrenfj |http://www.freecodecamp.com/darrenfj
github-henry sends brownie points to @heroiczero and @manish-giri and @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2170 | @darrenfj |http://www.freecodecamp.com/darrenfj
:star2: 1930 | @heroiczero |http://www.freecodecamp.com/heroiczero
:star2: 6678 | @manish-giri |http://www.freecodecamp.com/manish-giri
isaaknazar sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8600 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
if ((/&/g).test(str)) str = str.replace(/&/g, "&");
if ((/</g).test(str)) str = str.replace(/</g, "<");
if ((/>/g).test(str)) str = str.replace(/>/g, ">");
if ((/'/g).test(str)) str = str.replace(/'/g, "'");
if ((/"/g).test(str)) str = str.replace(/"/g, """);
isaaknazar sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
Just an information: are the advanced algorithms challenges needed for the Front End Certificate?
On my map they don't have an asterisk. I have completed the first one just to spend some tiem, and still no asterisk appears. Also, on the page where I can claim the certificate there is no mention of the advanced algorithms (while the basic and intermediate are mentioned).
Maybe there is a glitch and they are shown as not needed, while in reality I need to do them.
(3/4) is the step of the process:
(1/4) is the introduction page for the certification claim process
(2/3) is to check items have not been plagiarized
(3/4) is to check if all the requirements have been fulfilled
and I guess (4/4) is the end of the process for the certificate claim
@sjames1958gm good catch! thanks.. missed that one...
The reason !== -1 did not work because for the first pass in the loop newar[i-1] is undefined (i = 0 so newar[-1] is undefined)
so number - undefined is NaN and
NaN > -1
false
but NaN != -1 is true
darrenfj sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8601 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
NaN < -1
false
NaN == -1
false
NaN > -1
false
display:flex;
justify-content: center;
align-items: center;
bestintown23 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8602 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
$("html").css("background-image", 'url(${imageUrl})');
(those should be backticks around the url(${imageUrl}) part images: {
clear: "https://icons.wxug.com/data/wximagenew/n/noneinc/10023-thumb250.jpg",
clouds: "https://icons.wxug.com/data/wximagenew/e/elcondomondo/2-thumb250.jpg",
rain: "https://icons.wxug.com/data/wximagenew/d/Doesiedoats/6118-thumb250.gif"
}
var completedWord[i]
this is invalid syntax.
lower[i] = first + second
function foo() {
var bar = [];
for () {
bar.push(something);
}
return bar;
}
var completedWord[i]
is invalid.first + second
completedWords
? There are more than one word. So maybe an array to put the completed words
into.
completedWord =
this will just write the last word into completedWord and not get all the words
first + second
@gishy1 in the picture I see
var completeWord=0;
but if you are trying to build a string, it would be better to use
var completeWord=''; (two ' )
Then in the for loop you can add the capitalized words to the variable completeWord using the += operator
slice().chartAt();
image {
that you setup was in CSS?
@mixin background-2x($path, $ext: "png", $w: auto, $h: auto, $pos: left top, $repeat: no-repeat) {
$at1x_path: "#{$path}.#{$ext}";
$at2x_path: "#{$path}@2x.#{$ext}";
background-image: url("#{$at1x_path}");
background-size: $w $h;
background-position: $pos;
background-repeat: $repeat;
@media only screen and (-webkit-min-device-pixel-ratio : 1.5),
only screen and (-o-min-device-pixel-ratio: 3/2),
only screen and (min--moz-device-pixel-ratio: 1.5),
only screen and (min-device-pixel-ratio: 1.5),
only screen and (min-resolution: 144dpi) {
background-image: url("#{$at2x_path}");
}
@media only screen and (-webkit-min-device-pixel-ratio : 2.5),
only screen and (-o-min-device-pixel-ratio: 5/2),
only screen and (min--moz-device-pixel-ratio: 2.5),
only screen and (min-device-pixel-ratio: 2.5),
only screen and (min-resolution: 216dpi) {
background-image: url("#{$at2x_path}");
}
}
https://fcc-weather-api.glitch.me/api/current?lat=35&lon=139
<div class="icons1" id="phone">
into <figure>
and the example its just a fork of your original
props.mood
into s
but s
is expecting props
ashtheyogi sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:star2: 3004 | @coymeetsworld |http://www.freecodecamp.com/coymeetsworld
xapuu sends brownie points to @kbaig :sparkles: :thumbsup: :sparkles:
:cookie: 366 | @kbaig |http://www.freecodecamp.com/kbaig
var b = 7;
var a = 7;
a = b;
var b= 7; var a = var b;
var
once for each variable. This is called declaring the variable.
var b
with a value of 7
: var b = 7
b
, I simply need to write b
var = a
a
that has the same value as that of b
a
by writing var a
, and assign it a value at the same time by writing var a = b
var b = 7;
var a;
var a = b;
a
twice aren't you
var b = 7;
var a = b;
it is still being marked wrong
:cookie: 367 | @kbaig |http://www.freecodecamp.com/kbaig
ashtheyogi sends brownie points to @kbaig :sparkles: :thumbsup: :sparkles:
a
and b
are already defined in that problem so you do not need to use the var
keyword to define them again
var a = 7;
var b = 7;
If I type
var a = 1;
var a = 2;
I will get an error saying a
is already defined. Defined/declared mean the same thing
a
and b
are already declared:var a;
var b = 2;
x = 10
ashtheyogi sends brownie points to @kbaig :sparkles: :thumbsup: :sparkles:
var
though...
var x = 'Hi';
var y = 'Hello';
x = y; // x is now 'Hello'
// Google+ Login
passport.use(new GoogleStrategy({
clientID: process.env.GOOGLE_ID,
clientSecret: process.env.GOOGLE_SECRET,
callbackURL: '/auth/google/callback',
passReqToCallback: true
}, function(req, accessToken, refreshToken, profile, done) {
if (req.user) {
models.userTables.findOne({
where: {
google: profile.id
}
}).then(function(user) {
if (user) {
console.log("Already User exists in Google+ " + user);
req.flash('error', { msg: 'There is already an existing account linked with Google+ that belongs to you.' });
return done(null, user);
} else {
var new_User = {
name: user.name || profile.displayName,
gender: user.gender || profile._json.gender,
picture: user.picture || profile._json.image.url,
google: profile.id
}
console.log("Inserting into user 1" + new_User);
models.userTables.create(
new_User
).then(function(res) {
req.flash('success', { msg: 'Your Google account has been linked.' });
return res.redirect('/');
})
}
})
.catch(function(err) {
console.log("Error " + err);
return res.redirect('/signup');
});
} else {
models.userTables.findOne({
where: {
google: profile.id
}
}).then(function(user) {
console.log("Calling User G+ user 2" + user);
if (user) {
console.log("User email is here --> " + user.email);
req.flash('error', { msg: user.email + ' is already associated with another account.' });
return done(null, user);
}
models.userTables.findOne({
where: {
email: profile.emails[0].value
}
}).then(function(user) {
console.log("Calling User G+ user 2 again" + user);
if (user) {
req.flash('error', { msg: user.email + ' is already associated with another account.' });
done(err);
} else {
var newUser = {
name: profile.displayName,
email: profile.emails[0].value,
gender: profile._json.gender,
location: profile._json.location,
picture: profile._json.image.url,
google: profile.id
};
console.log("Inserting into user 2" + newUser.name);
models.userTables.create(newUser)
.then(function(user) {
done(user);
})
}
})
.catch(function(err) {
console.log("Error " + err);
done(err, user);
});
})
}
}));
here i am trying to connect with g+ using passport and sequelizefunction truthCheck(collection, pre) {
let x = Object.keys(collection).every(function(k) {
//console.log(collection[k])
if (collection[k].hasOwnProperty(pre)) {
if (collection[k])
return true;
} else {
return false;
}
});
console.log(x);
// Only change code above this line
return x;
}
truthCheck([{"name": "Pete", "onBoat": true}, {"name": "Repeat", "onBoat": true}, {"name": "FastFoward", "onBoat": null}], "onBoat") ; //should return false
truthCheck([{"user": "Tinky-Winky", "sex": "male", "age": 0}, {"user": "Dipsy", "sex": "male", "age": 3}, {"user": "Laa-Laa", "sex": "female", "age": 5}, {"user": "Po", "sex": "female", "age": 4}], "age");
// should be false
I don't understand why or what I am doing wrong?
HTML<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script><!--AGREGO JQUERY -->
<script src="script.js"></script>
.js file:
$(document).ready(function(){
$("#hidden").fadeIn();
});
css
``
display:none;
}
``
#hidden{
display:none;
}
hidden{
not #hidden{
meaning you're missing the hashtag
<script src="script.js"></script>
should be <script src="folderit is in/script.js"></script>
<script src="js/script.js"></script>
cs/main.css
of these
victorja sends brownie points to @daddycardona and @juiceyduecy :sparkles: :thumbsup: :sparkles:
:cookie: 408 | @daddycardona |http://www.freecodecamp.com/daddycardona
:cookie: 278 | @juiceyduecy |http://www.freecodecamp.com/juiceyduecy