Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    LucyGamer28
    @LucyGamer28
    is anyone currently online?
    VoidVolker
    @VoidVolker
    hi, yes
    LucyGamer28
    @LucyGamer28
    Excellant..thanks..I have a question...
    a few actually..
    Are you familiar with sending data down a socket, more specifically..limiting the amount of data sent down a socket to maybe 10 messages per sec
    trying to think of a good way to do ths
    VoidVolker
    @VoidVolker
    and what the problem? just use sleep(100)
    LucyGamer28
    @LucyGamer28
    sorry how does sleep controll messages per second?
    VoidVolker
    @VoidVolker
    sleep(100) x 10 = 1000 ms or one second
    LucyGamer28
    @LucyGamer28
    you mean count how many messages I send and then as soon as I reach that limit sleep for the rest of the second
    VoidVolker
    @VoidVolker
    nop, just sleep after msg
    LucyGamer28
    @LucyGamer28
    Ah ok
    Mandeep Khatry
    @mandeepkhatry
    Hi
    Andrews Yawson
    @yawsonandrews1_twitter
    Hello can anyone help me know whether to develop my app using IBM worklight or stick to just android studio and xcode
    janvleugels
    @janvleugels
    Hi! anyone hes knowledge of php / laravel?
    AnaCamelo
    @AnaCamelo
    @AnaCamelo
    Hello! Sorry. I have a question and I was wondering if anyone could help me
    I have this line of code: slides[i].style.display = "none";
    but, i don't understand what the slides[i] means
    Could anyone explain me ? Thanks!
    VoidVolker
    @VoidVolker
    slides - is array, and i is index
    for eaxmple: slides = [slideOne, slideTwo, slideThree]
    AnaCamelo
    @AnaCamelo
    So, here:
    for (i = 0; i < slides.length; i++) {
    slides[i].style.display = "none";
    }
    it is saying to hide ALL the slides? what about the one that is being displayed?
    it is a bit confusing to me. Thank you for answering @VoidVolker :)
    VoidVolker
    @VoidVolker
    yes. correct, this will hide all slides
    also, it is better to cache slides.length to separate variable
    AnaCamelo
    @AnaCamelo
    so, how is that one of the slides is being showed?
    VoidVolker
    @VoidVolker
    add code to show selected slide?
    AnaCamelo
    @AnaCamelo
    well, the code is working great, but i don't understand why if that loop is hiding all the slides, how is one being displayed?
    VoidVolker
    @VoidVolker
    in this loop no one slide is being displayed
    AnaCamelo
    @AnaCamelo
    exactly, that's why I'm confused
    VoidVolker
    @VoidVolker
    check other code
    AnaCamelo
    @AnaCamelo
    Can i show you athe whole code?
    VoidVolker
    @VoidVolker
    this loop isnt the place for searching the displayed slide
    use ``` for code
    before and after
    AnaCamelo
    @AnaCamelo
    oohh ok, thanks! :)

    ' var slideIndex = 1;
    showSlides(slideIndex);

    function plusSlides(n) {
    showSlides(slideIndex += n);
    }

    function currentSlide(n) {
    showSlides(slideIndex = n);
    }

    function showSlides(n) {
    var i;
    var slides = document.getElementsByClassName("mySlides");
    var dots = document.getElementsByClassName("dot");
    if (n > slides.length) {slideIndex = 1}
    if (n < 1) {slideIndex = slides.length}
    for (i = 0; i < slides.length; i++) {
    slides[i].style.display = "none";
    }
    for (i = 0; i < dots.length; i++) {
    dots[i].className = dots[i].className.replace(" active", "");
    }
    slides[slideIndex-1].style.display = "block";
    dots[slideIndex-1].className += " active";
    }'

    single quotation mark for the code? it didn't seem to work
    VoidVolker
    @VoidVolker
    wrooong style! use ``` for code wrapping
    not single quotation, three apostrophe
    AnaCamelo
    @AnaCamelo
    k
    VoidVolker
    @VoidVolker
    @AnaCamelo edit your msg for correct style
    @AnaCamelo you can edit your msg, please don't flood
    AnaCamelo
    @AnaCamelo
    sorry, I'm trying
    VoidVolker
    @VoidVolker
    code isn't redable, fix style before for more redaible view
    AnaCamelo
    @AnaCamelo
    ok
    VoidVolker
    @VoidVolker
    var slideIndex = 1;
    showSlides(slideIndex);
    
    function plusSlides(n) {
        showSlides(slideIndex += n);
    }
    
    function currentSlide(n) {
        showSlides(slideIndex = n);
    }
    
    function showSlides(n) {
    
        var i;    
        var slides = document.getElementsByClassName("mySlides");
        var dots = document.getElementsByClassName("dot");
    
        if (n > slides.length) {slideIndex = 1}
        if (n < 1) {slideIndex = slides.length}
    
        for (i = 0; i < slides.length; i++) {
            slides[i].style.display = "none";
        }
    
        for (i = 0; i < dots.length; i++) {
            dots[i].className = dots[i].className.replace(" active", "");
        }
    
        slides[slideIndex-1].style.display = "block";
        dots[slideIndex-1].className += " active";
    }
    AnaCamelo
    @AnaCamelo
    I can't make it work :S
    VoidVolker
    @VoidVolker
    like this
    new line after ```
    AnaCamelo
    @AnaCamelo
    var slideIndex = 1;
    showSlides(slideIndex);
    
    function plusSlides(n) {
      showSlides(slideIndex += n);
    }
    
    function currentSlide(n) {
      showSlides(slideIndex = n);
    }
    
    function showSlides(n) {
      var i;
      var slides = document.getElementsByClassName("mySlides");
      var dots = document.getElementsByClassName("dot");
      if (n > slides.length) {slideIndex = 1} 
      if (n < 1) {slideIndex = slides.length}
      for (i = 0; i < slides.length; i++) {
          slides[i].style.display = "none"; 
      }
      for (i = 0; i < dots.length; i++) {
          dots[i].className = dots[i].className.replace(" active", "");
      }
      slides[slideIndex-1].style.display = "block"; 
      dots[slideIndex-1].className += " active";
    }
    there you go! :)
    thank you!