Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
Philominsuji
@Philominsuji
I understood the for loop but I can not understand the nested for loop
Sweet Coding :)
@SweetCodingInc
You want to print as many * on one line as the value of $i
so when $i is 1, you print *
when $i is 2, you print * *
Philominsuji
@Philominsuji
yes we use for loop to that right?
Sweet Coding :)
@SweetCodingInc
yes
the outer loop tracks value of $i
the inner loop (nested loop) runs from 1 to $i
so that it can print as many *s as $i
when the inner loop is over, you want to move to next line.
you do that echo "<br>"
Philominsuji
@Philominsuji
when $i=1,the inner loop will run only one time right?
because inner loop condition is $j<=$i right?
Claudio Restifo
@Marmiz
@Philominsuji yep because j is initialised as 1, so it will run one time 1<= 1 is true, then the loop will check again but this time 2 <= 1 is false so it will stop and go back to executing the outer function
and the next thing in the outer function is echo <br> so the function will do that, and then resume the loop by incrementing i, checking the loop condition... and so on...
Dany Din
@danydin
@SweetCodingInc thanks but should i do like this className:hover{text....}?
CamperBot
@camperbot
danydin sends brownie points to @sweetcodinginc :sparkles: :thumbsup: :sparkles:
:cookie: 284 | @sweetcodinginc |http://www.freecodecamp.org/sweetcodinginc
Philominsuji
@Philominsuji
so each and every iteration one star should be print.Because there is no concatination operator used in this.Then how to print 1st one star next two star next three star?
Dany Din
@danydin
@Marmiz how to indicate hover in css?
Sweet Coding :)
@SweetCodingInc
@danydin that's right
Dany Din
@danydin
ahhh ok cuz for some reason the css didn't read it
Claudio Restifo
@Marmiz
@danydin :hover
Dany Din
@danydin
fixed
CamperBot
@camperbot
danydin sends brownie points to @marmiz :sparkles: :thumbsup: :sparkles:
Dany Din
@danydin
@Marmiz thx
CamperBot
@camperbot
:star2: 1158 | @marmiz |http://www.freecodecamp.org/marmiz
Dany Din
@danydin
@SweetCodingInc thx budddy
CamperBot
@camperbot
danydin sends brownie points to @sweetcodinginc :sparkles: :thumbsup: :sparkles:
api offline
Claudio Restifo
@Marmiz
@Philominsuji because i increments, so your j loops more on each iteration.
i = 0 --> j(1) <= 0 is false so nothing happens
i =1 --> j(1) <= 1 loop one time
i = 2 --> j(1) <= 2 loop two times (first time j = 1; then j =2)
i = 3 --> j(1) <= 3 loop three times ( j= 1; j=2; j=3)

[... and so on..]
until
i = 6 breaks the loop
Michael Cordero
@CyberPutty
anyone familiar with react and CORS?
Sweet Coding :)
@SweetCodingInc
@CyberPutty yes?
Michael Cordero
@CyberPutty
@SweetCodingInc cool. I'm using react in VSC and when i try a fetch i get a console error about not allowing CORS because i need Access-Control-Allow-Origin: *. where do i write that?
Sweet Coding :)
@SweetCodingInc
@CyberPutty what URL are you trying to fetch?
Michael Cordero
@CyberPutty
just a github file
Sweet Coding :)
@SweetCodingInc
can you share code ?
Michael Cordero
@CyberPutty
but im running locally on port#
const url= "https://github.com/lewagon/flats-boilerplate/blob/master/flats.json";
  fetch(url)
  .then(response=> response.json())
  .then((data)=>{
    console.log(data);
  });
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://github.com/lewagon/flats-boilerplate/blob/master/flats.json. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
Sweet Coding :)
@SweetCodingInc
@CyberPutty correct
you need to use the raw url https://raw.githubusercontent.com/lewagon/flats-boilerplate/master/flats.json
the url you've specified is an actual html page and not a json.
Michael Cordero
@CyberPutty
@SweetCodingInc lawl kk im try that first.
Sweet Coding :)
@SweetCodingInc
When you visit this file https://github.com/lewagon/flats-boilerplate/blob/master/flats.json there are 3 buttons on right side right above where the code starts. Click on Raw button that will take you to actual file
Michael Cordero
@CyberPutty
@SweetCodingInc Thanks' that worked.
CamperBot
@camperbot
cyberputty sends brownie points to @sweetcodinginc :sparkles: :thumbsup: :sparkles:
:cookie: 285 | @sweetcodinginc |http://www.freecodecamp.org/sweetcodinginc
Sweet Coding :)
@SweetCodingInc
use that url
@CyberPutty :+1: