These are chat archives for FreeCodeCamp/HelpFrontEnd

4th
Jun 2016
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 00:02
Hello Guys, I need help with something on my portfolio
basically im trying to make the "Home" Contact and About buttons scroll to the corresponding text
Xavier Velez
@JonSnow08
Jun 04 2016 00:06
@mutantspore thank you!
CamperBot
@camperbot
Jun 04 2016 00:06
:warning: jonsnow08 already gave mutantspore points
jonsnow08 sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
Jonathan Carroll
@gkcodeman
Jun 04 2016 00:09
@emmanuelledebarge use
It may help ya out
Kevin
@iKervin
Jun 04 2016 00:13
@emmanuelledebarge Use sections
Bruce Young
@mutantspore
Jun 04 2016 00:14
@freekngdom success yet?
Jonathan Carroll
@gkcodeman
Jun 04 2016 00:20
You honestly could do it without scrolling though. Just set up your sections of your portfolio and give each one a unique id using # then in your nav links set the hrefs paths to those links for example #about
@emmanuelledebarge when you click on the links it should immediately pull you straight to the id of the one you clicked
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 00:26
@iKervin @gkcodeman thanks i figured it out
CamperBot
@camperbot
Jun 04 2016 00:26
emmanuelledebarge sends brownie points to @ikervin and @gkcodeman :sparkles: :thumbsup: :sparkles:
:cookie: 125 | @ikervin |http://www.freecodecamp.com/ikervin
:cookie: 133 | @gkcodeman |http://www.freecodecamp.com/gkcodeman
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 00:26
@gkcodeman and thanks
CamperBot
@camperbot
Jun 04 2016 00:26
emmanuelledebarge sends brownie points to @gkcodeman :sparkles: :thumbsup: :sparkles:
:warning: emmanuelledebarge already gave gkcodeman points
Jonathan Carroll
@gkcodeman
Jun 04 2016 00:27
@emmanuelledebarge glad you got it
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 00:40
https://codepen.io/manmanthegr8/pen/BzyXee im trying to make my Project Page bigger so I can add thumbnails
but only the project pag
e
Kevin
@iKervin
Jun 04 2016 00:41
What do you mean?
@emmanuelledebarge
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 00:42
@iKervin Basically im trying to add in thumbnail links for my projects
@iKervin but my page is too small so when i try to add them it gets stuck
@iKervin and it sticks with the pictures at the bottom
@iKervin so i was wondering if i can make the page that has the projects bigger so I will be able to add thumbnails
Kevin
@iKervin
Jun 04 2016 00:45
@emmanuelledebarge I'm not exactly sure what you mean
Bruce Young
@mutantspore
Jun 04 2016 00:46
@gkcodeman just keep adding them .. they’ll wrap
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 00:48
@mutantspore I have...
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 00:50
@mutantspore I meant on the Projects page
Bruce Young
@mutantspore
Jun 04 2016 00:51
you want more cats?
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 00:52
@mutantspore theres a page i have that says projects
@mutantspore I want to add thumbnails of actual projects there
Bruce Young
@mutantspore
Jun 04 2016 00:52
i just added them to whre you already had 3
@emmanuelledebarge you need to make it a div as you hav ethe otehr sections
Greg Duncan
@GregatGit
Jun 04 2016 00:55
@mutantspore "you want more cats?" - it made me laugh!
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 00:55
YES!!!! @mutantspore THANKS!
CamperBot
@camperbot
Jun 04 2016 00:55
emmanuelledebarge sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star2: 1704 | @mutantspore |http://www.freecodecamp.com/mutantspore
Bruce Young
@mutantspore
Jun 04 2016 00:55
well .. made it easier to talk about lol… and I have to amuse myself a bit :)
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 00:56
@GregatGit i was laughin to lol
Greg Duncan
@GregatGit
Jun 04 2016 00:56
@emmanuelledebarge Have a look at the w3school template http://www.w3schools.com/bootstrap/bootstrap_scrollspy.asp
@emmanuelledebarge Also in codepen add your libraries in the settings - not the html - that will get your bootstrap working better
Kreijstal
@Kreijstal
Jun 04 2016 01:02
for intermediate Front End must you simply do the challenges, stylistically
Bruce Young
@mutantspore
Jun 04 2016 01:02
generally functionally.. style is your play ground
hit the user stories with and eye on the video and demo
Kreijstal
@Kreijstal
Jun 04 2016 01:15
Ok, right.
Frank
@Frankbono
Jun 04 2016 02:07
Hi everyone! I have a question and I need some help with the responsive navigation bar that I'm working on with Bootstrap. I made my navigation bar with Bootstrap and now I'm trying to make the drop down menu for smaller screens. Here's my question. Do I need jQuery to do that or is it possible to just build a drop down menu with Bootstrap alone?
Jeff
@Jeffgl77
Jun 04 2016 02:08
need opinions, thoughts and constructive critisism. http://codepen.io/Jeffgl77/full/qZeRNm/
JD Tadlock
@jdtdesigns
Jun 04 2016 02:15
@Frankbono if you're using bootstrap's drop for mobile, you will need jquery and bootstrap js
Frank
@Frankbono
Jun 04 2016 02:15
@jdtdesigns Thanks for answering!
CamperBot
@camperbot
Jun 04 2016 02:15
frankbono sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 434 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
JD Tadlock
@jdtdesigns
Jun 04 2016 02:18
@Jeffgl77 I'd add some padding to your elements and increase the font size a little. The bottom stream is cut off. The slider is also causing the image to drop down. Cool concept though. ;)
@frank if you want a small challenge try making the mobile menu on your own with jquery and css
Frank
@Frankbono
Jun 04 2016 02:20
@jdtdesigns I doing that right now. I'm redoing the jQuery challenges again for a refresher
Dan Stockham
@DanStockham
Jun 04 2016 02:23
How do you align headings with your paragraph?
I seem to have my divs creeping to the left when the markdown renders.
Chris Cullen
@123xylem
Jun 04 2016 02:28

@123xylem

function pairElement(str) {
  var arr=str.split("");
  var AT=["A","T"];
  var TA=["T","A"];
  var CG=["C","G"];
  var GC=["G","C"];
  var newarr=[];
  for(i=0;i<arr.length;i++){
   if(arr[i]=== "G"){
    arr.push(GC)  ;


    }
    if(arr[i]=== "C"){
     arr.push(CG) ;


    }else if(arr[i]=== "A"){
      arr.splice(arr[i], 0, AT);


    }else if(arr[i]=== "T"){
      arr.splice(arr[i], 0, TA);

    }return arr;

  }

}

pairElement("GCG");

Do you know why this only works on the first if statement and ignores the rest?
The .splice and .push change was just me testing if it was something to do with that but it wasnt.

JD Tadlock
@jdtdesigns
Jun 04 2016 02:36
@123xylem you're returning inside the loop
so it only runs once
Juwdohr
@Juwdohr
Jun 04 2016 02:50
@jdtdesigns what was the address to that jsfiddle that you shared with me?
JD Tadlock
@jdtdesigns
Jun 04 2016 02:57
Chris Cullen
@123xylem
Jun 04 2016 03:00
@jdtdesigns ty but when i return outside it it says infinite loop
CamperBot
@camperbot
Jun 04 2016 03:00
123xylem sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 435 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
mohammed zerzouri
@mohammedzer88
Jun 04 2016 03:03
hi guys im trying to get the first project done building the tribute page but im not sure about the classes for bootstrap ! how can i find out what each class does so i can use the proper classes to style my tribute page !
Juwdohr
@Juwdohr
Jun 04 2016 03:03
@123xylem 2nd if is missing an else
@mohammedzer88 take a look at: http://getbootstrap.com/
JD Tadlock
@jdtdesigns
Jun 04 2016 03:04
@123xylem you're logic needs a little tweeking
looking at it right now, i can already see it won't work
your trying to push a value to the array that has values in it
this challenge is simply concatenating a letter on to each letter in the given value
don't try to overthink it lol
Chris Cullen
@123xylem
Jun 04 2016 03:13
@jdtdesigns i dont think its as simple as concatenating
they must be in sub arrays
Chris Cullen
@123xylem
Jun 04 2016 03:20
ion pairElement(str) {
  var arr=str.split("");
  var newarr=[];
  var AT=["A","T"];
  var TA=["T","A"];
  var CG=["C","G"];
  var GC=["G","C"];
  for(i=0;i<arr.length;i++){
    switch(arr[i])
      {
         case "A" :
            arr.push(AT); break;

         case 'T' :
          arr.push(TA);    break;

         case 'C' :
           arr.push(CG); break;

         case 'G' :
                arr.push(GC);  break;


      }
    arr.shift();

    }return arr;


}

pairElement("GCT");
THis should work but my .shift takes out the middle C case for some reason as opposed to the str data
Bruce Young
@mutantspore
Jun 04 2016 03:22
@123xylem I can PM you my solution if you are interested.
Chris Cullen
@123xylem
Jun 04 2016 03:23
@mutantspore appreciate but I need to work out how to do this
Bruce Young
@mutantspore
Jun 04 2016 03:24
ok then
Chris Cullen
@123xylem
Jun 04 2016 03:25
@jdtdesigns so do you have an idea how to help?
Ryan
@ispeakcomputer
Jun 04 2016 03:26
@Jeffgl77 i know its a little late but I'm digging your use of the framework. Cleanest I have seen in the last few weeks.
JD Tadlock
@jdtdesigns
Jun 04 2016 03:27
@123xylem
for(i=0;i<arr.length;i++){
    switch(arr[i])
      {
         case "A" :
            newarr.push(AT); break;

         case 'T' :
          newarr.push(TA);    break;

         case 'C' :
           newarr.push(CG); break;

         case 'G' :
                newarr.push(GC);  break;


      }
   }
   return newarr;
you created a newarr,
just need to use it lol
Chris Cullen
@123xylem
Jun 04 2016 03:28
ah because My arr has the str chars in it...
JD Tadlock
@jdtdesigns
Jun 04 2016 03:28
correct
Chris Cullen
@123xylem
Jun 04 2016 03:28
Out of curiousity why didnt my .shift move the first 3 chars? Or even the first case char?
it moved the middle case char for some weird reason
JD Tadlock
@jdtdesigns
Jun 04 2016 03:30
didn't look at that, but if you use shift() on new array, it works like it's supposed to
Bruce Young
@mutantspore
Jun 04 2016 03:30
@123xylem can i show mine now? can I ? can I? huh?
JD Tadlock
@jdtdesigns
Jun 04 2016 03:30
meaning shift works, not the answer lol
@mutantspore post away
Bruce Young
@mutantspore
Jun 04 2016 03:31
@jdtdesigns ooo but you’ll tear it to shreds lol
JD Tadlock
@jdtdesigns
Jun 04 2016 03:32
i'll post mine too :P
Bruce Young
@mutantspore
Jun 04 2016 03:32
function pairElement(str) {

  var pairs = [];
  var bp = {  
        'G': 'C',
        'C': 'G',
        'A': 'T',
        'T': 'A'
      };

  str.split('').map(function(base) {pairs.push([base, bp[base]]);});

 return pairs;

}

pairElement("GCG");
Chris Cullen
@123xylem
Jun 04 2016 03:32
@mutantspore mines the bestest
Justin Woodward
@jwoo92
Jun 04 2016 03:32
can anyone assist me with the algorithm challenge 'roman numeral converter'? i have been stuck on it for several days. this is what i have so far:

function convertToRoman(num) {
 var number = [1000, 500, 100, 50, 40, 10, 9, 5, 4, 1];
 var roman = ['M', 'D', 'C', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I'];
 var result = num.toString().split('');



  return result;
}

convertToRoman(36);
JD Tadlock
@jdtdesigns
Jun 04 2016 03:32
function pairElement(str) {
  return str.split('').map(function(val) {
    var a = val == 'G' ? 'C' : val == 'C' ? 'G' : val == 'A' ? 'T' : 'A';

    return Array.from(val + a);
  });
}
pairElement("ATCGA");
i win :P
Chris Cullen
@123xylem
Jun 04 2016 03:33
@jdtdesigns @mutantspore you guys dont know the elegance of laymans code
@jdtdesigns @mutantspore also thanks for helping :)
CamperBot
@camperbot
Jun 04 2016 03:34
:warning: 123xylem already gave jdtdesigns points
:star2: 1705 | @mutantspore |http://www.freecodecamp.com/mutantspore
123xylem sends brownie points to @jdtdesigns and @mutantspore :sparkles: :thumbsup: :sparkles:
JD Tadlock
@jdtdesigns
Jun 04 2016 03:36
@jwoo92 is that what you have after deleting the old code, or is that the extent of your logic so far?
Justin Woodward
@jwoo92
Jun 04 2016 03:37
@jdtdesigns logic so far. the starting code only includes opening function and return num.
JD Tadlock
@jdtdesigns
Jun 04 2016 03:38
@jwoo92 you can approach it many ways
i did the decimal place approach
get the ones, tens, hundreds, thousands place number and determine the correct letter based on the digits place
Justin Woodward
@jwoo92
Jun 04 2016 03:40
@jdtdesigns is there a .Math method for doing that? if so i will have to look into it. either way, i have never used any kind of method to apply towards decimal places.
@jdtdesigns i have been struggling to wrap my head around the correct logic on how to size each number to match its roman numeral equivalent.
JD Tadlock
@jdtdesigns
Jun 04 2016 03:48
@jwoo92 give me a few minutes and i can give you an example
Bruce Young
@mutantspore
Jun 04 2016 03:48
@jdtdesigns @jwoo92 now showing mine will be an embarrassment . it works .. I do go through teh places as JD suggests but the actuual conversion is ummm “imaginative” lol
Justin Woodward
@jwoo92
Jun 04 2016 03:50
@jdtdesigns @mutantspore i have heard this one is more difficult. i have looked at hints and such, but i have been avoiding looking at the spoiler code.
JD Tadlock
@jdtdesigns
Jun 04 2016 03:50
@jwoo92 sometimes looking at the spoiler code isn't bad
you need to get an understanding of the logic and ways to approach it
which the spoilers usually give you
i've glanced over them and then stepped away and thought about how they did it
then i would get an idea of my own
Justin Woodward
@jwoo92
Jun 04 2016 03:53
@jdtdesigns i felt if i were to look at it, that i let myself down. i have been able to complete all the algorithms so far without doing so, but this one is different in a way..
JD Tadlock
@jdtdesigns
Jun 04 2016 03:53
@jwoo92 to get the the last digit in the number just do this num % 10
then you can divide it by 10 and set it equal to that and just use % 10 again to get the next num
Math.floor(num / 10) will remove the last digit
that's a recursive way to approach it
the last number being the ones and so on to the left
Pawan
@pawan92
Jun 04 2016 03:57
is there a way to get a border around each of my stream names? http://codepen.io/pawan92/pen/MyMRwo?editors=1111
Justin Woodward
@jwoo92
Jun 04 2016 03:59
@jdtdesigns okay, i am taking it all into my mind. i never had to approach a situation in this manner before.
JD Tadlock
@jdtdesigns
Jun 04 2016 03:59
@pawan92 instead of placing all the responses inside one <li>, wrap each one in an <li> as you loop through
then you can just add a border to the li
Pawan
@pawan92
Jun 04 2016 04:07
@jdtdesigns hmm would i have to create an array of results for that?
Bruce Young
@mutantspore
Jun 04 2016 04:11
@pawan92 .append(‘<li>’ + channels[i] + ' offline' + ‘</li>’)
then style the li with a css class
Connor Hastey-Palindat
@cpalindat
Jun 04 2016 04:17
Would anyone be able to help me with my ajax calls in my wikipedia project? :)
Bruce Young
@mutantspore
Jun 04 2016 04:18
@ConnHurr trot it out
Connor Hastey-Palindat
@cpalindat
Jun 04 2016 04:18

Okay so I feel in over my head here haha. Here's my pen: http://codepen.io/cpalindat/pen/NrPyQg?editors=1010

First, i'm not sure if I set up my JS correctly like flow wise? Second, I'm not sure if I set up the ajax properly

@mutantspore oops, forgot to mention you haha :)
Bruce Young
@mutantspore
Jun 04 2016 04:21
@ConnHurr ok are you using the browser dev tools? can you see th eerror in console?
Connor Hastey-Palindat
@cpalindat
Jun 04 2016 04:21
oh no...I dont even know how to use that to be hones
I'm using chrome and OSX
Bruce Young
@mutantspore
Jun 04 2016 04:22
right click on teh web page and choose inspect.. it wil pop up to one side
@ConnHurr what is this ids: mw.config.get('wgWikibaseItemId’),
Connor Hastey-Palindat
@cpalindat
Jun 04 2016 04:24
I was looking through the wikipedia reference, and thats what they said to use... I'll try removing that
So I guess that fixes most of the problem? Should it be returning [object Object]?
Thieu van Dijk
@Thieuvandijk
Jun 04 2016 04:24
I'm stuck with challenge 306..... I can't figure out what is meant with the functioncall: addTogether(2)(3) it's not the same as addTogether(2,3). How must addTogether(2)(3) be interpreted? Can anybody give me a hint?
Bruce Young
@mutantspore
Jun 04 2016 04:25
@ConnHurr replace your alert with console.log(data); and you can see what it returns
Justin Woodward
@jwoo92
Jun 04 2016 04:26
@mutantspore i have a non related question that popped up in my mind after seeing that guy's wiki viewer. is there any benefit from using ajax over json? i know how to use json, but i have not learned and never used ajax before.
Bruce Young
@mutantspore
Jun 04 2016 04:27
ajax is a longer version of getjson. it can be more configurable
Connor Hastey-Palindat
@cpalindat
Jun 04 2016 04:28
@jwoo92 I haven't learned it either, but I saw it on SO and thought I should give it a try
@mutantspore Is my AJAX set up wrong? its still giving me an error...Is there a benefit to using it like this, or should I just use a .getJSON?
Justin Woodward
@jwoo92
Jun 04 2016 04:29
@jdtdesigns with your divide by 10 suggestion...would that mean i would not need to string out and split num, but rather would just access the number directly?
@ConnHurr that is a good idea, it is always great to explore the unknown :)
JD Tadlock
@jdtdesigns
Jun 04 2016 04:32
@jwoo92 recursion is pretty complex, so i would probably just stick to splitting it
it won't be too much more code
Justin Woodward
@jwoo92
Jun 04 2016 04:32
@mutantspore thanks bruce, i can see that may come in handy in a more complex situation.
CamperBot
@camperbot
Jun 04 2016 04:32
jwoo92 sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star2: 1706 | @mutantspore |http://www.freecodecamp.com/mutantspore
Connor Hastey-Palindat
@cpalindat
Jun 04 2016 04:32
@jwoo92 Exactly! You'll never improve if you don't go outside your comfort zone...also by doing this I have learned there are a bazillion ways to do things which all end up doing it the same
@mutantspore Thank you! That makes a lot more sense, I must've been following the wrong page on the API.
CamperBot
@camperbot
Jun 04 2016 04:32
connhurr sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star2: 1707 | @mutantspore |http://www.freecodecamp.com/mutantspore
Bruce Young
@mutantspore
Jun 04 2016 04:32
@ConnHurr you can see my fork of yours works?
Connor Hastey-Palindat
@cpalindat
Jun 04 2016 04:32
Yes...I was just looking through it
I had the wrong param under action
Bruce Young
@mutantspore
Jun 04 2016 04:34
@ConnHurr wel what you have done is sort of duplicated stuff. you should remove most of what is in teh url and use that data object to build it up
Connor Hastey-Palindat
@cpalindat
Jun 04 2016 04:34
@mutantspore So in the URL I would just need to have the search part right?
or can I add the search into ajax?
Bruce Young
@mutantspore
Jun 04 2016 04:35
@ConnHurr no not even that just have search: replaceURL(searchItems), in teh dat aobject
Justin Woodward
@jwoo92
Jun 04 2016 04:35
@jdtdesigns thanks for your help so far. recursion is a 'newer' word for me. i have seen it around and being used alot. i believe it means done in repetition, but i do not think i have fully grasped its full meaning in relation to javascript.
CamperBot
@camperbot
Jun 04 2016 04:35
jwoo92 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 436 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
Justin Woodward
@jwoo92
Jun 04 2016 04:37
@ConnHurr thats great! i will have to visit ajax soon to learn its capabilities.
Connor Hastey-Palindat
@cpalindat
Jun 04 2016 04:37
@mutantspore Wow, that makes it so much more straighforward and elegant!
@mutantspore Okay I think this is my last question: since everything comes from the search form, everything needs to be nested in the submit function right?
Bruce Young
@mutantspore
Jun 04 2016 04:38
@ConnHurr you can actually do something sililar with getJSON by using making a similar data object fo rit
@ConnHurr you can put it in anoteh function but yes it wil need to be called from in there
Connor Hastey-Palindat
@cpalindat
Jun 04 2016 04:39
@mutantspore So, you mean just construct the URL and then pass it into .getJSON?
Justin Woodward
@jwoo92
Jun 04 2016 04:39
@ConnHurr if you do not know bruce already, he is a very helpful guy. he has assisted me in many issues that i have delt with.
Bruce Young
@mutantspore
Jun 04 2016 04:40
@ConnHurr this is worth watching
@ConnHurr look at the getJSON page ..$.getJSON( url [, data ] [, success ] ) so you can construct a data object before you use it.
http://api.jquery.com/jquery.getjson/
@ConnHurr this is mine using getJSON
   var parameters = {
      search: q,
      action: "opensearch",
      list: "search",
      format: "json",
      limit: num
    };

    $.getJSON(URL_Wiki, parameters)
      .done(function(data, textStatus, jqXHR) {
Connor Hastey-Palindat
@cpalindat
Jun 04 2016 04:43

@jwoo92 yes so far he has been an amazing help!
@mutantspore I will give that a watch when my house quiets down haha.

I see what you're trying to do and that does make sense, but what does the .done part at the end do?

Bruce Young
@mutantspore
Jun 04 2016 04:45
a callback (promise) rather than just putting a function straight there ..
Connor Hastey-Palindat
@cpalindat
Jun 04 2016 04:45
oh...that makes sense
Bruce Young
@mutantspore
Jun 04 2016 04:47
@ConnHurr even in ajax the success thing you have is depreciated
Deprecation Notice: The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callbacks are deprecated as of jQuery 1.8. To prepare your code for their eventual removal, use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead.
Connor Hastey-Palindat
@cpalindat
Jun 04 2016 04:48
oh so I should replace "search" with "done"?
And also thank you for mentioning the dev tools...that makes it so much easier to see whats going on
Bruce Young
@mutantspore
Jun 04 2016 04:50
@ConnHurr no .. leave it how you have it for now. get the rest working :)
yes I often bludgeon my projects to death with console.log
Connor Hastey-Palindat
@cpalindat
Jun 04 2016 04:52
My next goal is to make the results appear in a dropdown with the names and descriptions under the search bar
I'm planning on using jquery UI
Bruce Young
@mutantspore
Jun 04 2016 04:55
@ConnHurr I just used the opensearch as you have but I also grabbed the thumbnail image that goes with the page. And my random link wasn’t just that special link but a random search returning one page that I display first so the user can decide if they want to look at it
Justin Woodward
@jwoo92
Jun 04 2016 04:57
@ConnHurr nice search icon to input box. here is my wikiviewer if you wanted any other ideas. mine is a simplistic style.
Connor Hastey-Palindat
@cpalindat
Jun 04 2016 04:58
@mutantspore @jwoo92 Thanks guys, those are both awesome suggestions and ideas! I'm gonna try to do a couple of those
CamperBot
@camperbot
Jun 04 2016 04:58
connhurr sends brownie points to @mutantspore and @jwoo92 :sparkles: :thumbsup: :sparkles:
:warning: connhurr already gave mutantspore points
:cookie: 338 | @jwoo92 |http://www.freecodecamp.com/jwoo92
Justin Woodward
@jwoo92
Jun 04 2016 05:01
@mutantspore i never considered making the random article a search option. that is a very good idea.
Chris Cullen
@123xylem
Jun 04 2016 05:17

@123xylem

function fearNotLetter(str) {
  var newArr=[];
  var string="";
  var compare=[];

var rangeLow= str.charCodeAt(0) ; //Define first letter
var rangeHi= str.charCodeAt(str.length-1); //And last of str via unicodes

  for(i=rangeLow;i<=rangeHi;i++){
   //go through the values
   newArr.push(i);
   //outputting the range into an array

   for(j=0;j<str.length;j++){
    compare.push(str.charCodeAt(j));
   }

 string= newArr.join(",");
   //output array to string
 string= (String.fromCharCode.apply(null, newArr)); 

 }
  return compare;
}

fearNotLetter("abce");

Why isnt my compare loop running
It gives 4* unicodes
ANd not just the 4 unicodes
Why does the J loop give results 4 times?

Justin Woodward
@jwoo92
Jun 04 2016 05:17
@mutantspore were you paying attention to the conversation between JD and I about dividing by 10 on 'roman numeral converter'? i understand how i can get the numbers correctly by doing that, but i do not see how my result variable can be applied as so since it is split into a string. without splitting it, it seems getting the correct number would be very easy by dividing by 10. ex: 239 / 10 = 23.9 (9), 2.39 (30), .239 (200); convert 200 + 30 + 9. my current code:

function convertToRoman(num) {
 var number = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];
 var roman = ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I'];
 var result = num.toString().split('');



  return result;
}

convertToRoman(36);
Frostyjayy
@Frostyjayy
Jun 04 2016 05:39
Hey guys can someone help me with creating an asynchronous database search?
livonian-router
@livonian-router
Jun 04 2016 05:42
guys, is this efficient?
function largestOfFour(arr) {
  // You can do this!
  var largest = [];

  for (var i = 0; i < arr.length; i++)
    {
      largest.push(0);
      for (var j = 0; j < arr[i].length; j++)
        {
          if (arr[i][j] > largest[i])
            {
              largest.pop();
              largest.push(arr[i][j]);
            }
        }
    }

  return largest;
}
Harshit Anand
@nerocool996
Jun 04 2016 05:46
For Wikipedia Viewer do I have to give the list of title to api myself or there's way to send search request to the api?
Justin Woodward
@jwoo92
Jun 04 2016 05:48
@nerocool996 are you using json?
Harshit Anand
@nerocool996
Jun 04 2016 05:48
yes
@jwoo92
Justin Woodward
@jwoo92
Jun 04 2016 05:51
@nerocool996 study the link for the wiki api. you want to put together a url consisting of the wiki api and the searchterm that is inputed into your input box.
@nerocool996 so it would be wikiAPIurlHere + searchTerm + your result limits and callback. it will be up to you on what you put exactly as the wiki api url, limit, and call back.
the 'searchTerm' should be linked with the input box value.
no 'list of titles' needed and honestly, that would be the incorrect way to format this project anyway.
@livonian-router still having trouble?
Harshit Anand
@nerocool996
Jun 04 2016 05:58
@jwoo92 Oh thanks, I get it now.
CamperBot
@camperbot
Jun 04 2016 05:58
nerocool996 sends brownie points to @jwoo92 :sparkles: :thumbsup: :sparkles:
:cookie: 339 | @jwoo92 |http://www.freecodecamp.com/jwoo92
Justin Woodward
@jwoo92
Jun 04 2016 05:59
@nerocool996 if you still have trouble figuring out how to format the wiki api, let me know.
Harshit Anand
@nerocool996
Jun 04 2016 06:02
@jwoo92 Actually I wasn't able to find the make search request to the api. After going through the wiki page, I found it. You just have to set list = search
Justin Woodward
@jwoo92
Jun 04 2016 06:07
@nerocool996 great, i just did not want to give away the answer to allow you to figure it out. for search values, i found that replacing the white spaces with the + symbol will be a good idea for your wiki Api request (ex. 'blue bird' --> 'blue+bird'). i can help you out if needed by showing you what my full url that i used to request the json data from the api consisted of.
Justin Woodward
@jwoo92
Jun 04 2016 06:29
has anyone in here completed the algorithm challenge 'roman numeral converter'?
Ryan
@ispeakcomputer
Jun 04 2016 06:41
@jwoo92 i have not sorry .
not there yet .
Justin Woodward
@jwoo92
Jun 04 2016 06:41
@needsMoreCoffee good luck when you get to it lol!
@needsMoreCoffee if you do not mind me asking, where are you currently in the course?
Ryan
@ispeakcomputer
Jun 04 2016 07:02
@jwoo92 I skipped the last two algorithms to work the random qoute
was losing focus I needed to build something.
Justin Woodward
@jwoo92
Jun 04 2016 07:05
@needsMoreCoffee really? did you skip due to the difficulty level of the last two?
Ryan
@ispeakcomputer
Jun 04 2016 07:09
i skipped because i was losing focus i have been doing javascript course 15min - 1hr every day skipping here and there for 5 months. It was time for me to build something .
between FFC and codecademy during the 5 month period .
ill go back and do it but i really needed a breather .
afterall I really wanna get in on the the end projects helping non profits.
Manny
@Alloffices
Jun 04 2016 07:37
Be sure to create a Kamper developer blog to save any notes you may need to refer to as you master new skills. Kamper is a programmer-friendly blogging platform that allows you to source and document developer tools. It's free signup here: https://campers-c.herokuapp.com/users/sign_up :smile:
Ryan
@ispeakcomputer
Jun 04 2016 07:51
Sweet, Ill check it out.
thanks @Alloffices
CamperBot
@camperbot
Jun 04 2016 07:52
needsmorecoffee sends brownie points to @alloffices :sparkles: :thumbsup: :sparkles:
:cookie: 60 | @alloffices |http://www.freecodecamp.com/alloffices
LuvHappySmile
@LuvHappySmile
Jun 04 2016 09:05
I would greatly appreciate it if anyone would kindly give me some advice & feedback concerning my first project, thx! http://codepen.io/luvhappysmile365/pen/MeYLLQ?editors=1000
Manuel Micu
@manu-4216
Jun 04 2016 09:19
Hello. I'd like to install SASS on Windows and practice it a bit (I know codepen has it included, but I'd like to get a better feel of it, outside codepen). How should I set it up?
It will be in fact my first step outside codepen, so what else do I need (eg text editor, ...)?
Davide
@DavOnGit
Jun 04 2016 09:22
Atom or sublime text @manu-4216
Manuel Micu
@manu-4216
Jun 04 2016 09:24
@LuvHappySmile Looks good. However it is a bad practice to put your styling in HTML. It should all reside in CSS (colors, aligns, etc)
Davide
@DavOnGit
Jun 04 2016 09:25
@LuvHappySmile nice job :+1: next project follow @manu-4216 reccomandations, cya!
Bhaargavi1
@Bhaargavi1
Jun 04 2016 09:32
hai people i am check out my first project on computers .Basically its a 10 pages website. I am a mere beginner so i have used only html and css in it. The link is below and do share your views on it. The link is
Shusil Banjade
@shusil123
Jun 04 2016 09:39
http://codepen.io/shusil123/full/rLVeOm/ .. Have a look at my random quote generator
Bhaargavi1
@Bhaargavi1
Jun 04 2016 09:40
The link of my site is http://www.bhaargavics.96.lt/
Justin Woodward
@jwoo92
Jun 04 2016 09:41
@manu-4216 Sass, not SASS ;)
Manuel Micu
@manu-4216
Jun 04 2016 09:42
@jwoo92 oh, i apologize about that
Justin Woodward
@jwoo92
Jun 04 2016 09:44
@manu-4216 im just messing with you. though some people are die hard grammer correctors when it comes to that stuff.
Manuel Micu
@manu-4216
Jun 04 2016 09:46
@jwoo92 So you think it is worth learning it ?
Justin Woodward
@jwoo92
Jun 04 2016 09:59
@manu-4216 what exactly are you referring to?
Mihajlo Krsmanović
@rektix
Jun 04 2016 10:00
can anyone help me with wikipedia viewer?
just need to know what api to use to get text from wiki
Carlos Pulido
@carlosfrontend
Jun 04 2016 10:15
Hello, good morning I need to know if it is possible to recover 10 random wikipedia entries with their respective titles , links to each and texts can not get get a json with that data.
kirbyedy
@kirbyedy
Jun 04 2016 10:19
yes
Carlos Pulido
@carlosfrontend
Jun 04 2016 10:23
@kirbyedy I 'm trying and I can not do
did you read the documentation?
Carlos Pulido
@carlosfrontend
Jun 04 2016 10:25
@kirbyedy im using API sandbox but can't recover 10 random entries and their links to wikipedia
if i do it with opensearch i recover it but need search value
i wanna do it same open search with random
kirbyedy
@kirbyedy
Jun 04 2016 10:27
10 random articles ?
why?
Carlos Pulido
@carlosfrontend
Jun 04 2016 10:28
@kirbyedy I want to make a variant of the exercise display only an article I looked simple
pgjones72
@pgjones72
Jun 04 2016 10:30
hey guys. I was wondering if anyone had any good resources for improving web design and style. I'm more of a meat and potatoes guy(function over fashion, so to speak), so all my projects look like poo.
Carlos Pulido
@carlosfrontend
Jun 04 2016 10:30
i wanna paint 10 random articles in my html page and it can go to wikipedia links of self
kirbyedy
@kirbyedy
Jun 04 2016 10:31
@carlospulido sorry I have no idea how to get 10 random articles from wikipedia
Carlos Pulido
@carlosfrontend
Jun 04 2016 10:32
ok :) I thank you anyway
Justin Woodward
@jwoo92
Jun 04 2016 10:34
@carlospulido yes, it is possible.
kirbyedy
@kirbyedy
Jun 04 2016 10:34
@pgjones72 search around for web sites you like and try to recreate them
i don't know do it
generator= random not return wikipedia links of entries never :(
pgjones72
@pgjones72
Jun 04 2016 10:37
@kirbyedy no. I REALLLY don't have an eye for it. I thought that changing the background color of my buttons was the coolest thing ever. I just want to play with a few new style tools for a bit.
Carlos Pulido
@carlosfrontend
Jun 04 2016 10:38
@jwoo92 can u tell me it?
kirbyedy
@kirbyedy
Jun 04 2016 10:40
@pgjones72 maybe you should stick with backend then :)
Fourbits
@Fourbits
Jun 04 2016 10:42
Any idea why exactly one of my buttons is misaligned? https://codepen.io/fourbits/pen/QEbQrK
Also, why are the first and last buttons partially rounded?
Justin Woodward
@jwoo92
Jun 04 2016 10:46
@carlospulido either by using this http://en.wikipedia.org/w/api.php?action=query&generator=random&grnnamespace=0&prop=extracts&exchars=500&format=json or by using a random word generator api to fill your search input.
Shusil Banjade
@shusil123
Jun 04 2016 10:49

@Fourbits , use this css, instead of the auto generated, buttons.less css:

btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
border-radius: 0px !important;
margin-top: 5px;
}

And this:

.btn-group > .btn:last-child:not(:first-child), .btn-group > .dropdown-toggle:not(:first-child) {
border-radius: 0px !important;
}

Fourbits
@Fourbits
Jun 04 2016 10:58
@shusil123 thanks
CamperBot
@camperbot
Jun 04 2016 10:58
fourbits sends brownie points to @shusil123 :sparkles: :thumbsup: :sparkles:
:cookie: 317 | @shusil123 |http://www.freecodecamp.com/shusil123
Carlos Pulido
@carlosfrontend
Jun 04 2016 10:58
@jwoo92 good but it not return link to wikipedia page
Fourbits
@Fourbits
Jun 04 2016 10:58
It didn't work as you wrote it, but I added two of your lines to #buttons button in my css:
  border-radius: 0px !important;
  margin-top: 5px;
and now it works!
Shusil Banjade
@shusil123
Jun 04 2016 10:59
@Fourbits , Anytime. And The design is cool. You used angular, You are cool.
And try to 'Inspect Element' to solve those styling and positioning problems.
Justin Woodward
@jwoo92
Jun 04 2016 11:01
@carlospulido you must get the page id from the json data and add it to this for wiki page link. https://en.wikipedia.org/wiki?curid=
Fourbits
@Fourbits
Jun 04 2016 11:01
Thanks! I learned about Angular when I was doing an earlier challenge, and I found it much nicer to work with than jQuery.
OK -- will do!
Richard Andrews
@Whiplash5057
Jun 04 2016 11:01
guys need help
Carlos Pulido
@carlosfrontend
Jun 04 2016 11:03
@jwoo92 I'll try thank you very much
CamperBot
@camperbot
Jun 04 2016 11:03
carlospulido sends brownie points to @jwoo92 :sparkles: :thumbsup: :sparkles:
:cookie: 340 | @jwoo92 |http://www.freecodecamp.com/jwoo92
pgjones72
@pgjones72
Jun 04 2016 11:07
@kirbyedy LOL I can see you are going to be no help at all. I'll just keep doing my poopy frontend stuff until I get to the backend section. :)
TsenkoAleksiev87
@TsenkoAleksiev87
Jun 04 2016 11:18
can you help me out ?
function palindrome(str) {
  // Good luck!

  str = str.replace(/\W/g, "").toLowerCase();

  var newStr = str.replace(/\W/g, "").toLowerCase().split('').reverse();
  if (str === newStr) {
    return true;
  }
  return false;
}
I don't know what am I doing wrong
Shusil Banjade
@shusil123
Jun 04 2016 11:22

@TsenkoAleksiev87 , since W doesn't include underscore(_), you have to add it additionally.

Ohterwise, it seems fine to me.

TsenkoAleksiev87
@TsenkoAleksiev87
Jun 04 2016 11:22
OMG :@
@shusil123 thank you
CamperBot
@camperbot
Jun 04 2016 11:22
tsenkoaleksiev87 sends brownie points to @shusil123 :sparkles: :thumbsup: :sparkles:
:cookie: 320 | @shusil123 |http://www.freecodecamp.com/shusil123
TsenkoAleksiev87
@TsenkoAleksiev87
Jun 04 2016 11:23
@I give it a try right a way
Shusil Banjade
@shusil123
Jun 04 2016 11:23
@TsenkoAleksiev87 , anytime. I spent three hours for that thing...
TsenkoAleksiev87
@TsenkoAleksiev87
Jun 04 2016 11:23
@shusil123 I'm on 2 and a half :D
Shusil Banjade
@shusil123
Jun 04 2016 11:24
@TsenkoAleksiev87 , haha. That happens. And you haven't got to the caesar cipher yet.
That'a a real gem
TsenkoAleksiev87
@TsenkoAleksiev87
Jun 04 2016 11:26
@shusil123 hopefully I will get there....if I don't brake my laptop before that :D
Shusil Banjade
@shusil123
Jun 04 2016 11:27
@TsenkoAleksiev87 , Don't do that already. Many more to come, Sir...
TsenkoAleksiev87
@TsenkoAleksiev87
Jun 04 2016 11:28
I have to start ordering spare parts early huh? :P
Shusil Banjade
@shusil123
Jun 04 2016 11:29
That's an option, yes. @TsenkoAleksiev87 :smile:
Justin Woodward
@jwoo92
Jun 04 2016 11:32
ive been working on the algorithm challenge 'roman numeral converter' all night, this is what i have currently. i am getting an infinate loop near my last while loop. i can not seem to figure it out. can anyone look over my code please?

function convertToRoman(num) {
 var number = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];
 var roman = ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I'];
 var numStr = num.toString().split('').reverse();  
 var add = 0;
 var result = [];

  for (var i = 1; i < numStr.length; i++) {  

    while (add < i) {  

      if (numStr[i] === '0') {
      add++;
      } else {
      numStr[i] += '0'; 
      add++;
      }      
    } 
    add = 0;
  }
  // numStr = [ 6, 30 ]; 
  numStr = numStr.map(Number); 

  for (i = 0; i < numStr.length; i++) {

    while (add < number.length) {

      if (numStr[i] / number[add] < 1) {
       add++;
     } else if (numStr[i] >= number[add]) {       
      numStr[i] = numStr[i] / number[add];
      result += roman[add];     
       } else {
         add = number.length;
       }
    }
    add = 0;
  }  

 return result.reverse.join('');

}
convertToRoman(36);
kirbyedy
@kirbyedy
Jun 04 2016 11:39
@pgjones72 I dont know what kind of help did you expect :D
@pgjones72 if you showed us your work so we could give you some guidance, that could be constructive
Manuel Micu
@manu-4216
Jun 04 2016 11:43
@jwoo92 Sass. Is it worth learning?
Shusil Banjade
@shusil123
Jun 04 2016 11:46
@manu-4216 , It'll take you two-three hours to learn and it can make your css a lot cleaner and easy to write
Yes, it's worth learning.
Whether you go with SASS or SCSS.....
abtak mustapha
@mustapha88
Jun 04 2016 11:51
hello
any one here work in tic tac toe?
some one help in tic tac game?
Dan Stockham
@DanStockham
Jun 04 2016 12:06
What do you need help with?
pgjones72
@pgjones72
Jun 04 2016 12:07
@kirbyedy nah. it's really just nuts and bolts. I'm just happy that they work. Hope I didn't offend.
Justin Woodward
@jwoo92
Jun 04 2016 12:07
@manu-4216 its not hard to learn, i prefer SCSS over Sass, but i guess it comes down to what you like and want to do.
abtak mustapha
@mustapha88
Jun 04 2016 12:07
if some one take a moment look to my code and tell me what bis wrong with button X and O,?WHEN i choose one of them the logic of game is not correct but when you play dirctly it work perfctly
Dan Stockham
@DanStockham
Jun 04 2016 12:08
@mustapha88 Could you elaborate more?
abtak mustapha
@mustapha88
Jun 04 2016 12:11
@DanStockham ya i make the code with some friend it working nice in this case the human player choose X automaticlly and the AI chosse O BUT when i try to add button X and O TO TOGGLE between them to make the choise for a human player to chosse
between O or X I miss some thing there
Dan Stockham
@DanStockham
Jun 04 2016 12:21
@mustapha88 When I checked your code, I didn't see anything where the player buttons are attached with event handlers
@mustapha88 Your have the functions that selects the piece of the player all ready, but it isn't bound by any element on your DOM
$(document).ready(function () {
    newGame();
});
this.Turn=function(){
  this.turn=this.turn==="X"?"O":"X";
}
//This isn't bound to any node on your DOM
function chooseX() {
  player = "X";
  computer = "O";
  currplayer="player"

  $(".choose").css("display", "none");
}
//This isn't bound to any node on your DOM
function chooseO() {
  player = "O";
  computer = "X";
   currplayer="player";


  $(".choose").css("display", "none");
}
Dan Stockham
@DanStockham
Jun 04 2016 12:26
@mustapha88 Nevermind, you have inline javascript on your html with onClick
Though I still think you should get rid of that and add it to your code for vulnerability sake.
peterjameslewis1
@peterjameslewis1
Jun 04 2016 12:30
how do i create a nav bar
Dan Stockham
@DanStockham
Jun 04 2016 12:32
@mustapha88 Ah, It has something to do with your winning logic. Take a look at the result of the if conditional and tell me what is wrong there.
@peterjameslewis1 There is several ways you can build a nav bar.
peterjameslewis1
@peterjameslewis1
Jun 04 2016 12:33
i have done the html for it i am just not sure how to do the css
Dan Stockham
@DanStockham
Jun 04 2016 12:34
@peterjameslewis1 How do you want the navbar to look?
Alfarhan Zahedi
@alfarhanz
Jun 04 2016 12:34

@peterjameslewis1 ...use bootstrap.css...

<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">WebSiteName</a>
</div>
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Page 1</a></li>
<li><a href="#">Page 2</a></li>
<li><a href="#">Page 3</a></li>
</ul>
</div>
</nav>

Link, if u want to know more...http://www.w3schools.com/bootstrap/bootstrap_navbar.asp

peterjameslewis1
@peterjameslewis1
Jun 04 2016 12:35
i want to learn it on css first before going onto bootsrap as im new ti html and css
@DanStockham i want it to look similar to freecodecamps, all one bar with the links in top left
Dan Stockham
@DanStockham
Jun 04 2016 12:36
@peterjameslewis1 Could you show us what you have so far?
peterjameslewis1
@peterjameslewis1
Jun 04 2016 12:36
css ?
or html
Alfarhan Zahedi
@alfarhanz
Jun 04 2016 12:36
ok.....den follow dis link...http://www.w3schools.com/css/css_navbar.asp @peterjameslewis1
dis will teach u to make a navbar through CSS
peterjameslewis1
@peterjameslewis1
Jun 04 2016 12:38
@DanStockham html or css
Dan Stockham
@DanStockham
Jun 04 2016 12:38
@peterjameslewis1 Both
@peterjameslewis1 Preferable in codepen
peterjameslewis1
@peterjameslewis1
Jun 04 2016 12:38
<html>
<head>
<title>
Personal portfolio
</title>
</head>
<body>
<div>
<ul>
<li><a href="#">Home</a>
<li><a href="#">About</a>
<li><a href="#">Portfolio</a>
<li><a href="#">Contact</a>
</ul>
ul {
list-style-type:none;
}
li {
display:inline;
}
sake i realised i havent even closed the <li>
Alfarhan Zahedi
@alfarhanz
Jun 04 2016 12:39
use your css inside <style></style..
Dan Stockham
@DanStockham
Jun 04 2016 12:41
@peterjameslewis1 Could you put it on Codepen? I can understand the code better on there.
why put it in style when the is a editor box for css?
as you can see i dont have much hah
Alfarhan Zahedi
@alfarhanz
Jun 04 2016 12:42
den put it inside the css box
it will work
Dan Stockham
@DanStockham
Jun 04 2016 12:42
@peterjameslewis1 No no, you're off to a great start by using the ul tag
@peterjameslewis1 Though think about what you can do with the display of your list
@peterjameslewis1 And also do some research on how to remove the discs from your li tag.
peterjameslewis1
@peterjameslewis1
Jun 04 2016 12:44
what do you mean by discs, and thanks
abtak mustapha
@mustapha88
Jun 04 2016 12:44
@DanStockham sorry somebody call me
Dan Stockham
@DanStockham
Jun 04 2016 12:44
@peterjameslewis1 The bullet points.
@mustapha88 I posted your answer above.
peterjameslewis1
@peterjameslewis1
Jun 04 2016 12:45
oh, ive just dont that. list-style-type:none;
abtak mustapha
@mustapha88
Jun 04 2016 12:45
ya i check the logic @DanStockham
peterjameslewis1
@peterjameslewis1
Jun 04 2016 12:45
i get confused as to which css selector it should go in
shall i just use padding or margin to make the grey bar the size i want it?
Dan Stockham
@DanStockham
Jun 04 2016 12:48
@mustapha88 I honestly think that was causing your issue.
@peterjameslewis1 you want to use the selector li
abtak mustapha
@mustapha88
Jun 04 2016 12:49
@DanStockham ya i know that my button any bound with DOM
Dan Stockham
@DanStockham
Jun 04 2016 12:50
@mustapha88 But you binded it in your html and that's a big no-no.
abtak mustapha
@mustapha88
Jun 04 2016 12:50
@DanStockham i'm trying to make some change and i think i make some progress
Dan Stockham
@DanStockham
Jun 04 2016 12:50
@mustapha88 I think the suggestions I made will fix it.
@mustapha88 Unless you have another issue with it.
TsenkoAleksiev87
@TsenkoAleksiev87
Jun 04 2016 12:58
@TsenkoAleksiev87
Hey can someone give me a hint how to find the largest item in a two dimentional array?
arr [[2,3,5], [6,7,8]] for example
Math.max?
Dan Stockham
@DanStockham
Jun 04 2016 13:00
@TsenkoAleksiev87 First tell us what you came up with.
TsenkoAleksiev87
@TsenkoAleksiev87
Jun 04 2016 13:01
function largestOfFour(arr) {
  // You can do this!
  var largest = [];
  for (var i = 0; i < arr.length; i++) {
    for (var j = 0; j < arr.length; j++) {

    }
  }

  return largest;
}
and I'm stuck
Dan Stockham
@DanStockham
Jun 04 2016 13:01
Then tell us what you think is the solution.
TsenkoAleksiev87
@TsenkoAleksiev87
Jun 04 2016 13:02
somehow i have to find the largest in arr[i][j] and push it to largest
but i'm not sure how to find the max in arr[i][j]
Dan Stockham
@DanStockham
Jun 04 2016 13:02
Right, but even in puesdo code, write out what you think will work.
TsenkoAleksiev87
@TsenkoAleksiev87
Jun 04 2016 13:03
largest[i] = Math.max(arr[i][j]);
but this doesn't work as i would want to :)
Dan Stockham
@DanStockham
Jun 04 2016 13:04
@TsenkoAleksiev87 I know I may sound like a >|#& but I want you think it through some, then we can chime in to nudge you in the right direction.
TsenkoAleksiev87
@TsenkoAleksiev87
Jun 04 2016 13:04
@DanStockham I know. I don
I don't want to get the answer right away
I think I'm on the right path
but I can
Dan Stockham
@DanStockham
Jun 04 2016 13:05
So there is a easier way to find the highest number in something using a plain ol if conditional.
TsenkoAleksiev87
@TsenkoAleksiev87
Jun 04 2016 13:05
I was thinking of that but how to check j and j + 1
that would go out of the array right?
Shusil Banjade
@shusil123
Jun 04 2016 13:06
@TsenkoAleksiev87 , yes, think it through. do it like: largest.push (a[i][j]), and then sort the largest, then return the first or the last element depending the sorting (ascending/descending)
Dan Stockham
@DanStockham
Jun 04 2016 13:06
Well that second for loop is just itreating through your element array right?
TsenkoAleksiev87
@TsenkoAleksiev87
Jun 04 2016 13:06
right
Shusil Banjade
@shusil123
Jun 04 2016 13:07
@TsenkoAleksiev87 , the second loop must be: j<arr[i].length;
Dan Stockham
@DanStockham
Jun 04 2016 13:07
So we can think in just element scope then/.
We have several ways we can test to see which element in the array we are iterating has the highest value.
We can sort it with the highest value first or we can compare the current element to the previous through a conditional.
Dan Stockham
@DanStockham
Jun 04 2016 13:12
@TsenkoAleksiev87 Can you see what the code looks like from what I said?
I have to get out of here guys.
Sorin Ruse
@sorinr
Jun 04 2016 13:14
@TsenkoAleksiev87 somewhere you should use .push(Math.max.apply... @DanStockham Dan is right. think and think and search
TsenkoAleksiev87
@TsenkoAleksiev87
Jun 04 2016 13:20
i'm going to be stuck on this forever .... :(
when i float right all the tags go the wrong way round?
Sorin Ruse
@sorinr
Jun 04 2016 13:23
@TsenkoAleksiev87 no u r not. Search for this function: Math.max.apply and see what its returning and what is his sintax
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 13:25
@peterjameslewis1 you need to make a class called navbar header
peterjameslewis1
@peterjameslewis1
Jun 04 2016 13:28
done
Sorin Ruse
@sorinr
Jun 04 2016 13:28
@TsenkoAleksiev87 another hint: loop through your arr and for each i find using Math.max the largest number into that sub array and push it.
peterjameslewis1
@peterjameslewis1
Jun 04 2016 13:28
then float it in that class?
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 13:30
@peterjameslewis1 your ul should have classes to
Sorin Ruse
@sorinr
Jun 04 2016 13:30
@peterjameslewis1 when you float right make display: inline not block but be aware the order of tags changes
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 13:31
@peterjameslewis1 you could try <ul class="nav navbar-nav navbar-right"> as well
@peterjameslewis1 then the order stays the same
LuvHappySmile
@LuvHappySmile
Jun 04 2016 13:33
@manu-4216 Thank you for your honest feedback, I do really appreciate it!!
CamperBot
@camperbot
Jun 04 2016 13:33
luvhappysmile sends brownie points to @manu-4216 :sparkles: :thumbsup: :sparkles:
:cookie: 319 | @manu-4216 |http://www.freecodecamp.com/manu-4216
Sorin Ruse
@sorinr
Jun 04 2016 13:34
@peterjameslewis1 using bootstrap classes the way @emmanuelledebarge told you will avoid reordering of tags
LuvHappySmile
@LuvHappySmile
Jun 04 2016 13:35
@DavOnGit I will, thanks!
CamperBot
@camperbot
Jun 04 2016 13:35
luvhappysmile sends brownie points to @davongit :sparkles: :thumbsup: :sparkles:
:cookie: 514 | @davongit |http://www.freecodecamp.com/davongit
LuvHappySmile
@LuvHappySmile
Jun 04 2016 13:36
@manu-4216 Thank you for your time & feedback, I do really appreciate it!!
CamperBot
@camperbot
Jun 04 2016 13:36
luvhappysmile sends brownie points to @manu-4216 :sparkles: :thumbsup: :sparkles:
:warning: luvhappysmile already gave manu-4216 points
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 13:38
@peterjameslewis1 thats weird....
@peterjameslewis1
@peterjameslewis1 nevermind its not posting lol
peterjameslewis1
@peterjameslewis1
Jun 04 2016 13:40
i did just put that picture in so that could be why @emmanuelledebarge
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 13:41
@peterjameslewis1 oh yea, codepen gets all weird when someone is editing
peterjameslewis1
@peterjameslewis1
Jun 04 2016 13:41
now i need to correct the image size...nightmare
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 13:42
@peterjameslewis1 this helped me with my website
peterjameslewis1
@peterjameslewis1
Jun 04 2016 13:43
i resized it, i just added the class="img-responsive
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 13:43
@peterjameslewis1 you want your image before nav bar>
peterjameslewis1
@peterjameslewis1
Jun 04 2016 13:45
@emmanuelledebarge in html
or css @emmanuelledebarge
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 13:46
@peterjameslewis1 html
@peterjameslewis1 it looks like it moved to the bottom of the pag because you put the image in before the nav class
peterjameslewis1
@peterjameslewis1
Jun 04 2016 13:48
better
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 13:49
@peterjameslewis1 yes
@peterjameslewis1 <img class="img-responsive" src="http://s3.amazonaws.com/lws_lift/bentallkennedy/images/misc/1453916820_portfolio_black.png" height= "40" width="40">
@peterjameslewis1 that makes it really small feel free to adjust it to your liking lol
SuryaKavutarapu
@SuryaKavutarapu
Jun 04 2016 14:05
guys im stuck over here in show the local weather task
'use strict';

var app = angular.module('WeatherApp')
   app.constant("weatherURL","http://api.openweathermap.org/data/2.5/weather?q=");
 app.constant("units","&units=metric");
  app.constant("appid","&APPID=89255de125e10b7d7a38fc00ec6b1f0c");
 app.constant("cb","&callback=JSON_CALLBACK"); 
 app.constant("locURL", "http://ipinfo.io/json?callback=JSON_CALLBACK"); 
        app.service('weatherFactory',['$http','weatherURL','appid','units','cb','city',function($http,weatherURL,appid,units,cb,city) {
                   this.getWeather = function(city){
                                        return $http.get(weatherURL+city+units+appid+cb);
                                    };
        }]);
app.service('locFactory',['$http','locURL',function($http,locURL){
  this.getLocation = function(){
    return $http.get(LocURL);
  };
}]);


app.controller('weatherCtrl'['$scope','locFactory','weatherFactory',function($scope,locfactory,weatherFactory){
        $scope.message = "Loading ...";
                        $scope.Data= {};
                        locFactory.getlocation()
            .then(
                function(response) {
                     $scope.city = response.city + ',' + response.country;
                     weatherfactory.getWeather(city).then(function(response){
                       $scope.Data = response.data;
                     }, function(response) {
                    $scope.message = "Error: "+response.status + " " + response.statusText;
                });
                },
                function(response) {
                    $scope.message = "Error: "+response.status + " " + response.statusText;
                }
            );


                             }]);
Sorin Ruse
@sorinr
Jun 04 2016 14:07
@SuryaKavutarapu what is the problem Surya?
SuryaKavutarapu
@SuryaKavutarapu
Jun 04 2016 14:08
problem is i'm not getting any data out from the controller @sorinr
Sorin Ruse
@sorinr
Jun 04 2016 14:10
@SuryaKavutarapu try a console.log(response) and inspect the request and also the response
SuryaKavutarapu
@SuryaKavutarapu
Jun 04 2016 14:23
nothing works @sorinr
Sorin Ruse
@sorinr
Jun 04 2016 14:27
@SuryaKavutarapu can u give a link to ur pen?
Sorin Ruse
@sorinr
Jun 04 2016 14:34
@SuryaKavutarapu try and change the order of loading js libraries. jq first and ang after
Harshit Anand
@nerocool996
Jun 04 2016 14:40
I want to add a really simple slide down animation to my page. Can anyone give me reference where I can read about it, I am very new to it. So, something simple will suffice :worried:
Btw I am planning to use animate.css
saebrabaebra
@saebrabaebra
Jun 04 2016 15:02
@SuryaKavutarapu this is happening to me, too!
Kevin Holmes
@codersc
Jun 04 2016 15:04
my simon game doesnt animate the frist flash in the sequence of flashes i tell it to make. can someone take a look at my codepen?
it animates all the other ones though
why?
Peter Kenward
@PeterKenward
Jun 04 2016 15:08
Hello :)
SuryaKavutarapu
@SuryaKavutarapu
Jun 04 2016 15:14
@saebrabaebra okay what's your problem??
saebrabaebra
@saebrabaebra
Jun 04 2016 15:15
@SuryaKavutarapu I'm not sure. I think at least SOME of my code has to be correct but when I "run" the code it's just a plain font, in black, on a white background. The only code that's actually happening is the link works.
SuryaKavutarapu
@SuryaKavutarapu
Jun 04 2016 15:26
@saebrabaebra what are those link=#3577B1 vlink=#C64AFC alink=#F7727C and all
Lisa
@aGirlWhoCodes
Jun 04 2016 15:27
Hey guys. Anyone knows what does the console error: 'to much recursion' mean?
saebrabaebra
@saebrabaebra
Jun 04 2016 15:27
@SuryaKavutarapu to make the links, visited links, and active links the colors that match those hexcodes
SuryaKavutarapu
@SuryaKavutarapu
Jun 04 2016 15:29
@saebrabaebra you have to specify them in css not on markup go to css and
a:visted,a:hover,a:active and specify each of them whit specific colors
Le Twitch
@notalkingplz
Jun 04 2016 15:30

http://codepen.io/letwitch/pen/QEbmjg?editors=0012

I'm working on the twitch.tv API challenge.

Can someone teach me how to loop an XMLHttpRequest? It's to iterate with different URLs, but I'm only using freecodecamp's one just for testing. I'm obviously doing it wrong :S The first 9 requests gives me a status of 0 while the last one gives me an okay 200.

Lisa
@aGirlWhoCodes
Jun 04 2016 15:36
@notalkingplz Hey I am on the same project! I am using forEach javascript method. But you can also use maps. Those are used to itterate though an array.. I mean instead of a for loop. I tried it first with a for loop and that didn't work for me.. Although I don't think it's impossible..
Le Twitch
@notalkingplz
Jun 04 2016 15:39
@aGirlWhoCodes How did you change the streamer name after every iteration? Just adding 1 to a variable after each iteration?
@aGirlWhoCodes Also, how would it be different from using a for loop?
Lisa
@aGirlWhoCodes
Jun 04 2016 15:45

@notalkingplz Let's say you called your array of streamers streamers like: var streamers = ["freecodecamp", "etc"]; You access every streamer in a loop by: `streamers.forEach(function(name) {

}`

Greg Duncan
@GregatGit
Jun 04 2016 15:45
@notalkingplz make sure you add jquery in the settings and try this
var streamers = ["freecodecamp", "devwars", "esl_csgo", "dreamhackcs", "eleaguetv", "rainbow6", "monstercat", "laurentrivarddj", "delete", "streamdoesnotexist"];

for (var i = 0; i < streamers.length; i++) {
    var url = "https://api.twitch.tv/kraken/channels/" + streamers[i];
    $.getJSON(url, function(data){
        console.log(data);
    });
}
Lisa
@aGirlWhoCodes
Jun 04 2016 15:47
@notalkingplz As @GregatGit you can also do it with a for loop. Personally when I learned about the forEach method, I found the forEach method more clear.
Le Twitch
@notalkingplz
Jun 04 2016 15:47
@aGirlWhoCodes Cool stuff :) Just read up on it on MDN. Much more semantic and cleaner than a for loop
Thanks for the tip @aGirlWhoCodes
CamperBot
@camperbot
Jun 04 2016 15:48
notalkingplz sends brownie points to @agirlwhocodes :sparkles: :thumbsup: :sparkles:
:cookie: 305 | @agirlwhocodes |http://www.freecodecamp.com/agirlwhocodes
Lisa
@aGirlWhoCodes
Jun 04 2016 15:48
@notalkingplz Yeah. Learn about it! You will have fun with it!
Bil
@thebiltheory
Jun 04 2016 15:48
Hi!
Le Twitch
@notalkingplz
Jun 04 2016 15:48
Thanks @GregatGit, but I'm really trying to stay away from jQuery. Not a fan of it
CamperBot
@camperbot
Jun 04 2016 15:48
notalkingplz sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:cookie: 556 | @gregatgit |http://www.freecodecamp.com/gregatgit
Bil
@thebiltheory
Jun 04 2016 15:49
I am facing an issue for which I have no idea how to fix it
The svg can’t load crossdomain
Greg Duncan
@GregatGit
Jun 04 2016 15:49
@notalkingplz if you want to be a dev - you might have to learn to love it
Lisa
@aGirlWhoCodes
Jun 04 2016 15:51
@GregatGit Greg Greg! Would you mind to take a look at my code?
Greg Duncan
@GregatGit
Jun 04 2016 15:51
@aGirlWhoCodes sure
Lisa
@aGirlWhoCodes
Jun 04 2016 15:52
Seems like my second getJSON is not working.. I need it to display the logo on my screen.. http://codepen.io/Didi987/pen/qNdmrK
the console is giving my the error to much recursion..
*me
Greg Duncan
@GregatGit
Jun 04 2016 15:53
on line 23 you have a problem '<a src=' = urlPage +
Tulio Natale
@tuliodnw
Jun 04 2016 15:54
can someone try to break the calculator, im fixing all the bugs pls
http://codepen.io/tuliodnw/pen/vKYPEK?editors=0010
Greg Duncan
@GregatGit
Jun 04 2016 15:54
should be a + not =
Sorin Ruse
@sorinr
Jun 04 2016 15:54
@thebiltheory have same problem. i'm working on an php backed just to return all the view my front end needs
Le Twitch
@notalkingplz
Jun 04 2016 15:55
@GregatGit Well jQuery isn't exactly a must. It's a quality of life library, but at the same time, for a small project like this where all I need is a simple http get request, jQuery is a bit overkill, and I've learnt a lot more from understanding how exactly everything works, instead of making it easier by slapping on jQuery and calling it a day
Lisa
@aGirlWhoCodes
Jun 04 2016 15:56
@GregatGit OH that means the getJSON is working.. THen the problem must be with the image variable..
Bil
@thebiltheory
Jun 04 2016 15:56
@sorinr How to get this work …
Lisa
@aGirlWhoCodes
Jun 04 2016 15:56
@GregatGit Thanks for pointing that out!
CamperBot
@camperbot
Jun 04 2016 15:56
agirlwhocodes sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:cookie: 557 | @gregatgit |http://www.freecodecamp.com/gregatgit
Sorin Ruse
@sorinr
Jun 04 2016 16:01
@thebiltheory i have also this problem loading some weather font icons so i'm writing a php backend to give all the view already rendered to avoid cors
Greg Duncan
@GregatGit
Jun 04 2016 16:03
@aGirlWhoCodes var image = data.logo; keep it simple -
Pete
@petegarvin1
Jun 04 2016 16:07
evening all
does anyone have a sec to help me work out why my function buttons won't add to my calculation on my calculator? the numbers are all working, and are set up the same so I would expect the '+' (for example) to appear on the calc screen when clicked... http://codepen.io/petegarvin1/pen/ZQPBqz?editors=1010
aschwab9009
@aschwab9009
Jun 04 2016 16:12
Hey all. I'm having some problems making a button send to a spot on my page. Can anyone help?
Sorin Ruse
@sorinr
Jun 04 2016 16:14
@petegarvin1 first u haven't added bootstrap css but only js part
Pete
@petegarvin1
Jun 04 2016 16:14
@aschwab9009 can you explain a little more please
aschwab9009
@aschwab9009
Jun 04 2016 16:15
Absolutely. So I am trying to build a portfolio page. I have a stationary banner at the top with 3 buttons. I'd like the buttons to link to a specific spot on the page (the 'Home' button takes you to the top, the 'Info' button takes you to the middle of the page, etc.)
Pete
@petegarvin1
Jun 04 2016 16:15
@sorinr interesting.. didn't realise i hadn't.. but when i do it ruins the look :D think ill keep it off!
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 16:16
@aschwab9009 can i see the codepen?
Pete
@petegarvin1
Jun 04 2016 16:16
@aschwab9009 ahhh ok
aschwab9009
@aschwab9009
Jun 04 2016 16:16
Yeah. I'm sure it's garbage, but I'm still learning:
https://codepen.io/aschwab9009/pen/JKoWYE
Islam Ibakaev
@dagman
Jun 04 2016 16:16
hey guys take a look and feedback http://dagman.github.io/
Pete
@petegarvin1
Jun 04 2016 16:17
@aschwab9009 looks good :+1: ... you need to use the <a> tag to mark the sections of your site
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 16:17
@aschwab9009 hahaha far from garbage
Pete
@petegarvin1
Jun 04 2016 16:17
(i havent checked your code - just saying how i achieved it)
thats step 1
Greg Duncan
@GregatGit
Jun 04 2016 16:17

@aGirlWhoCodes your calls are working - I think its your html formating

 var myHtml = '<div class="resultsPart row">' +
            '<div class="col-xs-1"></div>' +
            '<div class="col-xs-2">' +
            '<img scr="' + image + '"/></div>' +
            '<div class="col-xs-3">' +
            '<a src=' + urlPage +
            '<h3>' + name + '</h3></div>' +
            '<div class="col-xs-2">' +
            '<h4>' + status + '</h4></div>' +
            '<div class="col-xs-2">' +
            '<h5>' + game + '</h5></div>' +
            '<div class="col-xs-2"></div>' +
            '</div>';
          console.log(myHtml);
          $('#results').append(myHtml);

this will allow you look at your html - just copy it and paste it in a brand new div (one that won't get effect by the jQuery and see why it won't display the the logo - the url for the logo is fine

Pete
@petegarvin1
Jun 04 2016 16:18
@aschwab9009 then you link to that div in the same way you would link to a web page (<a href=>)
make sense?
Greg Duncan
@GregatGit
Jun 04 2016 16:18
@aGirlWhoCodes Here is the html it is gererating
<div class="resultsPart row"><div class="col-xs-1"></div><div class="col-xs-2"><img scr="https://static-cdn.jtvnw.net/jtv_user_pictures/esl_sc2-profile_image-d6db9488cec97125-300x300.jpeg"/></div><div class="col-xs-3"><a src=https://www.twitch.tv/esl_sc2<h3>ESL_SC2</h3></div><div class="col-xs-2"><h4>Online</h4></div><div class="col-xs-2"><h5>StarCraft II</h5></div><div class="col-xs-2"></div></div>
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 16:18
@aschwab9009 so what your trying to do is make it so that when I click the home button it goes to the home section of the page?
aschwab9009
@aschwab9009
Jun 04 2016 16:19
@petegarvin1 @emmanuelledebarge Thanks! So I made the "Adam Schwab" text an <a> element, and directed the Home button to go there, but I can't seem to make it work
CamperBot
@camperbot
Jun 04 2016 16:19
aschwab9009 sends brownie points to @petegarvin1 and @emmanuelledebarge :sparkles: :thumbsup: :sparkles:
:cookie: 128 | @emmanuelledebarge |http://www.freecodecamp.com/emmanuelledebarge
:cookie: 424 | @petegarvin1 |http://www.freecodecamp.com/petegarvin1
aschwab9009
@aschwab9009
Jun 04 2016 16:19
@emmanuelledebarge that's correct
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 16:20
@aschwab9009 give it an id
Greg Duncan
@GregatGit
Jun 04 2016 16:20
@notalkingplz jQuery will actually make a http request simple - but it is handy to know how things work without jQuery
Pete
@petegarvin1
Jun 04 2016 16:20
@aschwab9009 i set my 'contact' button up like this: <li><a href="#contact">Contact</a></li>
aschwab9009
@aschwab9009
Jun 04 2016 16:20

I did that too. I have it as follows at the top:

<h3><a id="home"></a>Adam Schwab</h3>

Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 16:21
@aschwab9009 <li><a href="#HOME">HOME</a></li>
zrogravit247
@zrogravit247
Jun 04 2016 16:21
Can anyone tell me why the two images at the left are lower than the one ar the right? https://codepen.io/haikalstr/pen/NNZpBv
aschwab9009
@aschwab9009
Jun 04 2016 16:21

Then my button looks like this:

<div class="col-xs-1">
<button id="home-btn" class="btn btn-block" href="#home">Home</button>
</div>

Pete
@petegarvin1
Jun 04 2016 16:21
@aschwab9009 then i put this in the html at the top of the contacts page:<a name="contact"></a>
Justin Woodward
@jwoo92
Jun 04 2016 16:22
@GregatGit have you completed 'roman numeral converter'?
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 16:22
@aschwab9009 give the same id to your li's
zrogravit247
@zrogravit247
Jun 04 2016 16:22
Sorry I meant this one, any help?
Sorin Ruse
@sorinr
Jun 04 2016 16:22
@petegarvin1 i'veseen that changing the look. then ur problem is in the js
Pete
@petegarvin1
Jun 04 2016 16:22
@sorinr yep its definitely a JS issue
@sorinr just not sure why i can push the numbers (as strings) successfully to the 'screen', but not the + etc, even though they are also strings
aschwab9009
@aschwab9009
Jun 04 2016 16:23
I don't have any <li> items though. Should I have those? I didn't want any list
Pete
@petegarvin1
Jun 04 2016 16:23
@aschwab9009 i don't think that will make a diif
i just happened to use a list, but its the <a href> and then the other tag with the id that are the important bits
Greg Duncan
@GregatGit
Jun 04 2016 16:24
@aGirlWhoCodes You have a typo img src not img scr
Lisa
@aGirlWhoCodes
Jun 04 2016 16:25
@GregatGit I don't understand. if the calls are working.. It can be the html formating you say? What does that mean?
@GregatGit Ooh That's it!
@GregatGit Thank you very much. What a stupid small mistake..
CamperBot
@camperbot
Jun 04 2016 16:25
agirlwhocodes sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:warning: agirlwhocodes already gave gregatgit points
Pete
@petegarvin1
Jun 04 2016 16:25
@aschwab9009 basically give your button an <a href='#???'></a> then go to the area where the page in question starts and add in <a name= '???'></a>
@aschwab9009 ??? can be anything you like. Make sense?
Sorin Ruse
@sorinr
Jun 04 2016 16:26
@petegarvin1 you can push numbers only after you push "ac" that adds a zero. if you push ac then a number it becames 07, 08 or whatever number you press
Pete
@petegarvin1
Jun 04 2016 16:26
@sorinr yeah, but that isn't my issue. Thats a small thing i can sort later. All I'm looking for is why the function buttons won't push
Greg Duncan
@GregatGit
Jun 04 2016 16:26
@aGirlWhoCodes :+1:
aschwab9009
@aschwab9009
Jun 04 2016 16:28
@petegarvin1 Yeah that does make sense! Thanks. Side question, I fixed it w/ my home button, but now it has the text underlined like a link. Can I change that formatting so the text doesn't look like a link and instead looks more like a button?
CamperBot
@camperbot
Jun 04 2016 16:28
aschwab9009 sends brownie points to @petegarvin1 :sparkles: :thumbsup: :sparkles:
:warning: aschwab9009 already gave petegarvin1 points
Dan
@dcgoings
Jun 04 2016 16:29

hey guys, so i have a question. im currently in the beginning stages of building the tribute page. there's something that i can't seem to figure out whether it's possible or not.

let's say i have an image that spans the entire width of the page. obviously i want it to be responsive when the page shrinks or is on mobile.. but let's say when it shrinks, i want the image to show the portion that is at 50-75% (or like.. columns 7-9?) instead of showing exactly 50% (or columns 5-8~). is there a way i can do this?

Pete
@petegarvin1
Jun 04 2016 16:29
@aschwab9009 yeah you can, use css for that. Cant remember how to do it off the top of my head but a quick google will find it! ;) :beer:
aschwab9009
@aschwab9009
Jun 04 2016 16:30
@petegarvin1 ok sounds good! thanks again.
CamperBot
@camperbot
Jun 04 2016 16:30
aschwab9009 sends brownie points to @petegarvin1 :sparkles: :thumbsup: :sparkles:
:warning: aschwab9009 already gave petegarvin1 points
Pete
@petegarvin1
Jun 04 2016 16:30
@aschwab9009 no problem - good luck! images look great btw, i found that was half the battle building mine
Sorin Ruse
@sorinr
Jun 04 2016 16:31
@petegarvin1 <button id='7' class='btn btn-primary' onclick="push7()">7</button> and put all pushX functions outside of your doc.ready. you can name push7() as u wish
Pete
@petegarvin1
Jun 04 2016 16:32
why would i need to move them outside of the doc.ready?
the number work fine within it at the mo...
am i missing something?
Sorin Ruse
@sorinr
Jun 04 2016 16:33
@petegarvin1 just try it with one number and let me know
Pete
@petegarvin1
Jun 04 2016 16:33
@sorinr but the numbers work now?
its the + - / * I'm having the issue with
i can try it with one of them
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 16:36
@notalkingplz JQuery is amazing
@dcgoings can you post your codepen
Sorin Ruse
@sorinr
Jun 04 2016 16:39
@petegarvin1 variable first you have defined as a string with an initial value of ''. then you are trying to "push" a new value but push is a function for arrays. try console log (first) in each of your functions
Justin Woodward
@jwoo92
Jun 04 2016 16:40
i finally completed the algorithm challenge 'roman numeral converter' after a long night of working at it, but i feel like my code could be better. would anyone like to share what they came up with for that challenge with me? this is what i came up with to get it to work.

function convertToRoman(num) {
 var number = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];
 var roman = ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I'];
 var numStr = num.toString().split('').reverse();  
 var add = 0;
 var result = [];

  for (var i = 1; i < numStr.length; i++) {  

    while (add < i) {  

      if (numStr[i] === '0') {
      add++;
      } else {
      numStr[i] += '0'; 
      add++;
      }      
    } 
    add = 0;
  }

  numStr = numStr.reverse().map(Number);

  for (i = 0; i < numStr.length; i++) {

    while (numStr[i] - number[add] < 0) {
      add++;
    }

    while (numStr[i] - number[add] >= 0) {
      numStr[i] = numStr[i] - number[add];
      result += roman[add];
    }

    while (numStr[i] - number[add] < 0) {
      add++;
    }

    while (numStr[i] - number[add] >= 0) {
      numStr[i] = numStr[i] - number[add];
      result += roman[add];
    }  
    add = 0;
  }

 return result;

}
convertToRoman(16);
Pete
@petegarvin1
Jun 04 2016 16:40
@sorinr but that is ok, that is what i am using to stop the buttons working before the 'on' button is pressed. the on button then turns the variable first into an array
@sorinr its a specific issue with the function buttons. The number buttons are all working already
Dan
@dcgoings
Jun 04 2016 16:41
@emmanuelledebarge one second. will post shortly.
Sorin Ruse
@sorinr
Jun 04 2016 16:44
@petegarvin1 no they are not. move var first = []; outside of the doc.ready to make it global
Dan
@dcgoings
Jun 04 2016 16:46
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 16:47
@dcgoings img class=img-responsive
Dan
@dcgoings
Jun 04 2016 16:48
so ideally, if i make the width of my browser as small as possible, i would like to have the header image centered on the part with him in it, NOT the very center of the image (which doesn't contain him).
Pete
@petegarvin1
Jun 04 2016 16:48
@sorinr they are for me... I've tried your suggestion and all that did was make me able to type numbers in before i press 'on' which is not what i want. I'm sticking to just finding out why the function buttons won't push to first. I am happy with all of the rest of it
perhaps you weren't pushing 'on' before trying the numbers
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 16:49
@dcgoings i have a idea just give me a second and ill post it
Dan
@dcgoings
Jun 04 2016 16:49
how would i do that if i have the image inside the parallax class?
kk
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 16:50
This message was deleted
@dcgoings sorry i mean the width!
Dan
@dcgoings
Jun 04 2016 16:51
hmm.. guess that explains why my border isn't fully showing up.
Bhavik
@BhavikSheth
Jun 04 2016 16:53
How can I make the text in twitter change when the quote changes?
Dan
@dcgoings
Jun 04 2016 16:54
nvm, solved border issue. margin needed to be at 0px.
still not sure how to center on him on mobile/small browser
Sorin Ruse
@sorinr
Jun 04 2016 16:55
@petegarvin1 i think ur <input name="display".......> should post your typing history and when you press "=" it should make the calculations and replace th input with the resulting value
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 16:55
@dctor might need bootstrap let me check it out

@dcgoings one option i know of is this / For devices smaller than 400px: /
body {
background-image: url('img_smallflower.jpg');
}

/ For devices 400px and larger: /
@media only screen and (min-device-width: 400px) {
body {
background-image: url('img_flowers.jpg');
}
}

@dcgoings so you get a different background on a smaller device
Dan
@dcgoings
Jun 04 2016 16:58
ahhh, gotcha.
Pete
@petegarvin1
Jun 04 2016 17:00
@sorinr yes, that is the issue I'm talking about. it already shows my typing history (assuming you first press 'on') but then i can't use the function (including '='). I cannot make them appear in my typing history. Im trying to work out why
Dan
@dcgoings
Jun 04 2016 17:03
oh shit!! @emmanuelledebarge setting background-position: 68% 0%; worked as well.
does it work on yours? look okay?
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 17:04
@dcgoings yes
@dcgoings great job!
Sorin Ruse
@sorinr
Jun 04 2016 17:12
@petegarvin1 i'm on your penand when you press "on" it puts a "0" on your "display". then if you press any other number it will show you on "display" not 7 or 8 but 07, 08 etc and it does not even add the "decimal" point. just make var first = [] as global and in the "display" show just first.join();
Pete
@petegarvin1
Jun 04 2016 17:13
@sorinr i understand that, but that is not the thing i am trying to fix right now
i am trying to make the function buttons work as the numbers do
Sorin Ruse
@sorinr
Jun 04 2016 17:21
@petegarvin1 throughout your functions you are instantiating var first sometimes as a string and sometimes as an array plus the values you are pushing are inconsistent as type
Bhavik
@BhavikSheth
Jun 04 2016 17:21
Hi guys, in the Random Quote Machine project, how do I make the text change in the twitter box every time the New Quote button is clicked?
Pete
@petegarvin1
Jun 04 2016 17:27
@sorinr its only a string when using the on or off button. as i said, this is to stop the other buttons working at that time. All i want to know is why the function buttons are not acting the same as the number buttons. That is all
Sorin Ruse
@sorinr
Jun 04 2016 17:27
@BhavikSheth take a look here: http://codepen.io/sorinr/pen/VaJKrw
Dan
@dcgoings
Jun 04 2016 17:28

@emmanuelledebarge alright, maybe you can assist with this one.

.parallax-header {
    background: url('http://res.cloudinary.com/dcgoings/image/upload/v1465002727/wallhaven-38865_-_300px_ulg2b7.png');
    height: 300px;
    width: 100%;
    background-position: 68% 0%;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: fixed;
    margin: 0px;
    padding: 0px;
    @media (min-device-width: 1920px) {
        background: url('http://res.cloudinary.com/dcgoings/image/upload/v1465002727/wallhaven-38865_-_300px_ulg2b7.png');
        height: 300px;
        width: 100%;
        background-position: 68% 0%;
        background-repeat: no-repeat;
        background-attachment: fixed;
        background-size: contain;
        margin: 0px;
        padding: 0px;
    }
}

am i setting the min-device-width up correctly? because now im trying to remove the black bars on the sides of the image once the width of the page becomes > 1920px. it doesn't seem to be changing though, so im wondering if im just implementing it in the wrong location.

yerevin
@yerevin
Jun 04 2016 17:28
http://codepen.io/sirmmate/pen/ezYMYx
can somebody tell me why my click function push number so many times how long array is wide?
for example:
i have on 2nd level array as: arrGame[1,2]
if i click button 1 i get: arrPlayer[1,1]
i want to get: arrPlayer[1,-] and after clicking second button get arrPlayer[1,2]
what is wrong?
Sorin Ruse
@sorinr
Jun 04 2016 17:30
@petegarvin1 ok. it seems you don't understand what I'm trying to say. i will fork your pen and try to make my own modifications to show you what I mean
Manny
@Alloffices
Jun 04 2016 17:31
There are several resources that provide design patterns and inspiration designers and developers, but what's rad about CodePen is that they provide a fully functional version with it source code. https://campers-c.herokuapp.com/projects/codepen-design-patterns
Pete
@petegarvin1
Jun 04 2016 17:33
@sorinr don't worry I've mostly fixed it. some unrecognised terms e.g. #.
@sorinr thanks for trying to help anyway
CamperBot
@camperbot
Jun 04 2016 17:33
petegarvin1 sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 315 | @sorinr |http://www.freecodecamp.com/sorinr
Sorin Ruse
@sorinr
Jun 04 2016 17:37
@petegarvin1 as you wish.
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 17:38
@dcgoings what black bars?
DC
@dctor
Jun 04 2016 17:38
hello all, does anyone know why there is a blue color over the Get Quote button?
http://codepen.io/dctor/pen/rLaWZr
avistein
@avistein
Jun 04 2016 17:38
hey guys,I need a help in my Random quote machine
Dan
@dcgoings
Jun 04 2016 17:39
@emmanuelledebarge im on a 2560x1440 monitor right now. when i maximize the browser, there are black bars to the left and right of the image.
so my solution would be to set background-size to contain when the browser/screen is > 1920px, right? however, that doesn't seem to be working (but im going off the little popup that shows width in px inside codepen).
so if my browser width < 1920px, i want fixed background-size and >1920px i want contain background-size.
avistein
@avistein
Jun 04 2016 17:43
the generate and tweet button is kinda shifting upwards during the ajax call and then coming down after the response.So the jerk is taking away the smoothness.What should I do?
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 17:44
@dcgoings end the parallax header }
Dan
@dcgoings
Jun 04 2016 17:45
are you looking at the codepen or the code i posted in chat?
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 17:45
@dcgoings yes
Dan
@dcgoings
Jun 04 2016 17:45
which?
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 17:46
@dcgoings codepen
Dan
@dcgoings
Jun 04 2016 17:46
@media (max-device-width: 1920px) {
        .parallax-header {
            background: url('http://res.cloudinary.com/dcgoings/image/upload/v1465002727/wallhaven-38865_-_300px_ulg2b7.png');
            height: 300px;
            width: 100%;
            background-position: 68% 0%;
            background-repeat: no-repeat;
            background-attachment: fixed;
            background-size: fixed;
            margin: 0px;
            padding: 0px;
        }
    }

    @media (min-device-width: 1920px) {
        .parallax-header {
            background: url('http://res.cloudinary.com/dcgoings/image/upload/v1465002727/wallhaven-38865_-_300px_ulg2b7.png');
            height: 300px;
            width: 100%;
            background-position: 68% 0%;
            background-repeat: no-repeat;
            background-attachment: fixed;
            background-size: contain;
            margin: 0px;
            padding: 0px;
        }
    }
that's what i have in codepen at the moment.
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 17:48
@dcgoings bizzare, that might be the breakpoint for media query let me check
Sorin Ruse
@sorinr
Jun 04 2016 17:48
@avistein what its not working as you wish?
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 17:49
@dcgoings 1824px
avistein
@avistein
Jun 04 2016 17:49
@sorinr the buttons are kinda jerking you see,as soon as I press the generate,generate button and the tweet moved up and came down when the response is done
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 17:49
@dcgoings thats as high as it will go in media query
Dan
@dcgoings
Jun 04 2016 17:49
so if i set it to 1800 and 1801, it should work, right?
it still isn't.
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 17:49
@dcgoings no it will automatically adjust to its highest setting
Dan
@dcgoings
Jun 04 2016 17:50
wtf.
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 17:50
@dcgoings example: If I put 2000 but its breakpoint is 1824 it will automatically adjust to 1824
@dcgoings you could change the width of the page though
Dan
@dcgoings
Jun 04 2016 17:50
understood, but how would i get this to work then? im fine with settling for a lower px if it fixes my issue.
Manny
@Alloffices
Jun 04 2016 17:52
Codeshare: Handy if working with other devs and you need to share or debug code. Anyone you share the URL with can see changes real time. https://campers-c.herokuapp.com/projects/share-code-in-real-time-with-other-developers
Sorin Ruse
@sorinr
Jun 04 2016 17:52
@avistein you mean that the div has different height based on the quote length?
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 17:52
@dcgoings you can set your body and head width
yerevin
@yerevin
Jun 04 2016 17:53
http://codepen.io/sirmmate/pen/ezYMYx
can somebody tell me why my click function push number so many times how long array is wide?
for example:
i have on 2nd level array as: arrGame[1,2]
if i click button 1 i get: arrPlayer[1,1]
i want to get: arrPlayer[1,-] and after clicking second button get arrPlayer[1,2]
what is wrong?
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 17:53
@dcgoings and then you can set your mobile and enable it for smaller devices
Dan
@dcgoings
Jun 04 2016 17:54
hmm, ill see if i can figure that out. thank you @emmanuelledebarge
CamperBot
@camperbot
Jun 04 2016 17:54
:cookie: 130 | @emmanuelledebarge |http://www.freecodecamp.com/emmanuelledebarge
dcgoings sends brownie points to @emmanuelledebarge :sparkles: :thumbsup: :sparkles:
Dylan
@dhcodes
Jun 04 2016 17:55
@yerevin I don't believe your array can be [1,-]
was that a typo?
avistein
@avistein
Jun 04 2016 17:56
@sorinr no that is okay.But what I m saying that during the time the ajax call is send and response received the buttons are are staying in the top
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 17:56
@dcgoings body {
background-color: black;
color: white;
width:2000px;
height 2000px;
}
avistein
@avistein
Jun 04 2016 17:57
@sorinr and then when the request is complete...the buttons are suddenly coming down
Sorin Ruse
@sorinr
Jun 04 2016 17:58
@avistein on my pc i didn't noticed that
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 17:58
@dcgoings im on a big screen too however, and i dont see a black border
Dan
@dcgoings
Jun 04 2016 17:58
wtf.. really? that doesn't make sense to me
here, i undid the media queries.
Sorin Ruse
@sorinr
Jun 04 2016 18:00
@avistein yeah. ur right. sometimes i see what you mean
Dan
@dcgoings
Jun 04 2016 18:00
make the px width (in the codepen popup) > 2000px
Nazim
@nazimkazim
Jun 04 2016 18:00
Good Day Coders!!! I'm doing TWITCH TV project and want to extract text (string) from h1 in my code. Who knows how to implement. I get an error "Cannot read property 'length' of null". http://codepen.io/nazimkazim/pen/EyjQQQ
Dan
@dcgoings
Jun 04 2016 18:00
and you'll see the vertical black bar on the left side of the image.
avistein
@avistein
Jun 04 2016 18:01
@sorinr yeah ,maybe it's due to the late response?
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 18:02
@dcgoings I see it now lol
Dan
@dcgoings
Jun 04 2016 18:02
:)
Sorin Ruse
@sorinr
Jun 04 2016 18:02
@avistein it can be. I'm thinking of a way to overcome this behaivior
Dan
@dcgoings
Jun 04 2016 18:03
that's all im trying to fix lol. i just can't tell if media queries aren't working because it's technically still picking up my ACTUAL screen size regardless of what my browser width is or what.
avistein
@avistein
Jun 04 2016 18:09
@sorinr the response is right,checked it in the developer console.one request with more response time is just working smoothly than the one in which the buttons are jerking (whose response time is less)
so the problem lies in something else
Sorin Ruse
@sorinr
Jun 04 2016 18:10
@avistein try implementing some kind of "lazy loading"
Dylan
@dhcodes
Jun 04 2016 18:10
@dcgoings have you tried the views on chrome dev tools?
Dan
@dcgoings
Jun 04 2016 18:11
i have not. i will look into that and see what i can find out.
avistein
@avistein
Jun 04 2016 18:12
@sorinr umm,how to do that? sorry i am kind of total newbie in ajax and all that stuffs
Sorin Ruse
@sorinr
Jun 04 2016 18:12
@avistein by lazy loading I mean keeping the old quote visible until the new one was fully loaded and can be showon
Dan
@dcgoings
Jun 04 2016 18:12
and that will work with codepen as well?
Dylan
@dhcodes
Jun 04 2016 18:14
@dcgoings as long as you are in "full" mode
under change view
Justin Woodward
@jwoo92
Jun 04 2016 18:14
im having some trouble with 'where art thou'..what i was thinking about doing is if the keys matched, i would take the collections key's value and compare it to source's key value. if the same i would push the given key to variable arr. i cant think on how toget collection[i]'s key value so i can compare. here is my current code:

function whereAreYou(collection, source) {
  // What's in a name?
  var arr = [];
  // Only change code below this line
  var key, val;


  for(var prop in source) {
    key = prop;
    val = source[prop];
  }

  for (i = 0; i < collection.length; i++) {

   if(collection[i].hasOwnProperty(key)) {


   } 


  }

  // Only change code above this line
  return arr;
}

whereAreYou([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" });
avistein
@avistein
Jun 04 2016 18:15
@sorinr can u just write the snippet?
@sorinr alright did u mean to say,keeping the updation of the #textHere outside the success?
Sorin Ruse
@sorinr
Jun 04 2016 18:19
@avistein or try adding a class animated to ur upper div containing the quote in order to mask that beheivior
avistein
@avistein
Jun 04 2016 18:23
@sorinr this one http://api.jquery.com/animate/ ?
@avistein add it toyour pen abd then add a class to your upper div "animated behavioryouwhant"
Enrique Sayago
@esayago
Jun 04 2016 18:26
Hey guys just wanted to share this challenge I just finished
let me know if its working for you
Dylan
@dhcodes
Jun 04 2016 18:28
hmmm.. @esayago doesn't seem to be getting my correct location
Lisa
@aGirlWhoCodes
Jun 04 2016 18:28
@esayago Looks nice! And yes it's working!
Dylan
@dhcodes
Jun 04 2016 18:29
@esayago wait, maybe it is. What IP site are you using?
Enrique Sayago
@esayago
Jun 04 2016 18:29
@dhcodes is it close? I'm using ipinfo.io api
thanks
Dylan
@dhcodes
Jun 04 2016 18:29
interesting.... on the site, it's correct and on yours I guess it technically is but it picks a tiny township from within the whole city
so yeah, i guess it is working
yerevin
@yerevin
Jun 04 2016 18:30
@dhcodes its not but just read to end, it should be like [1] after first click and after 2nd [1,2]
Dylan
@dhcodes
Jun 04 2016 18:31
@esayago it also says it's 86 f when google says it's 75
so idk
Chris Lacaille
@ChrisL108
Jun 04 2016 18:31
Had a 'Git Bash' qustion...I wasn't sure where to ask and can't find anything on google but just wanted to know if there are any drawbacks to using git bash as your command line tool in Windows in place of regular command prompt. It uses linux type commands so I like it much better
& I only do front-end stuff if that makes a difference
Enrique Sayago
@esayago
Jun 04 2016 18:32
@dhcodes I know, Is the weather api I'm using, I ran all the variables manually to make sure it was not a code error
Dylan
@dhcodes
Jun 04 2016 18:32
@ChrisL108 i doubt anyone here would know. Maybe worth asking in the main FCC room
@esayago okay well all in all it looks good and seems to work
Enrique Sayago
@esayago
Jun 04 2016 18:33
thank you
Chris Lacaille
@ChrisL108
Jun 04 2016 18:35
@dhcodes yea true lol thanks though
CamperBot
@camperbot
Jun 04 2016 18:35
chrisl108 sends brownie points to @dhcodes :sparkles: :thumbsup: :sparkles:
:cookie: 942 | @dhcodes |http://www.freecodecamp.com/dhcodes
Hey guys I want to access the value of that text box using java script and I am pretty sure my html is wrong can someone help me?
avistein
@avistein
Jun 04 2016 18:46
@sorinr still no luck :/
Ken Nawrocki
@nawrockp
Jun 04 2016 18:52
@aryandua try prevent default
Aryan
@aryandua
Jun 04 2016 18:52
@nawrockp ok
Biazus
@Biazus
Jun 04 2016 18:53
I am developing the RandomQuotes challenge
Aryan
@aryandua
Jun 04 2016 18:53
It works thx @nawrockp
CamperBot
@camperbot
Jun 04 2016 18:53
aryandua sends brownie points to @nawrockp :sparkles: :thumbsup: :sparkles:
:cookie: 212 | @nawrockp |http://www.freecodecamp.com/nawrockp
Biazus
@Biazus
Jun 04 2016 18:53
how should I call the twitter API?
avistein
@avistein
Jun 04 2016 19:00
@Biazus use twitter web intent ,no need of API
Aryan
@aryandua
Jun 04 2016 19:09
why do my boxes instantly disappear after appearing?
http://codepen.io/aryandua/pen/OXVENY?editors=1011
parisempress
@parisempress
Jun 04 2016 19:14
Hey guys ! what is the difference between the modulus operator and the remainder operator?.....and both seem to have the sign %...... so I am a bit confused
Pete
@petegarvin1
Jun 04 2016 19:15
@parisempress they are the same just different names :D
@aryandua i have no idea... weird! sorry i know thats no help, but same boat and all that :beers:
parisempress
@parisempress
Jun 04 2016 19:16
well in the tutorial said "The remainder operator is sometimes incorrectly referred to as the "modulus" operator. It is very similar to modulus, but does not work properly with negative numbers." @petegarvin1
so that is why I was a bit confused on the signs
Pete
@petegarvin1
Jun 04 2016 19:16
ah ok.. i stand corrected
parisempress
@parisempress
Jun 04 2016 19:18
Thanks anyhow @petegarvin1
CamperBot
@camperbot
Jun 04 2016 19:18
parisempress sends brownie points to @petegarvin1 :sparkles: :thumbsup: :sparkles:
:cookie: 425 | @petegarvin1 |http://www.freecodecamp.com/petegarvin1
Pete
@petegarvin1
Jun 04 2016 19:18
:+1:
Matt Leonard
@matty22
Jun 04 2016 19:20
anyone around who has done their markdown previewer?
Manny
@Alloffices
Jun 04 2016 19:35
List of popular CSS libraries for 2016: https://campers-c.herokuapp.com/devtools/css-libraries
Le Twitch
@notalkingplz
Jun 04 2016 20:02

http://codepen.io/letwitch/pen/BzNVPN?editors=0012

The last two console outputs should be 422 followed by 404, but it isn't always like that. The requests are in the wrong order. How can I fix it?

Kevin Holmes
@codersc
Jun 04 2016 20:09
can anyone look at my simon game. i cant get my jquery animations to work all the time. its like it works the first four-five times and then stops. please help this is the last prject befre i can get the FE cert
http://codepen.io/sc_developer/pen/QEwrKP?editors=0001
@notalkingplz i dont think you can use https try http
Manny
@Alloffices
Jun 04 2016 20:14
Kite augments your coding environment with all the internet’s programming knowledge. https://goo.gl/wGfuH4
Biazus
@Biazus
Jun 04 2016 20:39
@avistein ok I will check it out
Biazus
@Biazus
Jun 04 2016 21:11
@avistein ok it worked, thanks
CamperBot
@camperbot
Jun 04 2016 21:11
biazus sends brownie points to @avistein :sparkles: :thumbsup: :sparkles:
:cookie: 239 | @avistein |http://www.freecodecamp.com/avistein
peterjameslewis1
@peterjameslewis1
Jun 04 2016 21:15
shall i make a button with the <button> tag or the <form> tag
what is the differance
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 21:17
@peterjameslewis1 button
@peterjameslewis1 form is only used for data
@peterjameslewis1 If i wanted to create a place for someone to put their email in I would do it in the form tag
Biazus
@Biazus
Jun 04 2016 21:19
@peterjameslewis1 you don't need a form if you are not sending anything to the server
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 21:19
@peterjameslewis1 if i wanted to create a way for them to send a email i would add a button tag
Isaac Pak
@pak11273
Jun 04 2016 21:21
can anyone check out my twitter pen. i'm trying to get the twitch thumbnails for each streamer to load right.
https://codepen.io/pak11273/pen/GqRawZ?editors=0011
Pawan
@pawan92
Jun 04 2016 21:22
hey all im trying to link my streams to their respective twitch channels using the html link anchor and it doesnt seem to be working..any tips? http://codepen.io/pawan92/pen/MyMRwo/?editors=1111
Islam Ibakaev
@dagman
Jun 04 2016 21:24
hey guys i changed about animation. how it looks? what u would be change in it?
DC
@dctor
Jun 04 2016 21:27
hey all, for the Local Weather project, how to find the user's location? is that by ip?
peterjameslewis1
@peterjameslewis1
Jun 04 2016 21:27
@emmanuelledebarge i googled how to create a button and people are saying put it in a form tag
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 21:28
@peterjameslewis1 depends what you are trying to mak
peterjameslewis1
@peterjameslewis1
Jun 04 2016 21:28
@emmanuelledebarge just to link to another website
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 21:29
@peterjameslewis1 then you use the href attribute
@peterjameslewis1 no buttons are needed
peterjameslewis1
@peterjameslewis1
Jun 04 2016 21:31
@emmanuelledebarge i want it to be a button that you click on that takes you to github and stuff
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 21:31
@peterjameslewis1 oh easy
@peterjameslewis1 first you have to import a bootstrap class
peterjameslewis1
@peterjameslewis1
Jun 04 2016 21:32
is alot of stuff bootrap when coding html and css? @emmanuelledebarge
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 21:32
@peterjameslewis1 yes
@peterjameslewis1 <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"><link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet">
@peterjameslewis1 you need those 2
peterjameslewis1
@peterjameslewis1
Jun 04 2016 21:33
becuse im extremly new to all this i am trying to focus on learning html and css as best as i can then i was going to go onto bootstrap
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 21:33
@peterjameslewis1 bootstrap is kind of part of html/css
peterjameslewis1
@peterjameslewis1
Jun 04 2016 21:33
@emmanuelledebarge that code you just gave me goes in <head> right
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 21:33
@peterjameslewis1 yes
peterjameslewis1
@peterjameslewis1
Jun 04 2016 21:34
i just see it as another scary code lanugage @emmanuelledebarge
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 21:34
@peterjameslewis1 well, bootstrap isnt really another language more of anohter libary
peterjameslewis1
@peterjameslewis1
Jun 04 2016 21:35
i am creating a personal portfolio as a task on freecodecamp
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 21:35
@peterjameslewis1 then if i wanted to add instagram heres what i would do
<a class="btn btn-block btn-social btn-instagram">
<span class="fa fa-instagram">Instagram</span>
peterjameslewis1
@peterjameslewis1
Jun 04 2016 21:36
how do i start creating the buttons as i have to do it in bootstrap
@emmanuelledebarge
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 21:36
@peterjameslewis1 <a class="btn btn-block btn-social btn-instagram">
<span class="fa fa-instagram">Instagram</span>
@peterjameslewis1 that would be a instagram button
@peterjameslewis1 if i wanted github i would just change all the parts that say instagram to github
Enrique Sayago
@esayago
Jun 04 2016 21:38
peterjameslewis1
@peterjameslewis1
Jun 04 2016 21:38
is it jQuery that starts everything with $
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 21:38
@peterjameslewis1 yes
peterjameslewis1
@peterjameslewis1
Jun 04 2016 21:38
@emmanuelledebarge im super confused
cant wait unfil im boss of thnis
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 21:38
@peterjameslewis1 jQuery uses the cash sign operator, whats wrong?
Enrique Sayago
@esayago
Jun 04 2016 21:39
@peterjameslewis1 It's ok to be confused, try not to skip any steps and read a lot from other sources as you go
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 21:40
peterjameslewis1
@peterjameslewis1
Jun 04 2016 21:41
@emmanuelledebarge @esayago cheers, its just trying to memorise all the tags. im not expecting myself to memorize all the tags in the first few weeks but its confusing having to do it on your own after all these websites hold your hand with tutorials
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 21:41
@peterjameslewis1 hahaha i dont have these memorized at all....
Enrique Sayago
@esayago
Jun 04 2016 21:42
@peterjameslewis1 dn't put to much energy on memorizing but on understanding the logic of your code....
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 21:42
@peterjameslewis1 When im coding I just try to find out what i want to do
Enrique Sayago
@esayago
Jun 04 2016 21:43
@peterjameslewis1 you can always google if you don't remember
peterjameslewis1
@peterjameslewis1
Jun 04 2016 21:43
@emmanuelledebarge @esayago true, if i understood all the tags i have read it would be a lot easier
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 21:43
@peterjameslewis1 For example: I want to create a button, i forgot the code for it i usually just go http://www.w3schools.com/bootstrap/bootstrap_buttons.asp or the bootstrap web
peterjameslewis1
@peterjameslewis1
Jun 04 2016 21:44
@emmanuelledebarge @esayago i never understood the class="container-fluid" class
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 21:44
@peterjameslewis1 Use .container-fluid for a full width container, spanning the entire width of your viewport.
peterjameslewis1
@peterjameslewis1
Jun 04 2016 21:45
@emmanuelledebarge they are all great resources i just need to get down which order all the code goes in
@emmanuelledebarge and normal class="jumbotron" to have a smaller container
Emmanuelle DeBarge
@emmanuelledebarge
Jun 04 2016 21:46
@peterjameslewis1 gotcha, we all have our struggles with programming but its always good to remember what our end goal is
yes
JD Tadlock
@jdtdesigns
Jun 04 2016 21:47
@pawan92 Here ya go. I fixed the css, added an online class to show a difference and tweeked the js. ;) http://codepen.io/jdtadlock/pen/QEbBdq?editors=0100
peterjameslewis1
@peterjameslewis1
Jun 04 2016 21:47
@emmanuelledebarge i also have struggles with moving around things with margins padding stuff like that, but ive been doing this for about a week so maybe i should chikll out
JD Tadlock
@jdtdesigns
Jun 04 2016 21:51
@peterjameslewis1 Learning this stuff takes years, and can be frustrating. Just push through and don't give up, and it will pay off. ;)
peterjameslewis1
@peterjameslewis1
Jun 04 2016 21:52
i was hoping to learn html, css, Bootstrap and JS in a year haha @jdtdesigns
Pawan
@pawan92
Jun 04 2016 21:55
@jdtdesigns THANKS!! =)
CamperBot
@camperbot
Jun 04 2016 21:55
pawan92 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 437 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
peterjameslewis1
@peterjameslewis1
Jun 04 2016 22:00
@emmanuelledebarge how did you get that github button to center on my page?
@emmanuelledebarge no worries i got it
JD Tadlock
@jdtdesigns
Jun 04 2016 22:04
@peterjameslewis1 no chance, unless you're a genius :P
these fake ads on youtube and other places saying you can be a developer in 6 weeks and crap are lies
it will only make you want to quit if you don't face the reality of learning this stuff
Justin Woodward
@jwoo92
Jun 04 2016 22:07
@jdtdesigns hey i finally completed the roman numeral converter challenge, though my code is not the cleanest ive produced.

function convertToRoman(num) {
 var number = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];
 var roman = ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I'];
 var numStr = num.toString().split('').reverse();  
 var add = 0;
 var result = [];

  for (var i = 1; i < numStr.length; i++) {  

    while (add < i) {  

      if (numStr[i] === '0') {
      add++;
      } else {
      numStr[i] += '0'; 
      add++;
      }      
    } 
    add = 0;
  }

  numStr = numStr.reverse().map(Number);

  for (i = 0; i < numStr.length; i++) {

    while (numStr[i] - number[add] < 0) {
      add++;
    }

    while (numStr[i] - number[add] >= 0) {
      numStr[i] = numStr[i] - number[add];
      result += roman[add];
    }

    while (numStr[i] - number[add] < 0) {
      add++;
    }

    while (numStr[i] - number[add] >= 0) {
      numStr[i] = numStr[i] - number[add];
      result += roman[add];
    }  
    add = 0;
  }

 return result;

}
convertToRoman(16);
JD Tadlock
@jdtdesigns
Jun 04 2016 22:20
@jwoo92 nice!
Justin Woodward
@jwoo92
Jun 04 2016 22:20
@jdtdesigns thanks, i was up all night working on that until 7-8am this morning.
CamperBot
@camperbot
Jun 04 2016 22:20
jwoo92 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 438 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
JD Tadlock
@jdtdesigns
Jun 04 2016 22:21
but now, many more things will make sense to you
you'll be glad you spent the time figuring it out ;)
Justin Woodward
@jwoo92
Jun 04 2016 22:22
@jdtdesigns thank god for console.log lol
CamperBot
@camperbot
Jun 04 2016 22:22
jwoo92 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:warning: jwoo92 already gave jdtdesigns points
JD Tadlock
@jdtdesigns
Jun 04 2016 22:22
oh yes
Maritimesailor
@Maritimesailor
Jun 04 2016 22:26
Hey yall I am currently working on the twitch streaming app. Using angularjs I was able to make the api call to twitch which returns an array. I am having trouble getting access to the actual data in order to get it on the screen here is my pen http://codepen.io/whatisthis/pen/dXoeKV
Thank you in advance
Pawan
@pawan92
Jun 04 2016 22:35
hey @jdtdesigns another question...trying to output channels that are unavailable as 'unavailable' by setting the data.stream===undefined and its not working..do you know what im missing
Justin Woodward
@jwoo92
Jun 04 2016 22:36
would anyone be able to help guide me in the right direction? my filter function is failing to produce the correct results.

function whereAreYou(collection, source) {
  // What's in a name?
  var arr = [];
  // Only change code below this line

  function test(value) {

    if (Object.is(value, source)) {
      value = true;
    } else {
      value = false;
    }   
  }

  arr = collection.filter(test);

  console.log(arr);

  // Only change code above this line
  return arr;
}

whereAreYou([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" });
Maritimesailor
@Maritimesailor
Jun 04 2016 22:36
Post in the javascript
room
JD Tadlock
@jdtdesigns
Jun 04 2016 22:37
this is a js room
Maritimesailor
@Maritimesailor
Jun 04 2016 22:37
True my bad @jdtdesigns
Alex DeCapri
@alexdecapri
Jun 04 2016 22:41
Can anyone help me with AJAX requests via jQuery for the Random Quote Machine? I'm not getting any quotes to come through and I have -albeit incorrectly- something set up.
JD Tadlock
@jdtdesigns
Jun 04 2016 22:42
@pawan92 post your codepen again
@jdtdesigns
JD Tadlock
@jdtdesigns
Jun 04 2016 22:48
@pawan92 just check for if ( data.status === 422 ) instead
Tulio Natale
@tuliodnw
Jun 04 2016 22:50
people im doing the pomodoro clock, but have problem with the timers, this is how im doing that isnt working
(function countdown(num) {
num--;
document.getElementById("counter").value = num;
}, 1000);
i call the function from the start button

people im doing the pomodoro clock, but have problem with the timers, this is how im doing that isnt working

(function countdown(num) {
   num--;    
    document.getElementById("counter").value = num;
    }, 1000);

i call the function from the start button

JD Tadlock
@jdtdesigns
Jun 04 2016 22:52
@tuliodnw you're calling a function
you need to be setting an interval
Pawan
@pawan92
Jun 04 2016 22:52
@jdtdesigns i tried it doesnt seem to work..comster404 always says offline
JD Tadlock
@jdtdesigns
Jun 04 2016 22:53
@pawan92 it's a number not a string
take the quotes off and you're good
Tulio Natale
@tuliodnw
Jun 04 2016 22:56
@jdtdesigns thanks, doing it
CamperBot
@camperbot
Jun 04 2016 22:56
tuliodnw sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 439 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
Pawan
@pawan92
Jun 04 2016 22:59
@jdtdesigns tried both it wont work :/
@alexdecapri I did a few things but all that wa really needed was a capital T on dataType
Islam Ibakaev
@dagman
Jun 04 2016 23:21
This message was deleted
Alex DeCapri
@alexdecapri
Jun 04 2016 23:21
goodness, thanks so much @mutantspore sometimes you need a second set of eyes!
CamperBot
@camperbot
Jun 04 2016 23:21
alexdecapri sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star2: 1708 | @mutantspore |http://www.freecodecamp.com/mutantspore
Islam Ibakaev
@dagman
Jun 04 2016 23:23
can someone provide me with image similar to this or tell where can i find it?
https://www.dropbox.com/s/k7fsyilveqz6n5b/blurred.jpg?dl=0
Frostyjayy
@Frostyjayy
Jun 04 2016 23:26
@dagman see if you can find anything in http://www.pixeden.com/graphic-web-backgrounds
Pawan
@pawan92
Jun 04 2016 23:27
@jdtdesigns thanks! i was doing data.stream instead of data.status!
CamperBot
@camperbot
Jun 04 2016 23:27
pawan92 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 440 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
Dan
@dcgoings
Jun 04 2016 23:27
can someone take a look at this tribute page? im trying to figure out what's going on at the bottom (red, white, and blue colors are only there to help me identify what's going on)
http://codepen.io/dcgoings/pen/MeWBwz
Tulio Natale
@tuliodnw
Jun 04 2016 23:28
can someone tell me why rthis method to pause my set interval didnt work? and how can i fix it?
$("#start").click(function() {
   $(".remove2").show();
   $(".remove").hide();
   if (num > 0) {

     var timer = setInterval(function countdown() {
       num--;
       document.getElementById("counter").value = num;
       if (num <= 0) {
         clearInterval(timer);
       }
     }, wait);
   }
 });

$("#pause").click(function() {
  wait=0;
     $("#pause").hide();
   $("#play").show();
 });
wait normally is at 100
1000*
JD Tadlock
@jdtdesigns
Jun 04 2016 23:31
// set the interval like this instead
window.timer = setInterval(function() {});

// to pause
$('#pause').click(function() {
  clearInterval(window.timer);
});
@tuliodnw
Islam Ibakaev
@dagman
Jun 04 2016 23:31
@dcgoings @Frostyjayy thx guys i will try
CamperBot
@camperbot
Jun 04 2016 23:31
dagman sends brownie points to @dcgoings and @frostyjayy :sparkles: :thumbsup: :sparkles:
:cookie: 100 | @frostyjayy |http://www.freecodecamp.com/frostyjayy
:cookie: 247 | @dcgoings |http://www.freecodecamp.com/dcgoings
Tulio Natale
@tuliodnw
Jun 04 2016 23:32
@jdtdesigns that stops it, i want pause, that one alredy works
so you can pause and later on play again.
JD Tadlock
@jdtdesigns
Jun 04 2016 23:32
lol, pause is the same as stop
when you click start, it will start from where it was again
Tulio Natale
@tuliodnw
Jun 04 2016 23:33
ups then, i dont know how to call it
JD Tadlock
@jdtdesigns
Jun 04 2016 23:34
wait should remain 1000
so just set the interval to 1000 instead of using a variable
alpox
@alpox
Jun 04 2016 23:36

@dcgoings

.main {
    background-color: #e4e4e4;
    margin-top: 0px;
    display: table;
}

.bottom-box {
    display: table-cell;
    float: none;
}

---> class="col-xs-4 bottom-box"
this could solve your problem :-)

Tulio Natale
@tuliodnw
Jun 04 2016 23:36
lets say i start at 8, and in 5 i want to pause it until i click a button
@jdtdesigns
how can i do that?
Dan
@dcgoings
Jun 04 2016 23:37
@alpox i actually had a weird -10px margin somewhere. i think im good now! i might mess around with your idea though just to learn. thanks!
CamperBot
@camperbot
Jun 04 2016 23:37
dcgoings sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:cookie: 667 | @alpox |http://www.freecodecamp.com/alpox
alpox
@alpox
Jun 04 2016 23:37
@dcgoings Yup i know, that messed things up. The rest is to make the height appropriate
@tuliodnw Just clear the interval and start it again on next click of the button with setInterval
Tulio Natale
@tuliodnw
Jun 04 2016 23:42
@alpox that would work, but is there no way to pause it?
alpox
@alpox
Jun 04 2016 23:43

@tuliodnw

var timer;
var pause;

function runTimer() {
    if (num > 0) {

     timer = setInterval(function countdown() {
       num--;
       document.getElementById("counter").value = num;
       if (num <= 0) {
         clearInterval(timer);
       }
     }, wait);
   }
}
$("#start").click(function() {
   $(".remove2").show();
   $(".remove").hide();
   runTimer();
 });

$("#pause").click(function() {
  $("#pause").hide();
   $("#play").show();
   if(pause) 
       runTimer();
   else
       clearInterval(timer);
 });

Something like this (Not tested!)

alpox
@alpox
Jun 04 2016 23:43
@tuliodnw No it only works this way
Tulio Natale
@tuliodnw
Jun 04 2016 23:43
@jdtdesigns @alpox thanks
CamperBot
@camperbot
Jun 04 2016 23:43
tuliodnw sends brownie points to @jdtdesigns and @alpox :sparkles: :thumbsup: :sparkles:
:warning: tuliodnw already gave jdtdesigns points
:cookie: 668 | @alpox |http://www.freecodecamp.com/alpox
How make the break length be like the session length css wise