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
Brett Guillory
@kurzninja
that's a good idea
sigursiguros
@sigursiguros
Hi guys, I'm working on the pomodoro clock zipline.
I'd like to know whether I need a date time function to get the job done?
Alex Evans
@alex-evans
@sigursiguros I would recommend not using date time functions and instead taking a look at setInterval() method. http://www.w3schools.com/jsref/met_win_setinterval.asp
sigursiguros
@sigursiguros
@alcatrats what's the difference between using setTimeout and setInternal
setInterval*
Alex Evans
@alex-evans
setTimeout will run once after the elapse time, setInterval will continue to run every interval of time until clearInterval is called.
Can someone help me out with the "Exact Change" challenge? I'm confused by how it is pointing me towards using Global Objects. I'm sure there is a reason as I'm writing the answer without them currently and it is ugly but I'm not grasping how the Global Objects will help simplify it. Any pointers?
Alex Evans
@alex-evans
For example I currently have the following:
function drawer(price, cash, cid) {
  var change = cash - price;
  var total = cid[0][1] + cid[1][1] + cid[2][1] + cid[3][1] + cid[4][1] + cid[5][1] + cid[6][1] + cid[7][1] + cid[8][1];

  if(total < change) {
    return "Insufficient Funds";

  } else if(total == change) {
    return "Closed";

  } else {
   return ...;    // will determine exact change at this point and things get very very messy 
  }
}

drawer(19.50, 20.00, [["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.10], ["QUARTER", 4.25], ["ONE", 90.00], ["FIVE", 55.00], ["TEN", 20.00], ["TWENTY", 60.00], ["ONE HUNDRED", 100.00]]);
JackeL
@jackel27
So, I finished the calculator challenge.. spent around 4 hours on it.. but could use a few fixes on layout adjustment....
Brett Guillory
@kurzninja
currently working on the Calculator myself
Sam Reeves
@smreeves
Also just finished the calc challenge. Starting to feel pretty comfortable with jQuery now...
Salman Shahid
@salman-shahid
The calculator is annoying.. a lot of error checking
JackeL
@jackel27
@mynameissal what type of error checking?
Brett Guillory
@kurzninja
I'm just starting to work on the value entry logic
trying to figure out how I want to do this
Salman Shahid
@salman-shahid
@kurzninja I made 2 plans then I decided to #yolo
Brett Guillory
@kurzninja
lol
Salman Shahid
@salman-shahid
@jackel27 Mostly math logic
JackeL
@jackel27
@mynameissal check out eval
Salman Shahid
@salman-shahid
and things like character limit checks, checks to see if there are no operators back to back..
JackeL
@jackel27
hmm
Salman Shahid
@salman-shahid
I am using eval but I have to make sure I don't have things like 1++1
JackeL
@jackel27
good point. I did not do that, I figured taking the string into an expression and returning it back would be fine... even if it was 6**6
Salman Shahid
@salman-shahid
Really.. hmm
Brett Guillory
@kurzninja
I'm thinking about implementing some kind of event subscription to determine what button is being pressed, and passing the value of that button to an assignment controller
so if it's a number, it possibly goes into or replaces the current operand
if it's an operator, it goes into my currOp function
var currOp = function() {

        if (arguments[0]) {
            this.value = arguments[0];
            return;
        } else {
            return this.value;
        }
    };
Salman Shahid
@salman-shahid
@jackel27
console.log(eval("1--1"));
SyntaxError: invalid decrement operand 1--1
@kurzninja I see, also depends on how you want your calculator works.
JackeL
@jackel27
@mynameissal good point.. I will have to work on that myself
Salman Shahid
@salman-shahid
E.g. do you want to display the whole line of calculations and evaluate when user presses = or evalulate after an operation..
Brett Guillory
@kurzninja
that's what I was wondering too
it looks like in the example, it doesn't evaluate until you hit =
but different calculators work differently
Salman Shahid
@salman-shahid
I think the second option is easier but each have their own difficulties.
Yeah, I am going with first option
JackeL
@jackel27

heres mine.. need to work on a few things though.. best viewed in browser...

http://codepen.io/Jackel27/pen/obQoRN

Brett Guillory
@kurzninja
if you want a real challenge, try implementing the user being able to type in the numbers on their keyboard as well as clicking on the page ;)
JackeL
@jackel27
@kurzninja how about voice recognition
Salman Shahid
@salman-shahid
@jackel27 Looks good this is the errors I pick up: multiple decimal places and the one I mentioned earlier.
Brett Guillory
@kurzninja
hahaha
JackeL
@jackel27
@mynameissal yeah, I noticed that also. I will have to do a check on last char in string
Salman Shahid
@salman-shahid
How about blinks from webcam
Brett Guillory
@kurzninja
set up a variable that checks to see if the current operation has had a decimal input, and ignore any after that
JackeL
@jackel27
@kurzninja can't do that. cause user could type 24.4 * 43.92
@kurzninja well, in my code anyways. I could get away with blocking consecutive decimals... but what if user has 24.4.4.4 lol
Brett Guillory
@kurzninja
well once an operator is selected, it's a new operand being entered
so that shouldn't be a problem