text:
TestTrakker.controller('StudentCtrl', ["$scope", "StudentCrud", "$rootScope", "$interval", '$timeout', "$q", "$sce", "$tooltip", "$popover", "FirebaseRef", "$firebaseArray", "$state", "$window",
  function($scope, StudentCrud, $rootScope, $interval, $timeout, $q, $sce, $tooltip, $popover, FirebaseRef, $firebaseArray, $state, $window) {

// BEGIN Current User and Current User Students Variables and Functions

  angular.element($window).bind('resize', function() {
    $scope.windowWidth = $window.innerWidth;
  });

  var auth = firebase.auth();

  auth.onAuthStateChanged(user => {
    if (user) {
      var currentUser = auth.currentUser;
      console.log("currentUser in onAuthStateChanged = ", currentUser);
      var uid = currentUser.uid
      // const studentsRef = firebase.database().ref('users/' + uid).child("students");
      const studentsRef = firebase.database().ref('users/' + uid).child("students");
      $scope.students = $firebaseArray(studentsRef);
      $scope.currentUser = user;
    } else {
      console.log("AuthStateChange failed");
      $state.go('landing');
    }
    $scope.teacherName = getTeacherName($scope.currentUser.displayName);
  });

  var getTeacherName = function(string) {
    var string = string.trim();
    var spaceIndex = string.indexOf(string.match(/\s/));
    var lastName = string.slice(spaceIndex + 1, string.length);
    return lastName;
  }

// END Current User and Current User Students Variables and Functions

// BEGIN Student CRUD Variables and Functions

    $scope.newDueDateOne = new Date(new Date().setHours(0,0,0));
    $scope.newDueDateTwo = new Date(new Date().setHours(0,0,0));
    $scope.newDueDateThree = new Date(new Date().setHours(0,0,0));
    $scope.newDueDateFour = new Date(new Date().setHours(0,0,0));

    $scope.timewrap = {};

    $scope.times = [1, 1.5, 2, 2.5, 3];

    $scope.addStudent = function() {
      if ($scope.newStudentName && $scope.timewrap.selectedTime) {
        StudentCrud.addStudent($scope.newStudentName, $scope.timewrap.selectedTime, $scope.newtestOneName, $scope.newDueDateOne, $scope.newtestTwoName, $scope.newDueDateTwo, $scope.newtestThreeName, $scope.newDueDateThree, $scope.newtestFourName, $scope.newDueDateFour);
        // FirebaseRef.addUser();
        toggleInvert();
      } else {
        $scope.alert = true;
        $timeout(function turnOffAlert() {$scope.alert = false}, 5000);
      }

    };

    // $scope.delete = function(student, owner) {
    //   $scope.selectAll = true;
    //   $scope.clickedToDelete = false;
    //   $scope.deleteAppear = false;
    //
    //   if(owner === "deleteSelected" || owner === "deleteAllStudents") {
    //     $scope.students.$remove(student).then(function() {
    //       console.log("student, which is now " + student + ", has been removed");
    //     });
    //   } else {
    //     auth.onAuthStateChanged(user => {
    //       if (user) {
    //         $scope.students.$remove(student).then(function() {
    //           console.log("student, which is now " + student + ", has been removed");
    //         });
    //       } else {
    //         console.log("delete failed");
    //       }
    //     });
    //   }
    // };
    //
    // $scope.deleteSelected = function() {
    //   var owner = "deleteSelected"
    //   $scope.clearSelected = false;
    //   $scope.deleteAppear = false;
    //   $timeout(function appear() {$scope.selectAll = true}, 1000);
    //   $timeout(function appear() {$scope.clickedToDelete = false}, 1000);
    //
    //   auth.onAuthStateChanged(user => {
    //     if (user) {
    //       for (var i = 0; i < $scope.students.length; i++) {
    //         if ($scope.students[i].isSafeToDelete) {
    //           $scope.delete($scope.students[i], owner);
    //         }
    //       }
    //     } else {
    //       console.log("delete failed");
    //     }
    //   });
    // };
    //
    // var deleteAllStudents = function() {
    //   var owner = "deleteAllStudents"
    //   $scope.warn = false;
    //
    //   auth.onAuthStateChanged(user => {
    //     if (user) {
    //       for (i = 0; i < $scope.students.length; i++) {
    //         $scope.delete($scope.students[i], owner);
    //       }
    //     } else {
    //       console.log("delete failed");
    //     }
    //   });
    // };

    $scope.delete = function(student) {
      $scope.selectAll = true;
      $scope.clickedToDelete = false;
      $scope.deleteAppear = false;

      $scope.students.$remove(student).then(function() {
        console.log("student, which is now " + student + ", has been removed");
      });
      // $scope.students.$destroy(student).then(function() {
      //   console.log("student, which is now " + student + ", has been removed");
      // });
    };

    $scope.deleteSelected = function() {

      $scope.clearSelected = false;
      $scope.deleteAppear = false;
      $timeout(function appear() {$scope.selectAll = true}, 1000);
      $timeout(function appear() {$scope.clickedToDelete = false}, 1000);

      for (var i = 0; i < $scope.students.length; i++)
        if ($scope.students[i].isSafeToDelete) {
          $scope.delete($scope.students[i]);
        }
    };

    var deleteAllStudents = function() {
      $scope.warn = false;
      for (i = 0; i < $scope.students.length; i++) {
        $scope.delete($scope.students[i]);
      }
    };

    $scope.warnClose = function() {
      $scope.warn = true;
    }

    $scope.logout = function() {
      promise = deleteAllStudents();
      $state.go('landing');
      // FirebaseRef.closeSession();
    };

// END Student CRUD Variables and Functions

// BEGIN TEST CRUD Variables and Functions

    $scope.scopeTestTime = function(testTime) {
      $scope.newTestTime = testTime;
    };

    var addHoursAndMinutes = function(hours, minutes) {
      var timeInMillisecs = (hours * 60 * 60 * 1000) + (minutes * 60 * 1000);
      return timeInMillisecs;
    };

    $scope.processTimeInput = function(student, testNo) {

      console.log("$scope.newTestTime = " + $scope.newTestTime);
      if (testNo == "testOne") {
        testOneTimeNum = addHoursAndMinutes($scope.newTestTime.getHours(), $scope.newTestTime.getMinutes());
        student.testOneTime = testOneTimeNum;
        student.totalTimeOne = testOneTimeNum * student.extendTime;
      } else if (testNo == "testTwo") {
        testTwoTimeNum = addHoursAndMinutes($scope.newTestTime.getHours(), $scope.newTestTime.getMinutes());
        student.testTwoTime = testTwoTimeNum;
        student.totalTimeTwo = testTwoTimeNum * student.extendTime;
      } else if (testNo == "testThree") {
        testThreeTimeNum = addHoursAndMinutes($scope.newTestTime.getHours(), $scope.newTestTime.getMinutes());
        student.testThreeTime = testThreeTimeNum;
        student.totalTimeThree = testThreeTimeNum * student.extendTime;
      } else if (testNo == "testFour") {
        testFourTimeNum = addHoursAndMinutes($scope.newTestTime.getHours(), $scope.newTestTime.getMinutes());
        student.testFourTime = testFourTimeNum;
        student.totalTimeFour = testFourTimeNum * student.extendTime;
      }
      $scope.students.$save(student);
    };

// END TEST CRUD Variables and Functions

// BEGIN Student Test TIMER Variables and Functions

    var refreshTime = function() {
      time = Date.now();
      $scope.time = time;
      return $scope.time;
    };

    $interval(refreshTime, 1000);

    // Custom Time in case a student already began the test
    $scope.newDueDate = new Date().setMinutes(0, 0);

    var promise;

    $scope.startTimer = function(student, testNo) {

      if (testNo == "testOne" && student.testOneStartTime == 0) {
        student.isTimerOneStart = true;
        student.testOneStartTime = Date.now();
        if (student.pausedTotalOne == 0) {
          student.testOneStartRecord = Date.now();
        }
      } else if (testNo == "testTwo" && student.testTwoStartTime == 0) {
        student.isTimerTwoStart = true;
        student.testTwoStartTime = Date.now();
        if (student.pausedTotalTwo == 0) {
          student.testTwoStartRecord = Date.now();
        }
      } else if (testNo == "testThree" && student.testThreeStartTime == 0) {
        student.isTimerThreeStart = true;
        student.testThreeStartTime = Date.now();
        if (student.pausedTotalThree == 0) {
          student.testThreeStartRecord = Date.now();
        }
      } else if (testNo == "testFour" && student.testFourStartTime == 0) {
        student.isTimerFourStart = true;
        student.testFourStartTime = Date.now();
        if (student.pausedTotalFour == 0) {
          student.testFourStartRecord = Date.now();
        }
      } else {
        console.log("path 3 chosen");
        return $scope.timer(student, testNo);
      }

      $scope.students.$save(student).then(function() {
        // console.log("promise passed");
        var promise = $interval(function() {$scope.timer(student, testNo)}, 1000);
      });

      // console.log("promise: " + promise);
      return promise;
    };

    var processTime = function(unprocessedTime, hourOption) {
      unprocessedTimeObj = new Date(unprocessedTime);
      unprocessedHour = unprocessedTimeObj.getHours();
      processedHour = unprocessedHour - hourOption;
      var processedTime = unprocessedTimeObj.setHours(processedHour);
      return processedTime;
    };

    $scope.waitOption = 1800000;

    $scope.warn = false;

    if (!timeoutStarted) {
      $timeout(function dbTimeout(){$scope.warn = true}, $scope.waitOption);
      $timeout(function dbTimeErase(){$scope.logout()}, ($scope.waitOption + 1800000));
      var timeoutStarted = true;
    }

    $scope.warningRejection = function() {
      $scope.warn = false;
      $scope.waitOption += 1800000;
      var timeoutStarted = false;
    }

    $scope.timer = function(student, testNo) {

      extendTime = student.extendTime;
      topBarDividend = 0,
      bottomBarDividend = 0,
      topBarRatio = 0,
      bottomBarRatio = 0

      if (testNo == "testOne") {

        testStartTime = student.testOneStartTime;
        totalTime = student.totalTimeOne;
        testTime = student.testOneTime;
        extension = (testTime * extendTime) - testTime;
        actualTestTime = totalTime - extension;

        if (actualTestTime > 0) {
          actualExtension = totalTime - actualTestTime;
        } else if (actualTestTime <= 0) {
          actualExtension = totalTime;
        }

        bottomBarRatio = extension / (testTime * extendTime);
        topBarRatio = 1 - bottomBarRatio;

        // in case timer has not started yet (test 1) OR: timer has ended
        if ((student.testOneStartTime == 0 && !student.isTestOneOver && !student.isTimerOnePaused) || student.isTestOneOver) {
          topBarWidth = 100 * topBarRatio;
          bottomBarWidth = 100 * bottomBarRatio;
          countdown = processTime(totalTime, 19);
        // timer 1 runs out to zero
        } else if (totalTime + testStartTime - Date.now() <= 0 && !student.isTimerOnePaused && !student.isTestOneOver) {
          topBarWidth = 0;
          bottomBarWidth = 0;
          countdown = 18000000;
          student.isTestOneOver = true;
          student.isTimerOnePaused = false;

          $scope.students.$save(student).then(function() {
          });
        // timer is counting down (test 1)
        } else if (!student.isTimerOnePaused && !student.isTestOneOver) {
          topBarDividend = testStartTime + actualTestTime - $scope.time;

          if (topBarDividend > 0) {
            topBarWidth = topBarDividend / testTime * 100 * topBarRatio;
            bottomBarDividend = extension;
          } else if (topBarDividend <= 0) {
            topBarWidth = 0;
            bottomBarDividend = testStartTime + totalTime - $scope.time;
          }
          // ultimate outputs
          bottomBarWidth = bottomBarDividend / extension * 100 * bottomBarRatio;
          // fn to manipulate new Date object
          dueTime = processTime(testStartTime + totalTime, 19);
          // ultimate outputs
          countdown = dueTime - $scope.time;
        // timer is paused (test 1)
        } else if (!student.isTestOneOver && student.isTimerOnePaused) {
          if (actualTestTime > 0) {
            topBarWidth = actualTestTime / testTime * 100 * topBarRatio;
            bottomBarDividend = extension;

          } else if (actualTestTime <= 0) {
            topBarWidth = 0;
            bottomBarDividend = actualExtension;
          }
          bottomBarWidth = bottomBarDividend / extension * 100 * bottomBarRatio;
          countdown = processTime(totalTime, 19);
        }

      } else if (testNo == "testTwo") {

        testStartTime = student.testTwoStartTime;
        totalTime = student.totalTimeTwo;
        testTime = student.testTwoTime;
        extension = (testTime * extendTime) - testTime;

        actualTestTime = totalTime - extension;

        if (actualTestTime > 0) {
          actualExtension = totalTime - actualTestTime;
        } else if (actualTestTime <= 0) {
          actualExtension = totalTime;
        }
        // ratios for bar widths
        bottomBarRatio = extension / (testTime * extendTime);
        topBarRatio = 1 - bottomBarRatio;

        // in case timer has not started yet (test 1) OR: timer has ended
        if ((student.testTwoStartTime == 0 && !student.isTestTwoOver && !student.isTimerTwoPaused) || student.isTestTwoOver) {
          topBarWidth = 100 * topBarRatio;
          bottomBarWidth = 100 * bottomBarRatio;

          countdown = processTime(totalTime, 19);
          // timer 1 runs out to zero
        } else if (totalTime + testStartTime - Date.now() <= 0 && !student.isTimerTwoPaused && !student.isTestTwoOver) {
          topBarWidth = 0;
          bottomBarWidth = 0;

          countdown = 18000000;
          student.isTestTwoOver = true;
          student.isTimerTwoPaused = false;

          $scope.students.$save(student).then(function() {
          });
        // timer is counting down (test 2)
        } else if (!student.isTimerTwoPaused && !student.isTestTwoOver) {
          topBarDividend = testStartTime + actualTestTime - $scope.time;

          if (topBarDividend > 0) {
            topBarWidth = topBarDividend / testTime * 100 * topBarRatio;
            bottomBarDividend = extension;
          } else if (topBarDividend <= 0) {
            topBarWidth = 0;
            bottomBarDividend = testStartTime + totalTime - $scope.time;
          }
          // ultimate outputs
          bottomBarWidth = bottomBarDividend / extension * 100 * bottomBarRatio;
          // fn to manipulate new Date object
          dueTime = processTime(testStartTime + totalTime, 19);
          // ultimate outputs
          countdown = dueTime - $scope.time;
        // timer is paused (test 1)
        } else if (!student.isTestTwoOver && student.isTimerTwoPaused) {

          if (actualTestTime > 0) {
            topBarWidth = actualTestTime / testTime * 100 * topBarRatio;
            bottomBarDividend = extension;

          } else if (actualTestTime <= 0) {
            topBarWidth = 0;
            bottomBarDividend = actualExtension;

          }
          bottomBarWidth = bottomBarDividend / extension * 100 * bottomBarRatio;
          countdown = processTime(totalTime, 19);
        }
      } else if (testNo == "testThree") {

        testStartTime = student.testThreeStartTime;
        totalTime = student.totalTimeThree;
        testTime = student.testThreeTime;
        extension = (testTime * extendTime) - testTime;

        actualTestTime = totalTime - extension;

        if (actualTestTime > 0) {
          actualExtension = totalTime - actualTestTime;
        } else if (actualTestTime <= 0) {
          actualExtension = totalTime;
        }
        // ratios for bar widths
        bottomBarRatio = extension / (testTime * extendTime);
        topBarRatio = 1 - bottomBarRatio;

        // in case timer has not started yet (test 1) OR: timer has ended
        if ((student.testThreeStartTime == 0 && !student.isTestThreeOver && !student.isTimerThreePaused) || student.isTestThreeOver) {
          topBarWidth = 100 * topBarRatio;
          bottomBarWidth = 100 * bottomBarRatio;

          countdown = processTime(totalTime, 19);
          // timer 1 runs out to zero
        } else if (totalTime + testStartTime - Date.now() <= 0 && !student.isTimerThreePaused && !student.isTestThreeOver) {
          topBarWidth = 0;
          bottomBarWidth = 0;

          countdown = 18000000;
          student.isTestThreeOver = true;
          student.isTimerThreePaused = false;

          $scope.students.$save(student).then(function() {
          });
        // timer is counting down (test 2)
      } else if (!student.isTimerThreePaused && !student.isTestThreeOver) {
          topBarDividend = testStartTime + actualTestTime - $scope.time;

          if (topBarDividend > 0) {
            topBarWidth = topBarDividend / testTime * 100 * topBarRatio;
            bottomBarDividend = extension;
          } else if (topBarDividend <= 0) {
            topBarWidth = 0;
            bottomBarDividend = testStartTime + totalTime - $scope.time;
          }
          // ultimate outputs
          bottomBarWidth = bottomBarDividend / extension * 100 * bottomBarRatio;
          // fn to manipulate new Date object
          dueTime = processTime(testStartTime + totalTime, 19);
          // ultimate outputs
          countdown = dueTime - $scope.time;
        // timer is paused (test 1)
      } else if (!student.isTestThreeOver && student.isTimerThreePaused) {

          if (actualTestTime > 0) {
            topBarWidth = actualTestTime / testTime * 100 * topBarRatio;
            bottomBarDividend = extension;

          } else if (actualTestTime <= 0) {
            topBarWidth = 0;
            bottomBarDividend = actualExtension;

          }
          bottomBarWidth = bottomBarDividend / extension * 100 * bottomBarRatio;
          countdown = processTime(totalTime, 19);
        }
      } else if (testNo == "testFour") {

        testStartTime = student.testFourStartTime;
        totalTime = student.totalTimeFour;
        testTime = student.testFourTime;
        extension = (testTime * extendTime) - testTime;

        actualTestTime = totalTime - extension;

        if (actualTestTime > 0) {
          actualExtension = totalTime - actualTestTime;
        } else if (actualTestTime <= 0) {
          actualExtension = totalTime;
        }
        // ratios for bar widths
        bottomBarRatio = extension / (testTime * extendTime);
        topBarRatio = 1 - bottomBarRatio;

        // in case timer has not started yet (test 1) OR: timer has ended
        if ((student.testFourStartTime == 0 && !student.isTestFourOver && !student.isTimerFourPaused) || student.isTestFourOver) {
          topBarWidth = 100 * topBarRatio;
          bottomBarWidth = 100 * bottomBarRatio;

          countdown = processTime(totalTime, 19);
          // timer 1 runs out to zero
        } else if (totalTime + testStartTime - Date.now() <= 0 && !student.isTimerFourPaused && !student.isTestFourOver) {
          topBarWidth = 0;
          bottomBarWidth = 0;

          countdown = 18000000;
          student.isTestFourOver = true;
          student.isTimerFourPaused = false;

          $scope.students.$save(student).then(function() {
          });
        // timer is counting down (test 2)
      } else if (!student.isTimerFourPaused && !student.isTestFourOver) {
          topBarDividend = testStartTime + actualTestTime - $scope.time;

          if (topBarDividend > 0) {
            topBarWidth = topBarDividend / testTime * 100 * topBarRatio;
            bottomBarDividend = extension;
          } else if (topBarDividend <= 0) {
            topBarWidth = 0;
            bottomBarDividend = testStartTime + totalTime - $scope.time;
          }
          // ultimate outputs
          bottomBarWidth = bottomBarDividend / extension * 100 * bottomBarRatio;
          // fn to manipulate new Date object
          dueTime = processTime(testStartTime + totalTime, 19);
          // ultimate outputs
          countdown = dueTime - $scope.time;
        // timer is paused (test 1)
      } else if (!student.isTestFourOver && student.isTimerFourPaused) {

          if (actualTestTime > 0) {
            topBarWidth = actualTestTime / testTime * 100 * topBarRatio;
            bottomBarDividend = extension;

          } else if (actualTestTime <= 0) {
            topBarWidth = 0;
            bottomBarDividend = actualExtension;

          }
          bottomBarWidth = bottomBarDividend / extension * 100 * bottomBarRatio;
          countdown = processTime(totalTime, 19);
        }
      }

      return {
        countdown: countdown,
        top: topBarWidth,
        bottom: bottomBarWidth,
        topBarDividend: topBarDividend,
        bottomBarDividend: bottomBarDividend
      }
    };

    $scope.pauseTimer = function(student, testNo) {
      if (testNo == "testOne") {
        student.isTimerOnePaused = true;
        student.totalTimeOne = (student.testOneStartTime + student.totalTimeOne) - Date.now();
        student.testOneStartTime = 0;
        student.pausedTimeOne = Date.now();
      } else if (testNo == "testTwo") {
        student.isTimerTwoPaused = true;
        student.totalTimeTwo = (student.testTwoStartTime + student.totalTimeTwo) - Date.now();
        student.testTwoStartTime = 0;
        student.pausedTimeTwo = Date.now();
      } else if (testNo == "testThree") {
        student.isTimerThreePaused = true;
        student.totalTimeThree = (student.testThreeStartTime + student.totalTimeThree) - Date.now();
        student.testThreeStartTime = 0;
        student.pausedTimeThree = Date.now();
      } else if (testNo == "testFour") {
        student.isTimerFourPaused = true;
        student.totalTimeFour = (student.testFourStartTime + student.totalTimeFour) - Date.now();
        student.testFourStartTime = 0;
        student.pausedTimeFour = Date.now();
      }

      $scope.students.$save(student).then(function() {
        $interval.cancel(promise);
      });

      $scope.$on('$destroy', function() {
        $interval.cancel(promise);
      });

      $scope.timer(student, testNo);
    };

    $scope.resumeTimer = function(student, testNo) {
      if (testNo == "testOne") {
        student.isTimerOnePaused = false;
        student.pausedTotalOne += Date.now() - student.pausedTimeOne;
      } else if (testNo == "testTwo") {
        student.isTimerTwoPaused = false;
        student.pausedTotalTwo += Date.now() - student.pausedTimeTwo;
      } else if (testNo == "testThree") {
        student.isTimerThreePaused = false;
        student.pausedTotalThree += Date.now() - student.pausedTimeThree;
      } else if (testNo == "testFour") {
        student.isTimerFourPaused = false;
        student.pausedTotalFour += Date.now() - student.pausedTimeFour;
      }

      $scope.students.$save(student).then(function() {
        $scope.startTimer(student, testNo);
      });
    };

    $scope.resetTimer = function(student, testNo) {
      if (testNo == "testOne") {
        student.isTimerOnePaused = false;
        student.totalTimeOne = student.testOneTime * student.extendTime;
        student.pausedTimeOne = 0;
        student.pausedTotalOne = 0;
        student.testOneStartTime = 0;
        student.isTimerOneStart = false;
      } else if (testNo == "testTwo") {
        student.isTimerTwoPaused = false;
        student.totalTimeTwo = student.testTwoTime * student.extendTime;
        student.pausedTimeTwo = 0;
        student.pausedTotalTwo = 0;
        student.testTwoStartTime = 0;
        student.isTimerTwoStart = false;
      } else if (testNo == "testThree") {
        student.isTimerThreePaused = false;
        student.totalTimeThree = student.testThreeTime * student.extendTime;
        student.pausedTimeThree = 0;
        student.pausedTotalThree = 0;
        student.testThreeStartTime = 0;
        student.isTimerThreeStart = false;
      } else if (testNo == "testFour") {
        student.isTimerFourPaused = false;
        student.totalTimeFour = student.testFourTime * student.extendTime;
        student.pausedTimeFour = 0;
        student.pausedTotalFour = 0;
        student.testFourStartTime = 0;
        student.isTimerFourStart = false;
      }

      $scope.students.$save(student).then(function() {
        $interval.cancel(promise);
      });

      $scope.$on('$destroy', function() {
        // Make sure that the interval is destroyed too
        $interval.cancel(promise);
      });
    };

    $scope.endTimer = function(student, testNo) {
      if (testNo == "testOne") {
        student.isTestOneOver = true;
        student.testOneEndedAt = Date.now();
      } else if (testNo == "testTwo") {
        student.isTestTwoOver = true;
        student.testTwoEndedAt = Date.now();
      } else if (testNo == "testThree") {
        student.isTestThreeOver = true;
        student.testThreeEndedAt = Date.now();
      } else if (testNo == "testFour") {
        student.isTestFourOver = true;
        student.testFourEndedAt = Date.now();
      }

      console.log("endTimer called");
      $scope.students.$save(student).then(function() {
        $interval.cancel(promise);
      });

      $scope.$on('$destroy', function() {
        // Make sure that the interval is destroyed too
        $interval.cancel(promise);
      });
    };

    $scope.startSelectedTests = function(students) {
      for (i = 0; i < students.length; i++) {
        if (students[i].isSafeToDelete) {
          if (!students[i].isTimerOneStart && !students[i].isTestOneOver) {
            $scope.startTimer(students[i], 'testOne')
          } else if (!students[i].isTimerTwoStart && !students[i].isTestTwoOver) {
            $scope.startTimer(students[i], 'testTwo')
          } else if (!students[i].isTimerThreeStart && !students[i].isTestThreeOver) {
            $scope.startTimer(students[i], 'testThree')
          } else if (!students[i].isTimerFourStart && !students[i].isTestFourOver) {
            $scope.startTimer(students[i], 'testFour')
          } else {
          $scope.info = true;
          $timeout(function turnOffAlert() {$scope.info = false}, 5000);
          }
        }
      }
    };

    $scope.startTime = function(student, testNo) {
      if (testNo == "testOne") {
        if (student.testOneStartRecord == 0) {
          time = "00:00:00";
        } else if (student.testOneStartRecord > 0) {
          time = student.testOneStartRecord;
        }
      } else if (testNo == "testTwo") {
        if (student.testTwoStartRecord == 0) {
          time = "00:00:00";
        } else if (student.testTwoStartRecord > 0) {
          time = student.testTwoStartRecord;
        }
      } else if (testNo == "testThree") {
        if (student.testThreeStartRecord == 0) {
          time = "00:00:00";
        } else if (student.testThreeStartRecord > 0) {
          time = student.testThreeStartRecord;
        }
      } else if (testNo == "testFour") {
        if (student.testFourStartRecord == 0) {
          time = "00:00:00";
        } else if (student.testFourStartRecord > 0) {
          time = student.testFourStartRecord;
        }
      }
      return time;
    };

    $scope.endTime = function(student, testNo) {
      if (testNo == "testOne") {
        if (student.testOneStartRecord == 0) {
          time = "00:00:00";
        } else if (student.testOneStartRecord > 0) {
          time = student.testOneTime + student.testOneStartRecord;
        }
      } else if (testNo == "testTwo") {
        if (student.testTwoStartRecord == 0) {
          time = "00:00:00";
        } else if (student.testTwoStartRecord > 0) {
          time = student.testTwoTime + student.testTwoStartRecord;
        }
      } else if (testNo == "testThree") {
        if (student.testThreeStartRecord == 0) {
          time = "00:00:00";
        } else if (student.testThreeStartRecord > 0) {
          time = student.testThreeTime + student.testThreeStartRecord;
        }
      } else if (testNo == "testFour") {
        if (student.testFourStartRecord == 0) {
          time = "00:00:00";
        } else if (student.testFourStartRecord > 0) {
          time = student.testFourTime + student.testFourStartRecord;
        }
      } else if (testNo == "exttestOne") {
        if (student.testOneStartRecord == 0) {
          time = "00:00:00";
        } else if (student.testOneStartRecord > 0) {
          time = (student.testOneTime * student.extendTime) + student.testOneStartRecord;
        }
      } else if (testNo == "exttestTwo") {
        if (student.testTwoStartRecord == 0) {
          time = "00:00:00";
        } else if (student.testTwoStartRecord > 0) {
          time = (student.testTwoTime * student.extendTime) + student.testTwoStartRecord;
        }
      } else if (testNo == "exttestThree") {
        if (student.testThreeStartRecord == 0) {
          time = "00:00:00";
        } else if (student.testThreeStartRecord > 0) {
          time = (student.testThreeTime * student.extendTime) + student.testThreeStartRecord;
        }
      } else if (testNo == "exttestFour") {
        if (student.testFourStartRecord == 0) {
          time = "00:00:00";
        } else if (student.testFourStartRecord > 0) {
          time = (student.testFourTime * student.extendTime) + student.testFourStartRecord;
        }
      } else if (testNo == "actualEndOne") {
        if (student.testOneEndedAt == 0) {
          time = "00:00:00";
        } else if (student.testOneStartRecord > 0) {
          time = student.testOneEndedAt;
        }
      } else if (testNo == "actualEndTwo") {
        if (student.testTwoEndedAt == 0) {
          time = "00:00:00";
        } else if (student.testTwoStartRecord > 0) {
          time = student.testTwoEndedAt;
        }
      } else if (testNo == "actualEndThree") {
        if (student.testThreeEndedAt == 0) {
          time = "00:00:00";
        } else if (student.testThreeStartRecord > 0) {
          time = student.testThreeEndedAt;
        }
      } else if (testNo == "actualEndFour") {
        if (student.testFourEndedAt == 0) {
          time = "00:00:00";
        } else if (student.testFourStartRecord > 0) {
          time = student.testFourEndedAt;
        }
      }
      return time;
    };

    $scope.totalPausedTime = function(student, testNo) {
      if (testNo == "testOne") {
        if (student.pausedTotalOne == 0) {
          time = "00:00:00";
        } else if (student.pausedTotalOne > 0) {
          time = StudentCrud.parseTime(student.pausedTotalOne);
        }
      } else if (testNo == "testTwo") {
        if (student.pausedTotalTwo == 0) {
          time = "00:00:00";
        } else if (student.pausedTotalTwo > 0) {
          time = StudentCrud.parseTime(student.pausedTotalTwo);
        }
      } else if (testNo == "testThree") {
        if (student.pausedTotalThree == 0) {
          time = "00:00:00";
        } else if (student.pausedTotalThree > 0) {
          time = StudentCrud.parseTime(student.pausedTotalThree);
        }
      } else if (testNo == "testFour") {
        if (student.pausedTotalFour == 0) {
          time = "00:00:00";
        } else if (student.pausedTotalFour > 0) {
          time = StudentCrud.parseTime(student.pausedTotalFour);
        }
      }
      return time;
    };

    $scope.testTime = function(student, testNo) {
      if (testNo == "testOne") {
        unprocessedTime = student.testOneTime;
      } else if (testNo == "testTwo") {
        unprocessedTime = student.testTwoTime;
      } else if (testNo == "testThree") {
        unprocessedTime = student.testThreeTime;
      } else if (testNo == "testFour") {
        unprocessedTime = student.testFourTime;
      } else if (testNo == "testOneExt") {
        unprocessedTime = (student.testOneTime * student.extendTime) - student.testOneTime;
      } else if (testNo == "testTwoExt") {
        unprocessedTime = (student.testTwoTime * student.extendTime) - student.testTwoTime;
      } else if (testNo == "testThreeExt") {
        unprocessedTime = (student.testThreeTime * student.extendTime) - student.testThreeTime;
      } else if (testNo == "testFourExt") {
        unprocessedTime = (student.testFourTime * student.extendTime) - student.testFourTime;
      } else if (testNo == "testOneExtBar") {
        unprocessedTime = (student.testOneTime * student.extendTime) - student.testOneTime;
        return unprocessedTime;
      } else if (testNo == "testTwoExtBar") {
        unprocessedTime = (student.testTwoTime * student.extendTime) - student.testTwoTime;
        return unprocessedTime;
      } else if (testNo == "testThreeExtBar") {
        unprocessedTime = (student.testThreeTime * student.extendTime) - student.testThreeTime;
        return unprocessedTime;
      } else if (testNo == "testFourExtBar") {
        unprocessedTime = (student.testFourTime * student.extendTime) - student.testFourTime;
        return unprocessedTime;
      } else if (testNo == "testOnetotal") {
        unprocessedTime = student.testOneTime * student.extendTime;
      } else if (testNo == "testTwototal") {
        unprocessedTime = student.testTwoTime * student.extendTime;
      } else if (testNo == "testThreetotal") {
        unprocessedTime = student.testThreeTime * student.extendTime;
      } else if (testNo == "testFourtotal") {
        unprocessedTime = student.testFourTime * student.extendTime;
      }

      time = processTime(unprocessedTime, 19);

      return time;
    };

// END Student Test TIMER Variables and Functions

// BEGIN UI MANIPULATION VARIABLES AND FUNCTIONS

    $scope.invertSelect = false;
    $scope.selectAll = true;

    $scope.saveAndToggleInvert = function(student) {
      $scope.students.$save(student);
      toggleInvert();
    };

    var toggleInvert = function() {
      var unsafeCount = 0;
      var safeCount = 0;

      for (i = 0; i < $scope.students.length; i++) {
        if ($scope.students[i] && $scope.students[i].isSafeToDelete) {
          safeCount++;
        } else if ($scope.students[i] && !$scope.students[i].isSafeToDelete) {
          unsafeCount++;
        }
      }

      $scope.clickedToDelete = false;

      if (safeCount > 0) {
        $scope.clickedToDelete = true;
        $timeout(function appear() {$scope.deleteAppear = true}, 1000);
      } else {
        $scope.deleteAppear = false;
        $timeout(function appear() {$scope.clickedToDelete = false}, 1000);
      }

      console.log("clickedToDelete: " + $scope.clickedToDelete);

      if (safeCount > 0 && unsafeCount > 1) {
        $scope.invertSelect = true;
        $scope.selectAll = false;
        console.log("safeCount: " + safeCount);
        console.log("invertSelect is true; selectAll is false");
      } else if (safeCount > 0 && safeCount == $scope.students.length) {
        $scope.invertSelect = false;
        $scope.selectAll = false;
        $scope.clearSelected = true;
        $scope.clickedToDelete = true;
        console.log("invertSelect is false; selectAll is true");
      } else if (safeCount == 0) {
        $scope.invertSelect = false;
        $scope.selectAll = true;
        $scope.clickedToDelete = false;
        console.log("invertSelect is false; selectAll is true");
      }
    }

    $scope.toggleSelectForDelete = function(students) {
      for (var i = 0; i < students.length; i++) {
        if (!students[i].isSafeToDelete) {
          students[i].isSafeToDelete = true;
        } else if (students[i].isSafeToDelete) {
          students[i].isSafeToDelete = false;
        }
        $scope.students.$save(students[i]);
      }
    }

    $scope.switchControl = function(students) {
      if ($scope.selectAll && !$scope.invertSelect) {

        $scope.toggleSelectForDelete(students);
        $scope.selectAll = false;
        $scope.invertSelect = false;
        $scope.clickedToDelete = true;
        $timeout(function appear() {$scope.clearSelected = true}, 1000);
        $timeout(function appear() {$scope.deleteAppear = true}, 1000);

      } else if ($scope.clearSelected) {

        $scope.toggleSelectForDelete(students);
        $scope.clearSelected = false;
        $scope.deleteAppear = false;
        $timeout(function appear() {$scope.selectAll = true}, 1000);
        $timeout(function appear() {$scope.clickedToDelete = false}, 1000);

      } else if ($scope.invertSelect) {
        $scope.toggleSelectForDelete(students);
      }
    };

// END UI MANIPULATION VARIABLES AND FUNCTIONS

  }
]);


text:
"use strict";

var gulp = require("gulp");
var lintJs = require("./build_tools/lintJs");
var bundle = require("./build_tools/bundle");
var sequence = require("./build_tools/sequence");
var clientSideJasmine = require("./build_tools/clientSideJasmine");
var serverSideJasmine = require("./build_tools/serverSideJasmine");

var LIB = "./lib/**/*.js";
var REST = "./*.js";
var BENCHMARKS = "./benchmarks/**/*.js";
var BUILD_TOOLS = "./build_tools/*.js";
var TEST_HELPERS = "./spec/helpers/**/*.js";
var CLIENT_TESTS = "./spec/client/**/*.js";
var CLIENT_TEST_BUNDLE = "./spec/build/lib.js";
var DEBUG_MODE_TEST_BUNDLE = "./spec/build/debugModeSpec.js";
var CONFIGURE_TESTS = "./spec/configureTesting.js";
var DEBUG_MODE_TEST = "./spec/debug_mode/debugModeSpec.js";
var SERVER_TESTS = "./spec/server/**/*.js";
var ALL_TEST_CODE = "./spec/**/*.js";
var NOT_BUILD_DIRECTORY_THOUGH = "!./spec/build/**/*.js";

var ALL_CODE = [
    BUILD_TOOLS,
    BENCHMARKS,
    LIB,
    REST,
    ALL_TEST_CODE,
    DEBUG_MODE_TEST,
    NOT_BUILD_DIRECTORY_THOUGH
];

gulp.task("lintJs", function() {
    return lintJs({
        what: ALL_CODE,
        fix: process.env.CI !== "true"
    });
});

gulp.task("test-on-server", function() {
    return serverSideJasmine([
        CONFIGURE_TESTS,
        TEST_HELPERS,
        SERVER_TESTS
    ]);
});

gulp.task("bundle-for-debug-mode", function() {
    return bundle({
        src: DEBUG_MODE_TEST,
        dest: DEBUG_MODE_TEST_BUNDLE
    });
});

// wawjr3d [1/31/2016]: test debug mode separately because the code in Backbone module
//  can only be spied on before executing the module.
gulp.task("test-debug-mode", ["bundle-for-debug-mode"], function() {
    return clientSideJasmine({
        src: DEBUG_MODE_TEST_BUNDLE
    });
});

gulp.task("bundle-for-client", function() {
    return bundle({
        src: [
            CONFIGURE_TESTS,
            TEST_HELPERS,
            CLIENT_TESTS
        ],
        dest: CLIENT_TEST_BUNDLE,
        debug: true
    });
});

gulp.task("test-on-client", ["bundle-for-client"], function() {
    return clientSideJasmine({
        specs: CLIENT_TEST_BUNDLE,
        vendor: "build_tools/vendor/es5-shim.js",
        debug: process.env.DEBUG === "true"
    });
});

gulp.task("default", sequence(
    "lintJs", [
        "test-on-server",
        "test-debug-mode",
        "test-on-client"
    ]
));

// ----------------------------------------------------------------------------
// Copyright (C) 2018 Bloomberg Finance L.P.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ----------------------------- END-OF-FILE ----------------------------------

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE markables SYSTEM "markables.dtd">
<markables xmlns="www.eml.org/NameSpaces/negation">
<markable id="markable_76" span="word_752" mmax_level="negation"  emo-expression-ref="emo-expression:markable_137" />
<markable id="markable_100500217" span="word_388" mmax_level="negation"  emo-expression-ref="emo-expression:markable_40" />
<markable id="markable_59" span="word_560" mmax_level="negation"  emo-expression-ref="emo-expression:markable_58" />
</markables>


text:
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading;
using Encog.ML.Data;
using Encog.ML.Data.Basic;
using Encog.Neural.Networks;
using Encog.Util.Arrayutil;
using aXon.Rover.Annotations;
using aXon.Rover.Enumerations;
using aXon.Rover.Models;

namespace aXon.Rover
{
    public class NeuralRobot : INotifyPropertyChanged
    {
        private readonly NormalizedField _CanGoStats;
        private readonly NormalizedField _hStats;
        private readonly BasicNetwork _network;

        private readonly bool _track;
        private RobotSimulator _sim;

        public NeuralRobot(BasicNetwork network, bool track, Position source, Position destination)
        {
            _hStats = new NormalizedField(NormalizationAction.Normalize, "Heading", 359, 0, .9, -.9);
            _CanGoStats = new NormalizedField(NormalizationAction.Normalize, "CanGo", 1, 0, 0.9, -0.9);
            _track = track;
            _network = network;
            sim = new RobotSimulator(source, destination);
        }

        public RobotSimulator sim
        {
            get { return _sim; }
            set
            {
                if (Equals(value, _sim)) return;
                _sim = value;
                OnPropertyChanged();
            }
        }

        public int ScorePilot()
        {

            while (sim.Traveling)
            {
                var input = new BasicMLData(2);

                input[0] = sim.DistanceToDestination;
                input[1] = _hStats.Normalize(sim.Heading);

                IMLData output = _network.Compute(input);
                double f = output[0];
                double l = output[1];
                double r = output[2];
                double rev = output[3];

                var dirs = new Dictionary<CommandDirection, double>
                    {
                        {CommandDirection.MoveForward, f},
                        {CommandDirection.TurnLeft, l},
                        {CommandDirection.TurnRight, r},
                        {CommandDirection.MoveInReverse, rev}

                    };
                KeyValuePair<CommandDirection, double> d = dirs.First(v => v.Value == 1.0);

                CommandDirection thrust = d.Key;
                sim.Turn(thrust);

                lock (RobotContol.ConsoleLock)
                {

                    if (_track)
                    {
                        sim.Telemetry();
                        switch (thrust)
                        {
                            default:
                                Thread.Sleep(50);
                                break;
                        }
                    }
                }
            }
            return (sim.Score);
        }

        public event PropertyChangedEventHandler PropertyChanged;

        [NotifyPropertyChangedInvocator]
        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}


text:
require "active_support/notifications"
require "zencoder_event/engine" if defined?(Rails)
require 'json'

module ZencoderEvent
  class << self
    attr_accessor :adapter, :backend, :event_retriever, :namespace

    def configure(&block)
      raise ArgumentError, "must provide a block" unless block_given?
      block.arity.zero? ? instance_eval(&block) : yield(self)
    end
    alias :setup :configure

    def instrument(params)
      state = params[:input][:state]
      id = params[:job][:pass_through]
      backend.instrument namespace.call(state), id if id
    end

    def subscribe(name, callable = Proc.new)
      backend.subscribe namespace.to_regexp(name), adapter.call(callable)
    end

    def all(callable = Proc.new)
      subscribe nil, callable
    end
  end

  class Namespace < Struct.new(:value, :delimiter)
    def call(name = nil)
      "#{value}#{delimiter}#{name}"
    end

    def to_regexp(name = nil)
      %r{^#{Regexp.escape call(name)}}
    end
  end

  class NotificationAdapter < Struct.new(:subscriber)
    def self.call(callable)
      new(callable)
    end

    def call(*args)
      payload = args.last
      subscriber.call(payload)
    end
  end

  class Error < StandardError; end
  class UnauthorizedError < Error; end

  self.adapter = NotificationAdapter
  self.backend = ActiveSupport::Notifications
  self.namespace = Namespace.new("zencoder_event", ".")
end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Bull. Soc. mycol. Fr. 16: 55 (1900)

#### Original name
Thelephora retiformis Berk. & M.A. Curtis

### Remarks
null


text:
'use strict';

$(document).ready(function() {
    $('#make_registration').click(function() {
        sys_func.submitAndSend(
            '#registration_form',
            $(this),
            '/ajax/general/registration',
            function(data) {
                if (!data) {
                    alert('error');
                    return;
                }

                if (!data.status || data.status != 'ok') {
                    alert((data.message) ? data.message : 'error');
                    return;
                }
                alert(page.get_i18n('successful_msg_2'))
                window.location = '/';
            }
        );
    });
});


text:
var SortedSet = require("../sorted-set");

var set = new SortedSet();
set.add(1);
set.add(2);
set.add(3);
set.add(-3);
set.add(-1);
set.add(-2);
set.log();

set.toArray().sort(function () {
    return Math.random() - .5;
}).forEach(function (value) {
    console.log("get", value);
    set.get(value);
    set.log();
});

console.log("add", 0);
set.add(0);
set.log();
console.log("add another", 0);
set.add(0);
set.log();
console.log("delete", 0);
set.delete(0);
set.log();
console.log("delete", 0);
set.delete(0);
set.log();
console.log("delete", 1);
set.delete(1);
set.log();

console.log('\nreducible methods');
console.log("min", set.min());
console.log("max", set.max());
console.log("sum", set.sum());
console.log("average", set.average());

console.log('\nconstrained greatest and least');
var set = new SortedSet([1, 3, 5, 7, 10]);
set.log();
console.log(set.findGreatestLessThan(7).value);
console.log(set.findLeastGreaterThan(6).value);

console.log('\nrange iterator');
var Iterator = require("../iterator");
var iterator = new Iterator(set.iterate(2, 10));
iterator.forEach(function (value) {
    console.log(value);
});

console.log('\nset length')
var set = new SortedSet([1, 3, 3, 5, 7, 10]);
console.log(set.length);


text:
C--------------------------------------------------------------------------
C
C Copyright 1981-2014 University College London
C
C Licensed under the Apache License, Version 2.0 (the "License");
C you may not use this file except in compliance with the License.
C You may obtain a copy of the License at
C
C    http://www.apache.org/licenses/LICENSE-2.0
C
C Unless required by applicable law or agreed to in writing, software
C distributed under the License is distributed on an "AS IS" BASIS,
C WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
C See the License for the specific language governing permissions and
C limitations under the License.
C
C--------------------------------------------------------------------------

C A.S. Nealis: 25/3/92 - Modified so can reopen files without a user
C prompt (originally to fix a bug in the handling of errors after
C calls to RFACTOR()
      SUBROUTINE OPNFIL(LUN, IRC, FILENAME, PLOTCNT)
      IMPLICIT NONE
      INTEGER LUN, IRC, PLOTCNT
      CHARACTER MESAGE*26, FILENAME(10)*14

      IRC = 1
      MESAGE = "Error opening file to read"

 1    CONTINUE
      PRINT 100
      READ(*,'(A)') FILENAME(PLOTCNT)
      IRC = 1
      OPEN(UNIT=LUN, FILE=FILENAME(PLOTCNT), STATUS='OLD', ERR=10)
      REWIND(LUN)

      RETURN
 10   CALL ERRMSG(MESAGE)
      GOTO 1

 100  FORMAT("Enter name of file containing data: ",$)
      END


text:
{{'msg.page.format.format.title' | translate}}

    <component-select
      #typeListSelect
      [array]="typeList"
      [viewKey]="'name'"
      (onSelected)="onTypeChange($event)">
    </component-select>

    <component-select
      #signListSelect
      [array]="currencySignList"
      [viewKey]="'name'"
      (onSelected)="onSignChange($event)">
    </component-select>

{{'msg.page.th.decimal.place' | translate}}

      <input (keyup)="$event.keyCode == 13 ? onDigitValid() : null"
             (clickOutside)="onDigitValid()"
             [(ngModel)]="decimalCopy" type="number" maxlength="1">

{{'msg.page.format.numeric.alias' | translate}}

    <component-select
      #numericAliasListSelect
      [array]="numericAliasList"
      [viewKey]="'name'"
      (onSelected)="onNumericAliasChange($event)">
    </component-select>

        <input [checked]="useThousandsSep" type="checkbox">

        {{'msg.page.th.thousand.sep' | translate}}

    {{'msg.page.format.custom.symbol' | translate}}

      <input type="checkbox" id="customSymbol" [ngModel]="customSymbol" (click)="showCustomSymbol()">

{{'msg.page.format.custom.symbol.enter' | translate}}

      <component-input
        [inputClass]="'ddp-input-typebasic'"
        [value]="customSymbol['value']"
        [isTrim]="false"
        (changeValue)="customSymbol['value'] = $event; changeSymbol();">
      </component-input>

{{'msg.page.format.custom.symbol.position' | translate}}

      <component-select
        [array]="positionList"
        [viewKey]="'name'"
        [defaultIndex]="'BEFORE' === customSymbol?.pos?.toString() ? 0 : 1"
        (onSelected)="changePosition($event)"
      ></component-select>

{{'msg.page.format.preview' | translate}}

{{preview}}


text:
<?php echo $farm_info['name']; ?>

<?php echo lang('str_farm_reg_date');?><?php echo $farm_info['reg_date'];?>

        <button class="btn btn-primary btn-herbhub vf-farm-contact"><?php echo lang('str_contact_farm'); ?></button>

                  <img class="center-block" src="<?php
                  if(!empty($farm_info['logo_path'])) {
                    echo storage_farm_logo_url($farm_info['logo_path']);
                  } else {
                    echo strage_farm_logo_default_url();
                  }
                    ?>">

<?php echo lang("str_farm_location");?>
                    <?php
                              if (!empty($farm_info['province'])) {
                                echo $farm_info['province'].', ';
                              }
                              if (!empty($farm_info['country'])) {
                                echo $farm_info['country'];
                              ?>
                              <img class="flag-thumb" src="<?php echo ci_site_url(flag_thumb_path($farm_info['country_iso']));?>">
                        <?php }?>

                    <?php echo lang("str_farm_herb_list")?>

                  <?php echo $farm_info['herbs'];?>

<?php echo lang("str_address");?><?php echo $farm_info['address_1'].' '.$farm_info['city'];?>

<?php echo lang("str_phone_number");?><?php echo '+'.$farm_info['phone_code'].' '.$farm_info['phone_number'];?>

<?php echo lang("str_farm_est_date");?><?php echo $farm_info['est_date']?>

<?php echo lang("str_website");?><a target="_blank" href="<?php
                  if (substr( $farm_info['website'], 0, 7 ) != "http://" && substr( $farm_info['website'], 0, 8 ) != "https://"){
                    echo '//';
                  } echo $farm_info['website'];?>"><?php echo $farm_info['website'];?>

<?php echo lang('str_farm_verified');?> : <?php echo $farm_info['verified'];?>

<?php echo lang('str_farm_organic');?> : <?php echo $farm_info['organic'];?>

<?php echo lang('str_farm_accomodation');?> : <?php echo $farm_info['accomodation'];?>

      <?php
        if (!empty($farm_images)) {        ?>

          <?php foreach($farm_images as $image): ?>
            <a href="<?php echo storage_farm_image_url($farm_id,$image['path']); ?>"><img src='<?php echo storage_farm_thumb72_url($farm_id,$image['path']); ?>'>
          <?php endforeach;?>

        <?php }?>

Introduction

<?php echo nl2br($farm_info['description']); ?>

In Stock

              <?php if (!empty($herb_list)){
                foreach ($herb_list as $herb):
                  $instock_msg = "N/A";
                  $instock = 0;
                  if(!empty($herb['in_stock_volume_kilo']) && !empty($herb['production_volume_kilo']))
                  {
                    $instock = intval($herb['in_stock_volume_kilo'])*100/intval($herb['production_volume_kilo']);
                    $instock_msg = 'In Stock '.$herb['in_stock_volume_kilo'].'Kg /'.$herb['production_volume_kilo'].'Kg';
                  }
                  ?>
                <?php echo $herb['name'];?>

                  <div data-placement="top" style="width: <?php echo $instock?>%;"
                  aria-valuemax="100" aria-valuemin="0" aria-valuenow="10" role="progressbar" class="progress-bar progress-bar-success">
                   <?php echo $instock_msg; ?>

            <?php endforeach; }?>

                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>

                  <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo lang('str_close');?></button>

    <button class="btn btn-primary btn-herbhub vf-farm-contact center-block"><?php echo lang('str_contact_farm'); ?></button>

<?php require_once APPPATH.'views/farm/exp_script.php';?>

<?php echo lang('str_farm_view_exp_title');?>

    <form id="new-exp">
      <textarea class='form-control' placeholder="<?php
      if (!empty($farm_info['account_id']) && !empty($account_id) && $farm_info['account_id'] == $account_id) {
        echo lang('str_farm_view_exp_new_placeholder_owner');
      } else {
        echo lang('str_farm_view_exp_new_placeholder');
      }
        ?>"></textarea>
      <button class="btn btn-primary pull-right" id="add-exp"><?php echo lang('str_post');?></button>
    </form>

  <?php if (!empty($farm_exps)) {foreach($farm_exps as $farm_exp_id=>$farm_exp) :?>
    <?php
    $deleted = ($farm_exp['text'] == '')?true:false;
    if (!empty($farm_exp['comments']) || $deleted==false) {?>
      <div class="exp-item" data-exp-id="<?php echo $farm_exp_id;?>">

            <?php
              if ($deleted==true) {
                $farm_exp['text'] = ''.lang('str_deleted_post').'';
              }
              if ($farm_exp['username'] == $username && $deleted==false) {?>

                  <?php echo lang('str_edit');?>
                  <?php echo lang('str_delete');?>

              <?php }?>

<?php echo $farm_exp['username'];?>

<?php echo timestamp_to_utc($farm_exp['creation_date']);?>

<?php echo nl2br($farm_exp['text']);?>

          <?php if ($farm_exp['username'] == $username && $deleted==false) {?>

              <button class="edit-btn btn btn-primary"><?php echo lang('str_edit');?>
              <button class="cancel-btn btn btn-default"><?php echo lang('str_cancel');?>

            <?php }?>

          <?php if (!empty($farm_exp['comments'])) {
            foreach($farm_exp['comments'] as $comment_id=>$comment):?>
            <div class="comment" data-com-id="<?php echo $comment_id;?>">
              <?php $deleted = ($farm_exp['text'] == '')?true:false;
              if ($farm_exp['username'] == $username && $deleted==false) {?>

                  <?php echo lang('str_edit');?>
                  <?php echo lang('str_delete');?>

              <?php }?>

<?php echo check_unknown_username($comment['username']);?>

<?php echo timestamp_to_utc($comment['creation_date']);?>

<?php echo nl2br($comment['text']);?>

              <?php if ($farm_exp['username'] == $username && $deleted==false) {?>

              <?php }?>

            <?php endforeach;
          }?>

          <form class="comment-form">
            <input class="comment-input form-control" name="comment" placeholder="<?php echo lang('str_comment_placeholder')?>"></form>

<?php echo lang('str_press_enter');?>

  <?php } endforeach;}?>


text:
var Url = require("../lib/Url"),
    expect = require("chai").expect;

describe("Url", function () {
  it("returns an instance when called as a function", function () {
    expect(Url({
      url: "https://example.com"
    })).to.be.an.instanceOf(Url);
  });

  it("uses URL as the unique ID", function () {
    expect(new Url({
      url: "https://example.com"
    }).getUniqueId()).to.equal("https://example.com");
  });

  it("accepts a string URL as the only argument", function () {
    expect(new Url("https://example.com").getUniqueId()).to.equal("https://example.com");
  });

  describe("#getStatusCode", function () {
    it("returns the statusCode if specified", function () {
      expect(new Url({
        url: "https://example.com",
        statusCode: 201
      }).getStatusCode()).to.equal(201);
    });

    it("defaults to null if statusCode not specified", function () {
      expect(new Url({
        url: "https://example.com"
      }).getStatusCode()).to.equal(null);
    });
  });

  describe("#getUrl", function () {
    it("returns the URL", function () {
      expect(new Url({
        url: "https://example.com"
      }).getUrl()).to.equal("https://example.com");
    });
  });

  describe("#getErrorCode", function () {
    it("returns the error code", function () {
      expect(new Url({
        url: "https://example.com",
        errorCode: "ROBOTS_NOT_ALLOWED"
      }).getErrorCode()).to.equal("ROBOTS_NOT_ALLOWED");
    });
  });

  describe("#getErrorMessage", function () {
    it("returns the error message", function () {
      expect(new Url({
        url: "https://example.com",
        errorCode: "ROBOTS_NOT_ALLOWED",
        errorMessage: "A robots.txt error"
      }).getErrorMessage()).to.equal("A robots.txt error");
    });

    it("returns null if no rror message", function () {
      expect(new Url({
        url: "https://example.com",
        errorCode: "ROBOTS_NOT_ALLOWED"
      }).getErrorMessage()).to.equal(null);
    });
  });
});


text:
published: true
layout: post
title: 'México lanza un llamado para adoptar la Carta Internacional de Datos Abiertos'
excerpt: 'La Carta Internacional de Datos Abiertos articula un conjunto de principios fundamentales para coordinar y promover la adopción de los Datos Abiertos como una base que le permita a los gobiernos trabajar junto con sus ciudadanos hacia la construcción de sociedades más democráticas, justas y prósperas.'
author: "Coordinación de Estrategia Digital Nacional"
featured: false
date: 2015-10-01 12:00:00 -0500
grid_img: "avances/odc/odc_grid.jpg"
featured_img: "avances/odc/odc_featured.jpg"
permalink: "/impacto/avances/open-data-charter.html"
section: impacto
sub_section: avances
category: desarrollo-sostenible
category_title: Desarrollo Sostenible
tags:
  - Carta Internacional de Datos Abiertos
  - datos abiertos
---

*"La Carta Internacional de Datos Abiertos tiene el potencial de acelerar el progreso al poner datos accionables en manos de las personas." Sir Tim Berners-Lee, Inventor de la World Wide Web*

En un momento histórico en el que el mundo está por adoptar la Agenda 2030 para el Desarrollo Sostenible, los Datos Abiertos se encuentran en el corazón de un movimiento global que aprovecha el potencial de las nuevas tecnologías impulsadas por la revolución de datos para generar un impacto positivo en el desarrollo económico y social a nivel global.

La Carta Internacional de Datos Abiertos articula un conjunto de principios fundamentales para coordinar y promover la adopción de los Datos Abiertos como una base que le permita a los gobiernos trabajar junto con sus ciudadanos hacia la construcción de sociedades más democráticas, justas y prósperas. Esos principios fundamentales son un marco de acción común para aprovechar el potencial de los Datos Abiertos como herramienta de implementación y monitoreo los Objetivos de Desarrollo Sostenible.

Al acordar principios en común para la liberación y uso de datos, la Carta Internacional de Datos Abiertos busca incrementar la accesibilidad, interoperabilidad, usabilidad e impacto de los Datos Abiertos a nivel global, utilizándolos como un vehículo para el desarrollo Sostenible.

La Carta Internacional de Datos Abiertos es una iniciativa multilateral apoyada por gobiernos, organizaciones de la sociedad civil, sector privado y expertos en la materia. El documento determina en 6 principios que los datos deben ser:

- Abiertos por Defecto
- Oportunos y Completos
- Accesibles y Utilizables
- Comparables e Interoperables
- Para mejorar la Gobernanza y la Participación Ciudadana
- Para el Desarrollo y la Innovación Incluyente

*"Como líderes de esta iniciativa, hacemos un llamado a otros gobiernos para adoptar estos principios, con el objetivo de colaborar y dar seguimiento al diseño y progreso de políticas públicas dirigidas a alcanzar los Objetivos de Desarrollo Sostenible." Enrique Peña Nieto, Presidente de México*

El objetivo principal de este esfuerzo colaborativo es fomentar una mayor coherencia, adopción e implementación de los principios de Datos Abiertos, estableciendo estándares y buenas prácticas en distintos sectores alrededor del mundo.

En el marco de la Asamblea General de las Naciones Unidas, el Gobierno de México lanza un llamado global a la adopción de la Carta Internacional de Datos Abiertos, promoviendo la visión de un mundo en el que gobiernos, sociedad civil, sector privado y ciudadanía tengan disponibles los datos necesarios como herramienta para mejorar la toma de decisiones, aumentar su competitividad y promover el desarrollo sostenible.

Para más información visita: [opendatacharter.net](http://opendatacharter.net 'Open Data Charter')


text:
<?xml version="1.0" ?>
<enemy>
    <behaviour>
        <root x="110" y="40">
            <normal>
                <action id="pressStick">
                    <string id="direction" values="directions">RIGHT</string>
                    <float id="duration in seconds">0.10</float>
                    <string id="Comment">Moves right</string>
                </action>
            </normal>
        </root>
    </behaviour>
</enemy>


text:
<md:EntityDescriptor xmlns:init="urn:oasis:names:tc:SAML:profiles:SSO:request-init" xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" xmlns:mdrpi="urn:oasis:names:tc:SAML:metadata:rpi" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" entityID="https://2012.qmplus.qmul.ac.uk/shibboleth">
    <md:Extensions>
      <mdrpi:RegistrationInfo registrationAuthority="http://ukfederation.org.uk" registrationInstant="2014-06-30T09:22:05Z">
        <mdrpi:RegistrationPolicy xml:lang="en">http://ukfederation.org.uk/doc/mdrps-20130902</mdrpi:RegistrationPolicy>
      </mdrpi:RegistrationInfo>
    </md:Extensions>
    <md:SPSSODescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol urn:oasis:names:tc:SAML:1.1:protocol urn:oasis:names:tc:SAML:1.0:protocol">
      <md:Extensions>
        <init:RequestInitiator Binding="urn:oasis:names:tc:SAML:profiles:SSO:request-init" Location="https://2012.qmplus.qmul.ac.uk/Shibboleth.sso/Login"/>
      </md:Extensions>
      <md:KeyDescriptor>
        <ds:KeyInfo>
          <ds:X509Data>
            <ds:X509Certificate>
						MIIDCTCCAfGgAwIBAgIJAKfCPp1ZOBsNMA0GCSqGSIb3DQEBBQUAMCExHzAdBgNV
						BAMTFjIwMTIucW1wbHVzLnFtdWwuYWMudWswHhcNMTQwNjI1MDk1ODE3WhcNMjQw
						NjIyMDk1ODE3WjAhMR8wHQYDVQQDExYyMDEyLnFtcGx1cy5xbXVsLmFjLnVrMIIB
						IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtKJY1LEzeMszLBA7vIwDWTvd
						a07jaXtUFBdFyEqnwBIr91EJxyCdkHd4qGhw3riCUE5XEEaHq7YkIA1sHjzAxkv3
						bpjnI1iaP4gU4+Dwec0kJ4VkPFt4vE6TSICeA//DBrL+ZMcD8hjZDRhTxAHv9t96
						bIfsmxrlBizuS6GAAAHm3eWbzYJ6V5tf79Z9GZjMTjZtrloem4B1+UsS0Ze17CU9
						liUSJUZKT39gQN7JywnQ+DAkGe1rfQmQHdwdt1ekPnPomOBy9h6aymxgOqGHxmIK
						l2tixtmYVZYoAPlrDEZEtdU6BRUMPiJCYlz/wG+QRN75PvMjbmpNIKAyJUwAZwID
						AQABo0QwQjAhBgNVHREEGjAYghYyMDEyLnFtcGx1cy5xbXVsLmFjLnVrMB0GA1Ud
						DgQWBBS9sdhTGd7ns9eUGONqUjAaTo1ADjANBgkqhkiG9w0BAQUFAAOCAQEAKtjj
						o3HiYvqfjOcaUNv0yq3i3LCTf+PobbmX5YBXDBQhYrvkuaUcfTRr6hIE86RZwMC7
						9rGV63IqTKQtpjF3odt/rSTNgRz0iEc2p+HtCdN4cBR6aSEwOyHfj8MotC8L5JO9
						3GTfasl+ZuRDEtsgZeIZv+zIjO1CDL6eE/OyyMo9bFmvOrrvGKXp01LR2VuqEy+M
						s9GzHa6yGaWQBoQaLVXMhRT3AM3y9hRh1P4GgsIS+Z0oOeW1VGEg6nDC29fXLfrN
						YWbnO44vlTi3MGoezwxe/U2v+4+rXPEJ28rVZp74FaLYsR+5OpsC5VR7moj78OWF
						uifWa1iscTfgACwOQg==
					</ds:X509Certificate>
          </ds:X509Data>
        </ds:KeyInfo>
      </md:KeyDescriptor>
      <md:ArtifactResolutionService Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP" Location="https://2012.qmplus.qmul.ac.uk/Shibboleth.sso/Artifact/SOAP" index="0"/>
      <md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://2012.qmplus.qmul.ac.uk/Shibboleth.sso/SAML2/POST" index="0"/>
      <md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST-SimpleSign" Location="https://2012.qmplus.qmul.ac.uk/Shibboleth.sso/SAML2/POST-SimpleSign" index="1"/>
      <md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact" Location="https://2012.qmplus.qmul.ac.uk/Shibboleth.sso/SAML2/Artifact" index="2"/>
      <md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:PAOS" Location="https://2012.qmplus.qmul.ac.uk/Shibboleth.sso/SAML2/ECP" index="3"/>
      <md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:1.0:profiles:browser-post" Location="https://2012.qmplus.qmul.ac.uk/Shibboleth.sso/SAML/POST" index="4"/>
      <md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:1.0:profiles:artifact-01" Location="https://2012.qmplus.qmul.ac.uk/Shibboleth.sso/SAML/Artifact" index="5"/>
    </md:SPSSODescriptor>
    <md:Organization>
      <md:OrganizationName xml:lang="en">Queen Mary and Westfield College, University of London</md:OrganizationName>
      <md:OrganizationDisplayName xml:lang="en">Queen Mary and Westfield College :2012 Archive service QMPlus</md:OrganizationDisplayName>
      <md:OrganizationURL xml:lang="en">http://www.qmul.ac.uk/</md:OrganizationURL>
    </md:Organization>
    <md:ContactPerson contactType="support">
      <md:GivenName>Academic Applications</md:GivenName>
      <md:EmailAddress>mailto:its-aa@qmul.ac.uk</md:EmailAddress>
    </md:ContactPerson>
    <md:ContactPerson contactType="technical">
      <md:GivenName>Moodle Support</md:GivenName>
      <md:EmailAddress>mailto:moodle-support@ulcc.ac.uk</md:EmailAddress>
    </md:ContactPerson>
    <md:ContactPerson contactType="technical">
      <md:GivenName>Academic Applications</md:GivenName>
      <md:EmailAddress>mailto:its-aa@qmul.ac.uk</md:EmailAddress>
    </md:ContactPerson>
  </md:EntityDescriptor>


text:
/*
* main file
*/

require.config({
    baseUrl: '',
    waitSeconds: 200, // large for slow network...
    urlArgs: "bust=" + (new Date()).getTime(), // no cache
    paths: {
        jquery: '../libs/jquery/dist/jquery.min',
        // bootstrap: '../libs/bootstrap/dist/js/bootstrap.min',
        // bootstrapSelect: '../libs/bootstrap-select/dist/js/bootstrap-select.min',
        // angular: '../libs/angular/angular.min',
        // angularRoute: '../libs/angular-route/angular-route.min',
        // angularAnimate: '../libs/angular-animate/angular-animate.min',

        appConfig: 'js/conf/app-config',

        appModules: 'js/app.min',
        appMain : 'js/app-main'
    },
    shim: {
        'jquery' : {
            exports: 'jquery'
        },
        // 'bootstrap' : {
        //     deps: ['jquery']
        // },

        // 'bootstrapSelect' : {
        //     deps: ['bootstrap']
        // },

        // // just need to make sure boostrap select is loaded before angular....
        // 'angular': {
        //     deps: ['bootstrapSelect']
        // },

        // 'angularRoute' : {
        //     deps: ['angular']
        // },

        // 'angularAnimate' : {
        //     deps: ['angular']
        // },

        'appModules': {
            deps:['appConfig', 'jquery']//, 'angularRoute', 'angularAnimate']
        },

        'appMain' : {
            deps: ['appModules']
        }
    }
});

if (window.console) {
    window.console.log = function () {}; // remove all console log
}

requirejs(['appMain']);


text:
<?php

namespace Dvsa\Mot\Frontend\MotTestModuleTest\Factory\View;

use Dvsa\Mot\Frontend\MotTestModule\Factory\View\DefectsJourneyUrlGeneratorViewHelperFactory;
use Dvsa\Mot\Frontend\MotTestModule\View\DefectsJourneyContextProvider;
use Dvsa\Mot\Frontend\MotTestModule\View\DefectsJourneyUrlGenerator;
use Dvsa\Mot\Frontend\MotTestModule\View\DefectsJourneyUrlGeneratorViewHelper;
use DvsaCommonTest\TestUtils\ServiceFactoryTestHelper;
use Dvsa\Mot\Frontend\Test\TestCase;

class DefectsJourneyUrlGeneratorViewHelperFactoryTest extends TestCase
{
    public function testFactoryCreatesInstance()
    {
        ServiceFactoryTestHelper::testCreateServiceWithPluginManager(
            DefectsJourneyUrlGeneratorViewHelperFactory::class,
            DefectsJourneyUrlGeneratorViewHelper::class,
            [
                DefectsJourneyUrlGenerator::class => DefectsJourneyUrlGenerator::class,
                DefectsJourneyContextProvider::class => DefectsJourneyContextProvider::class,
            ]
        );
    }
}


text:
var env, store, Person, Name;

module("unit/fragments - DS.FragmentArray", {
  setup: function() {
    Person = DS.Model.extend({
      names: DS.hasManyFragments("name")
    });

    Name = DS.ModelFragment.extend({
      first : DS.attr("string"),
      last  : DS.attr("string")
    });

    env = setupStore({
      person: Person,
      name: Name
    });

    store = env.store;
  },

  teardown: function() {
    env = null;
    store = null;
    Person = null;
    Name = null;
  }
});

test("fragments can be created and added through the fragment array", function() {
  store.push(Person, {
    id: 1,
    names: [
      {
        first: "Tyrion",
        last: "Lannister"
      }
    ]
  });

  store.find(Person, 1).then(async(function(person) {
    var fragments = person.get('names');
    var length = fragments.get('length');

    var fragment = fragments.createFragment({
      first: "Hugor",
      last: "Hill"
    });

    equal(fragments.get('length'), length + 1, "property size is correct");
    equal(fragments.indexOf(fragment), length, "new fragment is in correct location");
  }));
});

test("fragments can be added to the fragment array", function() {
  store.push(Person, {
    id: 1,
    names: [
      {
        first: "Tyrion",
        last: "Lannister"
      }
    ]
  });

  store.find(Person, 1).then(async(function(person) {
    var fragments = person.get('names');
    var length = fragments.get('length');

    var fragment = store.createFragment('name', {
      first: "Yollo"
    });

    fragments.addFragment(fragment);

    equal(fragments.get('length'), length + 1, "property size is correct");
    equal(fragments.indexOf(fragment), length, "fragment is in correct location");
  }));
});

test("fragments can be removed from the fragment array", function() {
  store.push(Person, {
    id: 1,
    names: [
      {
        first: "Arya",
        last: "Stark"
      }
    ]
  });

  store.find(Person, 1).then(async(function(person) {
    var fragments = person.get('names');
    var fragment = fragments.get('firstObject');
    var length = fragments.get('length');

    fragments.removeFragment(fragment);

    equal(fragments.get('length'), length - 1, "property size is correct");
    ok(!fragments.contains(fragment), "fragment is removed");
  }));
});

test("changes to array contents change the fragment array 'isDirty' property", function() {
  store.push(Person, {
    id: 1,
    names: [
      {
        first: "Aegon",
        last: "Targaryen"
      },
      {
        first: "Visenya",
        last: "Targaryen"
      }
    ]
  });

  store.find(Person, 1).then(async(function(person) {
    var fragments = person.get('names');
    var fragment = fragments.get('firstObject');
    var newFragment = store.createFragment('name', {
      first: 'Rhaenys',
      last: 'Targaryen'
    });

    ok(!fragments.get('isDirty'), "fragment array is initially in a clean state");

    fragments.removeFragment(fragment);

    ok(fragments.get('isDirty'), "fragment array is in dirty state after removal");

    fragments.unshiftObject(fragment);

    ok(!fragments.get('isDirty'), "fragment array is returned to clean state");

    fragments.addFragment(newFragment);

    ok(fragments.get('isDirty'), "fragment array is in dirty state after addition");

    fragments.removeFragment(newFragment);

    ok(!fragments.get('isDirty'), "fragment array is returned to clean state");

    fragments.removeFragment(fragment);
    fragments.addFragment(fragment);

    ok(fragments.get('isDirty'), "fragment array is in dirty state after reordering");

    fragments.removeFragment(fragment);
    fragments.unshiftObject(fragment);

    ok(!fragments.get('isDirty'), "fragment array is returned to clean state");
  }));
});

test("changes to array contents change the fragment array 'isDirty' property", function() {
  store.push(Person, {
    id: 1,
    names: [
      {
        first: "Jon",
        last: "Snow"
      }
    ]
  });

  store.find(Person, 1).then(async(function(person) {
    var fragments = person.get('names');
    var fragment = fragments.get('firstObject');

    ok(!fragments.get('isDirty'), "fragment array is initially in a clean state");

    fragment.set('last', 'Stark');

    ok(fragments.get('isDirty'), "fragment array in dirty state after change to a fragment");

    fragment.set('last', 'Snow');

    ok(!fragments.get('isDirty'), "fragment array is returned to clean state");
  }));
});

test("changes to array contents and fragments can be rolled back", function() {
  store.push(Person, {
    id: 1,
    names: [
      {
        first: "Catelyn",
        last: "Tully"
      },
      {
        first: "Catelyn",
        last: "Stark"
      }
    ]
  });

  store.find(Person, 1).then(async(function(person) {
    var fragments = person.get('names');
    var fragment = fragments.get('firstObject');

    var originalState = fragments.toArray();

    fragment.set('first', 'Cat');
    fragments.removeFragment(fragments.get('lastObject'));
    fragments.createFragment({
      first: 'Lady',
      last: 'Stonehart'
    });

    fragments.rollback();

    ok(!fragments.get('isDirty'), "fragment array is not dirty");
    ok(!fragments.isAny('isDirty'), "all fragments are in clean state");
    deepEqual(fragments.toArray(), originalState, "original array contents is restored");
  }));
});

test("serializing creates a new Array with contents the result of serializing each fragment", function() {
  var names = [
    {
      first: "Rhaegar",
      last: "Targaryen"
    },
    {
      first: "Viserys",
      last: "Targaryen"
    },
    {
      first: "Daenerys",
      last: "Targaryen"
    }
  ];

  store.push(Person, {
    id: 1,
    names: names
  });

  env.container.register('serializer:name', DS.JSONSerializer);

  // TODO: this is necessary to set `typeKey` and prevent `store#serializerFor` from blowing up
  store.modelFor('person');

  store.find(Person, 1).then(async(function(person) {
    var serialized = person.serialize();

    deepEqual(serialized.names, names, "serializing returns array of each fragment serialized");
  }));
});


text:
package jogs

/*
	Dispatcher decouples handles from handlers. This makes jogs a very flexible and extensible tool.
*/
type Dispatcher struct {
	registry map[string]Handler
}

func (d *Dispatcher) Register(handle string, plugin Handler) {
	d.registry[handle] = plugin
}

//////////////////////////////////////////////////////////////////////
// private parts
//////////////////////////////////////////////////////////////////////

func (d *Dispatcher) dispatch(node Node, cb Callback) {

	if d.registry[node.Handle] == nil {
		// TODO: log this
		return
	}

	d.registry[node.Handle].Handle(node, cb)
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="baseLayoutParam">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">match_parent</item>
    </style>

    <style name="toolbarStyle" parent="baseLayoutParam">
        <item name="android:layout_height">wrap_content</item>
        <item name="android:background">?attr/colorPrimary</item>
        <item name="android:minHeight">?attr/actionBarSize</item>"
    </style>

    <style name="recyclerViewStyle" parent="baseLayoutParam">
        <item name="android:layout_height">wrap_content</item>
        <item name="android:layout_below">@id/toolbar</item>
    </style>
</resources>


text:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/filterslist_name"
            android:layout_gravity="center_horizontal" />

        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/editTextName"
            android:inputType="text"
            android:layout_gravity="center_horizontal" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/filterslist_filters"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="40dp" />

        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/book_title"
                android:layout_gravity="center_horizontal" />

            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/editTextFTitle"
                android:inputType="text"
                android:layout_gravity="center_horizontal" />
        </LinearLayout>

        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/book_author"
                android:layout_gravity="center_horizontal" />

            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/editTextFAuthor"
                android:inputType="text"
                android:layout_gravity="center_horizontal" />
        </LinearLayout>

        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/book_collection"
                android:layout_gravity="center_horizontal" />

            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/editTextFCollection"
                android:inputType="text"
                android:layout_gravity="center_horizontal" />
        </LinearLayout>

        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/book_genre"
                android:layout_gravity="center_horizontal" />

            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/editTextFGenre"
                android:inputType="text"
                android:layout_gravity="center_horizontal" />
        </LinearLayout>

        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/filterslist_yearstart"
                android:layout_gravity="center_horizontal" />

            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/editTextFYearStart"
                android:inputType="number"
                android:layout_gravity="center_horizontal" />
        </LinearLayout>

        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/filterslist_yearend"
                android:layout_gravity="center_horizontal" />

            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/editTextFYearEnd"
                android:inputType="number"
                android:layout_gravity="center_horizontal" />
        </LinearLayout>

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/action_add"
            android:id="@+id/addButton"
            android:layout_gravity="center_horizontal" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:text=""
            android:id="@+id/textViewError"
            android:layout_gravity="center_horizontal" />

    </LinearLayout>

</ScrollView>


text:
require 'nokogiri'
require 'open-uri'
require 'green_button/rule'
require 'green_button/helpers'
require 'green_button/models'
require 'green_button/parser'

module GreenButton
  # could also load this from the data custodian:feed
  # url = "http://services.greenbuttondata.org:80/DataCustodian/espi/1_1/resource/RetailCustomer/1/DownloadMyData"

  def self.load(path)
    xml_file = Nokogiri.XML(open(path))
    xml_file.remove_namespaces!
    Parser.new(xml_file)
  end
end


text:
[![Circle CI](https://img.shields.io/circleci/project/bluecap-se/yarr.svg?style=flat-square)](https://circleci.com/gh/bluecap-se/yarr)
[![Dependency Status](https://img.shields.io/gemnasium/bluecap-se/yarr.svg?style=flat-square)](https://gemnasium.com/bluecap-se/yarr)
[![NPM version](https://img.shields.io/npm/v/yarr.svg?style=flat-square)](https://www.npmjs.com/package/yarr)
[![Docker pulls](https://img.shields.io/docker/pulls/bluecap/yarr.svg?style=flat-square)](https://registry.hub.docker.com/u/bluecap/yarr/)

*I feel lucky*, for [The Pirate Bay](https://thepiratebay.se/). A micro HTTP service,
for picking the best torrent available for download, by searching TPB.

## Install

Yarr! can be installed as a package either via NPM or Docker.

#### Using Docker

```console
$ docker run -d -p 80:8080 bluecap/yarr:latest
```

#### Using a package manager

```console
$ npm install yarr
```

## Usage

```console
$ yarr
Server started on localhost:8080
```

This will start the HTTP server, with [default config](https://github.com/bluecap-se/yarr/blob/master/lib/defaults.json).
Then navigate to [localhost:8080](http://localhost:8080)

### Full options

```console
$ yarr -h

I feel lucky, for The Pirate Bay

Usage:
    yarr [<config>]
    yarr [options]

Options:
    --host=HOST       Set server host
    --port=PORT       Set server port
    --source=URL      Set The Pirate Bay URL
    --api-key=TOKEN   Set API-key
    -h --help         Show this screen
    -v --version      Show version

Examples:
       yarr (run the server with default config)
       yarr ~/config.json
       yarr --host localhost --port 8080
```

#### Using Docker

Options can be set as environment variables. Only `source` and `api-key` can be set, the rest
can be configured by using the [port option](https://docs.docker.com/reference/commandline/run/).

```console
$ docker run -d -p 80:8080 -e API_KEY='secret' -e SOURCE='http://thepiratebay.se' bluecap/yarr:latest
```

## Use case

#### Getting the best torrent

Here, [HTTPie](https://github.com/jakubroztocil/httpie) is used when calling the API over HTTP. Using Curl is another option.

```console
$ http localhost:8080/search q==Game s==1 e==5 hd==720p
{
    "name": "...",
    "added": "05-16 2011",
    "magnet": "magnet:?xt=urn:...",
    "size": "1.46 GiB",
    "seeders": "69",
    "leachers": "10"
}
```

#### Getting the magnet

Here, [jq](http://stedolan.github.io/jq/) is used to parse the result from Yarr!. The result can then be piped to a torrent application of your choice.

```console
$ http localhost:8080/search q==Game s==1 e==5 hd==720p | jq .magnet
magnet:?xt=urn:
```

## API

All response is JSON formatted.

#### Perform a search
Returned is the best matching torrent.

```console
$ http localhost:8080/search q==value [param==value]
```

        Param
        Required
        Description
        Input type

        q
        Yes
        Search query.
        Freetext string

        s
        No
        Season, for shows.
        Number

        e
        No
        Episode, for shows. Requires season.
        Number

        hd
        No
        Flag for HD.
        720p, 1080p

#### Check version
Returned is the running version of Yarr!

```console
$ http localhost:8080/version
{
    "version": "1.1.0"
}
```

## Run tests

```console
$ make test
```

## License

Published under [MIT License](https://github.com/bluecap-se/yarr/blob/master/LICENSE).


text:
  Login
  <input type="text" id="username" [(ngModel)]="username" value=""> *

  Password
  <input type="password" id="password" [(ngModel)]="password" value=""> *

<button (click)="performLogin()">Enter</button>


text:
#ifndef LIBLAS_CSTDINT_HPP_INCLUDED
#define LIBLAS_CSTDINT_HPP_INCLUDED

#ifdef LIBLAS_C_API
#include <limits.h>

#ifndef _WIN32
#include <stdint.h>
#endif /* _WIN32 */

#else
#include <climits>
namespace liblas
{
#endif /* LIBLAS_C_API */

/*
//  These are fairly safe guesses for some 16-bit, and most 32-bit and 64-bit
//  platforms.  For other systems, they will have to be hand tailored.
//
//  Because the fast types are assumed to be the same as the undecorated types,
//  it may be possible to hand tailor a more efficient implementation.  Such
//  an optimization may be illusionary; on the Intel x86-family 386 on, for
//  example, byte arithmetic and load/stores are as fast as "int" sized ones.

//  8-bit types  ------------------------------------------------------------//
*/

#ifndef UINT8_C
# if UCHAR_MAX == 0xff
    typedef unsigned char   uint8_t;
    typedef signed char     int8_t;
# else
#  error defaults not correct; you must hand modify liblas/cstdint.hpp
# endif
#else
# ifndef LIBLAS_C_API
    typedef ::uint8_t uint8_t;
    typedef ::int8_t int8_t;
# endif

#endif /* UINT8_C */

/*
//  16-bit types  -----------------------------------------------------------//
*/

#ifndef UINT16_C
# if USHRT_MAX == 0xffff
    typedef unsigned short  uint16_t;
    typedef short           int16_t;
# else
#   error defaults not correct; you must hand modify liblas/cstdint.hpp
# endif
#else
# ifndef LIBLAS_C_API
    typedef ::uint16_t uint16_t;
    typedef ::int16_t int16_t;
# endif
#endif /* UINT16_C */

/*
//  32-bit types  -----------------------------------------------------------//
*/

#ifndef UINT32_C
# if ULONG_MAX == 0xffffffff
    typedef unsigned long   uint32_t;
# elif UINT_MAX == 0xffffffff
    typedef unsigned int    uint32_t;
# else
#   error defaults not correct; you must hand modify liblas/cstdint.hpp
# endif
#else
# ifndef LIBLAS_C_API
    typedef ::uint32_t uint32_t;
# endif
#endif /* UINT32_C */

#ifndef INT32_C
# if ULONG_MAX == 0xffffffff
    typedef long            int32_t;
# elif UINT_MAX == 0xffffffff
    typedef int             int32_t;
# else
#   error defaults not correct; you must hand modify liblas/cstdint.hpp
# endif
#else
# ifndef LIBLAS_C_API
    typedef ::int32_t int32_t;
# endif
#endif /* INT32_C */

/*
//  64-bit types + intmax_t and uintmax_t  ----------------------------------//
*/

#ifndef UINT64_C
# if ULONG_MAX != 0xffffffffu
#  if ULONG_MAX == 18446744073709551615u /* 2**64 - 1 */
    typedef long                int64_t;
    typedef unsigned long       uint64_t;
#  else
#   error defaults not correct; you must hand modify boost/cstdint.hpp
#  endif
# elif defined(__GNUC__) || defined(HAVE_LONG_LONG)
    __extension__ typedef long long            int64_t;
    __extension__ typedef unsigned long long   uint64_t;
# elif defined(_MSC_VER)
/*    // we have Borland/Intel/Microsoft __int64: */
    typedef __int64             int64_t;
    typedef unsigned __int64    uint64_t;
# else /* // assume no 64-bit integers */
#  define LIBLAS_NO_INT64_T
# endif
#endif /* UINT64_C */

#ifndef LIBLAS_C_API
}  /* namespace liblas */
#endif /* LIBLAS_C_API */

#endif /* LIBLAS_CSTDINT_HPP_INCLUDED */


text:
cask "font-bitstream-vera-sans-mono-nerd-font" do
  version "2.1.0"
  sha256 "b31595d1e717156a1f42b0ff635b93d5da631312e4f0bd5c581259171e4a42d8"

  url "https://github.com/ryanoasis/nerd-fonts/releases/download/v#{version}/BitstreamVeraSansMono.zip"
  appcast "https://github.com/ryanoasis/nerd-fonts/releases.atom"
  name "BitstreamVeraSansMono Nerd Font (Bitstream Vera Sans Mono)"
  homepage "https://github.com/ryanoasis/nerd-fonts"

  font "Bitstream Vera Sans Mono Bold Nerd Font Complete.ttf"
  font "Bitstream Vera Sans Mono Bold Nerd Font Complete Mono.ttf"
  font "Bitstream Vera Sans Mono Bold Oblique Nerd Font Complete.ttf"
  font "Bitstream Vera Sans Mono Bold Oblique Nerd Font Complete Mono.ttf"
  font "Bitstream Vera Sans Mono Nerd Font Complete Mono.ttf"
  font "Bitstream Vera Sans Mono Nerd Font Complete.ttf"
  font "Bitstream Vera Sans Mono Oblique Nerd Font Complete.ttf"
  font "Bitstream Vera Sans Mono Oblique Nerd Font Complete Mono.ttf"
end


text:
<Record>
<Term>Leukocyte Adhesion Deficiency Type 1</Term>
<SemanticType>Disease or Syndrome</SemanticType>
<ParentTerm>Leukocyte Adhesion Deficiency</ParentTerm>
<ClassificationPath>Findings_and_Disorders_Kind/Disease, Disorder or Finding/Disease or Disorder/Syndrome/Immunodeficiency Syndrome/Congenital Disorder of Natural Immunity/Leukocyte Adhesion Deficiency/Leukocyte Adhesion Deficiency Type 1</ClassificationPath>
<BroaderTerm>Leukocyte Adhesion Deficiency</BroaderTerm>
<BroaderTerm>Immunodeficiency Syndrome</BroaderTerm>
<BroaderTerm>Syndrome</BroaderTerm>
<BroaderTerm>Disease or Disorder</BroaderTerm>
<BroaderTerm>Leukocyte Adhesion Deficiency Type 1</BroaderTerm>
<BroaderTerm>Congenital Disorder of Natural Immunity</BroaderTerm>
<BroaderTerm>Disease, Disorder or Finding</BroaderTerm>
<BroaderTerm>Findings_and_Disorders_Kind</BroaderTerm>
<Synonym>LAD-Type I</Synonym>
<Synonym>LFA-I Deficiency</Synonym>
<Synonym>Leukocyte Adhesion Deficiency Type 1</Synonym>
<Description>Leukocyte Adhesion Deficiency, Type I; LFA-I deficiency</Description>
<Source>NCI Thesaurus</Source>
</Record>


text:
// Copyright 2013 The Changkong Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.

package crm

const VersionNo = "20131207"

/* 卖家设置的等级优惠信息 */
type GradePromotion struct {
	CurGrade          string `json:"cur_grade"`
	CurGradeName      string `json:"cur_grade_name"`
	Discount          int    `json:"discount"`
	NextGrade         string `json:"next_grade"`
	NextGradeName     string `json:"next_grade_name"`
	NextUpgradeAmount int    `json:"next_upgrade_amount"`
	NextUpgradeCount  int    `json:"next_upgrade_count"`
}

/* 描述分组的数据结构 */
type Group struct {
	GroupCreate string `json:"group_create"`
	GroupId     int    `json:"group_id"`
	GroupModify string `json:"group_modify"`
	GroupName   string `json:"group_name"`
	MemberCount int    `json:"member_count"`
	Status      string `json:"status"`
}

/* 表示会员关系的基本信息字段,用于会员列表的基本查询 */
type BasicMember struct {
	BizOrderId       int     `json:"biz_order_id"`
	BuyerId          int     `json:"buyer_id"`
	BuyerNick        string  `json:"buyer_nick"`
	CloseTradeAmount float64 `json:"close_trade_amount"`
	CloseTradeCount  int     `json:"close_trade_count"`
	Grade            int     `json:"grade"`
	GroupIds         string  `json:"group_ids"`
	ItemNum          int     `json:"item_num"`
	LastTradeTime    string  `json:"last_trade_time"`
	RelationSource   int     `json:"relation_source"`
	Status           string  `json:"status"`
	TradeAmount      float64 `json:"trade_amount"`
	TradeCount       int     `json:"trade_count"`
}

/* 会员信息对象 */
type CrmMember struct {
	AvgPrice         float64 `json:"avg_price"`
	BizOrderId       int     `json:"biz_order_id"`
	BuyerId          int     `json:"buyer_id"`
	BuyerNick        string  `json:"buyer_nick"`
	City             string  `json:"city"`
	CloseTradeAmount float64 `json:"close_trade_amount"`
	CloseTradeCount  int     `json:"close_trade_count"`
	Grade            int     `json:"grade"`
	GroupIds         string  `json:"group_ids"`
	ItemCloseCount   int     `json:"item_close_count"`
	ItemNum          int     `json:"item_num"`
	LastTradeTime    string  `json:"last_trade_time"`
	Province         int     `json:"province"`
	RelationSource   int     `json:"relation_source"`
	Status           string  `json:"status"`
	TradeAmount      float64 `json:"trade_amount"`
	TradeCount       int     `json:"trade_count"`
}

/* 动作action */
type ActionInfo struct {
	ActionCode string `json:"action_code"`
	Applier    string `json:"applier"`
	Id         int    `json:"id"`
	Name       string `json:"name"`
	SellerId   int    `json:"seller_id"`
	Status     int    `json:"status"`
	Verifier   string `json:"verifier"`
}

/* 分页结果 */
type PageResult struct {
	CurrentPage int `json:"current_page"`
	PageSize    int `json:"page_size"`
	TotalAmount int `json:"total_amount"`
	TotalPage   int `json:"total_page"`
}

/* 属性(指标)信息 */
type AttributeVO struct {
	ClazzType   int    `json:"clazz_type"`
	Code        string `json:"code"`
	Description string `json:"description"`
	DocumentId  int    `json:"document_id"`
	Id          int    `json:"id"`
	ParamKeys   struct {
		ParamKeyVO []*ParamKeyVO `json:"param_key_v_o"`
	}                `json:"param_keys"`
	Title     string `json:"title"`
	TopAccess int    `json:"top_access"`
	TypeId    int    `json:"type_id"`
	Unit      string `json:"unit"`
}

/* 属性必填参数的对象 */
type ParamKeyVO struct {
	ClazzType  int    `json:"clazz_type"`
	Code       string `json:"code"`
	DocumentId int    `json:"document_id"`
	Id         int    `json:"id"`
	Name       string `json:"name"`
	Sort       int    `json:"sort"`
	Type       int    `json:"type"`
	Value      string `json:"value"`
}

/* 档案对象 */
type DocumentVO struct {
	Code       string `json:"code"`
	Dscription string `json:"dscription"`
	Id         int    `json:"id"`
	Name       string `json:"name"`
}

/* 函数配置 */
type Function struct {
	Creator   string `json:"creator"`
	Id        int    `json:"id"`
	Name      string `json:"name"`
	ParseType int    `json:"parse_type"`
	Rule      string `json:"rule"`
	Status    int    `json:"status"`
	Strategy  int    `json:"strategy"`
	UserId    int    `json:"user_id"`
}

/* 用于表示分组中的标签 */
type InnerLabel struct {
	LabelId int `json:"label_id"`
	Level   int `json:"level"`
}

/* 标签组 */
type HanoiLabelGroup struct {
	BizStatus   int    `json:"biz_status"`
	Code        string `json:"code"`
	Description string `json:"description"`
	GmtCreate   string `json:"gmt_create"`
	GmtModified string `json:"gmt_modified"`
	Id          int    `json:"id"`
	Name        string `json:"name"`
	Open        bool   `json:"open"`
	Scene       int    `json:"scene"`
	Type        int    `json:"type"`
}

/* 标签 */
type Label struct {
	BizStatus   int    `json:"biz_status"`
	Code        string `json:"code"`
	Description string `json:"description"`
	GmtCreate   string `json:"gmt_create"`
	GmtModified string `json:"gmt_modified"`
	Id          int    `json:"id"`
	Name        string `json:"name"`
	Open        bool   `json:"open"`
	Scene       int    `json:"scene"`
	TemplateId  int    `json:"template_id"`
}

/* 标签的参数实例化 */
type ParameterVO struct {
	Name        string `json:"name"`
	StringValue string `json:"string_value"`
}

/* 模板、标签、分组的操作结果 */
type TemplateResult struct {
	ErrorMessage string `json:"error_message"`
	IsSuccess    bool   `json:"is_success"`
	Total        int    `json:"total"`
}

/* 值域对象 */
type RangeVO struct {
	Description string `json:"description"`
	DocumentId  int    `json:"document_id"`
	Id          int    `json:"id"`
	Key         string `json:"key"`
	Value       string `json:"value"`
}

/* 模板 */
type Template struct {
	BizStatus    int    `json:"biz_status"`
	Creater      int    `json:"creater"`
	Description  string `json:"description"`
	Expression   string `json:"expression"`
	GmtCreate    string `json:"gmt_create"`
	GmtModified  string `json:"gmt_modified"`
	Id           int    `json:"id"`
	Name         string `json:"name"`
	TemplateCode string `json:"template_code"`
}

/* 类型对象 */
type TypeVO struct {
	Description string `json:"description"`
	Id          int    `json:"id"`
	Name        string `json:"name"`
}

/* tmall权益 */
type GradeEquity struct {
	CurGrade     string `json:"cur_grade"`
	CurGradeName string `json:"cur_grade_name"`
	ExcludeArea  string `json:"exclude_area"`
	Point        int    `json:"point"`
	Postage      bool   `json:"postage"`
}