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
Gaurav
@gauravmagan
Screen Shot 2018-02-01 at 6.53.53 PM.png
Screen Shot 2018-02-01 at 6.56.48 PM.png
is there anything wrong
Screen Shot 2018-02-02 at 9.06.04 PM.png
Screen Shot 2018-02-02 at 9.06.12 PM.png
Gaurav
@gauravmagan
hi i have infact added the scripts but the console says file not found
Ken Haduch
@khaduch
@gauravmagan - is this a codepen project? Do you have the full URL for the files - starting with https:// ?
I guess I cannot see what you have in the assets folder...
I haven't used a CodePen project, so can you share the URL for it?
Nate Mallison
@NJM8
@gauravmagan It looks like maybe the file path is incorrect. about.html is in the views folder, to use src='assets/etc' the assets folder needs to be in the same directory as about.html
so just go up a level
I think src='/assets/etc' should do it
so it will start looking for assets from the project root directory not the folder it currently is in
DMsalati
@DMsalati
can someone tell me why offset isnt working on my code ?
</head> <body class="container-fluid"> <header class="row"> <div class="col-md-6 col-md-offset-3"> <h1>Random Quote Generator</h1> <h2>Inspirational Quotes</h2> </div> </header>
</head> <body class="container-fluid"> <header class="row"> <div class="col-md-6 col-md-offset-3"> <h1>Random Quote Generator</h1> <h2>Inspirational Quotes</h2> </div> </header>
Matej BoĆĄnjak
@mbosnjak01
Most likely no on what you provided. You should post your whole code. Best would be to put it in codepen and then link it here
DMsalati
@DMsalati
i just tried it on codepen and it works, but not on my file
William Watts
@Braillon7
@DMsalati it doesn't work on which file?
@DMsalati if it works on codepen and not somewhere else maybe it's how you set up your file. Make sure bootstrap is uploaded. I see nothing wrong with your code. Another thing you could do is col-md-12 and text-align center in your styling. That's the same thing as md-6 and offset-3 it sounds like it me.
A. J. Bozdar
@moajday

I am not entirely sure what following two programs do:

function showPrimes(n) {
        nextPrime: for (let i = 2; i < n; i++) {
            for (let j = 2; j < i; j++) {
                if (i % j == 0) continue nextPrime;
            }

            console.log( i );
        }

and

function showPrimes(n) {
        for (let i = 2; i < n; i++) {
            if (!isPrime(i)) continue;

            alert(i);
        }
    }
    function isPrime(n) {
        for (let i = 2; i < n; i++) {
            if ( n % i == 0) return false
        }
    return true;
    }

These are two examples available on JS.info website. None of them log or alert anything. :(

Is anyone available at this time?
Stephen James
@sjames1958gm
@ajbozdar Those are functions - they have to be called to do anything. Do you have code that calls the functions?
A. J. Bozdar
@moajday
I know they are functions. There are alert and console.log to test them.
Stephen James
@sjames1958gm
@ajbozdar If you call the first one showPrimes(10) for example it will console log out 2, 3, 5, 7
@ajbozdar The code you posted for the first one is missing the last } but I am guessing it is there in the real code
@ajbozdar - running the first one
showPrimes(10)
2
3
5
7
A. J. Bozdar
@moajday
@sjames1958gm Let me check.
Ayush Bahuguna
@relentless-coder
Hey, I am facing a rather weird problem. I have served pages via nodejs, and the problem is as I scroll up and down, the elements take a second to appear, it doesn't happen all the time, but let's 2 out of 5 times, this happens
A. J. Bozdar
@moajday
@sjames1958gm What is continue in program? How it works? What's its coding name? Is it kind of an attribute?
Stephen James
@sjames1958gm
@ajbozdar
continue inside a loop will jump to the next loop iteration (or if it has a label (here nextPrime)) it will jump to the label.
I have seldom, almost never, seen continue <label> in real code.
A. J. Bozdar
@moajday

Is my program error free now?

function showPrimes(n) {
        nextPrime: for (let i = 2; i < n; i++) {
            for (let j = 2; j < i; j++) {
                if (i % j == 0) continue nextPrime;
    }

    console.log( i ); // a prime should be logged in console.
  }
}
showPrimes(10);

It still logs nothing.

I changed n to 10; no response.
Stephen James
@sjames1958gm
@relentless-coder Are these basic HTML pages? Do they load a lot of extra files? Does it only happen when you scroll right after the page is loaded?
I would open devtools and use the network tab to see if there is a loading delay, at least start there
@ajbozdar Where are you calling the function?
There needs to be a line of code after the function like
showPrimes(10)
A. J. Bozdar
@moajday
If you have never seen continue in real code then JS.info is probably overusing labels.
Stephen James
@sjames1958gm
@ajbozdar The second example has continue without the label, that is what I usually see.
A. J. Bozdar
@moajday
Oops! My mistake. I am sorry. Look onto above code. It is just there in the end.
A. J. Bozdar
@moajday
You mean second code is better than the first code, right?
Stephen James
@sjames1958gm
@ajbozdar Yes, I believe so
@ajbozdar by just having the function called isPrime it is much easier to know what the code is doing.
ahmed-issa-mohd
@ahmed-issa-mohd
Can anyone tell me how border-image-slice Property works ?
ahmed-issa-mohd
@ahmed-issa-mohd
how is it working ?
Ghost
@ghost~5a4a80acd73408ce4f859755
did u read that?
ahmed-issa-mohd
@ahmed-issa-mohd
yse
image.png
yes
Stephen James
@sjames1958gm
@ahmed-issa-mohd It is saying how much of the border image to I slice off (how much do I use) to fill the border.
A larger number picks more of the image for the border (which then scales the image down to fit in the border)
ahmed-issa-mohd
@ahmed-issa-mohd
thankS