These are chat archives for FreeCodeCamp/HelpFrontEnd

12th
Nov 2017
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 00:52
@alpox around?
Dr-D-M
@Dr-D-M
Nov 12 2017 02:40
hello again
cannot get the API for weather app
I mean, I won't work
I know I asked this before, but, I'm asking now just about the API
abraham anak agung
@padunk
Nov 12 2017 02:45
@Dr-D-M do you mean the url or the data?
Dr-D-M
@Dr-D-M
Nov 12 2017 02:45
the url
Sorin Ruse
@sorinr
Nov 12 2017 02:45
@Dr-D-M do u have it on codepen?
Dr-D-M
@Dr-D-M
Nov 12 2017 02:46
yes it is
Sorin Ruse
@sorinr
Nov 12 2017 02:46
can u share the link?
Dr-D-M
@Dr-D-M
Nov 12 2017 02:46
$(document).ready(function(){
  var long;
  var lat;
   if (navigator.geolocation) {
  navigator.geolocation.getCurrentPosition(function(position) {
    lat = position.coords.latitude;
    long = position.coords.longitude;
    $("#data").html("latitude: " + lat + "<br>longitude: " + long );
  });
}
  var api = "https://fcc-weather-api.glitch.me/api/current?lat="+lat+"&lon="+long+";
  $.getJSON(api, function(data){
    var weatherType = data.weather[0].description;
    var kelvin = data.main.temp;
    var windSpeed = data.wind.speed;
    var city = data.name;


    console.log(city);
    console.log(api);
  });
});
this is the code i've don so far
the last quotation mark shouldn't be there, ignore it please
i used also the weather map APi url and it won't work either
would you tell me which API did you use to make it work? please
Christopher Susi
@chrisandsuch
Nov 12 2017 02:50
@Dr-D-M I’m trying out https://openweathermap.org/api at the moment. Let you know asap whenever I get it setup.
Dr-D-M
@Dr-D-M
Nov 12 2017 02:51
i tried with that page, chris... but did not work
I mean I didn't get anything on console
abraham anak agung
@padunk
Nov 12 2017 02:52
how about your lat and long ? you got number in the console?
Christopher Susi
@chrisandsuch
Nov 12 2017 02:52
@Dr-D-M lemme try postman
Sorin Ruse
@sorinr
Nov 12 2017 02:54
@Dr-D-M take a look in here
Dr-D-M
@Dr-D-M
Nov 12 2017 02:55
@padunk not in the console, i got a number in the html page
abraham anak agung
@padunk
Nov 12 2017 02:55
or maybe a typo here "https://fcc-weather-api.glitch.me/api/current?lat=" + lat + "&lon=" + long;
Dr-D-M
@Dr-D-M
Nov 12 2017 02:55
@chrisandsuch alright chris, post it man
@sorinr how did you get it??! now you're gonna now where I live LOL
Christopher Susi
@chrisandsuch
Nov 12 2017 03:01
@Dr-D-M @sorinr Thats good stuff. Thanks big time!
CamperBot
@camperbot
Nov 12 2017 03:01
chrisandsuch sends brownie points to @dr-d-m and @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 257 | @dr-d-m |http://www.freecodecamp.com/dr-d-m
:star2: 1352 | @sorinr |http://www.freecodecamp.com/sorinr
Sorin Ruse
@sorinr
Nov 12 2017 03:01
@Dr-D-M as @padunk pointed out u had a tipo error in here "&lon="+long+";. it had to be "&lon="+long; and i just moved the weather part into a function
Dr-D-M
@Dr-D-M
Nov 12 2017 03:38
@sorinr thanks so much, i did not notice that typo
CamperBot
@camperbot
Nov 12 2017 03:38
dr-d-m sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:star2: 1353 | @sorinr |http://www.freecodecamp.com/sorinr
Dr-D-M
@Dr-D-M
Nov 12 2017 03:39
@chrisandsuch thank you and for your responses, compa
CamperBot
@camperbot
Nov 12 2017 03:39
dr-d-m sends brownie points to @chrisandsuch :sparkles: :thumbsup: :sparkles:
:cookie: 269 | @chrisandsuch |http://www.freecodecamp.com/chrisandsuch
Sorin Ruse
@sorinr
Nov 12 2017 03:43
@Dr-D-M welcome
Seah Eng Chye
@Seahchye
Nov 12 2017 04:35
Hi all, a simple question here
Isaiah Trembley
@IsaiahCT
Nov 12 2017 04:35
hey
I might be ableto answer
Seah Eng Chye
@Seahchye
Nov 12 2017 04:35
I am doing the random quote machine challenge
Isaiah Trembley
@IsaiahCT
Nov 12 2017 04:36
now I might not be able oto help you
Seah Eng Chye
@Seahchye
Nov 12 2017 04:36
for the $(document).ready(function) code
do i put it under HTML or JS?
Isaiah Trembley
@IsaiahCT
Nov 12 2017 04:36
js
well, HTML would just be in the <script> tag
Seah Eng Chye
@Seahchye
Nov 12 2017 04:37
@IsaiahCT i see thanks
CamperBot
@camperbot
Nov 12 2017 04:37
seahchye sends brownie points to @isaiahct :sparkles: :thumbsup: :sparkles:
api offline
Isaiah Trembley
@IsaiahCT
Nov 12 2017 04:37
<script>
$(document).ready(function)({});

</script>
Lean Junio
@leanjunio
Nov 12 2017 04:38
@Seahchye Did you make sure that your .js file is included in your .html file?
<script src=“yourJsFile.js”></script>
Dr-D-M
@Dr-D-M
Nov 12 2017 04:39
@Seahchye is better if you do it in a separate file
and add it to your html as @leanjunio has just said
Seah Eng Chye
@Seahchye
Nov 12 2017 04:40
@leanjunio @Dr-D-M I am doing on codepen with separate sections for HTML CSS and JS
Dr-D-M
@Dr-D-M
Nov 12 2017 04:40
but if you're doing it on codepen, as FCC is asking, just change settings to jquery
Isaiah Trembley
@IsaiahCT
Nov 12 2017 04:41
^^^^
Dr-D-M
@Dr-D-M
Nov 12 2017 04:41
click on settings and then click on "javaScript", then, select on Quick add JQuery
Seah Eng Chye
@Seahchye
Nov 12 2017 04:41
@Dr-D-M add JQuery under pen settings?
Isaiah Trembley
@IsaiahCT
Nov 12 2017 04:41
I was also about to ask
otherwise it won't work
Dr-D-M
@Dr-D-M
Nov 12 2017 04:42
andthen it must work
Seah Eng Chye
@Seahchye
Nov 12 2017 04:42
@Dr-D-M @IsaiahCT @leanjunio got it thanks!
CamperBot
@camperbot
Nov 12 2017 04:42
seahchye sends brownie points to @dr-d-m and @isaiahct and @leanjunio :sparkles: :thumbsup: :sparkles:
api offline
:cookie: 300 | @leanjunio |http://www.freecodecamp.com/leanjunio
:cookie: 258 | @dr-d-m |http://www.freecodecamp.com/dr-d-m
Dr-D-M
@Dr-D-M
Nov 12 2017 04:42
after that, be sure of changing the Behaviour and unable (is that how you say it?) auto save and auto run
abraham anak agung
@padunk
Nov 12 2017 04:42
it depends of what framework you use, if you use pure js, no need to add jquery
Dr-D-M
@Dr-D-M
Nov 12 2017 04:43
@padunk in that challenge, he'll need jquery
@Seahchye you're welcome, man.
Dr-D-M
@Dr-D-M
Nov 12 2017 04:51
$(document).ready(function() {
  var long;
  var lat;
  var fTemp;
  var cTemp;
  var kTemp;
  var tempChange = true;
  if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(function(position) {
      lat = position.coords.latitude;
      long = position.coords.longitude;
      $("#data").html("latitude: " + lat + "<br>longitude: " + long);
      getWeather(lat, long);
    });
  }
  function getWeather(lat, long) {
    var api =
      "https://fcc-weather-api.glitch.me/api/current?lat=" +
      lat +
      "&lon=" +
      long;
    $.getJSON(api, function(data) {
      var weatherType = data.weather[0].description;
       kTemp = data.main.temp;
      var windSpeed = data.wind.speed;
      var city = data.name;


      // temperature status convertion
      fTemp = (kTemp*(5/9)-459.67).toFixed(1);
      // celsius
      cTemp = (kTemp - 273).toFixed(1);

      console.log(city);
      $("#city").html(city);
      $("#weatherType").html(weatherType);
      $("#fTemp").html(fTemp);
      $("#fTemp").click(function(){
        if(tempChange === false){
          $("#fTemp").html(cTemp);
          tempChange = true;
        }
        else{
          $("#fTemp").html(fTemp);
          tempChange = false;
        }
      });
      $("#windSpeed").html(windSpeed);
      //console.log(api);

    });
  }
});
can you tell me what I'm doing wrong?
i cannot get the right amount of degrees or grades or whatever you say it....
I needa get Farenheit to Celsius and viceversa
Dr-D-M
@Dr-D-M
Nov 12 2017 04:58
is that the correct formula? I failed physics many times in a row
Christopher Susi
@chrisandsuch
Nov 12 2017 05:00
@Dr-D-M I believe it is.
Daniel
@DanJP2016
Nov 12 2017 05:02
this site has a simple explanation of the conversion formulas for temps
https://www.mathsisfun.com/temperature-conversion.html
can you link to your codepen for that project?
Christopher Susi
@chrisandsuch
Nov 12 2017 05:03
@Dr-D-M which project?
abraham anak agung
@padunk
Nov 12 2017 05:04
i think the kTemp is in Celsius @Dr-D-M . and if u don't put var in your variable it ggoing to be global. Read the API doc if they have one
Dr-D-M
@Dr-D-M
Nov 12 2017 05:10
@chrisandsuch the project is: The Weather App
@DanJP2016 thanks man
CamperBot
@camperbot
Nov 12 2017 05:10
dr-d-m sends brownie points to @danjp2016 :sparkles: :thumbsup: :sparkles:
:cookie: 294 | @danjp2016 |http://www.freecodecamp.com/danjp2016
Christopher Susi
@chrisandsuch
Nov 12 2017 05:11
Daniel
@DanJP2016
Nov 12 2017 05:12
@Dr-D-M your welcome. did you get it working?
Dr-D-M
@Dr-D-M
Nov 12 2017 05:12
@DanJP2016 not yet, I'm trying to understand the formulas
LOL
@chrisandsuch won't load, cris
Christopher Susi
@chrisandsuch
Nov 12 2017 05:14
@Dr-D-M looking at it now and reading some of the jquery doc. Forgot the request methods
Dr-D-M
@Dr-D-M
Nov 12 2017 05:17
@chrisandsuch I think it is in the line 107
you didn't close something or put an extra parethesis or something
Daniel
@DanJP2016
Nov 12 2017 05:17
@Dr-D-M it looks like the temp the api gives you is already in celius, so you just need to convert it to fahrenheit. tempToFar = (cel * 9) / 5 + 32
Dr-D-M
@Dr-D-M
Nov 12 2017 05:17
it says "unexpected end of out put
@DanJP2016 Ah I see... so I'll need to change my variables right?
Daniel
@DanJP2016
Nov 12 2017 05:19
yes, you just need to convert to far since you already have the cel value, so you only need the one formula
Dr-D-M
@Dr-D-M
Nov 12 2017 05:20
alright alright alright @DanJP2016 therefore, the kelvin stuff and all is useless....just like my exwife, right?
Daniel
@DanJP2016
Nov 12 2017 05:21
exactly lol
Dr-D-M
@Dr-D-M
Nov 12 2017 05:24
@DanJP2016 thnks man
Daniel
@DanJP2016
Nov 12 2017 05:25
your welcome
Dr-D-M
@Dr-D-M
Nov 12 2017 05:28
@DanJP2016 hey that worked great!!
Daniel
@DanJP2016
Nov 12 2017 05:29
awesome man. you can also use Math.round(number goes here) to convert that decimal number to a whole number. might be a different method in jquery not sure though
Dr-D-M
@Dr-D-M
Nov 12 2017 05:38
yeah, that also would work great
Botenga
@Botenga
Nov 12 2017 06:24
l
alpox
@alpox
Nov 12 2017 09:43
@tiagocorreiaalmeida sry i was already in bed :D dont knoe what timezone you are in :D
Hussain Ruhollah
@Hussain-Ruhullah
Nov 12 2017 10:11
Hello world !
primuscovenant
@primuscovenant
Nov 12 2017 10:37
@rajarahull Welcome to Free code camp .
CamperBot
@camperbot
Nov 12 2017 10:37
primuscovenant sends brownie points to @rajarahull :sparkles: :thumbsup: :sparkles:
:cookie: 4 | @rajarahull |http://www.freecodecamp.com/rajarahull
Ivan Ngundela
@ingundela
Nov 12 2017 10:51
Hi everyone... may you please help in changing the default humburger menu color in bootstrap 4 "navbar-toggler-icon". actually my nav menu as a back background and when I size it to mobile the humburger menu looks dark grey can see it well.Thanks
Ivan Ngundela
@ingundela
Nov 12 2017 10:56
@rajarahull Welcom mate to be best place to be in 2017 going forward
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 10:57
GMT :D if you still around need a little explanation
Jake
@JakeDVirus
Nov 12 2017 11:03
caught in little mess.
in git i went to the previous commit just to check something by the command git checkout previousCommit-id
and now when i try to switch back to the latest commit by git checkout latestCommit-id then it shows error with the statement Please commit your changes or stash them before you switch branches.
i haven't made any changes i am sure but i dont know why its showing that change in a specific file. shall i commit it anyhow to get back to latest commit or it will mess the things more..
looking forward for help desperately
Long Nguyen
@longnt80
Nov 12 2017 11:07
type git status to see which files hasn't been commited
or staged
korzo
@korzo
Nov 12 2017 11:07
@NeelDVirus if you had no changes in working directory, you can use git reset
Walaa Mohtaseb
@walaamedhat
Nov 12 2017 11:08
@longnt80
hello
I want to ask about
How to cd automatically after git clone?
Long Nguyen
@longnt80
Nov 12 2017 11:10
yeah, sometimes I move between branches and it shows something like that too, maybe because I have that file open in the editor and git thought that I had some changes
@walaamedhat I think if you do git clone, you will be in that directory automatically?
is it not?
Jake
@JakeDVirus
Nov 12 2017 11:13
@korzo but right now i am in previous commit, not the latest. so being in the previous commit if i use git reset then would not it delete the succedding commits. sorry i am not so good with git commands
@longnt80 yeah it do show a specific file name with the change. may be it is because of the text editor issue
Walaa Mohtaseb
@walaamedhat
Nov 12 2017 11:16
@longnt80 I mean when type command to clone then automatic open the folder without type cd
Jake
@JakeDVirus
Nov 12 2017 11:22
@korzo @longnt80 i kinda stashed it by doing "git stash" and then i was able to get back to the latest commit by git checkout latest-commit id. i hope this hadn't made things weird under the hood
korzo
@korzo
Nov 12 2017 11:37
@NeelDVirus sorry, I'm on tablet and it takes forever to reply.
Stashing changes is ok, you can delete stash later.
check this answer https://stackoverflow.com/questions/22620393/various-ways-to-remove-local-git-changes
Jake
@JakeDVirus
Nov 12 2017 11:40
@korzo OH thank you so much. btw that answer is too lengthy and complex so i saved it to check it out when i will have free mind. can you just tell me the command that i can use to delete the stash.
is it git clean -f?
CamperBot
@camperbot
Nov 12 2017 11:40
neeldvirus sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
:cookie: 763 | @korzo |http://www.freecodecamp.com/korzo
Long Nguyen
@longnt80
Nov 12 2017 11:41
@walaamedhat sorry I don't know how to open the folder using command line
Karim
@krimou32
Nov 12 2017 11:43
Hello everyone! :)
Do you guys know how to modify the css of dynamically generated HTML elements with an on.('click', func) on another element? It's for the twitch API challenge
Here is the code that 'should' do it
```let targetId = event.target.id;
  if(targetId === 'selectAll') {
    allStreamers.css('display', 'block');
    console.log('selectAll has been clicked');
  } else if(targetId == 'selectOnline') {
    offlineStreamers.addClass('hidden');
    console.log('selectOnline has been clicked');
  } else if(targetId == 'selectOffline') {
    onlineStreamers.addClass('hidden');
    console.log('selectOffline has been clicked');
  }```
when I click the 3 different elements the console displays the console.log messages but does not modify the selected elements' class
Walaa Mohtaseb
@walaamedhat
Nov 12 2017 11:49
@longnt80 ooh ok thank you very much
CamperBot
@camperbot
Nov 12 2017 11:49
walaamedhat sends brownie points to @longnt80 :sparkles: :thumbsup: :sparkles:
:cookie: 668 | @longnt80 |http://www.freecodecamp.com/longnt80
Deepak Manjunath
@Deepak2322
Nov 12 2017 12:12
"2017-11-10 11:48:36.371"
i get the above from json feed, how to split that into array
Igor
@flipmotion
Nov 12 2017 12:42
Can any one explain me about reducers in redux? How use it and what should i do there, i can do logic in container.
Str.joint(‘ ‘)
Join
Long Nguyen
@longnt80
Nov 12 2017 12:51

Can any one explain me about reducers in redux? How use it and what should i do there, i can do logic in container.

reducer is a pure function that takes in state and action and return a new state

you shouldn't put any logic in reducer
Stephen James
@sjames1958gm
Nov 12 2017 13:04
@Deepak2322 You can use regex with split
2017-11-10 11:48:36.371".split(/[ \-:\.]/g);
Kevin K. Lee
@kevinkiklee
Nov 12 2017 13:05
@flipmotion you should be putting business logic into actions, if possible. i understand it's not feasible at times, but it's good to put all those concerns there.
redux follows a unidirectional data flow
when you are 'updating' the store, you aren't actually mutating it in any way. all you are doing is returning a new store.
the reducer is where you return the new store state.
the container/component will trigger an action. let's say you are trying to fetch the user profile information. you will trigger an action that you may name retrieveUserProfile. that thunk action will create a GET request asynchronously. when the request returns a response, the response is then passed to the reducer. the reducer takes the userprofile data, and adds it to store (by creating a new store).
rscales02
@rscales02
Nov 12 2017 13:36
How would I add a delay when I have repeat moves from the computer?https://codepen.io/rscales02/pen/VMrMBb?editors=1011
Curretly if the same color fires twice it only flashes once
Deepak Manjunath
@Deepak2322
Nov 12 2017 13:52
thanks @sjames1958gm
CamperBot
@camperbot
Nov 12 2017 13:52
deepak2322 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8687 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Nov 12 2017 14:11
@rscales02 You'll probably need a short timeout where you deactivate the current color before activating the new one
That would show up as two flashes for the same color
rscales02
@rscales02
Nov 12 2017 14:16
I have tried that a couple of different ways...
// I tried adding ...

if (combination[j] == combination[j-1]){
setTimeout... 
}

//... into the `var delay`
Moisés Man
@moigithub
Nov 12 2017 14:19
make a queuer
soo the next action only runs after previous ended
rscales02
@rscales02
Nov 12 2017 14:22
@moigithub it currently has an interval delay. If the combination is 2 different buttons one follows the other. Is that what you are referring to?

setTimeout/setInterval run everything at (almost) same time
it doesnt wait for previous to finish

setTimeout(()=>console.log('hello'),2000)
setTimeout(()=>console.log('bye'),2000)

will log hello bye almost at same time....
NOT hello.. wait 2 seconds n bye
if u want :point_up: behavior u will need to adjust the interval

setTimeout(()=>console.log('hello'),2000)
setTimeout(()=>console.log('bye'),4000)
alpox
@alpox
Nov 12 2017 14:33
@tiagocorreiaalmeida Did you mean me? :D
rscales02
@rscales02
Nov 12 2017 14:38
@moigithub I am trying to just delay the occurance of a function in a specific instance...
var delay = setInterval(function() {

        if (j < combination.length) {
            if (combination[j] === combination[j - 1]) {
                setTimeout(function(){
                    console.log('hi');
                    activate(combination[j]);
                }, 5);
                return j; //this return causes an unintended loop but gets the effect I want...
            } else {
                activate(combination[j]); //has timeout function
            }
        } else {
            clearInterval(delay);
        }
        j++;
    }, 500);
rscales02
@rscales02
Nov 12 2017 14:45
I am not calling the things at the same time... I just need a delay before calling the second time
if I remove that return it doesn't cause a delay...
rscales02
@rscales02
Nov 12 2017 14:58
without the return in there hi logs to the console, but it doesn't seem to run activate()
Moisés Man
@moigithub
Nov 12 2017 15:02
the trick with return.. is to know "where/who called" the function
cuz return... returns the execution flow to whoever called it
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 15:08
nah me @alpox since im from portugal the hour here is based on london time and stuff :D
diegoignacious
@diegoignacious
Nov 12 2017 15:11
hey everyone
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 15:11
hello
diegoignacious
@diegoignacious
Nov 12 2017 15:12
does anyone knows why bootstrap its kinda a bitch sometimes ?
Christopher Susi
@chrisandsuch
Nov 12 2017 15:12
Hello everyone
Tom
@moT01
Nov 12 2017 15:12
hey
alpox
@alpox
Nov 12 2017 15:15
@tiagocorreiaalmeida Hio :D
@tiagocorreiaalmeida Still need an explanation? :D
diegoignacious
@diegoignacious
Nov 12 2017 15:21
guys
im having a grid issue
with bootstrap
i've setup a grid of col-md-3 -3 -3 -3
but on screen
it prints it this way
image.png
anybody knows why ?
Tom
@moT01
Nov 12 2017 15:23
there must be a tiny bit of margin or something somewhere that is pushing that last one to the next row
diegoignacious
@diegoignacious
Nov 12 2017 15:23
i've tryed with "flex-wrap : nowrap" and still at the same way
Tom
@moT01
Nov 12 2017 15:23
my guess
diegoignacious
@diegoignacious
Nov 12 2017 15:24
h
mm
let
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 15:24
if you can setup that really quick on codepen maybe its easier to help mate
diegoignacious
@diegoignacious
Nov 12 2017 15:24
me check that again
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 15:24
@alpox and yeah I do cause after that I went to bed aswell :D just a sec will msg you about it
diegoignacious
@diegoignacious
Nov 12 2017 15:24
oh, that my big trouble here
Tom
@moT01
Nov 12 2017 15:24
if you're using flex - not sure you need the bootstrap
diegoignacious
@diegoignacious
Nov 12 2017 15:24
ive never knew how to propperly make a pen
im using a template
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 15:25
just copy and paste your code to there :D
diegoignacious
@diegoignacious
Nov 12 2017 15:25
built on bootstrap
@tiagocorreiaalmeida but js files is nightmare for me
imma try it
alpox
@alpox
Nov 12 2017 15:25
@tiagocorreiaalmeida kk :D
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 15:26
you dont need to copy that
Tom
@moT01
Nov 12 2017 15:26
you can build an example that replicates the problem @diegoignacious without including all the js and stuff
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 15:26
you can set on settings all the bootstrap stuff plus I think you dont need any js for this situation
diegoignacious
@diegoignacious
Nov 12 2017 15:28
alright here we go, it wont show the IMG's either, but here is my piece of code, plus all the css
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 15:30
allready spoted an issue
<div class="iso-box col-md-3 sma-6"
sm-6?
col-sm*
diegoignacious
@diegoignacious
Nov 12 2017 15:30
oh sure
my bad
but, there is not the issue
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 15:30
                    <div class="iso-box-wrapper col2-iso-box">
<div class="iso-box col-md-3 col-sm-3 col-lg-3">
you dont need to write this
if the idea is to be 3-3-3-3
even in smal screen
you can just go col-sm-3
and it will work
plus take care with naming classes or on the end this will be a mess
diegoignacious
@diegoignacious
Nov 12 2017 15:32
thanks @tiagocorreiaalmeida , didn't knew that
CamperBot
@camperbot
Nov 12 2017 15:32
diegoignacious sends brownie points to @tiagocorreiaalmeida :sparkles: :thumbsup: :sparkles:
:cookie: 440 | @tiagocorreiaalmeida |http://www.freecodecamp.com/tiagocorreiaalmeida
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 15:32
try bem method
diegoignacious
@diegoignacious
Nov 12 2017 15:32
image.png
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 15:33
or you will end up with a mess
diegoignacious
@diegoignacious
Nov 12 2017 15:33
this is craziest shit, if i scale the navigator to 75% it will show it propperly
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 15:33
there's more issues
place it back to normal
diegoignacious
@diegoignacious
Nov 12 2017 15:35
100%
image.png
why is this happening :worried:
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 15:35
cause probably
bad closed tags
theres online website
where you place the html and it tells you where you failing the tags
diegoignacious
@diegoignacious
Nov 12 2017 15:37
hmm
let me check
na, i actually had some open divs, but i've closed them, and still printing it at 2 rows
with a 3-3-3-3 grid
:(
rscales02
@rscales02
Nov 12 2017 15:52
setTimeout runs the code within it after x milliseconds... correct?
alpox
@alpox
Nov 12 2017 15:52
@rscales02 yep
rscales02
@rscales02
Nov 12 2017 15:56
var combination = [1, 1]
if (combination[j] === combination[j - 1]) {
                setTimeout(function(){
                    console.log('hi');
                    activate(combination[j]);
                }, 500);

            }else {
                activate(combination[j]);
            }
this should delay activate should it not?
alpox
@alpox
Nov 12 2017 15:57
@rscales02 Only the one in the if - but yes. 500 milliseconds - so half a second
@rscales02 Mabe your if doesn't hold
rscales02
@rscales02
Nov 12 2017 15:59
that is the activate I want delayed... the if seems to hold as hi shows up in the console
alpox
@alpox
Nov 12 2017 15:59
@rscales02 Okay, then activate should run right after the hi
diegoignacious
@diegoignacious
Nov 12 2017 16:02
somebody , please ?
:(
alpox
@alpox
Nov 12 2017 16:02
@diegoignacious Looks alright to me - whats the matter?
rscales02
@rscales02
Nov 12 2017 16:03
any particular reason that it wouldn't? I just tried consoling from activate and don't get a second running when combination[j] == combination[j-1]
alpox
@alpox
Nov 12 2017 16:03
@rscales02 You should get half a second with that code
If you want a second, use 1000 instead of 500
rscales02
@rscales02
Nov 12 2017 16:05
@alpox the problem seems to be that activate doesn't run, there is a half second delay before logging hi
alpox
@alpox
Nov 12 2017 16:07
@rscales02 Can you show me the code of activate?
you will notice that if there is a repeat in the button combination that hi only logs 1 time
alpox
@alpox
Nov 12 2017 16:14
@rscales02 activate runs, but button is undefined
So the switch doesn't enter a case
diegoignacious
@diegoignacious
Nov 12 2017 16:15
@alpox, thing is that i've made a grid of 3-3-3-3
but the 4th items its jumping to the next row
and i dont know why it is that
might my screen ?
might be *
alpox
@alpox
Nov 12 2017 16:16
@rscales02 j is actually out of bounds and i see why. j incremented before the setTimeout callback runs and doesn't have the same value anymore as when the if was run. Make a local copy of the variable j with let
@rscales02
let jCopy = j;
setTimeout(...); // Use jCopy in here instead of j
@diegoignacious Hmm non-responsive images which blow up the width of a col?
rscales02
@rscales02
Nov 12 2017 16:19
you rock my sox @alpox thanks
CamperBot
@camperbot
Nov 12 2017 16:19
rscales02 sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:star2: 1454 | @alpox |http://www.freecodecamp.com/alpox
alpox
@alpox
Nov 12 2017 16:20
@rscales02 np :-)
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 16:57
lets go @alpox stillthere?
James Patrick Kerrane
@jamesjpk123
Nov 12 2017 16:58

Can anyone help me with my code in mutations?

function mutation(arr) {
  var zero = arr[0].toLowerCase();
  var one = arr[1].toLowerCase();
  var zeroarr = zero.split("");
  var onearr = one.split("");
  zeroarr.sort();
  onearr.sort();

  function alpha(arr) {
    for(x = 0; x !== arr.size; x++) {
      if(arr[x] == arr[x + 1]) {
        arr.splice(x, 1);
      }
    }
  }
  alpha(zeroarr);
  alpha(onearr);
  var zerostring = zeroarr.toString();
  var onestring = onearr.toString();
  return zerostring.indexOf(onestring) !== -1;
}

mutation(["Mary", "Aarmy"]);

I'm trying to see if the letters present in arr[0] are present in arr[1]. I've been stuck on trying to remove duplicate letters. My attempt at doing so is in alpha();

alpox
@alpox
Nov 12 2017 17:03
@tiagocorreiaalmeida Yep i'm here :D
^(((http:\/\/)|(www)|(https:\/\/))?(www)?).(\w+)
not the regex master :D
anyway I want to get only the domain liek google and others
but I dont know a way of doing what I did on the start without grouping it :D
alpox
@alpox
Nov 12 2017 17:10
@tiagocorreiaalmeida You don't have to group all of them, you can do cases like (http|www|...) just as example
@tiagocorreiaalmeida Btw, you have to escape a . --> \.
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 17:11
in this case its a dot literally, and thanks let me see what I can do now :D
nm you are right :D
alpox
@alpox
Nov 12 2017 17:13
@tiagocorreiaalmeida :) yea you have to match a dot with \. :)
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 17:19
^(http:\/\/|https:\/\/)?w{3}?\.(.*)\.
im still missing something but i allready dying looking at this :D
Liam Docherty
@ldocherty1
Nov 12 2017 17:23

Hi,

Any ideas why when the user inputs "Yes" or "No into my program the following method doesn't load. I think the problem is with these lines within my program. I'm using JAVA.

System.out.println("Please enter the one of the following exactly how you see on your display 'Yes' or 'No'");
        outcome1=userinput.next();
        if(outcome1== "Yes"){
            FunctionalSkills();
        } 
        if(outcome1== "No"){
            System.out.println("Thanks for using the Liam's UCAS grade calculator.");
            System.exit(0);
        }
alpox
@alpox
Nov 12 2017 17:23
@tiagocorreiaalmeida The \. after w{3}?\. <-- has be optional
@tiagocorreiaalmeida Because in http://google.com there is no . before google
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 17:24
yeah yeah good eye, still missing something reading about "look-around assertions"
alpox
@alpox
Nov 12 2017 17:24
@tiagocorreiaalmeida Also, w{3}? doesn't work. Only one multiplier is allowed
@tiagocorreiaalmeida You can use w{0,3} to allow w to be there 0-3 times
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 17:25
but if I want to be really 3 isnt w{3} the way?
alpox
@alpox
Nov 12 2017 17:26
@tiagocorreiaalmeida Yes, but w can also be there 0 times
So if you want that both exactly - only 3 or 0 times - you'd need (w{3})?
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 17:29
taht what I have but once again im runing into the same problem the groups one, was trying to figure a way of not having it as a group or ignore it on the matches
alpox
@alpox
Nov 12 2017 17:30
@tiagocorreiaalmeida Why ignore it?
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 17:33
how would you do it to only return the domain?
alpox
@alpox
Nov 12 2017 17:33
@tiagocorreiaalmeida /.../.exec(url)[3]
Or url.match(/.../)[3]
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 17:37
image.png
alpox
@alpox
Nov 12 2017 17:38
@tiagocorreiaalmeida Ah ok .match works different it seems... use .exec then :D
With .exec you can get out specific capturing groups
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 17:41
that's diferent :D i should invest more time inregex
image.png
anyway still trying to figure out why that 2 one
gets the dot
:D
regex is the kind of thing you get all motivated to use and then you are like, yeah ok see you later
:D
alpox
@alpox
Nov 12 2017 17:44
@tiagocorreiaalmeida 1. entry -- is the whole match. (Index 0)
  1. entry -- is the first capturing group (Index 1)
  2. entry -- is the second capturing group (Index 2)
    ....
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 17:47
google.com
.com*
look above
happens only on that case
in the others I only get the domain and not what comes after the dot its what I mean
alpox
@alpox
Nov 12 2017 17:52
@tiagocorreiaalmeida What regex do you have now?
Liam Docherty
@ldocherty1
Nov 12 2017 17:56

I tried if(outcome1.equalsIgnoreCase("Yes")){.

However, the program runs but doesn't being the user to that method when they input "Yes" or "No". How can I fix this?

        System.out.println("Please enter the one of the following exactly how you see on your display 'Yes' or 'No'");
        outcome1=userinput.next();
        if(outcome1.equalsIgnoreCase("Yes")){ 
            FunctionalSkills();
        } 
       if(outcome1.equalsIgnoreCase("No")){                
       System.out.println("Thanks for using the Liam's UCAS grade calculator.");
            System.exit(0);
        } 
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 17:59
@alpox none I reseted it will give it a new look tomorrow nad start from the bottom :D I couldnt write nothing in regex 1month ago so this will get better with presistence, but thanks for the help!
CamperBot
@camperbot
Nov 12 2017 17:59
tiagocorreiaalmeida sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:star2: 1455 | @alpox |http://www.freecodecamp.com/alpox
alpox
@alpox
Nov 12 2017 18:04
@tiagocorreiaalmeida Heheh okay :D regex takes time to understand
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 18:05
still there's something that's usefull in all the programming languages I would say so its better to try to get better at it always as possible
alpox
@alpox
Nov 12 2017 18:28
Yea its very good to know
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 18:29
building any programming project at moment for the university?
alpox
@alpox
Nov 12 2017 18:34
@tiagocorreiaalmeida not really a project. Ill soon have to start training a neural network for dialect recognition
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 18:36
sounds like something I wouldnt be able to do :D
alpox
@alpox
Nov 12 2017 18:39
@tiagocorreiaalmeida Well same here :D i don't know much about it yet
@tiagocorreiaalmeida But i finished the crap with the essay ^^
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 18:44
in the end dont you have to create a project to show as thesis or something aswell?
alpox
@alpox
Nov 12 2017 18:49
@tiagocorreiaalmeida yea next semester. No project though
@tiagocorreiaalmeida It depends a bit on what i get. I guess i will do some datastructure research for datase indices
@tiagocorreiaalmeida I still have to go ask the professor for if he has something good for me
It will maybe be something like implementing stuff from newest research in a specific environment, maybe improve it and test it
Znadams
@Znadams
Nov 12 2017 18:53
any opinions on angular vs react?
Moisés Man
@moigithub
Nov 12 2017 18:55
full equiped car vs a bike
framework vs library
Znadams
@Znadams
Nov 12 2017 19:02
in favor of angular?
Dan Couper
@DanCouper
Nov 12 2017 19:03
Angular being a full framework doesn't make it better
Just different uses/development styles
Znadams
@Znadams
Nov 12 2017 19:05
is there one you guys would reccomend for a newb?
my goal is to get into industry ASAP
Moisés Man
@moigithub
Nov 12 2017 19:06
find what technology are used in ur zone.. n learn that
CamperBot
@camperbot
Nov 12 2017 19:06
find what technology are used in ur zone n learn that
nothing found
Tiago Correia
@tiagocorreiaalmeida
Nov 12 2017 19:07
this camper bot :D
Dan Couper
@DanCouper
Nov 12 2017 19:07
Yeah, what are companies near you using
Otherwise you're just randomly picking buzzwords out of a hat
Moisés Man
@moigithub
Nov 12 2017 19:08
i know some ppl will say.. with internet u can do remote work n blah blah blah... but thats NOT accessible for juniors
Znadams
@Znadams
Nov 12 2017 19:11
loiool
silly camper bot
it seems to be pretty even in my around
area^
react seems to be slightly more popular according to job postings but its so slgiht it does not seem statistically relevant
Kevin K. Lee
@kevinkiklee
Nov 12 2017 19:25
learn react. it's easier. simple as that.
also, most of the new projects that are starting now are using react.
there aren't many new things starting with angular. most of the angular jobs are maintenance jobs. at least in nyc.
Znadams
@Znadams
Nov 12 2017 19:44
Thanks @kevinkiklee
CamperBot
@camperbot
Nov 12 2017 19:44
znadams sends brownie points to @kevinkiklee :sparkles: :thumbsup: :sparkles:
:cookie: 331 | @kevinkiklee |http://www.freecodecamp.com/kevinkiklee
Kevin K. Lee
@kevinkiklee
Nov 12 2017 19:49
@Znadams if you want to get a job asap, this is a good curriculum: https://github.com/P1xt/p1xt-guides/blob/master/job-ready.md
Znadams
@Znadams
Nov 12 2017 19:49
Thanks! im working through the v2.0 as we speak
well sort of, im brushing up on some basic javascript first
Kevin K. Lee
@kevinkiklee
Nov 12 2017 19:51
super. it's a good curriculum.
Dan Couper
@DanCouper
Nov 12 2017 19:54
As well as being batteries included, the way Angular does stuff is [in a lot of ways] very similar to what you'd see in Java, which is always going to mean it'll be popular. It's popular and widely used, but dunno how much of that is maintenance of legacy enterprise stuff. advertises they want
And everyone advertises they want React devs, so take with pinch of salt
Kevin K. Lee
@kevinkiklee
Nov 12 2017 20:02
i just went through the job search process in nyc, and most of the angular jobs are 1.x jobs. i didn't see many angular 2+. and not many companies were trying to start something new with angular. most companies that were about to start something were planning to use react.
Znadams
@Znadams
Nov 12 2017 20:03
any opinions on react native vs cordova/ionic?
Kevin K. Lee
@kevinkiklee
Nov 12 2017 20:03
but angular is big, reliable and it is still used widely. doesn't hurt to learn. however, if your goal is to get into the industry asap, learning react will be faster than angular. angular is the chicken sink.
i haven't worked on mobile, but i do know several friends that are starting work on react native.
Znadams
@Znadams
Nov 12 2017 20:04
Thanks Kevin, helpful as always :)
A-J Roos
@Asjas
Nov 12 2017 20:04
Haha yeah he's been inspiring the last couple of days :)
Kevin K. Lee
@kevinkiklee
Nov 12 2017 20:04
and i'm sure, in a couple of years, react will die and we'll be on webassembly or elm.
Znadams
@Znadams
Nov 12 2017 20:05
Sometimes I feel that the market moves too fast :/
Kevin K. Lee
@kevinkiklee
Nov 12 2017 20:05
lol, i'm starting my new job on monday. i had some free time, so decided to come back to fcc real quick. after today, i'll probably end up disappearing because i'll be getting my ass kicked at the new job.
A-J Roos
@Asjas
Nov 12 2017 20:05
Lol. Well it's been great xD
Znadams
@Znadams
Nov 12 2017 20:05
The hottest fire creates the strongest steel
Kevin K. Lee
@kevinkiklee
Nov 12 2017 20:07
lol, i was an ass at certain points though =D i sometimes lose my filter when i'm online, because it's not a face-to-face conversation.
Znadams
@Znadams
Nov 12 2017 20:09
Thats probably fairly common
Dan Couper
@DanCouper
Nov 12 2017 20:12
YMMV Cordova is a massive pain in the ass, and IMO would be better if it died, but that may just be bad experiences. RN is pretty easy to use and works very well. If you ain't building for specific platform using Swift or Kotlin or whatever, seems next-best option.
Ken Haduch
@khaduch
Nov 12 2017 20:42
@kevinkiklee - best of luck with your new job!
unityredd
@unityredd
Nov 12 2017 20:51
I'm attempting to work on my tribute page and need a bit of help
A-J Roos
@Asjas
Nov 12 2017 20:51
Sure. What do you need help with?
unityredd
@unityredd
Nov 12 2017 20:52
I was wanting to add a background image that would be behind all the text and other elements on my page. can't seem to find the right resources.
very new to all of this.
A-J Roos
@Asjas
Nov 12 2017 20:53
You can either create a <div> and apply a background-image to it or you can apply the image to the body.
You apply the background-image in css to the element
unityredd
@unityredd
Nov 12 2017 20:56
Thank you. Trying that now.
vengal
@vengal4327
Nov 12 2017 21:30
Hi Guys, I'm getting '$export is not a function' when trying to import modules from another package that I wrote. like when I do
"Import modul_name from package-name". Any idea? I was able to import other packages without any issue.
The project is compiling fine.. but getting this error only when I'm trying to run in browser..
Ken Haduch
@khaduch
Nov 12 2017 23:56
@vengal4327 - are there times when you have to use import { module_name } from 'package-name';? I'm just getting to that part in a React course that I'm going through. Still not quite sure when you need the curly brackets, I think it's when there are multiple exported functions?
Tom
@moT01
Nov 12 2017 23:59
the curlys are for individual functions