Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:33
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • May 10 09:13
    @bjorno43 banned @zhaokunhaoa
  • Apr 25 17:12
    @mstellaluna banned @cmal
  • Apr 01 18:11
    thecodingaviator labeled #31179
  • Apr 01 18:11
    thecodingaviator labeled #31179
  • Apr 01 18:09
    thecodingaviator commented #31179
  • Apr 01 18:09
    thecodingaviator labeled #31182
  • Apr 01 18:09
    thecodingaviator labeled #31182
  • Apr 01 18:07
    thecodingaviator commented #31182
  • Apr 01 18:07
    thecodingaviator labeled #31190
  • Apr 01 18:07
    thecodingaviator labeled #31190
  • Apr 01 18:07
    thecodingaviator commented #31190
  • Apr 01 18:05
    thecodingaviator commented #31157
  • Apr 01 18:04

    thecodingaviator on master

    remove A (#31157) (compare)

  • Apr 01 18:04
    thecodingaviator closed #31157
  • Apr 01 18:04
    thecodingaviator closed #33788
  • Apr 01 18:04
    thecodingaviator commented #33788
  • Apr 01 18:02
    thecodingaviator closed #31059
  • Apr 01 18:02
    thecodingaviator commented #31059
imperial-isms
@imperial-isms
I thought something like that was happening
Margaret Greaney
@greaneym
Hi, I can see some people responding but it is just flashing up at the top and not echoing here to the gitter text stream, so I can't see it.
I think something is wrong here because I can't see responses. I will post some code to codepen.io and then ask again later.
imperial-isms
@imperial-isms
Thanks @JLuboff …I just learned it from “Convert JSON Data to HTML”. I copied and pasted it (still analyzed it) from that lesson, so I had to figure that it would work.
CamperBot
@camperbot
api offline
imperial-isms sends brownie points to @jluboff :sparkles: :thumbsup: :sparkles:
horo
@wolfHoro
'''
CamperBot
@camperbot
:bulb: to format code use backticks! ``` more info
imperial-isms
@imperial-isms
Why does this FCF code work…

<script>
  $(document).ready(function() {

    $("#getMessage").on("click", function() {
      $.getJSON("/json/cats.json", function(json) {

        var html = "";
        // Only change code below this line.
          json.forEach(function(val) {
            var keys = Object.keys(val);
            html += "<div class = 'cat'>";
            keys.forEach(function(key) {
              html += "<strong>" + key + "</strong>: " + val[key] + "<br>";
            });
            html += "</div><br>";
          });


        // Only change code above this line.

        $(".message").html(html);

      });
    });
  });
</script>
Jason Luboff
@JLuboff
@imperial-isms No problem. It's always a good idea when working with api's to see the structure of the returned data. You can do so either by inside your Ajax call having a console.log(data) where data is your property name (in your case, it would be json). Or grab the url and put it into your browser and see what you get.
@imperial-isms I'd have to go verify, but I imagine that you get an array of objects back with that one
imperial-isms
@imperial-isms
Okay that seems like the most likely scenario
horo
@wolfHoro
function chunk(arr, size) {
  var i;
  var a=size;
  var m=Math.ceil(arr.length/size);
  var arrlength=arr.length;
  var litarr=new Array();
  var newarr=new Array();
  for (i=0;i<m;i++){
    newarr[i]=new Array(size);
    litarr=arr.slice(a-size,a);
    a=a+size;
    newarr[i].push(litarr);
  }

}

chunk(["a", "b", "c", "d"], 2);
Why isn't newarr a two-dimensional array?
imperial-isms
@imperial-isms
I appreciate it
Jason Luboff
@JLuboff
:+1:

@wolfHoro It's a multi-demsional array, but one too deep. Right now you have this

[ [ [ 'a', 'b' ] ], [ [ 'c', 'd' ] ] ]

If you return newarr

Inside your loop, you don't need newarr[i]=new Array(size); as litarr is an array
so then you just need to push litarr into newarr
horo
@wolfHoro
@JLuboff Thank you,Let me think about it
CamperBot
@camperbot
wolfhoro sends brownie points to @jluboff :sparkles: :thumbsup: :sparkles:
api offline
horo
@wolfHoro
function chunk(arr, size) {
  var i;
  var a=size;
  var m=Math.ceil(arr.length/size);
  var arrlength=arr.length;
  var litarr=new Array();
  var newarr=new Array();
  for (i=0;i<m;i++){
    litarr=arr.slice(a-size,a);
    a=a+size;
    newarr.push(litarr);
  }

}

chunk(["a", "b", "c", "d"], 2);
I deleted newarr[i], but newarr became [a, b, c, d]., which made me very frustrated
Jason Luboff
@JLuboff
@wolfHoro return newarr outside your loop (before the last })
horo
@wolfHoro
@JLuboff I was so stupid, I thought about it for too long, but I ignored the simple place. Thanks for reminding me
CamperBot
@camperbot
wolfhoro sends brownie points to @jluboff :sparkles: :thumbsup: :sparkles:
api offline
Jason Luboff
@JLuboff
:+1:
Ronique Ricketts
@RoniqueRicketts
@JLuboff why did you break camperbot cookie jar
Diego Mayer
@Chrono79
He's on diet
and so we are
We'll starve if it doesn't get fixed soon
Jason Luboff
@JLuboff
I'm missing my cookies :(
Blauelf
@Blauelf
@JLuboff Maybe take one of those :cookie:
Michael Ney
@MichaelNey
Hi, I am Using EJS, and an external JS file which is linked to the EJS page via script tag. however I'm getting a variable undefined error in the EJS when i'm trying to use one of the variables in the JS file. Is there a way I can make the JS file load before EJS javascript is executed? Since I think that may be the issue
Jason Luboff
@JLuboff
@Blauelf It's just not the same sadly.. :cry:
Blauelf
@Blauelf
Some :candy: then?
Jason Luboff
@JLuboff
That'll have to suffice
Blauelf
@Blauelf
Reminds me of Candy Box game.
Ronique Ricketts
@RoniqueRicketts
@JLuboff lol me too. but idk what happen to camperbot's brownies.
Pethaf
@Pethaf
:coffee:
:tea:
Jason Luboff
@JLuboff
@Blauelf I don't have the patience for it, I want to keep eating them!
@RoniqueRicketts I'm wondering if since they're not really supporting gitter chat anymore that they killed the api..
Ronique Ricketts
@RoniqueRicketts
@JLuboff really, so where will we chat?
:'(
Jason Luboff
@JLuboff
The chat is still here, but perhaps no more brownies/cookies
Ronique Ricketts
@RoniqueRicketts
So how will we know that we contribute everyday
Jason Luboff
@JLuboff
....we wont!
Ronique Ricketts
@RoniqueRicketts
NOOOOOO!!!
THey can't do that. Cant they??? :worried: