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
Andrew Charlebois
@andrewchar
i know some code is out of whack im putting random stuff in to figure out how to convert my link to show C and F
satalite internet
Adam Yuhasz
@jayuhasz
@andrewchar that'll do it.
Bruce Young
@mutantspore
ok well maybe that’s were it thinks you… are
Andrew Charlebois
@andrewchar
yeah, 200km is actually shorting it. for me to drive to where its telling me i am, it would take me 5-6 hours lol
Bruce Young
@mutantspore
i’s it 2 way satellite or sat down and phone up? (or am i showing my age?)
Andrew Charlebois
@andrewchar
2 way satellite
Bruce Young
@mutantspore
lol maybe it thinks you are in space :) i don’t know the specifics of what it’s identifying and why but I’m sure that’s the reason
Andrew Charlebois
@andrewchar
lol
i first noticed when it said it was raining here
i was like hmmm we got a foot of snow today thats not right
Adam Yuhasz
@jayuhasz
@andrewchar it's giving you the geolocation of your ISP's facility that's connected to their trunk line
Bruce Young
@mutantspore
it also explains what methods it uses to find you
Andrew Charlebois
@andrewchar
@mutantspore yep still showing coatcook
oh well
Bruce Young
@mutantspore
@andrewchar it will be fine for most people
Gabriel
@Zera99
Why are my wells.. so close to each other? http://codepen.io/Zera99/pen/JGxQXy?editors=1100
Andrew Charlebois
@andrewchar
yeah. i'm just the unlucky one who is stuck with satellite internet lol
dposse
@dposse
what do you mean wells?
Gabriel
@Zera99
Bootstrap wells ^^
Ankit Panwar
@coderNoob
@h4r1m4u But can't we set format=jsonp instead of adding the callback parameter?
h4r1m4u
@h4r1m4u
@coderNoob you could - if the server is configured to know what to do with it. i might be wrong but i think wikipedia doesn't support format=jsonp parameter. the point i was making is that "So what the call back function does is, it prevents the statement from executing until all the data is fetched from the API call." is not quite a correct explanation of the callback parameter
Jovvi Johnson
@jovjohnson
would anyone be able to take a look at my javascript code for a widget i'm building? i can't get the events to cooperate
steve
@davidsonsteve
@batilc1 thanks again for your help earlier if you're still on, the hint to use ajax for the wiki search page was a lifesaver
CamperBot
@camperbot
davidsonsteve sends brownie points to @batilc1 :sparkles: :thumbsup: :sparkles:
:star: 209 | @batilc1 | http://www.freecodecamp.com/batilc1
h4r1m4u
@h4r1m4u
@jovjohnson it's usually better to post the question right away. then people in the room can check out what the problem is and see if they're able to help. on that note, what's the issue?
Ogundele Olumide
@Lumexralph

hello guys, am working on the pomodoro and this is how am thinking of tackling the project

1.have two global variable, break time and session time in secs

  1. create functions that increases and decreases length of session and break and updates the new time when clicked

  2. functions that starts session time and break time count by getting the time updated by the functions above and start a countdown on it

  3. use a function to toggle between the 2 modes using a boolean to indicate when session is running and if done start break session

5.a function to pause the event using clearInterval.

That's what I can think of , thanks for your time

h4r1m4u
@h4r1m4u
@Lumexralph sounds pretty good to me. here's a tip: you don't need two variables for the break and session time. have only one - let's call it mainTime. then whenever the timer reaches zero and you need to change the clock mode, get the value of the break or session from the DOM and assign it to your mainTime. that way you only need one function to start the countdown interval (or clear it). other than that, i think you're on the right track
Bruce Young
@mutantspore
@Lumexralph you only need one countdown function.. just feed it different variables
Ogundele Olumide
@Lumexralph
thanks @mutantspore @h4r1m4u .....will work on it
CamperBot
@camperbot
lumexralph sends brownie points to @mutantspore and @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1420 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
:star: 1142 | @mutantspore | http://www.freecodecamp.com/mutantspore
Joseph Morse
@jnmorse
@Lumexralph I had pause as another var that the interval function checks, if its paused it skips decrementing the current time, until it is unpaused. stop with clearIntrerval, also I wouldn't get any values from the dom, only interaction should be outputting to the dom.
Ogundele Olumide
@Lumexralph
@jnmorse ..you mean the click events?
Joseph Morse
@jnmorse
@Lumexralph in the first part of what I said, I meant when you click on paused I set a var paused to true, if you clear the interval and then start again its likely going to end up starting from the beginning, less you somehow save the state which I suppose could work.
h4r1m4u
@h4r1m4u
@jnmorse if you use only one variable to track the time and update it only when the timer reaches 0 (to start a new full work or break session), then your current time on the clock will be preserved when you clear the interval for pausing. clearing the interval seems cleaner rather than having the interval constantly running in the background even if the clock is paused
Joseph Morse
@jnmorse
@h4r1m4u the way I had it set up, the variable ended up back to its default state if I did clearinterval shrugs
Jovvi Johnson
@jovjohnson
@h4r1m4u http://codepen.io/jov/pen/mVoGXy
the spinners in my number fields aren't executing my jquery event
h4r1m4u
@h4r1m4u
@jovjohnson and what's the result that you want? what exactly should be happening?
Jovvi Johnson
@jovjohnson
and they're doing wonky things when the assorted veggies div field is clicked
the green text that displays the total price should be corresponding with the quantity and price per item
h4r1m4u
@h4r1m4u
ok, gotcha. let me have a look at it
Bruce Young
@mutantspore
@jovjohnson what is this? .. another new challenge?
Alvis Ng
@vizFlux
Hi guys, I’ve been coding the Pomodoro timer before this project recently categorized to an advanced front-end project. So it is being coded without any framework but plain JS, and now I am stucked at the timeCount() just won’t reach to 0 before ended and switched into breakInterval. Would really appreciate any help from anyone who’ve cleared this task. :smile:
var break_length;
var session_length;
var minutes;
var interval;
var breakInterval;
var seconds = 0;
​
function increaseBreak(break_length) {
    break_length++;
    $('#break').html(break_length);
    return break_length;
}
​
function decreaseBreak(break_length) {
    break_length--;
    if (break_length < 1) {
        break_length = 1;
    }
    $('#break').html(break_length);
    return break_length;
}
​
function increaseSession(session_length) {
    session_length++;
    $('#session').html(session_length);
    $('#total').html(session_length);
    return session_length;
}
​
function decreaseSession(session_length) {
    session_length--;
    if (session_length < 1) {
        session_length = 1;
    }
    $('#session').html(session_length);
    $('#total').html(session_length);
    return session_length;
}
​
function countdownCtrl() {
    if (seconds === 0) {
        minutes--;
        seconds = 59;
    } else {
        seconds--;
    }
    // Executing timeCount();
    (function timeCount() {
        if (minutes === 0 && seconds === 0) {
            clearInterval(interval);
            if (break_length) {
                breakInterval = setInterval(breakcountCtrl, 1000);
            }
        } else {
            $('#total').html(minutes + ":" + (seconds < 10 ? "0" : "") + String(seconds));
        }
    })();
​
    function breakcountCtrl() {
        $('#total').html(break_length--);
    }
}
​
$(document).ready(function() {
    break_length = parseInt($('#break').text());
    session_length = parseInt($('#session').text());
    minutes = session_length;
​
    $('#ibl').click(function() {
        break_length = increaseBreak(break_length);
    });
​
    $('#dbl').click(function() {
        break_length = decreaseBreak(break_length);
    });
​
    $('#ise').click(function() {
        session_length = increaseSession(session_length);
        minutes = session_length;
    });
​
    $('#dse').click(function() {
        session_length = decreaseSession(session_length);
        minutes = session_length;
    });
​
    $('#total').click(function() {
        if (interval) {
            clearInterval(interval);
            interval = undefined;
        } else {
            interval = setInterval(countdownCtrl, 50);
        }
    });
​
});
Harry Aydin
@HMAN1911
@jovjohnson You need to write a new function that deals with the counter value being changed, and make sure you're rendering the updated value on each click event. Hope that hint helps :smile:
edit: throw some console.log's in there to see if the value is actually being updated ;)
Ankit Panwar
@coderNoob
Guys lemme know if you can beat this game. Would be a great help :smile:
Tic-Tac-Toe
Jovvi Johnson
@jovjohnson
@hman1911 hmm. thanks. not sure where to start with a new function though. i'll play around with it some more.