These are chat archives for FreeCodeCamp/Help

12th
Oct 2017
korzo
@korzo
Oct 12 2017 00:00
But I doubt this is what you were asking for.
Jerzz
@2cool4school
Oct 12 2017 00:59
Does anyone know of an easy way to display a larger version of an image when the image is hovered over?
Kyle Holm
@thekholm80
Oct 12 2017 01:54
@2cool4school
<style>
  #myImage {
    width: 100px;
  }

  #myImage:hover {
    width: 150px;
  }
</style>
<img id='myImage' ... />
@2cool4school see it in action here: https://jsfiddle.net/33y5oL39/
Sean Clarke
@Seanland
Oct 12 2017 02:55
Hi All, Anyone have any recommendations on nodejs learning material. I have done learnyounode. Just looking for additional material. Thanks!
Georgia
@georgiawang5332
Oct 12 2017 05:34
@georgiawang5332
https://forum.freecodecamp.org/t/freecodecamp-algorithm-challenge-guide-friendly-date-ranges/16017
What is the wrong answer in this question? Because I posted it the program is wrong XD
Because I am how to write wrong, you can please help me master?
Darren
@DarrenfJ
Oct 12 2017 05:43
thanks @khaduch for keeping the room active :D
CamperBot
@camperbot
Oct 12 2017 05:43
darrenfj sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3360 | @khaduch |http://www.freecodecamp.com/khaduch
Darren
@DarrenfJ
Oct 12 2017 05:44
and thanks @heroiczero for the kudos to the regulars :D it's muchly appreciated...
CamperBot
@camperbot
Oct 12 2017 05:44
:star2: 1866 | @heroiczero |http://www.freecodecamp.com/heroiczero
darrenfj sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
Fabien SHAN
@X140hu4
Oct 12 2017 05:44
@georgiawang5332 Oh that challenge does not appear for me... I imagine it is only in the chinese version?
Darren
@DarrenfJ
Oct 12 2017 05:45
and my usual kudos and thanks to @Manish-Giri @dhcodes @Gersho
CamperBot
@camperbot
Oct 12 2017 05:45
: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:
Georgia
@georgiawang5332
Oct 12 2017 05:51
@X140hu4 thank u
CamperBot
@camperbot
Oct 12 2017 05:51
georgiawang5332 sends brownie points to @x140hu4 :sparkles: :thumbsup: :sparkles:
:cookie: 296 | @x140hu4 |http://www.freecodecamp.com/x140hu4
Fabien SHAN
@X140hu4
Oct 12 2017 05:59
@georgiawang5332 What was your question about it?
Georgia
@georgiawang5332
Oct 12 2017 06:03
https://codepen.io/georgia/pen/gGjadL (I am writing that is wrong)
https://forum.freecodecamp.org/t/freecodecamp-algorithm-challenge-guide-friendly-date-ranges/16017 (I copied this article is wrong, because my logical idea is not very good, so I do not know now that I am less problem, and then has been stuck here)
So would like to ask you experts who have their own finished products let me learn to learn, make up my lack of problems
alpox
@alpox
Oct 12 2017 07:53
@thekholm80 i use mongoose almost never ;) i used it only for very short tests. Usually i work with mysql or postgres
Baha
@hijazi
Oct 12 2017 09:13
hi there, I'm trying to submit this:
https://www.freecodecamp.org/challenges/create-decimal-numbers-with-javascript
and it's not working
doesn't a float in JS look like: 3.2
?!
I wanted to pass through the basic js to check if there's something to learn, but I feel there's a bug in this challenge
it gives errors in Chrome's console
Uncaught SyntaxError: Identifier 'myDecimal' has already been declared
could someone try to solve it please to check?
Here's a screenshot:
https://ibb.co/kSNzWG
alpox
@alpox
Oct 12 2017 09:23

@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

So its like redeclaring the variable
Which is only possible with a variable instantiated with var
Baha
@hijazi
Oct 12 2017 09:25
excuse me @alpox, but were you able to submit the challenge?
I always use let on FCC and never had a problem
and let should be more scope restricted than var and as I know is more recommended
alpox
@alpox
Oct 12 2017 09:26
@hijazi Yes i was able to.
Baha
@hijazi
Oct 12 2017 09:27
could you share your code please?
it's only asking for declaring a float! I'm solving the advanced algorithms and just went back to basic JS to mark them as done!
alpox
@alpox
Oct 12 2017 09:28

@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

Baha
@hijazi
Oct 12 2017 09:28
it's the same as my code in the screenshot above, isn't it?!
it's just not submitting, I'll try again :joy:
alpox
@alpox
Oct 12 2017 09:29
@hijazi Reset the code, reload the page with cache clear and try again
Baha
@hijazi
Oct 12 2017 09:30
reseting the page with clearing cache marked the tests as done! :/ thanks @alpox for being there :D
CamperBot
@camperbot
Oct 12 2017 09:30
:star2: 1351 | @alpox |http://www.freecodecamp.com/alpox
hijazi sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
alpox
@alpox
Oct 12 2017 09:31
@hijazi np :D
heroiczero
@heroiczero
Oct 12 2017 10:19
@Manish-Giri @thekholm80 @DarrenfJ @korzo @sjames1958gm @GitHub-Henry TY for taking your time to come help everyday :)
CamperBot
@camperbot
Oct 12 2017 10:19
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
@heroiczero
Oct 12 2017 10:21
@khaduch TY hope you get back :)
CamperBot
@camperbot
Oct 12 2017 10:21
heroiczero sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3361 | @khaduch |http://www.freecodecamp.com/khaduch
Surya Singh
@surya4
Oct 12 2017 10:38
any help on how to implement google map api with node
heroiczero
@heroiczero
Oct 12 2017 10:41
did you try looking at the documentation: https://github.com/google/google-api-nodejs-client
Stephen James
@sjames1958gm
Oct 12 2017 10:43
@heroiczero :+1:
heroiczero
@heroiczero
Oct 12 2017 10:43
@surya4 or you could use this documentation https://developers.google.com/drive/v3/web/quickstart/nodejs
Surya Singh
@surya4
Oct 12 2017 10:52

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
        }

    });
};
CamperBot
@camperbot
Oct 12 2017 10:52
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
Stephen James
@sjames1958gm
Oct 12 2017 10:55
@surya4 Your get_location_id is asynchronous so it cannot simply return a value. You can pass it a callback function from temple_get
and call that function in the get_location_id callback from request.
let location_unique_id = get_location_id(location_name); this line will not work.
get_location_id(location_name, function(id) {});
Something like the above, and then
function get_location_details(location_id, callback)
Then call callback within the function passed to request
Surya Singh
@surya4
Oct 12 2017 11:07
got it, i forgot the async part, thank you @sjames1958gm
CamperBot
@camperbot
Oct 12 2017 11:07
surya4 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
api offline
knight2
@knight2
Oct 12 2017 13:21
am I just really incredibly stupid

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....)

I can usually finish these introduction "5 hour" sections within 1-2 hours. and mongodb and mongoose section is taking forever. Mostly because I need to wait to get someone who knows what they are talking about to get a response, and then i'll be hung up on an error on the next challenge. repeat.
i'm actually impressed that this section has me complaining again to chat. I didn't expect the curriculum to get even worse than what I say from other parts of the beta section.
At a certain point, half-finished tutorials, with tests that don't match what is shown to you, are way less helpful than simply telling someone to go to another site to learn it while you wait to work on finished product. Beta yeah but i dunno...
This isn't really about someone finding 'bugs' in the beta, shouldn't even be qualified as beta.
knight2
@knight2
Oct 12 2017 13:26
more like a half done alpha.
as others suggested, i'll help contribute to theses sections once I complete it, but wow.
knight2
@knight2
Oct 12 2017 13:39
that being said i'm more just frustrated that I can't debug my problems in a timely manner. Does anyone know of any online chat communities with a backend focus? I've tried the largest slack groups etc but more are inactive despite having thousands of people.
heroiczero
@heroiczero
Oct 12 2017 13:45
@knight2 did you try https://university.mongodb.com/courses/M101JS/about this course if you are thinking of the MEAN stack
I haven't tried another course yet, no
Perhaps I should
I wasclose to finishing this one
Darren
@DarrenfJ
Oct 12 2017 15:03
thanks @heroiczero for the kudos :D
CamperBot
@camperbot
Oct 12 2017 15:03
darrenfj sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 1868 | @heroiczero |http://www.freecodecamp.com/heroiczero
Darren
@DarrenfJ
Oct 12 2017 15:05
@thekholm80 thanks for the jsfiddle example
CamperBot
@camperbot
Oct 12 2017 15:05
darrenfj sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1504 | @thekholm80 |http://www.freecodecamp.com/thekholm80
Kyle Holm
@thekholm80
Oct 12 2017 15:05
@DarrenfJ thanks for the thanks
CamperBot
@camperbot
Oct 12 2017 15:05
thekholm80 sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2120 | @darrenfj |http://www.freecodecamp.com/darrenfj
Darren
@DarrenfJ
Oct 12 2017 15:06
learnyounode
can;t remember if I ever checked that out
Kyle Holm
@thekholm80
Oct 12 2017 15:06
it's painfully bad
but still better than nothing
Darren
@DarrenfJ
Oct 12 2017 15:07
that the nodeschool stuff fCC had for exercises way back when?
Kyle Holm
@thekholm80
Oct 12 2017 15:07
i'm not sure
Darren
@DarrenfJ
Oct 12 2017 15:08
oh yah.. looking it over
i'm surprised no one's gone in and updated it..it seems to be circelc'd at 2015
Kyle Holm
@thekholm80
Oct 12 2017 15:09
it reminds me of dos, pre windows
I mean, I love CLI's and all, but geez
rscales02
@rscales02
Oct 12 2017 15:48
https://repl.it/M7Dj/1 Can someone help me understand why my this loop only runs twice?
Olga C
@Octopinky
Oct 12 2017 16:17
@rscales02 The loop runs all nine times. It goes into the while statement twice
rscales02
@rscales02
Oct 12 2017 16:20
shouldn't it stay in the while loop until that condition is satisfied? and if it is looping through the whole thing why is it only pushing "twenty" and leaving the rest?
in this example it is only returning $80 of the $96.74 total
Olga C
@Octopinky
Oct 12 2017 16:22
Ok. @rscales02 Lets go through the code line by line.
Please tell me what the code does. (I know what it does, it would be helpful to talk through it though)
rscales02
@rscales02
Oct 12 2017 16:24
first thing is to reverse the cid so it matches the same order as the key and you can hit the bigger denominations first
next is to create a for loop that cycles through the key to see if the changeDue is more or less than that denomination.
Olga C
@Octopinky
Oct 12 2017 16:26
Right there. The code goes in here only once.
rscales02
@rscales02
Oct 12 2017 16:28
it only hits the if statement once? It would seem that it hits at least twice since the "one hundred" key isn't triggered
the first cycle in the for loop does nothing, as 100 > 96.74
Olga C
@Octopinky
Oct 12 2017 16:32
Ok.
So, the code goes in on the second one
rscales02
@rscales02
Oct 12 2017 16:34
second cycle the if is true at which point I push the key value to change
Olga C
@Octopinky
Oct 12 2017 16:35
it pushes k[i] to change. k[i]='TWENTY', 20
rscales02
@rscales02
Oct 12 2017 16:36
yes, I then thought it would be wise to set that to change = ['twenty', 0] but that causes an infinite loop and I do not know why
Olga C
@Octopinky
Oct 12 2017 16:38
Ok. I am still following. What is your plan to do with that code after it pushes k[i] to change?
rscales02
@rscales02
Oct 12 2017 16:38
then we hit the while loop which should check the current cid available and check that the if statement remains true
while there is still cash in that denomination and change still needs to be given at an amount more than that denomination it should loop through adding value to change[x][1], reduce changeDue by the current denomination, and decreace the cid for the current denomination
Olga C
@Octopinky
Oct 12 2017 16:42
There is an x variable. How do you use that? I think it is used to keep track of changes?
rscales02
@rscales02
Oct 12 2017 16:43
the x variable is allowing me access to the last array in change usiing x = change.length - 1
Olga C
@Octopinky
Oct 12 2017 16:45
Ok. I understand. So, you think that is will go through the while loop several times, adding twenty to the change 3 times before exiting the loop?
@rscales02 https://repl.it/M7Dj/4 You can see here that your logic works.
You just need to change the lines in the while loop, so that the correct amounts of twenties, tens, fives, etc. would be added to the final answer
rscales02
@rscales02
Oct 12 2017 16:50
any idea why it goes loonie on the decimals?
Olga C
@Octopinky
Oct 12 2017 16:51
approximation is set to the 10th I think
rscales02
@rscales02
Oct 12 2017 16:54
why is it approximating? 10.05-.03 should give 10.02 not 10.01999999997
what did you change to my logic?
Olga C
@Octopinky
Oct 12 2017 16:55
Yes, I understand you. That is curious.
@rscales02 I did not change anything. You did it all by yourself! Lol. I just placed the console log on line 23, so we could see what happens to the code as it goes through the for loop.
rscales02
@rscales02
Oct 12 2017 16:58
Screenshot (8).png
I think the computers are plotting against me
Screenshot (9).png
Olga C
@Octopinky
Oct 12 2017 16:59
Ha ha. Lol. Lets see
rscales02
@rscales02
Oct 12 2017 17:00
your code works like I think mine should, my code gives me a big lump of crap. they are identical as far as I can tell
Olga C
@Octopinky
Oct 12 2017 17:00
This is hilarious. Use "my" code :)
On line 19
(change.push(key[i]);)
Should be^^^
Nope. Not that.
rscales02
@rscales02
Oct 12 2017 17:03
I have no idea why changing that makes a difference... it does, but I have no idea why
Olga C
@Octopinky
Oct 12 2017 17:05
I guess I did change something that made your logic work. It makes the pushed variable a string, instead of a number
rscales02
@rscales02
Oct 12 2017 17:05
It should be pushing an array, to make an array of arrays
Olga C
@Octopinky
Oct 12 2017 17:09
Ok. So, lets try again. Refresh the https://repl.it/M7Dj/4 at every step.
So, the for loop iterates through the 9 items in the key array. Do you see that?
Henry
@GitHub-Henry
Oct 12 2017 17:14
@heroiczero ty appreciate the brownies
CamperBot
@camperbot
Oct 12 2017 17:14
github-henry sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 1870 | @heroiczero |http://www.freecodecamp.com/heroiczero
rscales02
@rscales02
Oct 12 2017 17:14
Yes I see that the for loop works when you turn it into an array of strings, still not sure why it does not do that with an array of arrays
the result is expected as an array of arrays
Olga C
@Octopinky
Oct 12 2017 17:16
as of right now it does. refresh. If we keep going, we will find out what happens. https://repl.it/M7Dj/5 The number changed at the end.
Olga C
@Octopinky
Oct 12 2017 17:23
@rscales02 Great job. I am proud of you.
and while breaks the whole thing
Olga C
@Octopinky
Oct 12 2017 17:28
That menats that changeDue does not diminish with each iteration. I can see that you have it changeDue -= key[i][1];
rscales02
@rscales02
Oct 12 2017 17:28
so why does that not work?
even when i write it out changeDue = changeDue - key[i][1]; it doesnt work
Olga C
@Octopinky
Oct 12 2017 17:30
it has to do with line 21. Comment it out and run.
rscales02
@rscales02
Oct 12 2017 17:33
but what does change[x][1] have to do with changeDue?
Olga C
@Octopinky
Oct 12 2017 17:35
If you 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.
Derek
@dsoucie
Oct 12 2017 17:35
@daddycardona it was for the Image Search Abstraction Layer: https://www.freecodecamp.org/challenges/image-search-abstraction-layer
but someone helped me in the help/backend gitter
rscales02
@rscales02
Oct 12 2017 17:38
so it should set 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
and shouldn't my changeDue eventually becose negative thereby causing an end to the while loop?
Olga C
@Octopinky
Oct 12 2017 17:39
@rscales02 What is the role of settingchange[x][1]=0?
rscales02
@rscales02
Oct 12 2017 17:41
so when it initially hits the 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
maybe I can work around that
Olga C
@Octopinky
Oct 12 2017 17:42
Good thinking.
right direction I guess...
Olga C
@Octopinky
Oct 12 2017 17:45
Ok. Getting closer.
rscales02
@rscales02
Oct 12 2017 17:45
it still exits the while loop before I believe it should based on the parameters
Olga C
@Octopinky
Oct 12 2017 17:47
The code goes into the while loop 3 times
rscales02
@rscales02
Oct 12 2017 17:48
it looks to me like only once as change[0][1] = 40 and before it even hits the while loop =20
by the time it hits ["five", 5] it doesn't even loop once
Olga C
@Octopinky
Oct 12 2017 17:50
You can check yourself with changing line 25 to console.log(changeDue);
rscales02
@rscales02
Oct 12 2017 17:53
Am I retarded? when did 36 - 20 become 6?
also when did 96-20 become 36?
Olga C
@Octopinky
Oct 12 2017 17:55
It is more like 96-20-20-20. Hmmm
Whats is your latest code look like?
since the console.log is in the while loop shouldn't it log each loop through? so 96-20 log 76, 76-20 log 56...
Olga C
@Octopinky
Oct 12 2017 17:59
Ok. So, to see what exactly happens in the code, we can console log all the variables as they are being substracted. So, right above changeDue = changeDue - key[i][1]; put console.log("changeDue"+changeDue+"key[i][1]"+key[i][1]);
That will show what exactly is being substracted from what
rscales02
@rscales02
Oct 12 2017 18:01
so it skips 5s and 1s and dimes and nickels and pennies
there seems to be something GLARINGLY wrong with my logic
Olga C
@Octopinky
Oct 12 2017 18:02
Because the changeDue goes into the negative before it reaches the 5s
rscales02
@rscales02
Oct 12 2017 18:02
but it shouldnt
if (changeDue - key[i][1] >= 0 && cid[i][1] > 0)
since changeDue - key[i][1] = a negative number it should iterate to the next denomination
Olga C
@Octopinky
Oct 12 2017 18:04
You are doing good. We can start over again. It helps to just talk it through.
Dylan
@dhcodes
Oct 12 2017 18:10
lol @DarrenfJ thanks
CamperBot
@camperbot
Oct 12 2017 18:10
dhcodes sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2121 | @darrenfj |http://www.freecodecamp.com/darrenfj
rscales02
@rscales02
Oct 12 2017 18:11
I use a for loop to cycle through my key, if that key value is less than change due it pushes the key to change subtracts the key value from changedue and takes that same denomination out of the cid equivalent to that key
then it hits a while loop and while that key value is less than change due and there is still that denomination in the drawer it pulls one 'bill' from the drawer and puts it into change
Olga C
@Octopinky
Oct 12 2017 18:12

Ok. I understand everything besided the last part ""

and takes that same denomination out of the cid equivalent to that key

Ok. The logic is clear. You are imagining a cashier standing there and taking the bills out.
rscales02
@rscales02
Oct 12 2017 18:13
yes
but this cashier appears to be a bit more retarded than most :worried:
Olga C
@Octopinky
Oct 12 2017 18:14
Lol. Poor retarded cashier.
rscales02
@rscales02
Oct 12 2017 18:15
for some reason it stops pulling the 20s before cid ["twenty", ] is empty
Olga C
@Octopinky
Oct 12 2017 18:15
So, sart fresh and erase the code inside the for statement/
rscales02
@rscales02
Oct 12 2017 18:15
but it does the math as if it took all of them
Olga C
@Octopinky
Oct 12 2017 18:17
Then add an if statement and see if it can loop through key[i] values.
rscales02
@rscales02
Oct 12 2017 18:22
13 iterations later back to square 1 again https://repl.it/M7Dj/13
I can only picture this going back into a while loop that doesnt work
Olga C
@Octopinky
Oct 12 2017 18:24
You are doing fine. You can do it. I believe in you.
Great. So, now, we want to push each value into the change. change.push(key[i]);
if that works, then create a while loop and add the changeDue changes to it (so the loop would exit). Also console.log something inside the loop to see how many times it loop through
This will create the basic skeleton of the logic that you are implementing and I think it will help with progressing toward the solution. Lol. Words words.
rscales02
@rscales02
Oct 12 2017 18:33
words that I don't seem to be truely comprehending, When I have been putting a log in the while loop it has not logged the majority of the passes through the loop
that is working like I think it should but I need some way to get it to stay the current denomination until the drawer is empty or until changedue - denomination < 0
Is there another option than while? as that does not seem to be working for me
Olga C
@Octopinky
Oct 12 2017 18:41
Ok. So, no more while loop. The logic is different now?
Yes, there are many options, @rscales02.
rscales02
@rscales02
Oct 12 2017 18:43
well the logic doesnt work like i think it should so instead of kicking a dead horse until it moves, maybe hop on a new one
Olga C
@Octopinky
Oct 12 2017 18:43
Lol. Sounds great.
rscales02
@rscales02
Oct 12 2017 18:44
but time to walk away before I throw myself out the window after my computer
thats for the encouragement]
*thanks for the encouragement @Octopinky
CamperBot
@camperbot
Oct 12 2017 18:44
rscales02 sends brownie points to @octopinky :sparkles: :thumbsup: :sparkles:
:cookie: 374 | @octopinky |http://www.freecodecamp.com/octopinky
Olga C
@Octopinky
Oct 12 2017 18:44
You are welcome. You will get it. You are thinking critically and that is what important! Keep at it!
gishy1
@gishy1
Oct 12 2017 20:39
hello world ive been working on this for days and its driving me nuts
image.png
its not selecting non alpha-numeric characters as expected driving me nuts
my var a is not working\
gishy1
@gishy1
Oct 12 2017 20:45
hello world
:worried:
Tiago Correia
@tiagocorreiaalmeida
Oct 12 2017 20:47
hey
gishy1
@gishy1
Oct 12 2017 20:47
:cry:
Tiago Correia
@tiagocorreiaalmeida
Oct 12 2017 20:47
so there's a few thing you need to solve
your str =
sould be euqla to b
.split("").reverse.join("")
cause b
is the variable that hold all the letters and hasnon-alphanumeric characters removed
so setting str = str...
str there still has the non-alphanumeric characters
You'll need to remove all non-alphanumeric characters (punctuation, spaces and symbols) and turn everything lower case in order to check for palindromes.
lowercase the string before rmeoving anything from it
nm you do it
@gishy1 can you paste your code here?
gishy1
@gishy1
Oct 12 2017 20:49
ok
function palindrome(str) {
str = str.toLowerCase();
var a =/[^A-Za-z0-9]+/g;
var b =str.replace(a,"");
str =str.split("").reverse().join("");
// Good luck!
if(str===b){
return true;
}
else {
return str;
}
}
the symbols are still showing i dont know why
Tiago Correia
@tiagocorreiaalmeida
Oct 12 2017 20:51
ok so you are almost there
@gishy1 there's only 1 issue in your code
will try to explain it
function palindrome(str) {
  str = str.toLowerCase();
  var a =/\[^A-Za-z0-9]+/g;
  var b =str.replace(a,"");
  str =str.split("").reverse().join("");
first you lower case the string that's correct and then you create a regex - correct and then you are doing a correct replace the only thing youhave wrong is str = str.split(""):.. why would you use str.split("")? str still has all those signals you didnt removed them all you have to do is set str = b.split("").. b is the word without the signals and everythign correct and you reverse then you check if b = str then its one
hope it wasnt confusing
gishy1
@gishy1
Oct 12 2017 20:56
@tiagocorreiaalmeida hmmm yes tried that but when you return str;
with the palindromes with symbols like "five|_/|four"
they still show the symbol
Tiago Correia
@tiagocorreiaalmeida
Oct 12 2017 20:57
show me your code once again
gishy1
@gishy1
Oct 12 2017 20:58
how do i put code here like you did in the box :point_up:

```
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;
}
}

```

@tiagocorreiaalmeida here
Tiago Correia
@tiagocorreiaalmeida
Oct 12 2017 21:01
image.png
just pasted your code here it worked xd
gishy1
@gishy1
Oct 12 2017 21:04
wtf!
Tiago Correia
@tiagocorreiaalmeida
Oct 12 2017 21:04
:D
print me your page
so I can see what you have there
gishy1
@gishy1
Oct 12 2017 21:06
@tiagocorreiaalmeida print screen
?
Tiago Correia
@tiagocorreiaalmeida
Oct 12 2017 21:07
yeah
gishy1
@gishy1
Oct 12 2017 21:07
image.png
Petterandre
@Petterandre
Oct 12 2017 21:08
Hey guys :) I need a little bit of help, a bit stuck on the simon front end program. js isn't acting like I believe it is supposed to do. Anyone care to take a look at my else expression?
Tiago Correia
@tiagocorreiaalmeida
Oct 12 2017 21:09
@gishy1 copy code refrehs page
paste in code
remove the text case from the bottom
and enter submit
gishy1
@gishy1
Oct 12 2017 21:12
@tiagocorreiaalmeida not working bro!
:cry:
im going to bed this is really frustrating
Tiago Correia
@tiagocorreiaalmeida
Oct 12 2017 21:18
@gishy1 print to me that again
it has to work
gishy1
@gishy1
Oct 12 2017 21:18
ok bro
image.png
Tiago Correia
@tiagocorreiaalmeida
Oct 12 2017 21:20
remove everything from your board
and paste this in
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;
}
}
if it doesnt work send me a print again
gishy1
@gishy1
Oct 12 2017 21:24
@tiagocorreiaalmeida hold on bro let me try something
Tiago Correia
@tiagocorreiaalmeida
Oct 12 2017 21:25
im just telling you it worked on my browser
that's your code
so it has to work there
Manish Giri
@Manish-Giri
Oct 12 2017 21:30
@thekholm80 ty
CamperBot
@camperbot
Oct 12 2017 21:30
manish-giri sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1505 | @thekholm80 |http://www.freecodecamp.com/thekholm80
Manish Giri
@Manish-Giri
Oct 12 2017 21:31
@DarrenfJ @heroiczero ty
CamperBot
@camperbot
Oct 12 2017 21:31
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
gishy1
@gishy1
Oct 12 2017 21:35
@tiagocorreiaalmeida bro it only works with the capital w/W
i dont know why
and you have to include _|
in the regex
Tiago Correia
@tiagocorreiaalmeida
Oct 12 2017 21:36
change your regex to this
var a =/[^A-Za-z0-9]+/ig;
try agian
and no idea why this works here and not there
alpox
@alpox
Oct 12 2017 21:38
@gishy1 it was not working because of your backslash before the [
gishy1
@gishy1
Oct 12 2017 21:39
@alpox holy shit i just figured that out same time as you !!!
Kyle Holm
@thekholm80
Oct 12 2017 21:40
@Manish-Giri @heroiczero @DarrenfJ ty
CamperBot
@camperbot
Oct 12 2017 21:40
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
@gishy1
Oct 12 2017 21:40
:wave:
Kyle Holm
@thekholm80
Oct 12 2017 21:40
@alpox :wave: sorry i thought you were a mongoose fan lol
alpox
@alpox
Oct 12 2017 21:40
That backslash makes regex interpret the [ as that character, so it tries to match [. Instead of using it as special character to indicate a set of characters to match
@thekholm80 not really :) but no problem. I dont like mongodb so much because as soon as you leave the small web usecases like blogs, mongodb is terrible because it doesnt lend itself well to most data models
gishy1
@gishy1
Oct 12 2017 21:42
@alpox @tiagocorreiaalmeida thanks guys!!!!
CamperBot
@camperbot
Oct 12 2017 21:42
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
Kyle Holm
@thekholm80
Oct 12 2017 21:42
makes sense
Manish Giri
@Manish-Giri
Oct 12 2017 21:42
Screenshot 2017-10-12 06.36.03.png
@thekholm80 debug me tis
Kyle Holm
@thekholm80
Oct 12 2017 21:43
@Manish-Giri it looks like you're using java on a mac, that's probably 1/2 the problem?
Manish Giri
@Manish-Giri
Oct 12 2017 21:43
lol
Kyle Holm
@thekholm80
Oct 12 2017 21:44
did you finish up with your db project?
Manish Giri
@Manish-Giri
Oct 12 2017 21:45
you mean the thesis?
no it's ongoing
fml
Kyle Holm
@thekholm80
Oct 12 2017 21:45
yeah, i can't remember the db you were using
don't ever get old
Manish Giri
@Manish-Giri
Oct 12 2017 21:46
lol
haha
you're barely a year or 2 older than me
Neo4J
Kyle Holm
@thekholm80
Oct 12 2017 21:46
nearly 10?
Manish Giri
@Manish-Giri
Oct 12 2017 21:46
pfffft
Kyle Holm
@thekholm80
Oct 12 2017 21:46
that's right, neo4j
Manish Giri
@Manish-Giri
Oct 12 2017 21:46
2 yrs
Kyle Holm
@thekholm80
Oct 12 2017 21:46
i'm 37 next month
Manish Giri
@Manish-Giri
Oct 12 2017 21:46
okay maybe 4 yrs
alpox
@alpox
Oct 12 2017 21:47
Linked list tests... Thats more fun with C :D
Naveen B
@naveen62
Oct 12 2017 21:47

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' }

alpox
@alpox
Oct 12 2017 21:48
@naveen62 according to the console it worked :D
Kyle Holm
@thekholm80
Oct 12 2017 21:48
now you need to find out who has the account for reciver@gmail.com and ask them if they got your email
Naveen B
@naveen62
Oct 12 2017 21:49
@alpox but when i check the mail i did not receive any mail
alpox
@alpox
Oct 12 2017 21:49
@thekholm80 was going to say something similar :D
@naveen62 well you wont get a mail unless your mail is receiver@gmail.com ^^
Kyle Holm
@thekholm80
Oct 12 2017 21:50
reciver
alpox
@alpox
Oct 12 2017 21:51
Oh god that spelling
Sounds like lucifer :worried:
Kyle Holm
@thekholm80
Oct 12 2017 21:51
lol
Manish Giri
@Manish-Giri
Oct 12 2017 22:01
Screenshot 2017-10-12 18.01.25.png
@thekholm80 such dark
much wow
Kyle Holm
@thekholm80
Oct 12 2017 22:02
that looks really good
artbohr
@artbohr
Oct 12 2017 22:21
Guys, how to correctly render a Modal to pass information to edit my recipe? Can't figure the correct way to do it, watched a lot of things but still not sure on how to do it
https://codepen.io/artbohr/pen/GvXxwY?editors=0010
Petterandre
@Petterandre
Oct 12 2017 22:57
Well, its specifically the else statement on line 34, no matter what happens, it goes into it. https://codepen.io/ImNoroz/pen/YrNpmq?editors=1111
So regardless of what I do, Simon will never go into the state it is supposed to go into
Hmm. Perhaps I could move the call to simonDoes to the end of the function
Stephen James
@sjames1958gm
Oct 12 2017 23:10
@Petterandre I ran the code all the way to turn 20 and it gave me a win.
Petterandre
@Petterandre
Oct 12 2017 23:10
yeah, but it only asks for one at a time, and if you make an error, you just get to continue
Stephen James
@sjames1958gm
Oct 12 2017 23:12
SHouldn't simonDoes start at i = 0 ? if you want to play all the values?
Petterandre
@Petterandre
Oct 12 2017 23:13
i is at 0, it's comparing the values which are 1 -4
The current (one of many ;) ) issue is that the code refuses to re-simon the necessary sequence
Stephen James
@sjames1958gm
Oct 12 2017 23:16
@Petterandre You use i in simonDoes to go through your simonSeq array, but you never reset it to 0 to start from the start
It just moves along with turn and so you only ever play one sound/color
Petterandre
@Petterandre
Oct 12 2017 23:17
oh, the i should be reset to 0 every time its called!
Stephen James
@sjames1958gm
Oct 12 2017 23:17
Yes, At least that is one problem.
Petterandre
@Petterandre
Oct 12 2017 23:17
yeah, for sure, thanks :)
hm, that made it just stay at the first value in the array
a for loop should fix that
nope, infinite loop, haha
Petterandre
@Petterandre
Oct 12 2017 23:27
Oh well, Ill head to bed. Perhaps I find the issue tomorrow :)
artbohr
@artbohr
Oct 12 2017 23:34
@sjames1958gm hey, I looked at the portals stuff you suggested which works great with Modals, but I couldn't figure out where to create them in my case or how to load the modal correctly to pass it the data it needs to edit the recipes, in case you could help, I pass again the https://codepen.io/artbohr/pen/GvXxwY?editors=0010