Codepen pen won't load?

Codepen pen won't load?
0

#1

I’ve been using codepen to create a project in the form of a pen, and everything has been going fine until everything froze. I’ve tried reloading the page, opening in a newtab/window and restarting chrome, but the pen just won’t load. I tried exporting and running with notepad, but that had about 3 hours less of what I had done. Is there anything I can do to recover my work? And if not what caused this error?

NOTE: In the developer console I have the message GET https://www.google-analytics.com/analytics.js net::ERR_BLOCKED_BY_CLIENT


#2

Can you post a link to the Codepen in question?


#3

Here’s the link: https://codepen.io/EvolvedSquid/pen/jaWdRL?editors=0001


#4

Loads for me just fine.


#5

Is there anything that I may have possibly disabled?


#6

Can you copy and paste the code you loaded to here so I can recover some of my work?


#7

No problem. In addition to the code you had below, you also added the following external JS libraries:

https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.2/p5.js
https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.2/addons/p5.dom.js

var test = [0,1,-2,-3]
var test1= [5,10,15,20]
var test2 = [5,10,15,20]    
var tester = [test,test1]

function test12(test){ 
  this.score = Math.random()
}


var testarr = []

for(var i = 0; i < 20; i++){
  testarr[i] = new test12();
}

//console.log(matrixCrossover(tester,test1,true,.5))
//console.log(crossover(test,test1,false,0))

function arrMultScalar(input,value) {
    //Multiplies every element in an array by a scalar i.e. [5,10]*5 returns [25,50]
    var array3 = [];
    for(var i = 0; i < input.length; i++){
      array3[i] = input[i]*value;
    }
  return array3;
} 

function arrMult(array1,array2){
  //Multiplies each number in an array by each number in a different array i.e. [5,10]*[2,5] returns [10,50]
  var array3 = []
  for(var j = 0; j < array1.length; j++){
    array3[j] = array1[j]*array2[j];
  }
  return array3;
}

function arrAdd(array){
  //Adds all elements in an arry i.e. [5,10,15,20] returns = 50
  function add(a, b) {
    return a + b;
}
  return array.reduce(add,0);
}

function arrMultAddSig(array1,array2,bool){
  //Multiplies i in array1 by i in array2 then sums up that array, then squashes it to between 0 and 1 with a sigmoid if bool is false does not sigmoid
  array3 = arrMult(array1,array2);
  array4 = arrAdd(array3);
  if(bool){
  return sigmoid(array4);
  } else{
    return array4;
  }
}

function sigmoid(t) {
  //just a sigmoid function for activation
    return 1/(1+Math.pow(Math.E, -t));
}

function matrixMultAddSig(array1,array2,boolean){
  //Loops through an array of arrays and performs arrMultAddSig on each of them by the second array
  var array10x = []
  for(var k = 0; k < array1.length; k++){
    array10x[k] = arrMultAddSig(array1[k],array2,boolean);    
  }
  return array10x;
}

function crossover(partner1,partner2,mutatechild,mutationrate){
  var mid = Math.floor(Math.random() * (partner1.length - 0)) + 0
  var child = [];
  for(var i = 0; i < partner1.length; i++){
    if(i > mid){
      child[i] = partner1[i]
    } else
      child[i] = partner2[i]
  }
  if(mutatechild){
    mutate(child,mutationrate);
  }
  return child;
}

function mutate(being,mutationrate){
  for(var i = 0; i < being.length; i++){
    var chance = Math.random()
    if(chance < mutationrate){
      being[i] = Math.random();
    }
  }
}

function orderFromValue(array,ascendOrDescend){
  if(ascendOrDescend == 'ASCEND'){
    array.sort(function(a, b){return a.score - b.score});
  } else if(ascendOrDescend == 'DESCEND'){
    array.sort(function(a, b){return b.score - a.score});
  }
}

function chanceWheel(array,numberOfSelectants){

}

// function matrixCrossover(parent1,parent2,mutatechild,mutationrate){
//   var child = [];
//   for(var i = 0; i < parent1.length; i++){
//     child[i] = crossover(parent1[i],parent2[i],mutatechild,mutationrate)
//     return child
//   }
// }

#8

Thanks! A bit is gone, but I will definitely be able to work from this!


#9

If you are getting a message such as ERR_BLOCKED_BY_CLIENT, it is probable that something on your computer (client) is blocking it. This is most likely an adblocker or some other web filter. If you have an adblocker, try disabling it on codepen. Other than that, try a different/newer browser and clear your cache.


#10

Thank’s I got it working again, though that is after I retyped it up… Thanks anyway!


#11

OMG! I made the mistake of storing my code in CodePen, then when I pasted something over the wrong project, there was no UNDO button! Eek! Had to redo the entire project from scratch and resubmit! Ok, folks. Lesson learned. I’m doing the coding on a local app (Komodo - it’s free), then when I’m happy with my project, copy it to CodePen for viewing by the FCC gurus.
Glad someone was able to view some of it and get it to you so you didn’t have to start from scratch as I did. Yay!