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
Sebastian Cheung CQF
@scheung38
devtools console and not console? I only see one console in Codepen
kat-mag
@kat-mag
devtools
Stephen James
@sjames1958gm
I see this : expect.min.js:1 Uncaught Error: Expected 0 to equal 1
kat-mag
@kat-mag
ctrl+shift+i on chrome
or right button -> inspect
Stephen James
@sjames1958gm
@scheung38 codepen console shows only console.log() output, but the devtools console shows runtime errors as well
Or F12
Sebastian Cheung CQF
@scheung38
Ok then the link was incorrect, I had to change Codepen - Settings -> Javascript Preprocessor -> Babel to see console
kat-mag
@kat-mag
seriously
what browser are you using?
Stephen James
@sjames1958gm
@scheung38 If you use try/catch around your test cases you can send the output to the console from the catch.
Sebastian Cheung CQF
@scheung38
chrome
kat-mag
@kat-mag
have you used right mouse button -> inspect? or ctrl+shift+i?
Stephen James
@sjames1958gm
function counter(state, action) {
  // if (action.type === 'INCREMENT') {
  // return state + 1;
  // } else if (action.type === 'DECREMENT')   // {
  // return state - 1;
  // }
  // }
  return state;
}

try {
   expect(
     counter(0, {
       type: 'INCREMENT'
     })

).toEqual(1);


  console.log('All Tests Passed!');

} catch (e) {
  console.log('Test failed: ', e);
}
Sebastian Cheung CQF
@scheung38
This message was deleted
Stephen James
@sjames1958gm
@scheung38 That is a different tool than codepen - these are codepen limitations - that I think is jsbin
Sebastian Cheung CQF
@scheung38
@sjames1958gm thanks then JSBin is better than Codepen then in this case as I need to see error in Chrome inspector, JSBin shows error in their console
CamperBot
@camperbot
scheung38 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:warning: scheung38 already gave sjames1958gm points
Max Mirza
@maxmirza

hey guys im trying to get the physical layout of a tic tac toe game, is anyone willing to help? :)
boolean mouseOverRect(int x, int y, int w, int h) {
return (mouseX >= x && mouseX <= x+w && mouseY >= y && mouseY <= y+h);
}

Button squareOne;
Button squareTwo;
Button squareThree;
Button squareFour;
Button squareFive;
Button squareSix;
Button squareSeven;
Button squareEight;
Button squareNine;

import java.util.Scanner;

void setup()
{
size (800, 800);
squareOne = new Button( 100, 300 , 100, 100);
squareTwo = new Button( 200, 300 , 100, 100);
squareThree = new Button( 300, 300 , 100, 100);
squareFour = new Button( 400, 300 , 100, 100);
squareFive = new Button( 500, 300 , 100, 100);
squareSix = new Button( 600, 300 , 100, 100);
squareSeven = new Button( 600, 300 , 100, 100);
squareEight = new Button( 600, 300 , 100, 100);
squareNine = new Button( 600, 300 , 100, 100);
}

void draw()
{
squareOne.draw();
squareTwo.draw();
squareThree.draw();
squareFour.draw();
squareFive.draw();
squareSix.draw();
squareSeven.draw();
squareEight.draw();

}

Jack Lyons
@JackEdwardLyons
@c0d0er first of all, set up some variables to make your code cleaner and easier to read
Ciel
@xfffrank
why can't I see the project challenges finished on the main page of FCC after submitting with the codepen URL
Farid
@Faredhattab
any help with writing a program to cheak if a given array is magic Square or not (for example) [[2,7,6],[9,5,8],[4,3,1]]
https://upload.wikimedia.org/wikipedia/commons/thumb/e/e4/Magicsquareexample.svg/180px-Magicsquareexample.svg.png
Rostyslav
@BeerDRinker
hello al
all
need help
with twitch project
what query i should to do
GET /channels/:channel
or
GET /streamers/:channel
?
kirbyedy
@kirbyedy
Rostyslav
@BeerDRinker
so I need bouth?
kirbyedy
@kirbyedy
I think so
oh you need a client-id as well
Rostyslav
@BeerDRinker
I allready have one
kirbyedy
@kirbyedy
https://api.twitch.tv/kraken/streams/ + user name + client_id
Artur Arsalanov
@kurumkan

@Faredhattab please check this code var t =[[ 4 , 9, 2 ],[ 3 , 5, 7 ],[ 8 , 1 , 6 ]]

console.log(isMagic(t));

function isMagic(array){
var sum = array[0].reduce(function(a,b){return a+b});

for(var i=1; i<array.length; i++){
    var temp = array[i].reduce(function(a,b){return a+b});
    if(temp!==sum){
        return false;
    }
}

for(var i=0; i<array.length; i++){
    var temp = array.map(function(d){return d[i]}).reduce(function(a,b){return a+b});         
    if(temp!==sum){            
        return false;
    }
}

var temp1 = 0;
var temp2 = 0;
for(var i=0; i<array.length; i++){
    temp1+=array[i][i];
    temp2+=array[i][array.length-1-i];
}

if(temp1!==sum||temp2!==sum)
    return false;

return true;

}

@Faredhattab `var t =[[ 4 , 9, 2 ],[ 3 , 5, 7 ],[ 8 , 1 , 6 ]]

console.log(isMagic(t));

function isMagic(array){
var sum = array[0].reduce(function(a,b){return a+b});

for(var i=1; i<array.length; i++){
    var temp = array[i].reduce(function(a,b){return a+b});
    if(temp!==sum){
        return false;
    }
}

for(var i=0; i<array.length; i++){
    var temp = array.map(function(d){return d[i]}).reduce(function(a,b){return a+b});         
    if(temp!==sum){            
        return false;
    }
}

var temp1 = 0;
var temp2 = 0;
for(var i=0; i<array.length; i++){
    temp1+=array[i][i];
    temp2+=array[i][array.length-1-i];
}

if(temp1!==sum||temp2!==sum)
    return false;

return true;

}

`

f*k
Theodore P.
@Ierofantis
can anyone explain to me why when I append text it stays for a few seconds and after it dissapears? here is my pen
http://codepen.io/Ierofantis/pen/pEpYGp?editors=1010
Stephen James
@sjames1958gm
@Ierofantis You have your input inside a form and the browser wants to submit that form and that causes a refresh.
Make this change to call preventDefault (which prevents this default behavior)
$("#input").click(function(e) {
  e.preventDefault();
Theodore P.
@Ierofantis
@sjames1958gm many thanks!
CamperBot
@camperbot
ierofantis sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 3784 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Joshua Faggion
@joshfaggion11
What are some good API's for a random quote machine?
Or libary.