These are chat archives for FreeCodeCamp/Help

15th
Sep 2017
Engjell Bislimi
@Engjell00
Sep 15 2017 00:12
@just1witness thank you!!
CamperBot
@camperbot
Sep 15 2017 00:12
engjell00 sends brownie points to @just1witness :sparkles: :thumbsup: :sparkles:
api offline
just1witness
@just1witness
Sep 15 2017 00:12
@Engjell00 No prob :)
Engjell Bislimi
@Engjell00
Sep 15 2017 00:13
@just1witness I got a last question. https://codepen.io/EngjellBislimi/pen/RLPWdp look at the content in the middle I would like remove the space between the top and bottom
just1witness
@just1witness
Sep 15 2017 00:14
k
I'm not sure what your referring to. Could you tell me the id's in question?
Engjell Bislimi
@Engjell00
Sep 15 2017 00:15
the container 2
the blue transparent
just1witness
@just1witness
Sep 15 2017 00:17
You want to remove a space? I see them overlapping
Engjell Bislimi
@Engjell00
Sep 15 2017 00:20
oh well that's because it is not responsive at all
just1witness
@just1witness
Sep 15 2017 00:31
You must be looking on a phone then, eh?
@Engjell00 Don't feel bad, I'm still trying to get a potato to center on one screen size...
piteto
@piteto
Sep 15 2017 00:36
potato? :)
@Engjell00 use min-height
.container1{
    background-color: white;
    padding: 0.5%;
    min-height: 700px; /* min-height instead of height */
    width: 100%;
    border: 3px solid red;
}
Engjell Bislimi
@Engjell00
Sep 15 2017 00:37
i have a 14inch laptop haha
piteto
@piteto
Sep 15 2017 00:37
Then you can add margin-bottom and margin-top to that for more space.
just1witness
@just1witness
Sep 15 2017 00:37
@piteto
potato
Engjell Bislimi
@Engjell00
Sep 15 2017 00:38
yeah i see it know when i put my resolution lower the texts are overlaping
just1witness
@just1witness
Sep 15 2017 00:39
@Engjell00 I have found this to be very helpful for making things responsive
Engjell Bislimi
@Engjell00
Sep 15 2017 00:40
@piteto the space between the container 2 doesnt change!
just1witness
@just1witness
Sep 15 2017 00:40
The link I gave above has ways to make specific sizes based on the screen size of the user
piteto
@piteto
Sep 15 2017 00:41
@Engjell00
.container2{
  background-color: rgba(102,178,255,0.4);
  margin-top: 200px;
  margin-bottom: 200px;
}
use margin-top, margin-bottom
Engjell Bislimi
@Engjell00
Sep 15 2017 00:41
@piteto for me the space is just going further I dont want any space!
@just1witness with that does it mean when I change my resolution I can fix what's not responsive?
just1witness
@just1witness
Sep 15 2017 00:44
yes, for instance, if you have a gap on one screen size, you can close it on just that screen size, and if there is an overlap on the other, you can separate it and it won't affect the sizing on the other screen size.
@Engjell00
I'll paste an example, I've used it before.
just a sec
Engjell Bislimi
@Engjell00
Sep 15 2017 00:45
so i dont need to change all of my elements just what's weird
just1witness
@just1witness
Sep 15 2017 00:46
@Engjell00
@media screen and (max-width: 568px) {
  .container {
    width: 300px;
  }
}
@media screen and (max-width: 992px) {
  .container {
    width: 300px;
  }
}
@media (min-width: 1200px) {
  .container {
    width: 600px;
  }
}
Yep, just what's weird
I only have width in the example, but you can change a bunch of stuff
Engjell Bislimi
@Engjell00
Sep 15 2017 00:48
@just1witness thanks! example for the text overlapping i only need to change the width?
CamperBot
@camperbot
Sep 15 2017 00:48
engjell00 sends brownie points to @just1witness :sparkles: :thumbsup: :sparkles:
api offline
just1witness
@just1witness
Sep 15 2017 00:49
I think the height
or you could add a tiny bit of padding around the container
piteto
@piteto
Sep 15 2017 00:51
@Engjell00 the space you are seeing is from your h2 element. Right-click -> inspect and view it in the debug tools
.Section h2 {
  margin-top: 0;
  font-size: 37px;
  letter-spacing: 2px;
}
That removes the space above it
Amit Patel
@AmitP88
Sep 15 2017 00:52
hey guys, is it possible to store x and y in canvas in variables? (not a specific x and y coordinate, but just in general) I'm trying to get my grid to where each cell has only 1 random image inside (my for loop is generating 64 random images in each cell). I've written a for loop to solve this, but in order for it to work, I need to store x and y canvas coordinates in their own variables. https://github.com/AmitP88/Knights-of-Camelot/tree/master/Knights%20of%20Camelot/js
piteto
@piteto
Sep 15 2017 00:52
use padding to push the h2 element down if desired
just1witness
@just1witness
Sep 15 2017 00:53
Is it possible, likely. Do I know how to do it, no. sorry @AmitP88
Engjell Bislimi
@Engjell00
Sep 15 2017 00:53
@just1witness @piteto fucking love you guys geez finally did it
Amit Patel
@AmitP88
Sep 15 2017 00:53
@just1witness oh ok, thanks anyways
CamperBot
@camperbot
Sep 15 2017 00:53
amitp88 sends brownie points to @just1witness :sparkles: :thumbsup: :sparkles:
:cookie: 349 | @just1witness |http://www.freecodecamp.com/just1witness
just1witness
@just1witness
Sep 15 2017 00:54
my pleasure :)
Joseph
@revisualize
Sep 15 2017 01:28
Hey.
MrWang
@IceFireSages
Sep 15 2017 01:35
Cloud9 has no other website to replace it ,The account is not registered
Eric Miller
@ericmiller777
Sep 15 2017 01:42
cant decide
for tic tac toe to just make buttons
or to use canvas to make it fancy
or just get it done quick and learn to do it in react
just1witness
@just1witness
Sep 15 2017 01:53
I went fancy with the pomodoro timer and am regrettttttiiiiinnnnnggggg it!
lol
theres mine
Albert Cardona II
@daddycardona
Sep 15 2017 02:52
not even close to getting there @eric and good evening all you fine folks on fcc help gitter chat :)
just1witness
@just1witness
Sep 15 2017 03:51
@ericmiller777 Very nice! Although, I think you have to start the clock at 25 min as a default for work time on page load. I recall that being one of the user stories. But it's late and I'm tired so, I could be wrong. If I had gone sleek and simple like that I might even be done with tick tac toe by now, lol.
Darren
@DarrenfJ
Sep 15 2017 04:27
evening fCC
@daddycardona evening back atcha
Manish Giri
@Manish-Giri
Sep 15 2017 04:44
@DarrenfJ :wave:
Darren
@DarrenfJ
Sep 15 2017 04:48
hey buddy :D
what's up?
Manish Giri
@Manish-Giri
Sep 15 2017 04:50
:snake:
python
Darren
@DarrenfJ
Sep 15 2017 04:52
cooool
i'm still checking out Ruby but took a side detour back into Sass.. the codecademy course on it
Manish Giri
@Manish-Giri
Sep 15 2017 04:53
lemme show you something
Kyle Holm
@thekholm80
Sep 15 2017 04:54
@DarrenfJ :wave:
Darren
@DarrenfJ
Sep 15 2017 04:54
hey buddy! :D
Manish Giri
@Manish-Giri
Sep 15 2017 04:55
@DarrenfJ here
it's for this kata
coming on 500 lines, still not done, lol
Darren
@DarrenfJ
Sep 15 2017 04:57
jeebus!
Manish Giri
@Manish-Giri
Sep 15 2017 05:00
how that is ranked at 5 kyu, instead of 2 or 3, is beyond me
:unamused:
Darren
@DarrenfJ
Sep 15 2017 05:03
i was gonna say.. ranked wrong for sure
i mean just the write-up itself is 4th kyu
the solution 2nd :D
Manish Giri
@Manish-Giri
Sep 15 2017 05:03
lol yea
Darren
@DarrenfJ
Sep 15 2017 05:03
honestly that's the longest write up I've seen
there was 1 a 7 that i still don;t even know what they're asking.. lemme find it
Manish Giri
@Manish-Giri
Sep 15 2017 05:07
yea some of those descriptions are ....
i haven't checked it out any more but i'm like whaaaa???
Task:

Return undefined with no more than 10 characters.

Digits and letters are not allowed!
Manish Giri
@Manish-Giri
Sep 15 2017 05:09
oh man some of those golfs are fked up
other day I saw one which said reverse an array in 14 characters, without .reverse()
Darren
@DarrenfJ
Sep 15 2017 05:12
oh yah i'm just looking at that one now
lol!
the only think i can think of is maybe there's some other language lower level and more data or character manipluating that does it?
shrug
Kyle Holm
@thekholm80
Sep 15 2017 05:14
bleh 13 chars
Manish Giri
@Manish-Giri
Sep 15 2017 05:15
x=()=>void 0 wont work either
Kyle Holm
@thekholm80
Sep 15 2017 05:22
Time: 308ms Passed: 4 Failed: 1 Errors: 1
Test Results:
Checking for undefined
Test Passed: Value == undefined
Completed in 5ms
Checking for modification of x
Test Passed: Value == true
Test Passed: Value == true
Completed in 1ms
Checking for codelength and characters which should not be included in x
You code contains forbidden characters! - Expected: false, instead got: true
Test Passed: Value == true
:shrug:
oh, duh i got it lol
Darren
@DarrenfJ
Sep 15 2017 05:24
good work buddy
Kyle Holm
@thekholm80
Sep 15 2017 05:24
@DarrenfJ thanks, that was a fun one
CamperBot
@camperbot
Sep 15 2017 05:24
thekholm80 sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2024 | @darrenfj |http://www.freecodecamp.com/darrenfj
Darren
@DarrenfJ
Sep 15 2017 05:24
i cannot really fathom how to start it tbh
Kyle Holm
@thekholm80
Sep 15 2017 05:24
i like the golf code
Darren
@DarrenfJ
Sep 15 2017 05:24
brownies for oyu too!
thanks @thekholm80
CamperBot
@camperbot
Sep 15 2017 05:24
darrenfj sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1467 | @thekholm80 |http://www.freecodecamp.com/thekholm80
Darren
@DarrenfJ
Sep 15 2017 05:24
and for manish for starting me off on codewars :D
thanks @Manish-Giri
CamperBot
@camperbot
Sep 15 2017 05:25
darrenfj sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 6538 | @manish-giri |http://www.freecodecamp.com/manish-giri
Kyle Holm
@thekholm80
Sep 15 2017 05:25
manish is the kata master
Darren
@DarrenfJ
Sep 15 2017 05:25
@thekholm80 what's yer id. wanna follw yah
Kyle Holm
@thekholm80
Sep 15 2017 05:25
thekholm80
Manish Giri
@Manish-Giri
Sep 15 2017 05:25
manish is the kata master
lol
no
scout is
@thekholm80 @DarrenfJ ty
CamperBot
@camperbot
Sep 15 2017 05:26
manish-giri sends brownie points to @thekholm80 and @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2025 | @darrenfj |http://www.freecodecamp.com/darrenfj
:star2: 1468 | @thekholm80 |http://www.freecodecamp.com/thekholm80
Kyle Holm
@thekholm80
Sep 15 2017 05:26
@Manish-Giri ty
CamperBot
@camperbot
Sep 15 2017 05:26
thekholm80 sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 6539 | @manish-giri |http://www.freecodecamp.com/manish-giri
Kyle Holm
@thekholm80
Sep 15 2017 05:26
I'm off to bed, g'night folks
Manish Giri
@Manish-Giri
Sep 15 2017 05:28
:wave:
Darren
@DarrenfJ
Sep 15 2017 05:28
@thekholm80 night buddy
happy kata'ing
and puppies are licking my toes for time for their last night walk
Liam Docherty
@ldocherty1
Sep 15 2017 06:08
When a user clicks on my button I want them to be able to download a docx file. However, when I click on the button something happens. What is wrong with my code? <a class="btn btn-default btn-xl js-scroll-trigger" href="../cv/cv.docx">Click To Download My CV</a>
Coy Sanders
@coymeetsworld
Sep 15 2017 06:21

However, when I click on the button something happens.

clarify?

Manish Giri
@Manish-Giri
Sep 15 2017 06:48
@coymeetsworld have you used any Java 8?
Coy Sanders
@coymeetsworld
Sep 15 2017 06:48
no not really @Manish-Giri
i wrote some code in 1.8 but nothing I think specific from that version
Manish Giri
@Manish-Giri
Sep 15 2017 06:50
okay
I've been trying to use some of 8 specific features recently
Georgia
@georgiawang5332
Sep 15 2017 09:04
@sjames1958gm THX :smile:
CamperBot
@camperbot
Sep 15 2017 09:04
georgiawang5332 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8464 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Will Rodgers
@daddyrodgers
Sep 15 2017 09:45
I am about to start back with code camp. Is there anything anyone can tell me to help out
Stephen James
@sjames1958gm
Sep 15 2017 09:47
@daddyrodgers Jump in and start working. If you get stuck come here for specific questions.
Make sure you carefully read the instructions, translating instructions to code is a skill to be developed
heroiczero
@heroiczero
Sep 15 2017 10:06
@daddyrodgers Just Start :) Nothing much to it :sparkles:
Yura
@yura1044
Sep 15 2017 10:24
hello, need some help please with "random quote machine" challenge, is it possible to share a quote to facebook from codepen.io like it is with twitter? i tried all kind of stuff like facebook URL Redirection, and also fb.ui through JS SDK, but none seems to work for me
Yura
@yura1044
Sep 15 2017 10:28
thank you :)
Yura
@yura1044
Sep 15 2017 11:13
it didn't really worked out for me with facebook so i'll just go with the flow of the challenge instructions and set it for twitter and tumbler. even that quote plugin, has no option on configuring it to work the way i want (or i just don't have enough knowledge on deeper level programming..) - which is really getting the quote and sharing it as a text, i guess facebook really not meant to work same as twitter etc.., thanks and good day everyone !
Ellyria
@Ellyria
Sep 15 2017 13:07
Any time, @DarrenfJ. I loved it.
Gil Alexandel
@gilalexandel
Sep 15 2017 13:47

@gilalexandel
Greetings!

I'm trying to implement an autocomplete on my Wikipedia Viewer. I've successfully connected the WikiAPI with an input element and when i start to type the options from the api start to appear as options of a datalist htlm element... My issue here is that now i want to link those options with the url so, i'll be able to redirect to the Wikipedia article.
https://codepen.io/gilalexandel/pen/WZepmo?editors=0010

Stephen James
@sjames1958gm
Sep 15 2017 14:22
@gilalexandel You probably need to check if the enter key was pressed, then you call a different function that acts on the contents of the input box
Darren
@DarrenfJ
Sep 15 2017 14:56
morning fCC
Michael Oliver
@Michael3353
Sep 15 2017 14:57
morning
Dylan
@dhcodes
Sep 15 2017 15:26
morning @DarrenfJ
Stephen James
@sjames1958gm
Sep 15 2017 15:41
Hello All
Dylan
@dhcodes
Sep 15 2017 15:45
:wave: @sjames1958gm
Stephen
@TeddyHugs
Sep 15 2017 15:48
Morning all! :clap:
Nahuel Ovejero
@NahuelOvejero
Sep 15 2017 16:11
:wave: people
David D Crosby
@davidc4991vvc
Sep 15 2017 16:34
help please :Type two statements. The first reads user input into person_name. The second reads user input into person_age. Below is a sample output for the given program if the user's input is: Amy 4
In 5 years Amy will be 9
Nahuel Ovejero
@NahuelOvejero
Sep 15 2017 16:39
@davidc4991vvc what language?
guess is something like that.
writeLine("Insert name");
string name = readline();
writeLine("Insert age");
int age = readline();
writeLine( name + " Will be " + (age +1) + "Next year");
quickspeedy
@quickspeedy
Sep 15 2017 17:24

Can anybody explain how this code works?

function factorialize(num) {
  if(num < 1) {
    return (num = 1);
  }
  console.log("Result: " + num * factorialize(num - 1));
  return num * factorialize(num - 1);
}
factorialize(5);

For instance, return num * factorialize(num - 1); so if 5 is the number we want to factorialize, then 5 4 = 20, 20 3 = 60 and so on. My question is where does it save 20 and 60 to?

Nahuel Ovejero
@NahuelOvejero
Sep 15 2017 17:31
ah, recursion. ...
well, if you do
console.log(5*4);
where the value saves?
@quickspeedy
quickspeedy
@quickspeedy
Sep 15 2017 17:35
@NahuelOvejero I don't think it saves since there is no var to it.
Nahuel Ovejero
@NahuelOvejero
Sep 15 2017 17:35
@quickspeedy exactly.
well, the 20 and 60 doesn't save up
it's like you are doing 54321
5 * 4 *3*2*1
quickspeedy
@quickspeedy
Sep 15 2017 17:36
@NahuelOvejero So it does it at once in the same function?
Nahuel Ovejero
@NahuelOvejero
Sep 15 2017 17:37
not exactly, is like
5 * recursion(4)
and recursion(4) have its own
4*recursion(3)
so it resolves every case until recursion hit the if with a return (the if(num<1))
after that, the last recursion(1) just got a value
and all recursion function get remplace by that value
So it's becomes ```5 4 321 ````
quickspeedy
@quickspeedy
Sep 15 2017 17:41
@NahuelOvejero Ok I think I understand better, one more thing, factorialize(5) is called once, correct?
Nahuel Ovejero
@NahuelOvejero
Sep 15 2017 17:42
Indeed, just once. then factorialize(5-1), then 4-1, and so on
until 1
quickspeedy
@quickspeedy
Sep 15 2017 17:43
Ok, makes sense. Thanks! I really appreciate it! @NahuelOvejero
CamperBot
@camperbot
Sep 15 2017 17:43
quickspeedy sends brownie points to @nahuelovejero :sparkles: :thumbsup: :sparkles:
:cookie: 799 | @nahuelovejero |http://www.freecodecamp.com/nahuelovejero
Nahuel Ovejero
@NahuelOvejero
Sep 15 2017 17:45
recursion should always include a "base case" , a condition where it stop and is not called itself
can you imagine where is the base case for that excercise?
quickspeedy
@quickspeedy
Sep 15 2017 17:47
@NahuelOvejero Should the base case be placed before the recursion?
Nahuel Ovejero
@NahuelOvejero
Sep 15 2017 17:48
depends on hoy your code is, but usually , yes, it is a if at the top of the funcion
quickspeedy
@quickspeedy
Sep 15 2017 17:49
Ok, if(num < 1) is considered a base case for this scenario?
Nahuel Ovejero
@NahuelOvejero
Sep 15 2017 17:50
exactly
quickspeedy
@quickspeedy
Sep 15 2017 17:51
Got it, otherwise it would go into an infinity loop right?
Nahuel Ovejero
@NahuelOvejero
Sep 15 2017 17:51
indeed, and infinite recursions doesn't end well :P
also, it ends at 1 , because at 0 it will be 0 * anything = 0 and screw up everything :P
quickspeedy
@quickspeedy
Sep 15 2017 17:52
Agreed, I tested it without a base case and it crashed my browser.
Nahuel Ovejero
@NahuelOvejero
Sep 15 2017 18:04
its like you are mulitiplying every number
quickspeedy
@quickspeedy
Sep 15 2017 18:05
Yeah and it never stopped.
Gil Alexandel
@gilalexandel
Sep 15 2017 18:08
@sjames1958gm let me check try that, thanks.
CamperBot
@camperbot
Sep 15 2017 18:08
gilalexandel sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8465 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
knight2
@knight2
Sep 15 2017 18:20
why does including https://gitcdn.link/repo/freeCodeCamp/testable-projects-fcc/master/build/bundle.js on codepen result in console logging 'mocha not loaded yet'?
Joshua Arnett
@josha5
Sep 15 2017 18:52
Can anyone lend a hand with a bug in my pomodoro timer project?
My timer is counting down correctly all I'm trying to do now is have an add session button that when clicked adds a minute to the pomodoro timer. When the increment button is clicked it goes up by one minute correctly but when you start the timer 59 seconds are added to the time
Joshua Arnett
@josha5
Sep 15 2017 19:00
Nevermind I figured it out lol
Augustas
@AugustasV
Sep 15 2017 19:41

https://www.freecodecamp.org/challenges/stand-in-line

item=arr.push(6);
  item=arr.shift(0);

Push is working, but whats wrong with shift? I dont want to see spoiler.

Anuj Mishra
@Jun03
Sep 15 2017 19:44
Can anyone help me with my Simon game project , two of the buttons are clickable but other two are not , though i think its because of z-index but i can't get it right even though i tried ., here's my codepen link , https://codepen.io/jun03/full/pWzdjq
Jake
@JakeDVirus
Sep 15 2017 19:46

in my twitch.tv project i made a ajax call and there seems to be a sligth delay in appending the retrieved element after the loading animation gets removed. the delay is slight but quite enough to make it feel weird. the snippet for this context is below.

    $.ajax({
       //code block
    }).done(function(){
        $("#loader-block").addClass("display-none");
        $(".wrapper_streamers-blocks").removeClass("hidden");
    });

https://codepen.io/neel111/pen/yzNxVw
how can i make this trasition between removing of the loading animation and appending of the element at the same time.

piteto
@piteto
Sep 15 2017 19:48
@AugustasV
// The push() method adds one or more elements to the end 
// of an array and returns the new length of the array.
var arr=[40,50,60];
var item = arr.push(6);  // item = 4 and arr = [40,50,60,6];

// The shift() method removes the first element 
// from an array and returns that element. 
var arr=[40,50,60];
var item = arr.shift(); // item = 40 and arr = [50,60];
.shift() shouldn't have a number inside the parentheses
Augustas
@AugustasV
Sep 15 2017 19:52
@piteto yes, but still not working
piteto
@piteto
Sep 15 2017 19:53
@AugustasV can you show your updated code?
Augustas
@AugustasV
Sep 15 2017 19:54
function nextInLine(arr, item) {
  // Your code here
   item=arr.push(8);
  item=arr.shift();
  return item;  // Change this line
}

// Test Setup
var testArr = [1,2,3,4,5];

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));
oh change this line. Return item?
piteto
@piteto
Sep 15 2017 19:55
@AugustasV The issue is with the 8
There are several test cases and they all use different numbers
you are using arr correctly, which is passed into the function. You also need to use the value represented by item that gets passed into the function
piteto
@piteto
Sep 15 2017 20:01
@NeelDVirus Put a console.log at the end of each of your success function and at the end of your .done() function. You will see it is not the last piece of code that runs in your javascript.
This is the last chunk of code that runs:
                    success: function(returnedData2){
                        var cloneRetrieved = cloningAndUpdating(returnedData2, usernamesList[i]);
                        cloneList.unshift(cloneRetrieved);
                        if (i == usernamesList.length -1) {
                            putFCCTop(cloneList);
                            $(".wrapper_streamers-blocks").append(cloneList);
                        }    
                   },
To fix it, move your hide/display code into that if statement:
                        if (i == usernamesList.length -1) {
                            putFCCTop(cloneList);
                            $(".wrapper_streamers-blocks").append(cloneList);
                            $("#loader-block").addClass("display-none");
                            $(".wrapper_streamers-blocks").removeClass("hidden");                          
                        }
(and by the way, jQuery has handy .hide() and .show() methods - no need to modify css)
Augustas
@AugustasV
Sep 15 2017 20:06
@piteto one test case still fails. I dont get the point

function nextInLine(arr, item) {
  // Your code here
   item=arr.push(10);
  item=arr.shift();
  return item;  // Change this line
}

// Test Setup
var testArr = [1,2,3,4,5,1];

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 10)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));
Tiago Correia
@tiagocorreiaalmeida
Sep 15 2017 20:06
so... anyone here has some design knowledge ?:D
Jake
@JakeDVirus
Sep 15 2017 20:07
@piteto yeah i know. it's the fact that after success is completed(letting the appending in process) then .done() method is executed but the appending process in the success block took more time than the time in whole execution of success and done. This is the logic i am being able to comprehend. is there anything i am missing or having some wrong conception?
oops going to check out the code you suggested
piteto
@piteto
Sep 15 2017 20:08
@AugustasV Right, this test case should be failing: nextInLine([], 1) should return 1
your code adds a 10 to the end of the array and then removes the first item. With an empty array, you're adding 10 and then removing 10.
Here's another hint:
function myFunction(arr, item) {
  console.log(arr); // []
  console.log(item); // 1
}

myFunction([], 1)
Jake
@JakeDVirus
Sep 15 2017 20:10
@piteto Oh fish!! it worked man!! but i am surprised why was going under the hood that i worked in this way but not in the way previously if the appending was not an issue. can you help me understand the logic in bried. i am blunt here
Thanks seriously
piteto
@piteto
Sep 15 2017 20:11
@NeelDVirus Your success and .done() function runs once for every user
you're hiding the loading and showing the users before you process the final user
Jake
@JakeDVirus
Sep 15 2017 20:15
@piteto what i see is that success runs once for every user but .done() runs only once and in the last place.
success(where the if statemet mentioned above resides) is in the 2nd-level nested ajax call which inside the loop , and .done() is the method of 1st-level ajax call(inside which the loop and 2nd-level nested ajax resides)
piteto
@piteto
Sep 15 2017 20:17
@NeelDVirus Ajax is asynchronous though - so even if you make one ajax call that then runs a for loop to call multiple ajax calls - it won't know when that for loop completes
the .done() for that first ajax call runs when the network response comes back (and while the second ajax call is still processing)
Jake
@JakeDVirus
Sep 15 2017 20:20
@piteto oh o o o.. i am getting your point.. trying to understand the implicit logics and plot. need a minute or two to digest and understand this plot
piteto
@piteto
Sep 15 2017 20:21
@NeelDVirus Maybe this helps explain:
$.ajax({
  url: url,
  success: function() {
    $.ajax({
      url: url2,
      success: function() {
        // this code comes back last
      }
    })
  }
}).done(function() {
  // this code runs when the first ajax call is done, not the second one.
});
(Assuming it takes the same amount of time to get url, and url2)
Jake
@JakeDVirus
Sep 15 2017 20:22
@piteto Oh i got it!! thank you so so much... you made me understand directly to the point. Thank you so much! i really wana thank you a lot this time :D :D
CamperBot
@camperbot
Sep 15 2017 20:22
neeldvirus sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
:cookie: 109 | @piteto |http://www.freecodecamp.com/piteto
piteto
@piteto
Sep 15 2017 20:23
Glad that helped :)
Jake
@JakeDVirus
Sep 15 2017 20:25
@piteto seriously you had no idea how much relieved and happy i am feeling now. i wasted two hours scratching my head and researching about this :D
piteto
@piteto
Sep 15 2017 20:26
.done() is kind of misleading! I think that's a jQuery thing. .then() is more common
but maybe wouldn't have helped explain it any better
Jake
@JakeDVirus
Sep 15 2017 20:31
@piteto OOps .then() haven't came across my eyes yet
i will check about it though
Augustas
@AugustasV
Sep 15 2017 20:50
@piteto i stuck at this task 3 time :/ still not completed
Darren
@DarrenfJ
Sep 15 2017 20:53
bah!
testing's making me crazy
Manish Giri
@Manish-Giri
Sep 15 2017 20:54
@DarrenfJ solve a 1 kyu kata, to feel better
:smiling_imp:
Darren
@DarrenfJ
Sep 15 2017 20:54
afternoon to everyone i missed when i snuck off totest... @Michael3353 @sjames1958gm @dhcodes @NahuelOvejero
@Manish-Giri ha!
i'm working a 4 over when i take breaks :D
Manish Giri
@Manish-Giri
Sep 15 2017 20:55
cool
piteto
@piteto
Sep 15 2017 20:55
@AugustasV I'm not sure how else to help without giving the answer. The only thing you need to fix is the 10 in your code
Augustas
@AugustasV
Sep 15 2017 21:00
function nextInLine(arr, item) {
  // Your code here
   item=arr.push(1);
  item=arr.shift();
  return item;  // Change this line
}

// Test Setup
var testArr = [10, 10, 10, 10];

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 10)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));
now only last case is failing. I dont neet to edit console.log more?
Darren
@DarrenfJ
Sep 15 2017 21:02
@Manish-Giri almost got it but it's a horrible mess.. story of my day
note to self; will refactor later
Manish Giri
@Manish-Giri
Sep 15 2017 21:03
@DarrenfJ wow that looks complex
Augustas
@AugustasV
Sep 15 2017 21:04
@piteto thanks! I just needed to change number to name
function nextInLine(arr, item) {
  // Your code here
   item=arr.push(item);
  item=arr.shift();
  return item;  // Change this line
}

// Test Setup
var testArr = [10, 10, 10, 10];

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 10)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));
CamperBot
@camperbot
Sep 15 2017 21:04
augustasv sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
:cookie: 111 | @piteto |http://www.freecodecamp.com/piteto
duvidel
@duvidel
Sep 15 2017 21:05
Hi. I am not sure if I would be able to get help here or in the main FCC group for some of my issues. I am on the private portfolio assignment on CodePen. I found a site with 18 social media buttons but it shares them as a list without the actual pictures of the buttons like Facebook or Linkedin. Does anyone have a better link or document on how to create them? Thanks!
Darren
@DarrenfJ
Sep 15 2017 21:08
@Manish-Giri yah and the instructions fail to mention years and days so I have to 2 more sections.. that'll be my coding tonight ;)
Manish Giri
@Manish-Giri
Sep 15 2017 21:09
lol
nice
Darren
@DarrenfJ
Sep 15 2017 21:09
@duvidel it's really about how you are trying to use them.. have you thought about using font awesome icons?
duvidel
@duvidel
Sep 15 2017 21:09
Yeah, but I am a complete noob.
Liam Docherty
@ldocherty1
Sep 15 2017 21:10
Hi, I am building a florist company an e-commerce website. However, I have no experience with the payment aspect side of things. What I mean by the 'payment aspect' is the process involved in order for the customer to pay for the item which is being sold. Anyone have any tips on where to start?
duvidel
@duvidel
Sep 15 2017 21:13
I want the contact form and an FB and LinkedIn icon. I don’t even use Twitter, Reddit, etc. because I simply don’t have the desire. It would be nice to get a grip on their use and maybe drop the code on my budget Wordpress blog too.
Darren
@DarrenfJ
Sep 15 2017 21:17
@duvidel you probably need to do something similar to the exercises where you used the paper airplane and thumbs up icons on the cat app.. basically create a button as normal, and insert the icon... 'as if' it was just additional text..
DarrenfJ @DarrenfJ sneaking off to test some more
duvidel
@duvidel
Sep 15 2017 21:19
Thanks, Darren! Will Font Awesome icons tell me what to put in CSS and JQuery as needed?
Darren
@DarrenfJ
Sep 15 2017 21:20
yah more or less.... they'll give oyu the CSS
duvidel
@duvidel
Sep 15 2017 21:20
Great!
Darren
@DarrenfJ
Sep 15 2017 21:20
the JQuery wold be what you would normally dowith a button
for linking to a page though it's easier you don;t really need JQuery
it's just alink inside the button code
lemme find yah some demos
@duvidel play around with this if yer not using Bootstrap or something to make your buttons
duvidel
@duvidel
Sep 15 2017 21:22
Wow! Thanks! It is not as much inability but slow comprehension and ability to infer from one example to another with limited practice.
duvidel
@duvidel
Sep 15 2017 21:25
I have bootstrap3 in CodePen. For my later Navbar, there was some code from a bootstrap link. I don’t know if it belongs in the header settings of CodePen, but I dropped it in the html column.
Darren
@DarrenfJ
Sep 15 2017 21:28
@duvidel i gotta split for a but but that should get you started...
duvidel
@duvidel
Sep 15 2017 21:29
Thanks again!
Manish Giri
@Manish-Giri
Sep 15 2017 21:37
@DarrenfJ ty
CamperBot
@camperbot
Sep 15 2017 21:37
manish-giri sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2026 | @darrenfj |http://www.freecodecamp.com/darrenfj
duvidel
@duvidel
Sep 15 2017 21:39
@darrenfj thanks!
CamperBot
@camperbot
Sep 15 2017 21:39
duvidel sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2027 | @darrenfj |http://www.freecodecamp.com/darrenfj
Kyle Holm
@thekholm80
Sep 15 2017 21:43
@DarrenfJ @Manish-Giri thanks
CamperBot
@camperbot
Sep 15 2017 21:43
thekholm80 sends brownie points to @darrenfj and @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 2028 | @darrenfj |http://www.freecodecamp.com/darrenfj
:star2: 6541 | @manish-giri |http://www.freecodecamp.com/manish-giri
Manish Giri
@Manish-Giri
Sep 15 2017 22:05
@thekholm80 ty
CamperBot
@camperbot
Sep 15 2017 22:05
manish-giri sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1469 | @thekholm80 |http://www.freecodecamp.com/thekholm80
Tiago Correia
@tiagocorreiaalmeida
Sep 15 2017 22:34
image.png
how can I avoid this kind of things on css?
Tiago Correia
@tiagocorreiaalmeida
Sep 15 2017 22:57
solved