These are chat archives for FreeCodeCamp/HelpFrontEnd

10th
Apr 2016
for some reason the div with id "portfolio" won't show my background-image either
Michael Karpinski
@karpimpski
Apr 10 2016 00:05
@bhenriquez8 you should put your background images in your CSS tab
it's cleaner that way
@bhenriquez8 anyway, the img src in your portfolio div is #. a dead link
bhenriquez8
@bhenriquez8
Apr 10 2016 00:06
@karpimpski i thought i was doing that? i made a .sky-bg class in my css tab
Michael Karpinski
@karpimpski
Apr 10 2016 00:07
there's nothing like that in your css tab, at least not on this one. let me go to the full link, maybe it didn't update in the chat
@bhenriquez8 no, there's no sky-bg class in your css tab
Lengieng Ing
@lengieng
Apr 10 2016 00:07
Anyone could help me on this? Looks like my jQuery doesn't work on mobile. I tested on Safari and firefox on iOS9. Both didn't work.
https://codepen.io/lengieng/full/vGpbvB/
bhenriquez8
@bhenriquez8
Apr 10 2016 00:08
@karpimpski okay wait, maybe it's because i forgot to save. can you check again?
Michael Karpinski
@karpimpski
Apr 10 2016 00:11
@bhenriquez8 sorry, I'm not sure. maybe try a different image and see if that works?
wonsi
@wonsi
Apr 10 2016 00:12
Does anyone know why the jquery in this pen http://codepen.io/CorneliusMooseknuckle/full/BKJXME/ would display fine in my desktop , but not not at all on my android phone? Any help is appreciated.
bhenriquez8
@bhenriquez8
Apr 10 2016 00:13
@karpimpski i'll try, just think it's weird how the class works for <div id="about"> but not <div id="portfolio">
Patrick Ayres
@Pat-Ayres
Apr 10 2016 00:13
@bhenriquez8 the class is working fine, for some reason the div just has a height of 0, if you inspect element and manually set it to a larger height you can see that the background image is there
bhenriquez8
@bhenriquez8
Apr 10 2016 00:16
@Pat-Ayres have no idea how to do that lol. i'm new. so right click on my codepen and look to increase the height on that div element?
Michael Karpinski
@karpimpski
Apr 10 2016 00:17
@bhenriquez8 in css just manually make height: 100px, or however high you want it
you should see an image
@wonsi fix your HTML
@wonsi try moving your first row div above the container div. that should work
bhenriquez8
@bhenriquez8
Apr 10 2016 00:20
@karpimpski oh wow that worked! have no idea why though. thanks
CamperBot
@camperbot
Apr 10 2016 00:20
bhenriquez8 sends brownie points to @karpimpski :sparkles: :thumbsup: :sparkles:
:star: 281 | @karpimpski | http://www.freecodecamp.com/karpimpski
Michael Karpinski
@karpimpski
Apr 10 2016 00:20
@bhenriquez8 your container should have been in one row, that's good. but everything within the container should not have been wrapped in a row, because that confuses the computer when you have other rows within a row
@bhenriquez8 i'm not very good at explaining, but i hope that at least shed a little light on your problem. and no worries!
bhenriquez8
@bhenriquez8
Apr 10 2016 00:24
@karpimpski hmm, what would have been the better approach? i'm glad i encountered this now though so i can learn from it
Patrick Ayres
@Pat-Ayres
Apr 10 2016 00:26
@bhenriquez8 you have an extra div in the portfolio that is conflicting: <div class="col-md-9">
bhenriquez8
@bhenriquez8
Apr 10 2016 00:27
@Pat-Ayres ah man :( I think i'll just work off my text editor, it's a lot easier to see how it's structured when it's on a bigger screen
Patrick Ayres
@Pat-Ayres
Apr 10 2016 00:27
@bhenriquez8 I'm not exactly sure why, but that is what is setting the div's height to 0
bhenriquez8
@bhenriquez8
Apr 10 2016 00:28
@Pat-Ayres thanks for pointing that out :) and yeah it's really weird
CamperBot
@camperbot
Apr 10 2016 00:28
bhenriquez8 sends brownie points to @pat-ayres :sparkles: :thumbsup: :sparkles:
:star: 270 | @pat-ayres | http://www.freecodecamp.com/pat-ayres
Patrick Ayres
@Pat-Ayres
Apr 10 2016 00:28
@bhenriquez8 you're welcome
Michael Karpinski
@karpimpski
Apr 10 2016 00:28
@bhenriquez8 sorry about before, I thought you were wosni. that's why I gave you confusing advice
bhenriquez8
@bhenriquez8
Apr 10 2016 00:29
@karpimpski haha it's okay, i freaked out a bit because i thought it wasn't showing my css but it's all good
does anyone know of any browser extensions that's useful to a web developer?
Michael Karpinski
@karpimpski
Apr 10 2016 00:34
@bhenriquez8 also, this one's very useful for me (not only for web dev, for other purposes too) https://chrome.google.com/webstore/detail/whatfont/jabopobgcpjmedljpbcaablpmlmfcogm
Stein-T Dale
@Lofthur
Apr 10 2016 00:36
Hi all. I have started the Build a Random Quote Machine project. I have been searching for hours to find a free quote api that works. I have found some that are free but when I try them i get this error: No 'Access-Control-Allow-Origin. Can someone help me out?
Michael Karpinski
@karpimpski
Apr 10 2016 00:37
@Lofthur if you're not too worried about having a ton of quotes, just make 2 arrays for quotes and the source (don't worry, you'll have plenty of practice with an API next project)
@Lofthur other than that, I'm not sure. I personally didn't use an API for that project
Stein-T Dale
@Lofthur
Apr 10 2016 00:37
Ahhh. I just thought we had to since we had the api call lessons first :D
Michael Karpinski
@karpimpski
Apr 10 2016 00:38
@Lofthur doesn't say anything in the objectives, at least I don't think. but you'll definitely need an API for the weather project so you won't be missing much practice
bhenriquez8
@bhenriquez8
Apr 10 2016 00:38
@karpimpski thanks! yeah i keep hearing there are useful tools out there that make debugging and stuff easier
CamperBot
@camperbot
Apr 10 2016 00:38
bhenriquez8 sends brownie points to @karpimpski :sparkles: :thumbsup: :sparkles:
:warning: bhenriquez8 already gave karpimpski points
Michael Karpinski
@karpimpski
Apr 10 2016 00:39
@bhenriquez8 as far as debugging, I'm not sure. codepen helps a bit, let me see if i can find you any decent debugging tools quick
@bhenriquez8 oh, the first link I gave does have debugging tools in it!
Stein-T Dale
@Lofthur
Apr 10 2016 00:39
@karpimpski Thanks. That makes this project a bit easier :D
CamperBot
@camperbot
Apr 10 2016 00:39
lofthur sends brownie points to @karpimpski :sparkles: :thumbsup: :sparkles:
:star: 282 | @karpimpski | http://www.freecodecamp.com/karpimpski
Michael Karpinski
@karpimpski
Apr 10 2016 00:39
@Lofthur no problem sir. if you need any help figuring out the arrays, just reply my name
Stein-T Dale
@Lofthur
Apr 10 2016 00:40
Will do :D
bhenriquez8
@bhenriquez8
Apr 10 2016 00:40
@karpimpski haha sweet! i'll check them out now
Michael Karpinski
@karpimpski
Apr 10 2016 00:55
i have a question about the grid system
if i want a specific width for 1 size, is there any way to do that without typing out widths for all of the sizes?
Robert Richey
@0x0936
Apr 10 2016 01:04
for anyone that has completed tic tac toe and implemented minimax, did you construct a binary search tree to hold nodes? did you use objects as these nodes, holding references to prev & next nodes? What reference material did you use - blog posts, video lectures, documentation? Did you add alpha beta pruning? any other layers approaching 'Deep Blue' A.I.?
Michael Karpinski
@karpimpski
Apr 10 2016 01:15
http://codepen.io/karpimpski/pen/YqYQXy here is my to-do list so far (personal project)
how would I make it so that, when you click a checkbox, it strikes through the text or even removes it?
Brandon Lee
@brandonlee781
Apr 10 2016 01:19
Does anyone know when using flexbox, do I need to add "display: flex" to every flexbox element or is it inherited from parent elements?
Robert Richey
@0x0936
Apr 10 2016 01:29
@karpimpski got a forked pen showing how to line-through the text. lines 11 and 33 show the changes
@brandonlee781 display: flex; applies to the current element only and all of it's direct children become flex items. It is not inherited.
Brandon Lee
@brandonlee781
Apr 10 2016 01:30
@0x0936 Awesome, thanks!
CamperBot
@camperbot
Apr 10 2016 01:30
brandonlee781 sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 1269 | @0x0936 | http://www.freecodecamp.com/0x0936
Michael Karpinski
@karpimpski
Apr 10 2016 02:15
@0x0936 thank you! any way to do an animation with the strikethrough to make it slower?
CamperBot
@camperbot
Apr 10 2016 02:15
karpimpski sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 1270 | @0x0936 | http://www.freecodecamp.com/0x0936
MichaelTsang
@MichaelTsang
Apr 10 2016 02:24
$(document).ready(function(){
    $("#change").on("click",function(){
        $.getJSON('quoteJSON.json', setQuote);
        function setQuote(data){
           for (var i = 0; i < data.rows.length; i++) {
               var randomRow = parseInt(Math.random()*data.rows.length); 
               var content = data.rows[randomRow].content ;
               var author = data.rows[randomRow].author;
              $('#quote').html('<p>' +randomRow+content + '</p>');
              $('#author').html('<p>' +randomRow+ author + '</p>');
           }

        function getQuote(){
                   alert(content);
           }
           return getQuote;
        }

});
why can't this closure work?
click button setQuote() work , but getQuote() do nothing
Michael Karpinski
@karpimpski
Apr 10 2016 02:28
@0x0936 I got it, and was even able to make it so that unchecking the box took the strike away! http://codepen.io/karpimpski/pen/YqYQXy thank you!
CamperBot
@camperbot
Apr 10 2016 02:28
karpimpski sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:warning: karpimpski already gave 0x0936 points
Michael Karpinski
@karpimpski
Apr 10 2016 02:29
now what doesevent.preventDefault do?
Michael Karpinski
@karpimpski
Apr 10 2016 02:36
@dhcodes I know, thanks for the link though! I was asking more about what it does in my code
CamperBot
@camperbot
Apr 10 2016 02:36
karpimpski sends brownie points to @dhcodes :sparkles: :thumbsup: :sparkles:
:star: 582 | @dhcodes | http://www.freecodecamp.com/dhcodes
Michael Karpinski
@karpimpski
Apr 10 2016 02:37
@dhcodes when i take it out, nothing changes with my app
Dylan
@dhcodes
Apr 10 2016 02:39
ah @karpimpski I don't see it in your code though
Michael Karpinski
@karpimpski
Apr 10 2016 02:39
@karpimpski yeah, I removed it. it was at the end of my keypress function
Patrick Ayres
@Pat-Ayres
Apr 10 2016 02:47
@karpimpski it might not actually be doing anything in your code, i think it's generally just seen as a good practice to avoid possible bugs across different browsers
Michael Karpinski
@karpimpski
Apr 10 2016 02:48
@Pat-Ayres i'm not trying to sound smart or anything, this is a real question. but what do you mean? how does it prevent bugs, and when should I use event.preventDefault?
JD Tadlock
@jdtdesigns
Apr 10 2016 02:52
It prevents the default behavior of the element you've set it on. If you use it on a link, the link won't load a url.
You can use it to change the behavior of element events
Patrick Ayres
@Pat-Ayres
Apr 10 2016 02:54
@karpimpski I think some people would say to just always use event.preventdefault, others would say to only use it if you encounter a bug and absolutely need it, so on that front it depends, personally I tend to use it more often than not.
Robert Richey
@0x0936
Apr 10 2016 02:57
I typically find that I only use e.preventDefault() on links being clicked or form submit buttons. I've used it once to create my own right-click context menu. This is also how some websites prevent you from right clicking an image - presumably to prevent you from saving it
Patrick Ayres
@Pat-Ayres
Apr 10 2016 03:01
@karpimpski as for how it prevents bugs, the main purpose of it is to stop contradictory triggers on an event, for instance imagine you have a table with rows of to-dos, you might have a click event on your row that opens the to-do in an editor, but you also have a "delete" column with a button to delete the to-do in that cell. Well in that instance if you need to use event.preventDefault when the user clicks the delete button, otherwise the event will bubble up to your row trigger and try to open the deleted to-do in your editor, potentially causing an error
Dylan
@dhcodes
Apr 10 2016 03:02
@0x0936 great examples
Miguel T Rivera
@mtrivera
Apr 10 2016 03:24
wiki quote
CamperBot
@camperbot
Apr 10 2016 03:24

:point_right: challenge escaping literal quotes in strings [wiki]

Escaping Literal Quotes in Strings

In JavaScript, you can escape a quote from considering it as an end of string quote by placing a backslash \ in front of the quote.

"Alan said, \"Peter is learning JavaScript\"."

This signals JavaScript that the following quote is not the end of the string, but should instead appear inside the string.

However another option is to alternate quotation marks if possible. 'Alan said, "Peter is learning JavaScript"' this would also work.

:pencil: read more about challenge escaping literal quotes in strings on the FCC Wiki

Miguel T Rivera
@mtrivera
Apr 10 2016 03:25
wiki random quote machine
CamperBot
@camperbot
Apr 10 2016 03:25
no wiki entry for: random quote machine
Paul Borawski
@iAmNawa
Apr 10 2016 03:28
@migueltrivera can we help you?
Miguel T Rivera
@mtrivera
Apr 10 2016 03:47
@iAmNawa im completely lost with the quote machine its driving me nuts, I think i might work on the weather one and come back to it later
Paul Borawski
@iAmNawa
Apr 10 2016 03:51
@migueltrivera I did the weather one first, I haven’t done the quote one yet either. I would check youtube for how to make a random quote machine, you might find something
Miguel T Rivera
@mtrivera
Apr 10 2016 03:53
@iAmNawa thanks
CamperBot
@camperbot
Apr 10 2016 03:53
migueltrivera sends brownie points to @iamnawa :sparkles: :thumbsup: :sparkles:
:star: 386 | @iamnawa | http://www.freecodecamp.com/iamnawa
Michael Karpinski
@karpimpski
Apr 10 2016 04:08
@migueltrivera I think programming 360 has something on it
the youtube channel is named something like that
Mark Little
@MarkBLittle
Apr 10 2016 04:08
@migueltrivera Did you try making a JSON object on CodePen and calling directly from that, rather than trying to use an API?
Patrick Black
@Mortiferr
Apr 10 2016 04:11
Paul Borawski
@iAmNawa
Apr 10 2016 04:14
@Mortiferr Usually an animation on a box like that means you should be abel to click
@Mortiferr looks good though
Patrick Black
@Mortiferr
Apr 10 2016 04:15
good point
I was really just messing with shadows
and trying to make it look less bland
@iAmNawa
Miguel T Rivera
@mtrivera
Apr 10 2016 04:16
@MarkBLittle idk how to do that, im going to do the weather one first
Mark Little
@MarkBLittle
Apr 10 2016 04:17
Do you not know how to set up a JSON object, or just how to call it?
Matt Yamamoto
@MattYamamoto
Apr 10 2016 04:17
@migueltrivera I think he means just create an object... but you can just as easily use an array
Patrick Black
@Mortiferr
Apr 10 2016 04:18
@iAmNawa Check it out now? I removed the inversion effect on the button and the shadow on the well and added a shadow to the button instead
Gregory Buhler
@Gregory-Buhler
Apr 10 2016 04:18
Hey guys, any thoughts on this: http://codepen.io/Gregory-Buhler/full/WwdVba/
Paul Borawski
@iAmNawa
Apr 10 2016 04:18
@Mortiferr looks better
Parminder Singh
@Trion129
Apr 10 2016 04:19
@Mortiferr Looks great! Also add a tweet button
Patrick Black
@Mortiferr
Apr 10 2016 04:20
@Gregory-Buhler Looks good, but I would say remove the hover effect on the buttons because it makes it look like they're being pressed
Vyani
@vyani
Apr 10 2016 04:20
@Mortiferr looks good. that's responsive too
Patrick Black
@Mortiferr
Apr 10 2016 04:20
@vyani thanks, I have to make things responsive or it kills me
CamperBot
@camperbot
Apr 10 2016 04:20
mortiferr sends brownie points to @vyani :sparkles: :thumbsup: :sparkles:
Paul Borawski
@iAmNawa
Apr 10 2016 04:20
@Gregory-Buhler damn that actually looks like a calculator
Matt Yamamoto
@MattYamamoto
Apr 10 2016 04:20
@Gregory-Buhler looks good, but I can't seem to add a decimal point to a number with more than two digits.
CamperBot
@camperbot
Apr 10 2016 04:20
:star: 222 | @vyani | http://www.freecodecamp.com/vyani
Gregory Buhler
@Gregory-Buhler
Apr 10 2016 04:20
@Mortiferr Maybe do it for an active?
@MattYamamoto I'll take a look at that.
Patrick Black
@Mortiferr
Apr 10 2016 04:21
@vyani Thanks very much!
CamperBot
@camperbot
Apr 10 2016 04:21
mortiferr sends brownie points to @vyani :sparkles: :thumbsup: :sparkles:
:warning: mortiferr already gave vyani points
Vyani
@vyani
Apr 10 2016 04:21
haha yeah sure @Mortiferr
Gregory Buhler
@Gregory-Buhler
Apr 10 2016 04:21
@Mortiferr @MattYamamoto Thanks.
CamperBot
@camperbot
Apr 10 2016 04:21
gregory-buhler sends brownie points to @mortiferr and @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 946 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
:star: 189 | @mortiferr | http://www.freecodecamp.com/mortiferr
Paul Borawski
@iAmNawa
Apr 10 2016 04:21
@Gregory-Buhler How did you get the shadow on the inside of the calculator?
Gregory Buhler
@Gregory-Buhler
Apr 10 2016 04:21
@iAmNawa box-shadow: inset 0 0 10px colorhere;
Patrick Black
@Mortiferr
Apr 10 2016 04:22
@iAmNawa sure, as soon as I get the notif I'll follow back
Paul Borawski
@iAmNawa
Apr 10 2016 04:22
oh nice. @Gregory-Buhler thanks! looks great
CamperBot
@camperbot
Apr 10 2016 04:22
iamnawa sends brownie points to @gregory-buhler :sparkles: :thumbsup: :sparkles:
Gregory Buhler
@Gregory-Buhler
Apr 10 2016 04:22
@iAmNawa I declare an inset and a regular to give it a more 3d effect.
Parminder Singh
@Trion129
Apr 10 2016 04:22
@Gregory-Buhler Awesome calculator :+1:
CamperBot
@camperbot
Apr 10 2016 04:22
:star: 312 | @gregory-buhler | http://www.freecodecamp.com/gregory-buhler
Gregory Buhler
@Gregory-Buhler
Apr 10 2016 04:22
@Trion129 Thanks!
CamperBot
@camperbot
Apr 10 2016 04:22
gregory-buhler sends brownie points to @trion129 :sparkles: :thumbsup: :sparkles:
:star: 319 | @trion129 | http://www.freecodecamp.com/trion129
Gregory Buhler
@Gregory-Buhler
Apr 10 2016 04:23
Hover now changed to active for better UI =P
Parminder Singh
@Trion129
Apr 10 2016 04:25
xP Try adding an undo button just in case someone presses AC by mistake
Gregory Buhler
@Gregory-Buhler
Apr 10 2016 04:26
@Trion129 I can try that I'll see what I can whip up.
Elbert Cortez
@trip16661
Apr 10 2016 04:33
i{m really clue less about how this wikipedia api works
so far i got results but not what i expected
D: which is kinda frustrating
since i ve been doing research for a big while
Gregory Buhler
@Gregory-Buhler
Apr 10 2016 04:52
And I feel that that final update will do it. Able to now add decimal after two digits, and an undo button is added.
Parminder Singh
@Trion129
Apr 10 2016 04:53
nice @Gregory-Buhler :)
bhenriquez8
@bhenriquez8
Apr 10 2016 05:09
okay so i know what <div class="row"><div class="col-xs-6"> does, but what does it mean when the inner class has "col-xs-6 col-md-4"???
i've asked this before and forgot.....
Gregory Buhler
@Gregory-Buhler
Apr 10 2016 05:10
Um... if you declare col-md-4
If you don't then they all inherit the 6 columns
Parminder Singh
@Trion129
Apr 10 2016 05:10
it means that on small screen devices it will span 6 cols but on medium screen(PC) it spans 4 columns
Gregory Buhler
@Gregory-Buhler
Apr 10 2016 05:10
OHHH
I read that wrong
Sorry D=
bhenriquez8
@bhenriquez8
Apr 10 2016 05:11
ohhh! that makes so much sense! i just assumed it was like making a box-like border
Parminder Singh
@Trion129
Apr 10 2016 05:12
To be noted they should always be in increasing order to work
col-md-4 col-xs-6 will span 4 on small devices too
bhenriquez8
@bhenriquez8
Apr 10 2016 05:14
so first md and then xs?
Gregory Buhler
@Gregory-Buhler
Apr 10 2016 05:14
xs then md
Parminder Singh
@Trion129
Apr 10 2016 05:15
nope first xs,then sm ,then md, then lg
not many users have sm and lg so I just omit them
Gregory Buhler
@Gregory-Buhler
Apr 10 2016 05:17
Yeah xs works pretty well for sm, and lg works for my screen but most time if you try to fill it too much the site looks cluttered.
Nagireddy Srichakradhar Reddy
@srichakradhar
Apr 10 2016 05:31
Hi everone... I'm a beginner. I'm doing the "Build a Tribute Page" exercise. I'm using a panel for the image and its description. When I add "panel-header" class, there's no gap between the image and the panel border. And when I add "panel-body" class, the gap is a bit more than what is required. how should I do it?
ajaybti
@ajaybti
Apr 10 2016 05:39
http://codepen.io/ajaybti/pen/GZObVx?editors=1111 weather info not acessing help me please.
Aryan Singh
@AryanSingh
Apr 10 2016 05:44
does anyone know how to install robomongo on linux
google says there must be a ./configure file but i cannot find it
Ogundele Olumide
@Lumexralph
Apr 10 2016 05:56
@srichakradhar try using margin and padding CSS properties, if I get what you're saying
kirbyedy
@kirbyedy
Apr 10 2016 06:05
@ajaybti its working
Rada
@Radascript
Apr 10 2016 06:07
Hey guys, I was wondering if I could see how you solved the "Sorted Union" Algorithm challenge. I solved it, but I think my method is a little wacky, and isn't using the suggested functions. If you could post your solution so I can see how other people approached it that would be really cool. Here's how I solved it:
function uniteUnique(arr1, arr2, arr3) {

  var bigArr = [];
  for (i=0; i<arguments.length; i++)
    {
      console.log(arguments[i]);
      bigArr = bigArr.concat(arguments[i]);
    }
    console.log(bigArr);

  var result = [];
  for (j=0; j<bigArr.length; j++)
    {
      if (result.indexOf(bigArr[j]) < 0)
        {
          result.push(bigArr[j]);
        }
    }

  console.log(result);
  return result;

}

uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]);
Parminder Singh
@Trion129
Apr 10 2016 06:10
This was my way
function uniteUnique(arr1, arr2, arr3) {
  var newarr = [];
  var args = Array.prototype.slice.call(arguments);
  for(var l = 0;l < args.length;l++){
    for(var i = 0; i < args[l].length;i++){
      var found = false;
      for(var j = 0;j < newarr.length;j++){
        if(args[l][i] == newarr[j]){
          found = true;
          break;
        }
      }
      if(!found){
        newarr.push(args[l][i]);
      }
    }
  }
  return newarr;
}
ajaybti
@ajaybti
Apr 10 2016 06:11
@kirbyedy wheatherType variable not displaying value even on console.log please do check it again,,i stucked here from past 1 hr..
Rada
@Radascript
Apr 10 2016 06:11
@Trion129 thanks for sharing
CamperBot
@camperbot
Apr 10 2016 06:11
radascript sends brownie points to @trion129 :sparkles: :thumbsup: :sparkles:
:star: 322 | @trion129 | http://www.freecodecamp.com/trion129
Rada
@Radascript
Apr 10 2016 06:14
@ajaybti it's working for me as well, but you also seem to have commented out the section that was bugging you?
kirbyedy
@kirbyedy
Apr 10 2016 06:14
@ajaybti no, its good, check the picture
Screen Shot 2016-04-10 at 09.14.26.png
you do have an error dough
and I think its because you did not spelled the weather correctly
its weather... not wHeather
Rada
@Radascript
Apr 10 2016 06:17
yes just got here to say the same thing. Your top commented out thing, it has an extra H
you do it a few times
MichaelTsang
@MichaelTsang
Apr 10 2016 06:22
Show the Local Weather
http://openweathermap.org/current
i found that the apis were wrong and can't get anything
UDAY PRAPHULLA MALANGAVE
@malangaveuday
Apr 10 2016 06:23
help me to solve profile lookup problem in front-end certification
CamperBot
@camperbot
Apr 10 2016 06:23
no wiki entry for: me to solve profile lookup problem in front-end certification
MichaelTsang
@MichaelTsang
Apr 10 2016 06:23
return nothing
kirbyedy
@kirbyedy
Apr 10 2016 06:27
@MichaelTsang explain
Parminder Singh
@Trion129
Apr 10 2016 06:28
@MichaelTsang They need Appid associated with the request to give the content for example
http://api.openweathermap.org/data/2.5/weather?q=London,uk&APPID=<appid you got from the api provider> returns the weather data of London
ajaybti
@ajaybti
Apr 10 2016 06:29
@kirbyedy OMG very silly mistake,thanks alot to figure it out.
CamperBot
@camperbot
Apr 10 2016 06:29
ajaybti sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star: 826 | @kirbyedy | http://www.freecodecamp.com/kirbyedy
ajaybti
@ajaybti
Apr 10 2016 06:30
@Radascript thanks
CamperBot
@camperbot
Apr 10 2016 06:30
ajaybti sends brownie points to @radascript :sparkles: :thumbsup: :sparkles:
:star: 288 | @radascript | http://www.freecodecamp.com/radascript
MichaelTsang
@MichaelTsang
Apr 10 2016 06:32
@Trion129 ohhh got it, the example confuse me.. thank u
CamperBot
@camperbot
Apr 10 2016 06:32
michaeltsang sends brownie points to @trion129 :sparkles: :thumbsup: :sparkles:
:star: 323 | @trion129 | http://www.freecodecamp.com/trion129
Parminder Singh
@Trion129
Apr 10 2016 06:33
@MichaelTsang You can get your Appid by signing in to openweather.org :smile: :+1:
Rami
@RNwebdk
Apr 10 2016 06:44
how do i search for channels in gitter ? i'm looking for a PHP channel... tryed google, but no luck
Emil Aasa
@emilaasa
Apr 10 2016 06:46
Hey guys I'm curious about how other people organize their front end workflow.
I am currently splitting up my work in a sketching phase, a static html / css phase and then adding angular 2 functionality. Would love to hear other peoples ways of getting it done.
Rami
@RNwebdk
Apr 10 2016 06:48
@emilaasa No search anywhere ?
Parminder Singh
@Trion129
Apr 10 2016 06:48
I also make static html and css first to see how everything will look and then add all the necessary functionality
Emil Aasa
@emilaasa
Apr 10 2016 06:54
@RNwebdk if you really want to search it you can access the gitter api =)
Could make a nice webapp for FCC
Rada
@Radascript
Apr 10 2016 06:57
what's the point of regular expressions, what are they normally used for?
Parminder Singh
@Trion129
Apr 10 2016 06:58
They are used to detect patterns in a string
e.g. Detecting if the string is a valid email address
I learnt regex from this website http://regexone.com/
It makes you work on problems which makes it easier to understand their concepts
Rada
@Radascript
Apr 10 2016 07:01
@Trion129 awesome thanks I'll check it out. And sorry if these are silly questions - but why couldn't you just use the normal string comparison like if blablabla[i] === "@" sort of thing?
CamperBot
@camperbot
Apr 10 2016 07:01
radascript sends brownie points to @trion129 :sparkles: :thumbsup: :sparkles:
:warning: radascript already gave trion129 points
Parminder Singh
@Trion129
Apr 10 2016 07:03
You can do all pattern recognition code yourself but that will be too much effort
In today's world no time to reinvent the wheel :smile: Regex makes it time efficient
Rada
@Radascript
Apr 10 2016 07:03
ok gotcha. Will check out the link now tyty
ciaaraama
@ciaaraama
Apr 10 2016 07:24
Hello. I just finished my "Build a Tribute Page" challenge. Can anyone help me with the three book images in my codepen? I can't make them all the same height? What am I missing? http://codepen.io/chiramarisa/pen/JXpdJZ
MichaelTsang
@MichaelTsang
Apr 10 2016 07:24
  if(navigator.geolocation){
    navigator.geolocation.getCurrentPosition(function(position){
      $("#data").html("latitude: " + position.coords.latitude + "<br> Lontitude: " +
     position.coords.longitude)
    });
  }
i used the example code but still can't get my location what's the problem
Coy Sanders
@coymeetsworld
Apr 10 2016 07:24
http://regexr.com/ is a good resource to test out regular expressions to @Radascript FYI
MichaelTsang
@MichaelTsang
Apr 10 2016 07:25
i mean i create a new js file and html file Local, and the code doesn't work
Coy Sanders
@coymeetsworld
Apr 10 2016 07:29
missing a semicolon at the end of your line @MichaelTsang
on the $("#data").html line
Rada
@Radascript
Apr 10 2016 07:29
@coymeetsworld I'm still getting through regexone haha I'll check regexr right after
Coy Sanders
@coymeetsworld
Apr 10 2016 07:30
regexone is a good tutorial @Radascript , regexr is more for testing, and has a cheatsheet there too for helping
MichaelTsang
@MichaelTsang
Apr 10 2016 07:31
@coymeetsworld not he keypoint.. Console shows everything is OK
@coymeetsworld
$(document).ready(function(){

    if(navigator.geolocation){
    alert("a");
    navigator.geolocation.getCurrentPosition(function(position){
    alert("b");
    $("#data").html("latitude: " + position.coords.latitude + "<br> Lontitude: " +
     position.coords.longitude);
    });
 }

});
alert("a") works but b doesn't
Coy Sanders
@coymeetsworld
Apr 10 2016 07:32
looks fine to me @MichaelTsang , do you enable geolocation on your browser?
there would've been a pop-up saying do you want the browser to know your location or something like that?
maybe something wrong w/ your html perhaps?
MichaelTsang
@MichaelTsang
Apr 10 2016 07:34
@coymeetsworld Chrome blocks
Coy Sanders
@coymeetsworld
Apr 10 2016 07:36
try looking at this, it can work on chrome (thats what I use) https://support.google.com/chrome/answer/142065?hl=en
or maybe there's a possibility where ever you're coding from blocks geolocation? I'm not sure, not my area of expertise
i just think the code looks fine to me unless im missing something
MichaelTsang
@MichaelTsang
Apr 10 2016 07:41
@coymeetsworld cause my VPN ?..
Coy Sanders
@coymeetsworld
Apr 10 2016 07:42
possibly
i don't use VPN (although I should)
I believe it could give you false location stats if you use it but I'm not sure why it would be blocking it
and by false I mean it reports where your VPN is located rather than your own location
did the link help? or no still problems? @MichaelTsang
MichaelTsang
@MichaelTsang
Apr 10 2016 07:46
@coymeetsworld sad
already allow all sites track
but still blocked
Coy Sanders
@coymeetsworld
Apr 10 2016 07:49
hmm, well if it's any consolation it works when I run it lol
what about trying a different browser perhaps?
or hard refreshing chrome after the change?
MichaelTsang
@MichaelTsang
Apr 10 2016 07:50
@coymeetsworld ;D
i use xamp and it works
it can't work when it was local file
use localhost can access
@coymeetsworld thanks a lot
CamperBot
@camperbot
Apr 10 2016 07:52
michaeltsang sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:star: 507 | @coymeetsworld | http://www.freecodecamp.com/coymeetsworld
Coy Sanders
@coymeetsworld
Apr 10 2016 07:55
ah nice @MichaelTsang good thinking :thumbsup:
Greg
@madcoyote
Apr 10 2016 08:15
Anyone care to take a peek at my Tribute Page attempt?
any advice would be appreciated. http://codepen.io/madcoyote/full/mPXyMx/
MichaelTsang
@MichaelTsang
Apr 10 2016 08:22
@madcoyote maybe u should move the webpage to center place
Greg
@madcoyote
Apr 10 2016 08:23
whoops, thanks
MichaelTsang
@MichaelTsang
Apr 10 2016 08:24
so if u zoom in or zoom out the browser it would not look strange
buiphuking
@buiphuking
Apr 10 2016 08:25
hi guys, i do Smallest Common Multiple,
but something wrongs, plz check the link
https://www.freecodecamp.com/challenges/smallest-common-multiple
MichaelTsang
@MichaelTsang
Apr 10 2016 08:26
@madcoyote and another clearer simple font i guess makes it better , anyway good job
Greg
@madcoyote
Apr 10 2016 08:29
@MichaelTsang thanks!
CamperBot
@camperbot
Apr 10 2016 08:29
madcoyote sends brownie points to @michaeltsang :sparkles: :thumbsup: :sparkles:
:star: 279 | @michaeltsang | http://www.freecodecamp.com/michaeltsang
buiphuking
@buiphuking
Apr 10 2016 08:47
@MichaelTsang but i do Smallest Common Multiple, not greatest common divisor , or maybe i'm not good to get what you mean
MichaelTsang
@MichaelTsang
Apr 10 2016 08:51
This message was deleted
@buiphuking
sry!!! NOT PLUS multiply
@buiphuking sry wait a minute
MichaelTsang
@MichaelTsang
Apr 10 2016 08:56
( 6, 10) the greatest common divisor is 2 and the Smallest Common Multiple is ( 6 * 10 )/ 2
that's what i wanna say
forget about this, maybe i should not help others till i totally understand.. but that's my way to figure it out
buiphuking
@buiphuking
Apr 10 2016 08:59
so (1,2,3,4,5) the greast common divisor i s 1 and the smallest common multiple is 12345 = 120 : 1 = 120
MichaelTsang
@MichaelTsang
Apr 10 2016 09:06
@buiphuking noooo.. my way just for two numbers..
MichaelTsang
@MichaelTsang
Apr 10 2016 09:13
@buiphuking maybe u can use for loop to do this , one by one (1,2,3,4,5) get (1,2) smallest common multiple A then (A,3) = B the (B,4)
buiphuking
@buiphuking
Apr 10 2016 09:14
@MichaelTsang thanks!
CamperBot
@camperbot
Apr 10 2016 09:14
buiphuking sends brownie points to @michaeltsang :sparkles: :thumbsup: :sparkles:
:star: 280 | @michaeltsang | http://www.freecodecamp.com/michaeltsang
Emil Aasa
@emilaasa
Apr 10 2016 09:41
Anybody got an opinion on witch flavor to write css in? I've looked at a few and I already have a postcss pipeline set up with auto-prefixer and some other stuff, now I'm just looking for an easy syntax
Islam Ibakaev
@dagman
Apr 10 2016 09:55
i saw some people build tictactoe game using canvas? Is it prefferable to build it in canvas?
Elbert Cortez
@trip16661
Apr 10 2016 10:22
$(document).ready(function() {
  var wikiApi = "https://en.wikipedia.org/w/api.php?action=query&format=json&prop=extracts%7Cinfo&generator=search&exchars=500&exlimit=20&exintro=1&inprop=url&gsrsearch="

  var searchInp;
  // Links needed for the api

  $("#delete").hide();
  $("#search").on("submit", function() {
    searchInp = $("#searchInp").val();
    var finalApi = wikiApi + searchInp + "&callback=?";
    $.getJSON(finalApi, function (data) {
        shortCut = data.query.pages
        $.each(shortCut, function (i, ids) {
          $("wikiQuery").html("<h4 href="+ids.fullurl+">"+ ids.title +  "</h4>" + "<br>" )  
        })

    });


  })

})
am i doing something wrong ?
This message was deleted
Stephen James
@sjames1958gm
Apr 10 2016 10:35
@trip16661 The code looks good are there any errors in the devtools console>
Krishna Sahu
@sahukrishna
Apr 10 2016 10:49
hello world
CamperBot
@camperbot
Apr 10 2016 10:49

welcome to FreeCodeCamp @specteecular!

Krishna Sahu
@sahukrishna
Apr 10 2016 10:49
hi need a bit of help pushing my portfolio site to github
here is my folder structure mysite > this folder contains specteecular.github.io > this folder contains my portfolio folder which has all site file like image , css , js and index.html
what am i doing wrong here?
any one here?
Robert Uivarosi
@URobert
Apr 10 2016 10:58
yes
so what't the problem more exactly
?
Emil Aasa
@emilaasa
Apr 10 2016 10:59
screenshot of folder structure
would help
Krishna Sahu
@sahukrishna
Apr 10 2016 11:00
@emilaasa not sure how to screenshot folder structure
i mean it would just show current folder
C:\Users\www\Desktop\krishna sahu site\specteecular.github.io\portfolio
portfolio folder contains all the site code
Emil Aasa
@emilaasa
Apr 10 2016 11:01
if you put your index in root it should work
so remove your wrapping folder
rename portfolio to specteecular.github.io
Krishna Sahu
@sahukrishna
Apr 10 2016 11:01
so the new structure should be C:\Users\www\Desktop\krishna sahu site\specteecular.github.io\
right?
Emil Aasa
@emilaasa
Apr 10 2016 11:01
jeps
Krishna Sahu
@sahukrishna
Apr 10 2016 11:02
also i have css , js folder inside portfolio folder
Emil Aasa
@emilaasa
Apr 10 2016 11:02
If you want separate folders for your projects
Krishna Sahu
@sahukrishna
Apr 10 2016 11:02
do i have to remove the folder and add files inside html file?
Emil Aasa
@emilaasa
Apr 10 2016 11:02
No
You just need to have an index file in the root (the folder named after your url)
Other than that you can structure your projects however you like
F1nches
@F1nches
Apr 10 2016 11:06
Anyone here completed Tic Tac Toe?
Islam Ibakaev
@dagman
Apr 10 2016 11:07
@F1nches i am going to start doind it :smile:
today
Krishna Sahu
@sahukrishna
Apr 10 2016 11:41
@emilaasa thanks
CamperBot
@camperbot
Apr 10 2016 11:41
specteecular sends brownie points to @emilaasa :sparkles: :thumbsup: :sparkles:
:star: 338 | @emilaasa | http://www.freecodecamp.com/emilaasa
Krishna Sahu
@sahukrishna
Apr 10 2016 11:41
Pete
@petegarvin1
Apr 10 2016 11:53
@specteecular looks sweet! :D well done
abtak mustapha
@mustapha88
Apr 10 2016 13:14
hello every body
some one help
Fsalker
@Fsalker
Apr 10 2016 13:19
Hello, does the <Input> from Bootstrap have an "onchange" attribute?
such as <Input onchange='myFunction()'>
Zain Ul Haq
@drsherlock
Apr 10 2016 13:30
hello, my tic tac toe is complete, but it is not responsive, it gets messed up when i change screen size. How do i make it responsive?
Paul Borawski
@iAmNawa
Apr 10 2016 13:46
@drsherlock @media screen and (max-width: 480px) {
Look up media screen
Zain Ul Haq
@drsherlock
Apr 10 2016 13:51
@iAmNawa but i am trying to do this using bootstrap
Paul Borawski
@iAmNawa
Apr 10 2016 13:59
@drsherlock well I can see that your h1 element does’t have a class that would make it responsive
nsloc22
@nsloc22
Apr 10 2016 14:00
anyone knows if I can build game challenge like tic tac toe in unity and post link to webgl version?
instead codepen
Paul Borawski
@iAmNawa
Apr 10 2016 14:02
@nsloc22 yes
codercooooder
@codercooooder
Apr 10 2016 14:24
guys I have a cool row of media responsive svgs that are almost right but I think there is something that needs to be tweaked pretty hard. I hope one of you can help: http://codepen.io/ihatecoding/pen/dMdGpW
Dardan Demiri
@dardandemiri
Apr 10 2016 14:27
Can you explain more @codercooooder
what do you want to tweak
codercooooder
@codercooooder
Apr 10 2016 14:30
so Im not sure on the final design I'd like..I want this to be robust.. When I increase the size the of the svg width and minimize it, things start breaking...I think it has something to do with the structure of the columns - the svgs widths need to be identical and fixed based on the percentage of the UL
@dardandemiri i got help with this, and I think the guy had good intentions but the strcuture is weird.
@dardandemiri i can make it media responsive and change things when they get small....that' snot a problem, but I know the basic structure can be improved so I need less media queries.
I'll show you an alternate version so you can see what I mean.
codercooooder
@codercooooder
Apr 10 2016 14:35
here look what happens when the text of one is longer: http://codepen.io/ihatecoding/pen/KzQVmL
and then you make the screen smaller @dardandemiri
I want the svgs to scale and be one quarter of the containing div's width no matter what.
notice that the containing div is not 100%, that is important..I want the containing div to have left and right margins
@dardandemiri sorry I forgot to mention you above
Krishna Sahu
@sahukrishna
Apr 10 2016 15:12
@Spacecamel100 thanks
CamperBot
@camperbot
Apr 10 2016 15:12
specteecular sends brownie points to @spacecamel100 :sparkles: :thumbsup: :sparkles:
:star: 403 | @spacecamel100 | http://www.freecodecamp.com/spacecamel100
NPeyralans
@NPeyralans
Apr 10 2016 15:27
Can anybody explain to me how to put a "Tweet this Quote" button onto my Random Quote Generator?
Krishna Sahu
@sahukrishna
Apr 10 2016 15:27
hello all
how does one get FCC logo as icon ( like twitter icon from font awesome)
i searched but it seems like its not on font awesome
any work around or should i use img?
NPeyralans
@NPeyralans
Apr 10 2016 15:29
@specteecular I've just done the image
Krishna Sahu
@sahukrishna
Apr 10 2016 15:29
link ?
Krishna Sahu
@sahukrishna
Apr 10 2016 15:31
thanks @NPeyralans
CamperBot
@camperbot
Apr 10 2016 15:31
specteecular sends brownie points to @npeyralans :sparkles: :thumbsup: :sparkles:
:star: 277 | @npeyralans | http://www.freecodecamp.com/npeyralans
NPeyralans
@NPeyralans
Apr 10 2016 15:33
Can anyone help me figure out how to put a "Tweet this quote" button on my random quote generator website?
lcthornhill
@lsrus
Apr 10 2016 15:35
@NPeyralans this link should help you out https://dev.twitter.com/web/tweet-button#add-tweet-button
NPeyralans
@NPeyralans
Apr 10 2016 15:36
@lsrus Thanks!
CamperBot
@camperbot
Apr 10 2016 15:36
npeyralans sends brownie points to @lsrus :sparkles: :thumbsup: :sparkles:
:star: 348 | @lsrus | http://www.freecodecamp.com/lsrus
lcthornhill
@lsrus
Apr 10 2016 15:36
@NPeyralans np
Patrick Black
@Mortiferr
Apr 10 2016 16:27
Can anyone offer any assistance regarding APIs? If so, please message me privately.
PapaUnik1993
@PapaUnik1993
Apr 10 2016 16:32
my weather app script works in console but not on codepen page??? why???
StasiekK
@StasiekK
Apr 10 2016 16:35
@PapaUnik1993 to know that we need to look on codepen i think
PapaUnik1993
@PapaUnik1993
Apr 10 2016 16:36
StasiekK
@StasiekK
Apr 10 2016 16:41
@PapaUnik1993 what should do button?
PapaUnik1993
@PapaUnik1993
Apr 10 2016 16:42
@StasiekK i used the button to alert temp or somthing to see if it works and on the page is undefined and in console it works
StasiekK
@StasiekK
Apr 10 2016 16:42
@PapaUnik1993 yes, in console it's is running script
PapaUnik1993
@PapaUnik1993
Apr 10 2016 16:43
@StasiekK it show whe i alert from console but not frome page,tried diff way to show resut but it works only in console
StasiekK
@StasiekK
Apr 10 2016 16:43
but, you don't add anything to html
PapaUnik1993
@PapaUnik1993
Apr 10 2016 16:44
@StasiekK thats the problem when i do it with click function with changin <h2> or <p> element it won't work,or when i alert with click it shows undefined
StasiekK
@StasiekK
Apr 10 2016 16:44
@PapaUnik1993 i get in console error with line
mainW = json.weather[0].main;
PapaUnik1993
@PapaUnik1993
Apr 10 2016 16:48
@StasiekK click on the button http://codepen.io/Davidsim1993/pen/eZeaoL
@StasiekK Thank you man that you help me it mean a lot to me
CamperBot
@camperbot
Apr 10 2016 16:48
papaunik1993 sends brownie points to @stasiekk :sparkles: :thumbsup: :sparkles:
:star: 432 | @stasiekk | http://www.freecodecamp.com/stasiekk
StasiekK
@StasiekK
Apr 10 2016 17:02
@PapaUnik1993 from what i see you aren't reciving data
so all calls to json object's five back undefined
PapaUnik1993
@PapaUnik1993
Apr 10 2016 17:03
@StasiekK but why it works in console?
StasiekK
@StasiekK
Apr 10 2016 17:04
@PapaUnik1993 sorry i aren't so advenced yet, you need to wait for someone more who did weather project, or try calling api another way
PapaUnik1993
@PapaUnik1993
Apr 10 2016 17:04
@StasiekK ok,thx for your time bro
CamperBot
@camperbot
Apr 10 2016 17:04
papaunik1993 sends brownie points to @stasiekk :sparkles: :thumbsup: :sparkles:
:warning: papaunik1993 already gave stasiekk points
StasiekK
@StasiekK
Apr 10 2016 17:05
@PapaUnik1993 sorry, icould not help,
Gregory Buhler
@Gregory-Buhler
Apr 10 2016 17:07
@PapaUnik1993 It currently says it cannot find the city.
Which means the lat and/or lon is off.
MichaelTsang
@MichaelTsang
Apr 10 2016 17:08
Build a Wikipedia Viewer
i can't search anything
what's the problem , it just an example project
Gregory Buhler
@Gregory-Buhler
Apr 10 2016 17:09
@MichaelTsang do you mean the example is not working correctly?
MichaelTsang
@MichaelTsang
Apr 10 2016 17:09
yes
click icon and input sth but show nothing
@Gregory-Buhler change another browser and it works
.. wired
Gregory Buhler
@Gregory-Buhler
Apr 10 2016 17:11
Which browser were you using first?
MichaelTsang
@MichaelTsang
Apr 10 2016 17:11
chrome
Gregory Buhler
@Gregory-Buhler
Apr 10 2016 17:12
Very weird, and it was up to date?
MichaelTsang
@MichaelTsang
Apr 10 2016 17:12
no, i am doing this
Gregory Buhler
@Gregory-Buhler
Apr 10 2016 17:15
@PapaUnik1993 so I took a look at an alert to see what url you were sending for the api. Both your lat and lon are undefined.
NPeyralans
@NPeyralans
Apr 10 2016 17:47
Hey everyone, I'm having a problem with my buttons! I'm trying to override the .btn-default color after the click, but whatever I do nothing responds... Any ideas why I can't override the default color after click?
http://codepen.io/NPeyralans/pen/aNEogx
Jeff
@adzam5
Apr 10 2016 17:51
@NPeyralans Removing :active from .btn:active:focus will change the button to the color you are setting
NPeyralans
@NPeyralans
Apr 10 2016 17:52
Nice! Thanks @adzam5
CamperBot
@camperbot
Apr 10 2016 17:52
npeyralans sends brownie points to @adzam5 :sparkles: :thumbsup: :sparkles:
:star: 399 | @adzam5 | http://www.freecodecamp.com/adzam5
Jeff
@adzam5
Apr 10 2016 17:53
@NPeyralans No problem
Ali Amirazizi
@alivera
Apr 10 2016 17:58
hi anyone here
Alex Coder
@jkid314159
Apr 10 2016 17:58
Hello world
CamperBot
@camperbot
Apr 10 2016 17:58

welcome to FreeCodeCamp @jkid314159!

Alex Coder
@jkid314159
Apr 10 2016 18:00
In Basic JavaScript model "Record Collection" error messages says, After updateRecords(2548, "artist", ""), artist should not be set . I set to empty string, "" but not correct. And then try to do nothing and return collection but still not correct. Any suggestions?
Ali Amirazizi
@alivera
Apr 10 2016 18:00
Has anyone done the "show the local weather" project? If so anyone have problems running it from codepen, more specifically the api key being an issue?
kirbyedy
@kirbyedy
Apr 10 2016 18:01
@alivera did you register your account and got your api key ?
Ali Amirazizi
@alivera
Apr 10 2016 18:01
@kirbyedy yes! i have it working on my own server. but codepen wont load it
Tien Anh Nguyen
@tienanh2007
Apr 10 2016 18:01
Could someone explain to me how this javascript code for the scrolling effect when press a button on navbar work
$(function() {
$('ul.nav a').bind('click',function(event){
var $anchor = $(this);
    $('html, body').stop().animate({
        scrollTop: $($anchor.attr('href')).offset().top
    }, 1500,'easeInOutExpo');
kirbyedy
@kirbyedy
Apr 10 2016 18:02
@alivera do you have a link to the pen
Ali Amirazizi
@alivera
Apr 10 2016 18:02
@kirbyedy also is it safe to just throw my api key on the web like that lol
kirbyedy
@kirbyedy
Apr 10 2016 18:03
well its for testing purposes, and everybody does it for that project
anyway what can happen ?
Alex Coder
@jkid314159
Apr 10 2016 18:04
if ( value !== "" && prop != "tracks" ) {
collection[id][propIn] = value;
} else if ( value !== "" && prop == "tracks" ) {
collection[id][propIn].push( value );
} else if ( value === "" && prop == "artist" ) {
collection[id][propIn] = "";
}
return collection;
Ali Amirazizi
@alivera
Apr 10 2016 18:05
@kirbyedy alright cool! I sent it to you on pm lol
kirbyedy
@kirbyedy
Apr 10 2016 18:05
:)
Alex Coder
@jkid314159
Apr 10 2016 18:08
oh it is delete
Erik Villoria
@kire73
Apr 10 2016 18:29
does open weather API provide icons I can call from the json data I get? or do i have to interpret and input my own icons?
JohnnyRaved
@JohnnyRaved
Apr 10 2016 18:32

var streamerInfoArray = getStreamerInfo(streamerArray);

function getStreamerInfo(streamerArray) {
var infoArray = [];
streamerArray.forEach(function (streamer) {
$.getJSON('https://api.twitch.tv/kraken/users/' + streamer + '?callback=?',
function (user) {
var obj= {userName: user.name, logo: user.logo};
infoArray.push(obj);
}); // infoArray has 10 elements at the end of this loop
});
return infoArray; // has 0 elements here ???
}

Oops! Can anyone tell me why streamerInfoArray remains empty?
@kire73 It does, but they kinda hide it in the doc.

var streamerInfoArray = getStreamerInfo(streamerArray);

function getStreamerInfo(streamerArray) {
var infoArray = [];
streamerArray.forEach(function (streamer) {
$.getJSON('https://api.twitch.tv/kraken/users/' + streamer + '?callback=?',
function (user) {
var obj= {userName: user.name, logo: user.logo};
infoArray.push(obj);
}); // infoArray has 10 elements at the end of this loop
});
return infoArray; // has 0 elements here ???
}

Ryder Timberlake
@SherSpock
Apr 10 2016 18:36
@JohnnyRaved have you tried returning infoArray one line further up, inside the })? I'd be interested to know the error if that doesn't help at all
@JohnnyRaved basically what is probably happening is you are going down a level in scope, and making changes to infoArray, which it has access to as a child scope, but then when you open back up into the broader scope it only has access to the variable as defined in the original scope, which is an array
empty
Alexander Zubko
@zubko
Apr 10 2016 18:46
@JohnnyRaved $.getJSON makes an async download, the execution will jump to the next expression, before the dowload will finish. I recommend you to put 2 console.log calls - 1st one before infoArray.push(obj); and 2nd one before return infoArray and you’ll see that the 2nd call happens before the 1st one
Tien Anh Nguyen
@tienanh2007
Apr 10 2016 18:47
Could someone help me make my navbar elements on the same line.
nevermind
it was I was just in a smaller window
PapaUnik1993
@PapaUnik1993
Apr 10 2016 18:51
@Gregory-Buhler try it again,it was definet but for some reason is not working the first time
@alivera i have problem with the weather app,it works only in console but not on page
abtak mustapha
@mustapha88
Apr 10 2016 19:01
could some one help with weather app?
abtak mustapha
@mustapha88
Apr 10 2016 19:17
some help in weather app i can't get current data
Gregory Buhler
@Gregory-Buhler
Apr 10 2016 19:24
@PapaUnik1993 give me a moment
ElvisTheStriker
@ElvisTheStriker
Apr 10 2016 19:27
Hi folks need some help with my Randon Quote generator. Clicking "click here for random quote" does not work . Can someone give me a pointer as to where I've gone wrong.
http://codepen.io/ElvisTheStriker/pen/mPXVRp
Celestial
@celestialz
Apr 10 2016 19:29
why do you have <style> .larger-image {
width: 100%;
} in your css
you should never have html elements with html tags in your css like that
Gregory Buhler
@Gregory-Buhler
Apr 10 2016 19:33
@PapaUnik1993 so you cannot return the values like you're doing with lat and long, you need to send the new values to another function like a setup function for example:
```
function successFunction(position) {
  doWeather(position.coords.latitude, position.coords.longitude)
}

function doWeather(latitude, longitude) {
  var Weather = "http://api.openweathermap.org/data/2.5/weather?lat=" + latitude + "&lon=" + longitude + "&appid=" + key + "&units=metric";
  $.getJSON(Weather, function(json) {

    mainW = json.weather[0].main;
    temp = json.main.temp;
    country = json.sys.country;
    name = json.name;
// function to push all new values for actual page setup.
  });
}
Gabe Pressman
@gpressman
Apr 10 2016 19:34
@ElvisTheStriker I would check the docs of the api and make sure you don't need a key or anything like that
Gregory Buhler
@Gregory-Buhler
Apr 10 2016 19:34
Gotta go for a bit be back later!
Coira Ellison
@Coira
Apr 10 2016 19:34
@ElvisTheStriker your api call is incorrect, look at the example here http://quotesondesign.com/api-v4-0/
and check your console, you're getting an access error
ElvisTheStriker
@ElvisTheStriker
Apr 10 2016 19:35
@Coira and @gpressman thanks for the tips. I'll check those out
CamperBot
@camperbot
Apr 10 2016 19:35
elvisthestriker sends brownie points to @coira and @gpressman :sparkles: :thumbsup: :sparkles:
:star: 544 | @coira | http://www.freecodecamp.com/coira
:star: 279 | @gpressman | http://www.freecodecamp.com/gpressman
Gabe Pressman
@gpressman
Apr 10 2016 19:36
can anyone help me get this stuff positioned correctly, I want these 4 elements centered and obviously not on top of eachother
ok, now they aren't on top of eachother, just need to figure out how to center properly
Gregory Buhler
@Gregory-Buhler
Apr 10 2016 19:37
@gpressman remove the absolute position, add a col-xs-offset-4 to your stuff div.
remove absolute position from the box class
Gabe Pressman
@gpressman
Apr 10 2016 19:38
yup, did that. what does offset do?
wow
thanks @Gregory-Buhler
CamperBot
@camperbot
Apr 10 2016 19:38
gpressman sends brownie points to @gregory-buhler :sparkles: :thumbsup: :sparkles:
Gregory Buhler
@Gregory-Buhler
Apr 10 2016 19:38
Offset pushes it that many colums over, since there are 12 columns per row you move your current wrapper div to the center.
CamperBot
@camperbot
Apr 10 2016 19:38
:star: 314 | @gregory-buhler | http://www.freecodecamp.com/gregory-buhler
Gianni de Luca
@giannidluca
Apr 10 2016 19:47
I'm kinda lost with JavaScript to much info
Gabe Pressman
@gpressman
Apr 10 2016 20:09
anyone have a picture hosting sites that works? All my imgur hosted pictures are returning 403 forbidden, so I uploaded to google photo and there's no error but they still aren't loading
Ghost
@ghost~56bd2077e610378809c105cd
Apr 10 2016 20:14
i use tinypic.com @gpressman
Gabe Pressman
@gpressman
Apr 10 2016 20:15
thanks @Rogue00 I'll give it a try, kinda horrifying that I've been sending out my portfolio to employers and all my pictures are errors
CamperBot
@camperbot
Apr 10 2016 20:15
gpressman sends brownie points to @rogue00 :sparkles: :thumbsup: :sparkles:
Ghost
@ghost~56bd2077e610378809c105cd
Apr 10 2016 20:15
yea that sux
CamperBot
@camperbot
Apr 10 2016 20:15
:star: 344 | @rogue00 | http://www.freecodecamp.com/rogue00
Ghost
@ghost~56bd2077e610378809c105cd
Apr 10 2016 20:15
yea that sux ugh
hmm...i need more coffe
i worked on algorithms late
i passed through ome of them but my understanding of them isnt so great
Gabe Pressman
@gpressman
Apr 10 2016 20:18
I was thinking the same thing.. about coffee
you decided for me, I'll have more once I get this picture situation fixed
Ghost
@ghost~56bd2077e610378809c105cd
Apr 10 2016 20:18
i even loaded gifs at tinypic and was able to use them similar to images
o ha cools
it doesnt work right...not nearly finished...but im not to it yet...im still working through basic algorithms...the gifs are neat
Gabe Pressman
@gpressman
Apr 10 2016 20:23
ha
the gifs are cool
I like
how if you hit "="
it just puts and equal sign on screen
Ghost
@ghost~56bd2077e610378809c105cd
Apr 10 2016 20:24
ha yea...the javascript isnt working right yet...plus i need a couple more buttons
Gabe Pressman
@gpressman
Apr 10 2016 20:24
did you do all the intermediate ziplines?
Ghost
@ghost~56bd2077e610378809c105cd
Apr 10 2016 20:25
not yet...im still working on basic algorithms
Gabe Pressman
@gpressman
Apr 10 2016 20:25
why did you jump to the calculator is what I'm wondering
Ghost
@ghost~56bd2077e610378809c105cd
Apr 10 2016 20:25
i put this together for mainly design elements to share with my group
im not really compententt enough with the javascript yet to make it work proprly so its sitting to the side...my design elemnets are a bit over the top lol
the basic algorithms leaving me feeling a bit stumped
Ghost
@ghost~56bd2077e610378809c105cd
Apr 10 2016 20:30
im up to chunky monkey in basic algorithms....get my head sorted and then back to them
Gabe Pressman
@gpressman
Apr 10 2016 20:32
if I can make one reccomendation
Ghost
@ghost~56bd2077e610378809c105cd
Apr 10 2016 20:32
certainly
Gabe Pressman
@gpressman
Apr 10 2016 20:32
is just try not to get too frustrated when things don't work
Ghost
@ghost~56bd2077e610378809c105cd
Apr 10 2016 20:32
o yes i know that feeling well
Gabe Pressman
@gpressman
Apr 10 2016 20:32
as you code more, your patience will build
Ghost
@ghost~56bd2077e610378809c105cd
Apr 10 2016 20:33
im like the little engine that could right now man
just chug chug chuggin along no matter the pace
Gabe Pressman
@gpressman
Apr 10 2016 20:33
I went to a coding bootcamp, I'm mostly on here to improve my js, and learn node eventually
but when we first started
we got so mad when we couldn't get a problem in 5 minutes
Ghost
@ghost~56bd2077e610378809c105cd
Apr 10 2016 20:33
whether they take minutes hours or days im moving forward :)
Gabe Pressman
@gpressman
Apr 10 2016 20:34
now I spend hours working on one little thing only to realize it's a stupid fringe case that is totally out in space and I probably would have never known to begin with
Ghost
@ghost~56bd2077e610378809c105cd
Apr 10 2016 20:34
javascript is super hard...for me especially i think .,...partly because i never learned algebra..or other complicatedmaths
Gabe Pressman
@gpressman
Apr 10 2016 20:34
maybe you should pepper some of that in too? khanacademy.com has free middle school and high school level math courses
Ghost
@ghost~56bd2077e610378809c105cd
Apr 10 2016 20:35
im high school grad..my 25 yr reunion is coming in a few months :P
im currently taking classes at the code academyy...the odin project...and challenges here..tho i do have some other sources listed i havent begun them...im full up for now i think
it isnt the math now giving me a hard time so much as theory and practice
the how and why things work the way they do....
Gabe Pressman
@gpressman
Apr 10 2016 20:37
js can be really difficult, I prefer Ruby
Ghost
@ghost~56bd2077e610378809c105cd
Apr 10 2016 20:37
telling myself learning javascript is like learning another language...that i must read, practice and repeat before i will become even close to proficiant
JD Tadlock
@jdtdesigns
Apr 10 2016 20:37
@alivera You need to return jsonp from the api, not json. Check out the api docs to see how to
Ghost
@ghost~56bd2077e610378809c105cd
Apr 10 2016 20:37
yea but i can see how important javascript is to working applications...and that makes it imperative for me to learn
Gabe Pressman
@gpressman
Apr 10 2016 20:38
yeah, unfortunately you can't live in a vacuum and just say you like language x
they interac
interact
Ghost
@ghost~56bd2077e610378809c105cd
Apr 10 2016 20:38
yea
is slow going now......and i know i need other resources outside of fcc...so im using them
im also involved in a couple of supporty type groups
but learing it solo is rough..any way you look at it
imlearning it...if my pace is slower than id prefer
these algorithms leave me feeling like i know much less than i actually do
tho i think they affect a lot of people like that
Islam Ibakaev
@dagman
Apr 10 2016 21:13
i'm building a tictactoe game and i cant figure out how to make opponent to move not randomly? http://codepen.io/dagman/pen/jqZbje?editors=0010
Dardan Demiri
@dardandemiri
Apr 10 2016 21:19
You need a Logic behind it @dagman
Coira Ellison
@Coira
Apr 10 2016 21:20
@dagman don't use imgur, they don't let you link. i'm getting a 403 error when i click
Islam Ibakaev
@dagman
Apr 10 2016 21:20
@dardandemiri i understand but how to start cant figure out(
Dardan Demiri
@dardandemiri
Apr 10 2016 21:20
Like this:

X X O
| | |
| | |

If ( there are 2 X on row 1, Make an O

or better
Look this video
Just to understand the Algorithem
@dagman
Islam Ibakaev
@dagman
Apr 10 2016 21:24
@dardandemiri thx surely will be watched)
CamperBot
@camperbot
Apr 10 2016 21:24
dagman sends brownie points to @dardandemiri :sparkles: :thumbsup: :sparkles:
:star: 284 | @dardandemiri | http://www.freecodecamp.com/dardandemiri
Dardan Demiri
@dardandemiri
Apr 10 2016 21:24
Your welcome
;)
Taras Yaremkiv
@Y-Taras
Apr 10 2016 22:01
Hello everyone! Sorry but I need some help in twitch json api assignment. Take a look at that script, and give me a hint why elem is an empty string in the last console.log
$(document).ready(function() {
    var array = ["freecodecamp", "storbeck", "terakilobyte", "habathcx", "RobotCaleb", "MedryBW",
        "thomasballinger", "noobs2ninjas", "beohoff", "brunofin", "comster404", "asdfhjklzxv",
        "sheevergaming", "OgamingSC2", "cretetion", "ESL_SC2"
    ];
    var elem = "";
    for (var i = 0; i < array.length; i++) {
        var request1 = 'https://api.twitch.tv/kraken/streams/' + array[i] + '?callback=?';
        $.getJSON(request1, function(data1) {
            console.log(data1);
            if (data1.stream === null) {
                elem += ' <a href="#" class="list-group-item">' + 'Offline' + '</a>';
            } else if (data1.status == 404) {
                elem += ' <a href="#" class="list-group-item">' + elem.message + '</a>';
            } else if (data1.status == 422) {
                elem += ' <a href="#" class="list-group-item">' + 'Account Closed' + '</a>';
            }
        });
    }
    document.getElementsByClassName('list-group')[0].innerHtml = elem;
    console.log('elem ', elem);
});
Stephen James
@sjames1958gm
Apr 10 2016 22:02
@Y-Taras Because all of the elem += happens after your console.log
Taras Yaremkiv
@Y-Taras
Apr 10 2016 22:03
@sjames1958gm I'm talking about console.log('elem ', elem);
Stephen James
@sjames1958gm
Apr 10 2016 22:04
@sjames1958gm So am I
@sjames1958gm The $.getJSON sends a request and then returns. Later when the response returns the code in the callback function runs. So your console.log at the end happens before
Taras Yaremkiv
@Y-Taras
Apr 10 2016 22:10

oh, should I put

document.getElementsByClassName('list-group')[0].innerHtml = elem;

before the cycle to make it work?

Stephen James
@sjames1958gm
Apr 10 2016 22:11
@Y-Taras You should add each item as you get the response inside the callback.
Stephen James
@sjames1958gm
Apr 10 2016 22:18
@kire73 I would try to get the weather and temperature to be the same size.
Erik Villoria
@kire73
Apr 10 2016 22:18
@sjames1958gm button?
Stephen James
@sjames1958gm
Apr 10 2016 22:18
Probably needs to be bigger as well
Erik Villoria
@kire73
Apr 10 2016 22:23
okay how about now? @sjames1958gm
Stephen James
@sjames1958gm
Apr 10 2016 22:23
Looks better
Taras Yaremkiv
@Y-Taras
Apr 10 2016 22:28
@sjames1958gm what chapter of js should I read to figure it out?
I just can't understand why json is executing in the end.
@kire73 by the way your code is displaying the wrong city for me), but my is fine http://codepen.io/Y-Taras/pen/bpdOeB.
Pete
@petegarvin1
Apr 10 2016 23:06
Anyon working through the algos - code wars is great for practice!
Stephen James
@sjames1958gm
Apr 10 2016 23:21
@Y-Taras Sorry was offline - google javascript aynchronous functions.
Taras Yaremkiv
@Y-Taras
Apr 10 2016 23:24
@sjames1958gm thanks
CamperBot
@camperbot
Apr 10 2016 23:24
y-taras sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star: 570 | @sjames1958gm | http://www.freecodecamp.com/sjames1958gm
EricOber
@EricOber
Apr 10 2016 23:46
hey guys, im having trouble building a personal portfolio page.... Tough, dont know where to start. first time.
Randy Goldsmith
@Dueldrawer8
Apr 10 2016 23:52
anyone know how i can see the data?
someone told me to use jsonp.. i figured if i console.log data.. it would show me the data
but no data is appearing