Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Andrew Michael Potter
    @AMPotter
    I'm not there physically, but I'm there in spirit. I'm also online if anyone has any questions.
    aaroncrows
    @aaroncrows
    @AMPotter don't suppose you'd take a sec to look over my setInterval woes?
    Andrew Michael Potter
    @AMPotter
    Yeah dude, I'll DM you.
    Hannah Won
    @nowhannahwon
    Just arrived. We're running a lighter crew tonight, so feel free to ask if a TA is available here if you can't flag someone down.
    Emily Doherty
    @edohert
    @dcorns here is the website with the filtering issue, currently the Paiting.html page. https://github.com/edohert/casey.git
    Emily Doherty
    @edohert
    Emily Doherty
    @edohert
    @harberg all of those lovely spaces have been removed.
    Nicholas Harberg
    @harberg
    @edohert
    $('#filters').on('click', 'button', function() {
            var filterValue = $(this).attr('data-filter');
            $paintingPageContent.isotope({
                filter: filterValue
            });
            return false;
        });
    @edohert All we were missing was returning false at the end of the .on()
    Emily Doherty
    @edohert
    @harberg YESSS!! Thank you!!!!
    Sheyna Watkins
    @sheyna
    For the Algorithm assignment, is there anyone here using insertion sort who has been successfully able to slow down their animation? I just spend 2.5 hours at the lab discovering it's almost impossible to slow mine done. I'm going to keep working on it but I was wondering if anyone else has gotten it to work?
    Zac Mrowicki
    @zmrow
    Does anyone know how to get the value of a custom attribute from an HTML element contained in an array?
    Nicholas Harberg
    @harberg
    Custom attribute?
    Adam Caldwell
    @adamrcaldwell
    I've been having trouble animating my sort as well. Putting setTimeout() in the loop produces a completely different result. From what I'm reading it has something to do with closure, which I don't really understand. I'll post again if I get it to work.
    Adam Caldwell
    @adamrcaldwell
    function bubbleSort() {
        var $len = $(".num").length;
        for (i = 0; i < $len; i++) {
            for(j = 0, stop = $len - i; j < stop; j++) {
                if(liToVal(j) > liToVal(j + 1)) {
                    swap(j, j + 1);
                }
            }
        }
    };
    Sorry for the spam. liToVal returns the number in the list element and swap does what you'd expect. This code works, but when I put in setTimeout with the correct syntax, a little animation happens but the page remains in its unsorted state. I've now spent about 4 hours stuck on this step. Anyone have a guess?
    Brian Caldwell
    @Caldwerl
    setTimeout only performs once after waiting a set amount of time,
    setInterval will perform every set amount of time until clearInterval is called
    Adam Caldwell
    @adamrcaldwell
    I was under the impression that setTimeout within a for loop would produce the right result. I'll give setInterval a try, thank you!
    Adam Caldwell
    @adamrcaldwell

    Nope, setInterval didn't work either. I can't see why when I change the swap line above to:

    setTimeout(swap, 25, j, j+1);

    It doesn't wait 25 ms before each swap instead of leaving me with the same unsorted page (as noted, it works as posted above). I may just turn it in for partial credit, 5 hours with no progress is enough.

    Sheyna Watkins
    @sheyna
    @adamrcaldwell I had the same problem. As I understand it setinterval and setTimeout can only return values, they can't just slow data processing.
    Sheyna Watkins
    @sheyna
    So unless you code as something to return setTimeout and setInterval will not work. Someone in the computing universe needs to invent a sleep() function to tell the computer to just pause for a moment. I'm trying to find a way around this by putting an unrelated for loop in the middle of the code where I want to computer to slow down. In other words I'm slowing the computer down by handing it too much information to process at the that moment. It's a hack, and I don't know if I can get to to work entirely, but we'll see.
    *your code has
    Adam Caldwell
    @adamrcaldwell
    @sheyna thanks so much for this, it makes sense the way you've put it. I will renew my efforts and post here if I come up with anything.
    Sheyna Watkins
    @sheyna
    Let me know if you find an answer. I'm working on mine as well. And if I come up with anything I'll let you know.
    Sheyna Watkins
    @sheyna
    HA HA! I got it to slow down! Only now after it finishes sorting it crashes the browser. I'm using setInterval(). How to I get SetInterval to stop?
    Sheyna Watkins
    @sheyna
    I'm having trouble getting clearInterval() to work. Where should I place it? I have the sorting process divided into two functions. And a button calls the first function which calls the second. I've tried to put the clear inside the button and inside both the functions. Only I'm having no luck. What am I doing wrong?
    Adam Caldwell
    @adamrcaldwell
    I wish I knew, I haven't even gotten setInterval to work yet. Among the many examples I looked at was one where clearInterval was called with a second button after the algorithm finished, so that's what I'll try if I get that far. :)
    Sheyna Watkins
    @sheyna

    clearInterval() is not working in any of these:

    VERSION 1:
    alt

    VERSION 2:
    alt

    VERSION 3:
    alt

    Any ideas?

    @adamrcaldwell Yes, most of what i'm seeing online has setInterval clear with entirely separate button. But I'm trying to figure out how this works:

    http://stackoverflow.com/questions/10485385/how-do-i-correctly-use-setinterval-and-clearinterval-to-switch-between-two-diffe

    Sheyna Watkins
    @sheyna
    I know the project is due tonight. But when is the deadline to get feedback? I still can't get clearInterval() to work. Should I turn it in and get partial credit? Will I be penalized if I don't get it in today?
    Adam Caldwell
    @adamrcaldwell
    I know that we have hitherto been able to turn things in late with no penalty, but I'm not sure how long the TAs will be around to grade since we've had our last class. Brook said "for a week" on Monday. I'm turning in mine now with the comment that I will push a new version if/when I get it to work right.
    Sheyna Watkins
    @sheyna
    That's probably what I will end up doing. I just hate to mess up my 99.7% any more.
    Sheyna Watkins
    @sheyna
    Of course, NOW at 12:30 I figure it out. I was using my variables with setInterval() incorrectly! Now it works! I'm updating my submission.
    Dale Corns
    @dcorns
    Don't give up. They will get graded
    Matthew Conquergood
    @kristjin
    i've been working with the setInterval used in Brook's code and do not understand why his call of setInterval with 3 parameters works. On the deck.html code. Very lost on that front.
    Sheyna Watkins
    @sheyna
    I could never get setInterval to take parameters. When I tired it completely ignored the time delay I was trying to impose. So I put the parameters inside another function which then launched the function I was trying to launch to begin with.
    Sheyna Watkins
    @sheyna
    What I mean is: Button launched setInterval(), which launched a middleman function which gave parameters and launched the sorting function.
    Samantha Camus
    @xdothackerx
    The TAs will be grading until the 15th, if I understand our contract correctly. ;)
    Brook Riggio
    @brookr
    @kristjin Yeah, the setTimeout fonction is a bit of an odd one. The intention is to say, "I want function foo executed after a delay of 3000 microseconds". So you trigger it with `setTimeout(foo, 3000);' or similar.
    Really, though, I read the docs on it just about every time I use it: https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers.setTimeout
    Here is a collection of a few other examples of how to use it: http://www.sitepoint.com/settimeout-example/
    Hope that helps!
    @sheyna No penalty in points for late work, but TAs will be wrapping up grading shortly, so getting something in now is a good idea.
    Matthew Conquergood
    @kristjin
    @brookr what throws me is your use of a 3rd parameter, as opposed to just the two. What am I missing there?
    @brookr but after following those LINKS, I see... I see. ;) Thanks yo.
    Brook Riggio
    @brookr
    Great, you got it! Yes, the additional params go after the delay parameter, which is kinda bizarro world.
    But that's what the docs are for! Good work in sorting it out.