get help in general - we have more specialized help rooms here: https://gitter.im/FreeCodeCamp/home
<style>
#myImage {
width: 100px;
}
#myImage:hover {
width: 150px;
}
</style>
<img id='myImage' ... />
darrenfj sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3360 | @khaduch |http://www.freecodecamp.com/khaduch
:star2: 1866 | @heroiczero |http://www.freecodecamp.com/heroiczero
darrenfj sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:cookie: 537 | @gersho |http://www.freecodecamp.com/gersho
:star2: 1842 | @dhcodes |http://www.freecodecamp.com/dhcodes
:star2: 6645 | @manish-giri |http://www.freecodecamp.com/manish-giri
darrenfj sends brownie points to @manish-giri and @dhcodes and @gersho :sparkles: :thumbsup: :sparkles:
georgiawang5332 sends brownie points to @x140hu4 :sparkles: :thumbsup: :sparkles:
:cookie: 296 | @x140hu4 |http://www.freecodecamp.com/x140hu4
@hijazi What you cannot do is:
let x = 1;
let x = 3;
Which is basically what happens when you run code with a let
- and then run the code again in the same environment
var
let
on FCC and never had a problem
let
should be more scope restricted than var
and as I know is more recommended
@hijazi
var ourDecimal = 5.7;
// Only change code below this line
let myDecimal = 3.20;
I'm not sure how you managed to already declare myDecimal
upfront :D
:star2: 1351 | @alpox |http://www.freecodecamp.com/alpox
hijazi sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
heroiczero sends brownie points to @manish-giri and @thekholm80 and @darrenfj and @korzo and @sjames1958gm and @github-henry :sparkles: :thumbsup: :sparkles:
:cookie: 618 | @korzo |http://www.freecodecamp.com/korzo
:star2: 1503 | @thekholm80 |http://www.freecodecamp.com/thekholm80
:star2: 8541 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
:star2: 6646 | @manish-giri |http://www.freecodecamp.com/manish-giri
:cookie: 386 | @github-henry |http://www.freecodecamp.com/github-henry
:star2: 2119 | @darrenfj |http://www.freecodecamp.com/darrenfj
heroiczero sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3361 | @khaduch |http://www.freecodecamp.com/khaduch
thanx @heroiczero , i was not understand it well.
thanx @sjames1958gm i tried this but again not able to understand it well
i wrote this which is working with get_location_id function and failing in get_location_details function. I am not able to figure out to pass body.results[0].place_id as returned value to variable location_unique_id and hence passing this value as parameter to get_location_details.
exports.temple_get = (req, res) => {
let location_name = req.params.temple_name;
console.log("location name --> " + location_name);
let location_unique_id = get_location_id(location_name);
console.log("get location id -- > " + location_unique_id);
let location_info = get_location_details(location_unique_id);
console.log("location_info --> " + location_info);
res.header('Access-Control-Allow-Origin', "*");
res.render('pages/temple');
};
function get_location_id(location_name) {
let modified_name = location_name.split(' ').join('+');
console.log("modified_name -- > " + modified_name);
// get place id from here
let geocode_url = "https://maps.googleapis.com/maps/api/geocode/json?address=" + modified_name + "&sensor=false&key=" + geocode_api_key;
request({
url: geocode_url,
json: true
}, function(error, response, body) {
if (!error && response.statusCode === 200) {
// console.log(body) // Print the json response
// console.log(body.results[0].place_id)
body.results[0].place_id;
}
});
};
function get_location_details(location_id) {
// get details of place using place id
console.log("id -- >" + location_id);
var place_url = "https://maps.googleapis.com/maps/api/place/details/json?placeid=" + location_id + "&key=" + place_api_key;
request({
url: place_url,
json: true
}, function(error, response, body) {
if (!error && response.statusCode === 200) {
console.log(body); // Print the json response
}
});
};
surya4 sends brownie points to @heroiczero and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8542 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
:star2: 1867 | @heroiczero |http://www.freecodecamp.com/heroiczero
let location_unique_id = get_location_id(location_name);
this line will not work.get_location_id(location_name, function(id) {});
function get_location_details(location_id, callback)
surya4 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
or is the FCC Beta api and microservice section just EXTREMELY poorly written, stuck on challenge after challenge. When someone is gracious enough to help me find a solution, I find out that my mistake is because of something incredibly simple, and could have been avoided with proper guidance from FCC.
(fcc is structuring their tests differently from what the mongoose documentation tells you to do, and fcc just tells you to look at the documentation....)
darrenfj sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 1868 | @heroiczero |http://www.freecodecamp.com/heroiczero
darrenfj sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1504 | @thekholm80 |http://www.freecodecamp.com/thekholm80
thekholm80 sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2120 | @darrenfj |http://www.freecodecamp.com/darrenfj
"twenty"
and leaving the rest?
changeDue
is more or less than that denomination.
if
statement once? It would seem that it hits at least twice since the "one hundred"
key isn't triggered
100 > 96.74
if
is true at which point I push the key value to change
change = ['twenty', 0]
but that causes an infinite loop and I do not know why
while
loop which should check the current cid available and check that the if
statement remains true
change[x][1]
, reduce changeDue
by the current denomination, and decreace the cid
for the current denomination
x = change.length - 1
github-henry sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 1870 | @heroiczero |http://www.freecodecamp.com/heroiczero
while
breaks the whole thing
changeDue -= key[i][1];
changeDue = changeDue - key[i][1];
it doesnt work
change[x][1]
have to do with changeDue
?
console.log(change[x][1]);
on line 21, you will see that change[x][1] is different on each iteration. Setting it to a set value on each iteration (change[x][1] = 0;
) creates an infinite loop.
change[x][1] = 0
then enter the while
loop which should iterate 3 times, then I would think that it would go into the next iteration of the for loop setting change[x+1][1] = 0
changeDue
eventually becose negative thereby causing an end to the while loop?
change[x][1]=0
?
while
loop it has a value of 0, not 20, so as I take 20 from the cid and place it in the change I dont have an extra 20
change[0][1] = 40
and before it even hits the while loop =20
["five", 5]
it doesn't even loop once
console.log(changeDue);
changeDue = changeDue - key[i][1];
put console.log("changeDue"+changeDue+"key[i][1]"+key[i][1]);
if (changeDue - key[i][1] >= 0 && cid[i][1] > 0)
changeDue - key[i][1] = a negative number
it should iterate to the next denomination
dhcodes sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2121 | @darrenfj |http://www.freecodecamp.com/darrenfj
change
subtracts the key value from changedue
and takes that same denomination out of the cid
equivalent to that key
change
Ok. I understand everything besided the last part ""
and takes that same denomination out of the
cid
equivalent to that key
cid ["twenty", ]
is empty
change.push(key[i]);
rscales02 sends brownie points to @octopinky :sparkles: :thumbsup: :sparkles:
:cookie: 374 | @octopinky |http://www.freecodecamp.com/octopinky
function palindrome(str) {
str = str.toLowerCase();
var a =/\[^A-Za-z0-9]+/g;
var b =str.replace(a,"");
str =str.split("").reverse().join("");
```
function palindrome(str) {
str = str.toLowerCase();
var a =/[^A-Za-z0-9]+/g;
var b =str.replace(a,"");
str =b.split("").reverse().join("");
// Good luck!
if(str===b){
return true;
}
else {
return false;
}
}
```
function palindrome(str) {
str = str.toLowerCase();
var a =/[^A-Za-z0-9]+/g;
var b =str.replace(a,"");
str =b.split("").reverse().join("");
// Good luck!
if(str===b){
return true;
}
else {
return false;
}
}
manish-giri sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1505 | @thekholm80 |http://www.freecodecamp.com/thekholm80
manish-giri sends brownie points to @darrenfj and @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 1871 | @heroiczero |http://www.freecodecamp.com/heroiczero
:star2: 2122 | @darrenfj |http://www.freecodecamp.com/darrenfj
var a =/[^A-Za-z0-9]+/ig;
thekholm80 sends brownie points to @manish-giri and @heroiczero and @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 1872 | @heroiczero |http://www.freecodecamp.com/heroiczero
:star2: 2123 | @darrenfj |http://www.freecodecamp.com/darrenfj
:star2: 6647 | @manish-giri |http://www.freecodecamp.com/manish-giri
gishy1 sends brownie points to @alpox and @tiagocorreiaalmeida :sparkles: :thumbsup: :sparkles:
:cookie: 391 | @tiagocorreiaalmeida |http://www.freecodecamp.com/tiagocorreiaalmeida
:star2: 1353 | @alpox |http://www.freecodecamp.com/alpox
hi guys does any one know why its not working
var nodemailer = require("nodemailer");
var transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: 'mygmail@gmail.com',
pass: 'mypassword'
}
})
var mailOptions = {
from: 'sender@gmail.com',
to: 'reciver@gmail.com',
subject: 'forget password',
text: 'dummy text',
html: '<h2>Click link below to reset</h2>'
}
transporter.sendMail(mailOptions, function(err, info) {
if(err) {
console.log('error',err)
} else {
console.log(info)
}
})
console:
{ accepted: [ 'reciver@gmail.com' ],
rejected: [],
response: '250 2.0.0 OK 1507842711 81sm14858774pfh.145 - gsmtp',
envelope:
{ from: 'senderg@gmail.com',
to: [ 'reciver@gmail.com' ] },
messageId: '3c6aee09-281c-9d9e2b743056@gmail.com' }
reciver@gmail.com
and ask them if they got your email